Skip to content

Commit

Permalink
feat: add pine icons to sage
Browse files Browse the repository at this point in the history
  • Loading branch information
monicawheeler committed May 17, 2024
1 parent 9fbb17f commit 8c417e0
Show file tree
Hide file tree
Showing 8 changed files with 1,212 additions and 757 deletions.
2 changes: 2 additions & 0 deletions docs/app/views/application/_app_head_content.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@
<link href="/favicon-16x16.png" rel="icon" sizes="16x16" type="image/png">
<link href="/favicon.ico" rel="icon" type="image/x-icon">
<%= csrf_meta_tags %>
<script type="module" src="https://cdn.jsdelivr.net/npm/@pine-ds/core/dist/pine-core/pine-core.esm.js"></script>
<script nomodule src="https://cdn.jsdelivr.net/npm/@pine-ds/core/dist/pine-core/index.esm.js"></script>
1 change: 1 addition & 0 deletions docs/app/views/examples/components/icon/_preview.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<%= sage_component SageIcon, { icon: "pen", label: "Edit", color: "primary-300" } %>
<%= sage_component SageIcon, { icon: "preview-on", label: "Preview", color: "sage-300" } %>
<%= sage_component SageIcon, { icon: "trash", label: "Delete", color: "red-300" } %>
<pds-icon icon="trash" color="#006699"></pds-icon>
</div>

<%= sage_component SageDivider, {} %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<%= "sage-btn--#{component.style}" if component.style %>
<%= "sage-btn--align-end" if (component.align == "end") %>
<%= "sage-btn--icon-#{component.icon[:style]}-#{component.icon[:name]}" if component.icon %>

<%= component.generated_css_classes %>
"
<% if component.spinner_on_submit.present? %>
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,8 @@
"watch:assets": "cd packages/sage-assets && yarn build:watch",
"watch:react": "cd packages/sage-react && yarn build:watch",
"watch:system": "cd packages/sage-system && yarn build:watch"
},
"dependencies": {
"@pine-ds/icons": "^4.2.0"
}
}
3 changes: 3 additions & 0 deletions packages/sage-react/.storybook/manager-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@
type="image/png"
href="favicon.ico"
/>

<script type="module" src="http://localhost:7200/build/pds-icons.esm.js"></script>
<script nomodule src="http://localhost:7200/build/index.esm.js"></script>
13 changes: 12 additions & 1 deletion packages/sage-react/lib/Icon/Icon.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { downSmall } from '@pine-ds/icons/icons';
import { SageTokens } from '../configs';
import { ICON_ADJACENT_TYPES, ICON_CARD_COLORS, ICON_SIZES } from './configs';

Expand Down Expand Up @@ -46,8 +47,18 @@ export const Icon = ({
attributes.role = 'img';
}

// const sizeMapping = {
// [ICON_SIZES.XS]: 'small',
// [ICON_SIZES.SM]: 'normal',
// [ICON_SIZES.MD]: 'medium',
// [ICON_SIZES.LG]: 'large',
// [ICON_SIZES.XL]: 'large',
// };

const renderIcon = () => (
<i className={classNames} {...attributes} {...rest} />
<i>
<pds-icon name={downSmall} />
</i>
);

const setBackgroundDimensions = () => {
Expand Down
1 change: 1 addition & 0 deletions packages/sage-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
},
"dependencies": {
"@kajabi/sage-assets": "^1.14.5",
"@pine-ds/icons": "^4.2.0",
"classnames": "^2.2.6",
"debounce": "^1.2.0",
"focus-trap": "^6.2.2",
Expand Down
1,945 changes: 1,189 additions & 756 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 8c417e0

Please sign in to comment.