@pine-ds/core 0.0.2-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/cjs/index-13500e25.js +2468 -0
- package/dist/cjs/index-13500e25.js.map +1 -0
- package/dist/cjs/index.cjs.js +4 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/pds-avatar.cjs.entry.js +70 -0
- package/dist/cjs/pds-avatar.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-button.cjs.entry.js +57 -0
- package/dist/cjs/pds-button.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-checkbox.cjs.entry.js +57 -0
- package/dist/cjs/pds-checkbox.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-chip.cjs.entry.js +49 -0
- package/dist/cjs/pds-chip.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-copytext.cjs.entry.js +68 -0
- package/dist/cjs/pds-copytext.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-divider.cjs.entry.js +35 -0
- package/dist/cjs/pds-divider.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-icon.cjs.entry.js +277 -0
- package/dist/cjs/pds-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-image.cjs.entry.js +31 -0
- package/dist/cjs/pds-image.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-input.cjs.entry.js +44 -0
- package/dist/cjs/pds-input.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-label-71ea2cad.js +44 -0
- package/dist/cjs/pds-label-71ea2cad.js.map +1 -0
- package/dist/cjs/pds-link.cjs.entry.js +37 -0
- package/dist/cjs/pds-link.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-progress.cjs.entry.js +27 -0
- package/dist/cjs/pds-progress.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-radio.cjs.entry.js +53 -0
- package/dist/cjs/pds-radio.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-sortable-item.cjs.entry.js +24 -0
- package/dist/cjs/pds-sortable-item.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-sortable.cjs.entry.js +2706 -0
- package/dist/cjs/pds-sortable.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-switch.cjs.entry.js +55 -0
- package/dist/cjs/pds-switch.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-tab.cjs.entry.js +33 -0
- package/dist/cjs/pds-tab.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-tabpanel.cjs.entry.js +26 -0
- package/dist/cjs/pds-tabpanel.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-tabs.cjs.entry.js +98 -0
- package/dist/cjs/pds-tabs.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-textarea.cjs.entry.js +54 -0
- package/dist/cjs/pds-textarea.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-tooltip.cjs.entry.js +151 -0
- package/dist/cjs/pds-tooltip.cjs.entry.js.map +1 -0
- package/dist/cjs/pine-core.cjs.js +25 -0
- package/dist/cjs/pine-core.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +37 -0
- package/dist/collection/components/_internal/pds-label/pds-label.js +7 -0
- package/dist/collection/components/_internal/pds-label/pds-label.js.map +1 -0
- package/dist/collection/components/pds-avatar/pds-avatar.css +59 -0
- package/dist/collection/components/pds-avatar/pds-avatar.js +217 -0
- package/dist/collection/components/pds-avatar/pds-avatar.js.map +1 -0
- package/dist/collection/components/pds-avatar/stories/pds-avatar.stories.js +65 -0
- package/dist/collection/components/pds-button/pds-button.css +122 -0
- package/dist/collection/components/pds-button/pds-button.js +187 -0
- package/dist/collection/components/pds-button/pds-button.js.map +1 -0
- package/dist/collection/components/pds-button/stories/pds-button.stories.js +65 -0
- package/dist/collection/components/pds-checkbox/pds-checkbox.css +106 -0
- package/dist/collection/components/pds-checkbox/pds-checkbox.js +266 -0
- package/dist/collection/components/pds-checkbox/pds-checkbox.js.map +1 -0
- package/dist/collection/components/pds-checkbox/stories/pds-checkbox.stories.js +80 -0
- package/dist/collection/components/pds-chip/pds-chip.css +245 -0
- package/dist/collection/components/pds-chip/pds-chip.js +188 -0
- package/dist/collection/components/pds-chip/pds-chip.js.map +1 -0
- package/dist/collection/components/pds-chip/stories/pds-chip.stories.js +79 -0
- package/dist/collection/components/pds-copytext/pds-copytext.css +85 -0
- package/dist/collection/components/pds-copytext/pds-copytext.js +186 -0
- package/dist/collection/components/pds-copytext/pds-copytext.js.map +1 -0
- package/dist/collection/components/pds-copytext/stories/pds-copytext.stories.js +57 -0
- package/dist/collection/components/pds-divider/pds-divider.css +92 -0
- package/dist/collection/components/pds-divider/pds-divider.js +94 -0
- package/dist/collection/components/pds-divider/pds-divider.js.map +1 -0
- package/dist/collection/components/pds-divider/stories/pds-divider.stories.js +25 -0
- package/dist/collection/components/pds-icon/stories/pds-icon.stories.js +16 -0
- package/dist/collection/components/pds-image/pds-image.css +13 -0
- package/dist/collection/components/pds-image/pds-image.js +173 -0
- package/dist/collection/components/pds-image/pds-image.js.map +1 -0
- package/dist/collection/components/pds-image/stories/pds-image.stories.js +35 -0
- package/dist/collection/components/pds-input/pds-input.css +88 -0
- package/dist/collection/components/pds-input/pds-input.js +279 -0
- package/dist/collection/components/pds-input/pds-input.js.map +1 -0
- package/dist/collection/components/pds-input/stories/pds-input.stories.js +110 -0
- package/dist/collection/components/pds-link/pds-link.css +67 -0
- package/dist/collection/components/pds-link/pds-link.js +138 -0
- package/dist/collection/components/pds-link/pds-link.js.map +1 -0
- package/dist/collection/components/pds-link/stories/pds-link.stories.js +49 -0
- package/dist/collection/components/pds-progress/pds-progress.css +77 -0
- package/dist/collection/components/pds-progress/pds-progress.js +148 -0
- package/dist/collection/components/pds-progress/pds-progress.js.map +1 -0
- package/dist/collection/components/pds-progress/stories/pds-progress.stories.js +65 -0
- package/dist/collection/components/pds-radio/pds-radio.css +101 -0
- package/dist/collection/components/pds-radio/pds-radio.js +261 -0
- package/dist/collection/components/pds-radio/pds-radio.js.map +1 -0
- package/dist/collection/components/pds-radio/stories/pds-radio.stories.js +71 -0
- package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.css +63 -0
- package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +90 -0
- package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js.map +1 -0
- package/dist/collection/components/pds-sortable/pds-sortable-item/stories/pds-sortable-item.stories.js +24 -0
- package/dist/collection/components/pds-sortable/pds-sortable.css +10 -0
- package/dist/collection/components/pds-sortable/pds-sortable.js +150 -0
- package/dist/collection/components/pds-sortable/pds-sortable.js.map +1 -0
- package/dist/collection/components/pds-sortable/stories/pds-sortable.stories.js +130 -0
- package/dist/collection/components/pds-switch/pds-switch.css +134 -0
- package/dist/collection/components/pds-switch/pds-switch.js +277 -0
- package/dist/collection/components/pds-switch/pds-switch.js.map +1 -0
- package/dist/collection/components/pds-switch/stories/pds-switch.stories.js +102 -0
- package/dist/collection/components/pds-tabs/pds-tab/pds-tab.css +158 -0
- package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js +154 -0
- package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js.map +1 -0
- package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.css +12 -0
- package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js +107 -0
- package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js.map +1 -0
- package/dist/collection/components/pds-tabs/pds-tabs.css +33 -0
- package/dist/collection/components/pds-tabs/pds-tabs.js +209 -0
- package/dist/collection/components/pds-tabs/pds-tabs.js.map +1 -0
- package/dist/collection/components/pds-tabs/stories/pds-tabs.stories.js +63 -0
- package/dist/collection/components/pds-textarea/pds-textarea.css +84 -0
- package/dist/collection/components/pds-textarea/pds-textarea.js +303 -0
- package/dist/collection/components/pds-textarea/pds-textarea.js.map +1 -0
- package/dist/collection/components/pds-textarea/stories/pds-textarea.stories.js +111 -0
- package/dist/collection/components/pds-textarea/textarea-interface.js +2 -0
- package/dist/collection/components/pds-textarea/textarea-interface.js.map +1 -0
- package/dist/collection/components/pds-tooltip/pds-tooltip.css +143 -0
- package/dist/collection/components/pds-tooltip/pds-tooltip.js +287 -0
- package/dist/collection/components/pds-tooltip/pds-tooltip.js.map +1 -0
- package/dist/collection/components/pds-tooltip/stories/pds-tooltip.stories.js +114 -0
- package/dist/collection/global/pine-ui-global.js +2 -0
- package/dist/collection/global/pine-ui-global.js.map +1 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/stories/_helpers/index.js +15 -0
- package/dist/collection/stories/_helpers/index.js.map +1 -0
- package/dist/collection/utils/form.js +28 -0
- package/dist/collection/utils/form.js.map +1 -0
- package/dist/collection/utils/overlay.js +68 -0
- package/dist/collection/utils/overlay.js.map +1 -0
- package/dist/collection/utils/types.js +2 -0
- package/dist/collection/utils/types.js.map +1 -0
- package/dist/collection/utils/utils.js +7 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/docs.d.ts +421 -0
- package/dist/docs.json +3718 -0
- package/dist/esm/index-a58668b3.js +2438 -0
- package/dist/esm/index-a58668b3.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/pds-avatar.entry.js +66 -0
- package/dist/esm/pds-avatar.entry.js.map +1 -0
- package/dist/esm/pds-button.entry.js +53 -0
- package/dist/esm/pds-button.entry.js.map +1 -0
- package/dist/esm/pds-checkbox.entry.js +53 -0
- package/dist/esm/pds-checkbox.entry.js.map +1 -0
- package/dist/esm/pds-chip.entry.js +45 -0
- package/dist/esm/pds-chip.entry.js.map +1 -0
- package/dist/esm/pds-copytext.entry.js +64 -0
- package/dist/esm/pds-copytext.entry.js.map +1 -0
- package/dist/esm/pds-divider.entry.js +31 -0
- package/dist/esm/pds-divider.entry.js.map +1 -0
- package/dist/esm/pds-icon.entry.js +273 -0
- package/dist/esm/pds-icon.entry.js.map +1 -0
- package/dist/esm/pds-image.entry.js +27 -0
- package/dist/esm/pds-image.entry.js.map +1 -0
- package/dist/esm/pds-input.entry.js +40 -0
- package/dist/esm/pds-input.entry.js.map +1 -0
- package/dist/esm/pds-label-a26dd876.js +39 -0
- package/dist/esm/pds-label-a26dd876.js.map +1 -0
- package/dist/esm/pds-link.entry.js +33 -0
- package/dist/esm/pds-link.entry.js.map +1 -0
- package/dist/esm/pds-progress.entry.js +23 -0
- package/dist/esm/pds-progress.entry.js.map +1 -0
- package/dist/esm/pds-radio.entry.js +49 -0
- package/dist/esm/pds-radio.entry.js.map +1 -0
- package/dist/esm/pds-sortable-item.entry.js +20 -0
- package/dist/esm/pds-sortable-item.entry.js.map +1 -0
- package/dist/esm/pds-sortable.entry.js +2702 -0
- package/dist/esm/pds-sortable.entry.js.map +1 -0
- package/dist/esm/pds-switch.entry.js +51 -0
- package/dist/esm/pds-switch.entry.js.map +1 -0
- package/dist/esm/pds-tab.entry.js +29 -0
- package/dist/esm/pds-tab.entry.js.map +1 -0
- package/dist/esm/pds-tabpanel.entry.js +22 -0
- package/dist/esm/pds-tabpanel.entry.js.map +1 -0
- package/dist/esm/pds-tabs.entry.js +94 -0
- package/dist/esm/pds-tabs.entry.js.map +1 -0
- package/dist/esm/pds-textarea.entry.js +50 -0
- package/dist/esm/pds-textarea.entry.js.map +1 -0
- package/dist/esm/pds-tooltip.entry.js +147 -0
- package/dist/esm/pds-tooltip.entry.js.map +1 -0
- package/dist/esm/pine-core.js +20 -0
- package/dist/esm/pine-core.js.map +1 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm-es5/index-a58668b3.js +3 -0
- package/dist/esm-es5/index-a58668b3.js.map +1 -0
- package/dist/esm-es5/index.js +2 -0
- package/dist/esm-es5/index.js.map +1 -0
- package/dist/esm-es5/loader.js +2 -0
- package/dist/esm-es5/loader.js.map +1 -0
- package/dist/esm-es5/pds-avatar.entry.js +2 -0
- package/dist/esm-es5/pds-avatar.entry.js.map +1 -0
- package/dist/esm-es5/pds-button.entry.js +2 -0
- package/dist/esm-es5/pds-button.entry.js.map +1 -0
- package/dist/esm-es5/pds-checkbox.entry.js +2 -0
- package/dist/esm-es5/pds-checkbox.entry.js.map +1 -0
- package/dist/esm-es5/pds-chip.entry.js +2 -0
- package/dist/esm-es5/pds-chip.entry.js.map +1 -0
- package/dist/esm-es5/pds-copytext.entry.js +2 -0
- package/dist/esm-es5/pds-copytext.entry.js.map +1 -0
- package/dist/esm-es5/pds-divider.entry.js +2 -0
- package/dist/esm-es5/pds-divider.entry.js.map +1 -0
- package/dist/esm-es5/pds-icon.entry.js +2 -0
- package/dist/esm-es5/pds-icon.entry.js.map +1 -0
- package/dist/esm-es5/pds-image.entry.js +2 -0
- package/dist/esm-es5/pds-image.entry.js.map +1 -0
- package/dist/esm-es5/pds-input.entry.js +2 -0
- package/dist/esm-es5/pds-input.entry.js.map +1 -0
- package/dist/esm-es5/pds-label-a26dd876.js +2 -0
- package/dist/esm-es5/pds-label-a26dd876.js.map +1 -0
- package/dist/esm-es5/pds-link.entry.js +2 -0
- package/dist/esm-es5/pds-link.entry.js.map +1 -0
- package/dist/esm-es5/pds-progress.entry.js +2 -0
- package/dist/esm-es5/pds-progress.entry.js.map +1 -0
- package/dist/esm-es5/pds-radio.entry.js +2 -0
- package/dist/esm-es5/pds-radio.entry.js.map +1 -0
- package/dist/esm-es5/pds-sortable-item.entry.js +2 -0
- package/dist/esm-es5/pds-sortable-item.entry.js.map +1 -0
- package/dist/esm-es5/pds-sortable.entry.js +8 -0
- package/dist/esm-es5/pds-sortable.entry.js.map +1 -0
- package/dist/esm-es5/pds-switch.entry.js +2 -0
- package/dist/esm-es5/pds-switch.entry.js.map +1 -0
- package/dist/esm-es5/pds-tab.entry.js +2 -0
- package/dist/esm-es5/pds-tab.entry.js.map +1 -0
- package/dist/esm-es5/pds-tabpanel.entry.js +2 -0
- package/dist/esm-es5/pds-tabpanel.entry.js.map +1 -0
- package/dist/esm-es5/pds-tabs.entry.js +2 -0
- package/dist/esm-es5/pds-tabs.entry.js.map +1 -0
- package/dist/esm-es5/pds-textarea.entry.js +2 -0
- package/dist/esm-es5/pds-textarea.entry.js.map +1 -0
- package/dist/esm-es5/pds-tooltip.entry.js +2 -0
- package/dist/esm-es5/pds-tooltip.entry.js.map +1 -0
- package/dist/esm-es5/pine-core.js +2 -0
- package/dist/esm-es5/pine-core.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/pine-core/index.esm.js +2 -0
- package/dist/pine-core/index.esm.js.map +1 -0
- package/dist/pine-core/p-0a776a7b.entry.js +2 -0
- package/dist/pine-core/p-0a776a7b.entry.js.map +1 -0
- package/dist/pine-core/p-0adb4b48.entry.js +2 -0
- package/dist/pine-core/p-0adb4b48.entry.js.map +1 -0
- package/dist/pine-core/p-0c26a00d.entry.js +2 -0
- package/dist/pine-core/p-0c26a00d.entry.js.map +1 -0
- package/dist/pine-core/p-1c0ffcab.entry.js +2 -0
- package/dist/pine-core/p-1c0ffcab.entry.js.map +1 -0
- package/dist/pine-core/p-22bd3102.system.entry.js +9 -0
- package/dist/pine-core/p-22bd3102.system.entry.js.map +1 -0
- package/dist/pine-core/p-22dd8116.entry.js +2 -0
- package/dist/pine-core/p-22dd8116.entry.js.map +1 -0
- package/dist/pine-core/p-23fb6af2.system.entry.js +2 -0
- package/dist/pine-core/p-23fb6af2.system.entry.js.map +1 -0
- package/dist/pine-core/p-24077dcd.entry.js +2 -0
- package/dist/pine-core/p-24077dcd.entry.js.map +1 -0
- package/dist/pine-core/p-27fd7f08.system.entry.js +2 -0
- package/dist/pine-core/p-27fd7f08.system.entry.js.map +1 -0
- package/dist/pine-core/p-331cbf1d.entry.js +2 -0
- package/dist/pine-core/p-331cbf1d.entry.js.map +1 -0
- package/dist/pine-core/p-3386bfe1.system.entry.js +2 -0
- package/dist/pine-core/p-3386bfe1.system.entry.js.map +1 -0
- package/dist/pine-core/p-401cd4bc.entry.js +2 -0
- package/dist/pine-core/p-401cd4bc.entry.js.map +1 -0
- package/dist/pine-core/p-4a804680.entry.js +2 -0
- package/dist/pine-core/p-4a804680.entry.js.map +1 -0
- package/dist/pine-core/p-4fc42ff3.system.entry.js +2 -0
- package/dist/pine-core/p-4fc42ff3.system.entry.js.map +1 -0
- package/dist/pine-core/p-50ea2036.system.js +2 -0
- package/dist/pine-core/p-50ea2036.system.js.map +1 -0
- package/dist/pine-core/p-5b37a4a2.system.entry.js +2 -0
- package/dist/pine-core/p-5b37a4a2.system.entry.js.map +1 -0
- package/dist/pine-core/p-643f5378.entry.js +2 -0
- package/dist/pine-core/p-643f5378.entry.js.map +1 -0
- package/dist/pine-core/p-669d948a.system.entry.js +2 -0
- package/dist/pine-core/p-669d948a.system.entry.js.map +1 -0
- package/dist/pine-core/p-73262287.system.entry.js +2 -0
- package/dist/pine-core/p-73262287.system.entry.js.map +1 -0
- package/dist/pine-core/p-79d7e0b1.system.entry.js +2 -0
- package/dist/pine-core/p-79d7e0b1.system.entry.js.map +1 -0
- package/dist/pine-core/p-7bc01826.entry.js +2 -0
- package/dist/pine-core/p-7bc01826.entry.js.map +1 -0
- package/dist/pine-core/p-7fcd5f0b.entry.js +8 -0
- package/dist/pine-core/p-7fcd5f0b.entry.js.map +1 -0
- package/dist/pine-core/p-85f6a94e.system.entry.js +2 -0
- package/dist/pine-core/p-85f6a94e.system.entry.js.map +1 -0
- package/dist/pine-core/p-8f62c812.entry.js +2 -0
- package/dist/pine-core/p-8f62c812.entry.js.map +1 -0
- package/dist/pine-core/p-930ab8a3.system.entry.js +2 -0
- package/dist/pine-core/p-930ab8a3.system.entry.js.map +1 -0
- package/dist/pine-core/p-938886d8.system.entry.js +2 -0
- package/dist/pine-core/p-938886d8.system.entry.js.map +1 -0
- package/dist/pine-core/p-97cb4285.entry.js +2 -0
- package/dist/pine-core/p-97cb4285.entry.js.map +1 -0
- package/dist/pine-core/p-abdca153.js +3 -0
- package/dist/pine-core/p-abdca153.js.map +1 -0
- package/dist/pine-core/p-ac31a7c8.system.entry.js +2 -0
- package/dist/pine-core/p-ac31a7c8.system.entry.js.map +1 -0
- package/dist/pine-core/p-af75cc15.entry.js +2 -0
- package/dist/pine-core/p-af75cc15.entry.js.map +1 -0
- package/dist/pine-core/p-b17b818b.entry.js +2 -0
- package/dist/pine-core/p-b17b818b.entry.js.map +1 -0
- package/dist/pine-core/p-b79a8b07.entry.js +2 -0
- package/dist/pine-core/p-b79a8b07.entry.js.map +1 -0
- package/dist/pine-core/p-bce2d5b5.system.entry.js +2 -0
- package/dist/pine-core/p-bce2d5b5.system.entry.js.map +1 -0
- package/dist/pine-core/p-bff583bd.system.js +2 -0
- package/dist/pine-core/p-bff583bd.system.js.map +1 -0
- package/dist/pine-core/p-c0f9dbe1.system.entry.js +2 -0
- package/dist/pine-core/p-c0f9dbe1.system.entry.js.map +1 -0
- package/dist/pine-core/p-c4dbae0e.system.js +2 -0
- package/dist/pine-core/p-c4dbae0e.system.js.map +1 -0
- package/dist/pine-core/p-c6d878f8.entry.js +2 -0
- package/dist/pine-core/p-c6d878f8.entry.js.map +1 -0
- package/dist/pine-core/p-c8a41b43.system.entry.js +2 -0
- package/dist/pine-core/p-c8a41b43.system.entry.js.map +1 -0
- package/dist/pine-core/p-d3e173ea.system.entry.js +2 -0
- package/dist/pine-core/p-d3e173ea.system.entry.js.map +1 -0
- package/dist/pine-core/p-f09892d3.system.entry.js +2 -0
- package/dist/pine-core/p-f09892d3.system.entry.js.map +1 -0
- package/dist/pine-core/p-f168654a.entry.js +2 -0
- package/dist/pine-core/p-f168654a.entry.js.map +1 -0
- package/dist/pine-core/p-f1d7f16f.js +2 -0
- package/dist/pine-core/p-f1d7f16f.js.map +1 -0
- package/dist/pine-core/p-f2c3035d.system.entry.js +2 -0
- package/dist/pine-core/p-f2c3035d.system.entry.js.map +1 -0
- package/dist/pine-core/p-f3af6d74.system.entry.js +2 -0
- package/dist/pine-core/p-f3af6d74.system.entry.js.map +1 -0
- package/dist/pine-core/p-fa5d4e73.system.js +3 -0
- package/dist/pine-core/p-fa5d4e73.system.js.map +1 -0
- package/dist/pine-core/p-fba29e90.entry.js +2 -0
- package/dist/pine-core/p-fba29e90.entry.js.map +1 -0
- package/dist/pine-core/pine-core.css +1 -0
- package/dist/pine-core/pine-core.esm.js +2 -0
- package/dist/pine-core/pine-core.esm.js.map +1 -0
- package/dist/pine-core/pine-core.js +127 -0
- package/dist/pine-core/svg/access-key.svg +1 -0
- package/dist/pine-core/svg/add-circle.svg +1 -0
- package/dist/pine-core/svg/add-image.svg +1 -0
- package/dist/pine-core/svg/add-small.svg +1 -0
- package/dist/pine-core/svg/add.svg +1 -0
- package/dist/pine-core/svg/ai-sparkle.svg +1 -0
- package/dist/pine-core/svg/ai-writer-filled.svg +1 -0
- package/dist/pine-core/svg/ai-writer.svg +1 -0
- package/dist/pine-core/svg/align-center.svg +1 -0
- package/dist/pine-core/svg/align-justify.svg +1 -0
- package/dist/pine-core/svg/align-left.svg +1 -0
- package/dist/pine-core/svg/align-right.svg +1 -0
- package/dist/pine-core/svg/analytics-filled.svg +1 -0
- package/dist/pine-core/svg/analytics-outline.svg +1 -0
- package/dist/pine-core/svg/app-store.svg +1 -0
- package/dist/pine-core/svg/archive.svg +1 -0
- package/dist/pine-core/svg/arrow-corner.svg +1 -0
- package/dist/pine-core/svg/arrow-down.svg +1 -0
- package/dist/pine-core/svg/arrow-left.svg +1 -0
- package/dist/pine-core/svg/arrow-right.svg +1 -0
- package/dist/pine-core/svg/arrow-up.svg +1 -0
- package/dist/pine-core/svg/assessment.svg +1 -0
- package/dist/pine-core/svg/at-sign.svg +1 -0
- package/dist/pine-core/svg/attach.svg +1 -0
- package/dist/pine-core/svg/automations.svg +1 -0
- package/dist/pine-core/svg/ban.svg +1 -0
- package/dist/pine-core/svg/bank.svg +1 -0
- package/dist/pine-core/svg/bell.svg +1 -0
- package/dist/pine-core/svg/blog-filled.svg +1 -0
- package/dist/pine-core/svg/blog.svg +1 -0
- package/dist/pine-core/svg/bold.svg +1 -0
- package/dist/pine-core/svg/broadcast.svg +1 -0
- package/dist/pine-core/svg/calendar-date.svg +1 -0
- package/dist/pine-core/svg/calendar-schedule.svg +1 -0
- package/dist/pine-core/svg/calendar-simple.svg +1 -0
- package/dist/pine-core/svg/card-bw-amex.svg +1 -0
- package/dist/pine-core/svg/card-bw-apple-card.svg +1 -0
- package/dist/pine-core/svg/card-bw-diners-club.svg +1 -0
- package/dist/pine-core/svg/card-bw-discover.svg +1 -0
- package/dist/pine-core/svg/card-bw-gpay-card.svg +1 -0
- package/dist/pine-core/svg/card-bw-mastercard.svg +1 -0
- package/dist/pine-core/svg/card-bw-paypal.svg +1 -0
- package/dist/pine-core/svg/card-bw-stripe.svg +1 -0
- package/dist/pine-core/svg/card-bw-visa.svg +1 -0
- package/dist/pine-core/svg/card-update.svg +1 -0
- package/dist/pine-core/svg/caret-down.svg +1 -0
- package/dist/pine-core/svg/caret-left.svg +1 -0
- package/dist/pine-core/svg/caret-right.svg +1 -0
- package/dist/pine-core/svg/caret-up.svg +1 -0
- package/dist/pine-core/svg/cart-add.svg +1 -0
- package/dist/pine-core/svg/cart.svg +1 -0
- package/dist/pine-core/svg/certificate.svg +1 -0
- package/dist/pine-core/svg/check-circle-filled.svg +1 -0
- package/dist/pine-core/svg/check-circle.svg +1 -0
- package/dist/pine-core/svg/check.svg +1 -0
- package/dist/pine-core/svg/circle-1.svg +1 -0
- package/dist/pine-core/svg/circle-2.svg +1 -0
- package/dist/pine-core/svg/circle-3.svg +1 -0
- package/dist/pine-core/svg/circle-4.svg +1 -0
- package/dist/pine-core/svg/circle-5.svg +1 -0
- package/dist/pine-core/svg/circle-6.svg +1 -0
- package/dist/pine-core/svg/circle-7.svg +1 -0
- package/dist/pine-core/svg/circle-8.svg +1 -0
- package/dist/pine-core/svg/circle-9.svg +1 -0
- package/dist/pine-core/svg/clock.svg +1 -0
- package/dist/pine-core/svg/closed-captions.svg +1 -0
- package/dist/pine-core/svg/cloud-upload.svg +1 -0
- package/dist/pine-core/svg/code.svg +1 -0
- package/dist/pine-core/svg/color.svg +1 -0
- package/dist/pine-core/svg/columns.svg +1 -0
- package/dist/pine-core/svg/comment.svg +1 -0
- package/dist/pine-core/svg/connect.svg +1 -0
- package/dist/pine-core/svg/contact.svg +1 -0
- package/dist/pine-core/svg/contacts-filled.svg +1 -0
- package/dist/pine-core/svg/contacts-outline.svg +1 -0
- package/dist/pine-core/svg/conversation.svg +1 -0
- package/dist/pine-core/svg/copy.svg +1 -0
- package/dist/pine-core/svg/coupon.svg +1 -0
- package/dist/pine-core/svg/course.svg +1 -0
- package/dist/pine-core/svg/creator-studio-filled.svg +1 -0
- package/dist/pine-core/svg/creator-studio.svg +1 -0
- package/dist/pine-core/svg/credit-card.svg +1 -0
- package/dist/pine-core/svg/custom-field.svg +1 -0
- package/dist/pine-core/svg/customize.svg +1 -0
- package/dist/pine-core/svg/danger-filled.svg +1 -0
- package/dist/pine-core/svg/danger.svg +1 -0
- package/dist/pine-core/svg/dashboard-filled.svg +1 -0
- package/dist/pine-core/svg/dashboard-outline.svg +1 -0
- package/dist/pine-core/svg/delete-circle.svg +1 -0
- package/dist/pine-core/svg/delete-key.svg +1 -0
- package/dist/pine-core/svg/delete-x.svg +1 -0
- package/dist/pine-core/svg/dollar-sign.svg +1 -0
- package/dist/pine-core/svg/dot-menu-horizontal.svg +1 -0
- package/dist/pine-core/svg/down-small.svg +1 -0
- package/dist/pine-core/svg/download.svg +1 -0
- package/dist/pine-core/svg/downsell.svg +1 -0
- package/dist/pine-core/svg/draft.svg +1 -0
- package/dist/pine-core/svg/drop.svg +1 -0
- package/dist/pine-core/svg/duplicate.svg +1 -0
- package/dist/pine-core/svg/email-activity.svg +1 -0
- package/dist/pine-core/svg/emoji.svg +1 -0
- package/dist/pine-core/svg/enlarge-vertical.svg +1 -0
- package/dist/pine-core/svg/enlarge.svg +1 -0
- package/dist/pine-core/svg/expand.svg +1 -0
- package/dist/pine-core/svg/facebook-2.svg +1 -0
- package/dist/pine-core/svg/facebook.svg +1 -0
- package/dist/pine-core/svg/favorite.svg +1 -0
- package/dist/pine-core/svg/feedback.svg +1 -0
- package/dist/pine-core/svg/file-money.svg +1 -0
- package/dist/pine-core/svg/file.svg +1 -0
- package/dist/pine-core/svg/filter.svg +1 -0
- package/dist/pine-core/svg/flag.svg +1 -0
- package/dist/pine-core/svg/flash-filled.svg +1 -0
- package/dist/pine-core/svg/flash.svg +1 -0
- package/dist/pine-core/svg/folder-group.svg +1 -0
- package/dist/pine-core/svg/folder.svg +1 -0
- package/dist/pine-core/svg/form-field.svg +1 -0
- package/dist/pine-core/svg/form-filled.svg +1 -0
- package/dist/pine-core/svg/form.svg +1 -0
- package/dist/pine-core/svg/fullscreen.svg +1 -0
- package/dist/pine-core/svg/funnel.svg +1 -0
- package/dist/pine-core/svg/grant-offer.svg +1 -0
- package/dist/pine-core/svg/handle-2-vertical.svg +1 -0
- package/dist/pine-core/svg/handle-2.svg +1 -0
- package/dist/pine-core/svg/handle.svg +1 -0
- package/dist/pine-core/svg/hashtag.svg +1 -0
- package/dist/pine-core/svg/hd-video.svg +1 -0
- package/dist/pine-core/svg/heading-large.svg +1 -0
- package/dist/pine-core/svg/heading-small.svg +1 -0
- package/dist/pine-core/svg/headset.svg +1 -0
- package/dist/pine-core/svg/help-filled.svg +1 -0
- package/dist/pine-core/svg/help-outline.svg +1 -0
- package/dist/pine-core/svg/home-alt.svg +1 -0
- package/dist/pine-core/svg/horizontal-line.svg +1 -0
- package/dist/pine-core/svg/image.svg +1 -0
- package/dist/pine-core/svg/info-circle-filled.svg +1 -0
- package/dist/pine-core/svg/info-circle.svg +1 -0
- package/dist/pine-core/svg/instagram.svg +1 -0
- package/dist/pine-core/svg/ios-battery.svg +1 -0
- package/dist/pine-core/svg/ios-data.svg +1 -0
- package/dist/pine-core/svg/ios-wifi.svg +1 -0
- package/dist/pine-core/svg/italic.svg +1 -0
- package/dist/pine-core/svg/kajabi-filled.svg +1 -0
- package/dist/pine-core/svg/kajabi-outlined.svg +1 -0
- package/dist/pine-core/svg/lab.svg +1 -0
- package/dist/pine-core/svg/launch.svg +1 -0
- package/dist/pine-core/svg/layout-grid.svg +1 -0
- package/dist/pine-core/svg/layout-list.svg +1 -0
- package/dist/pine-core/svg/left-small.svg +1 -0
- package/dist/pine-core/svg/linkedin.svg +1 -0
- package/dist/pine-core/svg/list-bullet.svg +1 -0
- package/dist/pine-core/svg/list-numbers.svg +1 -0
- package/dist/pine-core/svg/location.svg +1 -0
- package/dist/pine-core/svg/lock-alt.svg +1 -0
- package/dist/pine-core/svg/lock.svg +1 -0
- package/dist/pine-core/svg/logo-afterpay.svg +1 -0
- package/dist/pine-core/svg/loop.svg +1 -0
- package/dist/pine-core/svg/mail-filled.svg +1 -0
- package/dist/pine-core/svg/mail.svg +1 -0
- package/dist/pine-core/svg/map.svg +1 -0
- package/dist/pine-core/svg/mapped.svg +1 -0
- package/dist/pine-core/svg/margin-left.svg +1 -0
- package/dist/pine-core/svg/margin-right.svg +1 -0
- package/dist/pine-core/svg/marker-filled.svg +1 -0
- package/dist/pine-core/svg/marker.svg +1 -0
- package/dist/pine-core/svg/marketing-filled.svg +1 -0
- package/dist/pine-core/svg/marketing-outline.svg +1 -0
- package/dist/pine-core/svg/menu-2.svg +1 -0
- package/dist/pine-core/svg/menu-alt.svg +1 -0
- package/dist/pine-core/svg/menu.svg +1 -0
- package/dist/pine-core/svg/merge.svg +1 -0
- package/dist/pine-core/svg/microphone-off.svg +1 -0
- package/dist/pine-core/svg/microphone.svg +1 -0
- package/dist/pine-core/svg/move-left.svg +1 -0
- package/dist/pine-core/svg/move-right.svg +1 -0
- package/dist/pine-core/svg/multi-pay.svg +1 -0
- package/dist/pine-core/svg/newsletter.svg +1 -0
- package/dist/pine-core/svg/one-off-session.svg +1 -0
- package/dist/pine-core/svg/one-time.svg +1 -0
- package/dist/pine-core/svg/partners-filled.svg +1 -0
- package/dist/pine-core/svg/partners-outline.svg +1 -0
- package/dist/pine-core/svg/pause-circle.svg +1 -0
- package/dist/pine-core/svg/pause.svg +1 -0
- package/dist/pine-core/svg/payout.svg +1 -0
- package/dist/pine-core/svg/pen.svg +1 -0
- package/dist/pine-core/svg/phone-portrait.svg +1 -0
- package/dist/pine-core/svg/phone-toolbar.svg +1 -0
- package/dist/pine-core/svg/play-circle.svg +1 -0
- package/dist/pine-core/svg/play-outline.svg +1 -0
- package/dist/pine-core/svg/play-store.svg +1 -0
- package/dist/pine-core/svg/play.svg +1 -0
- package/dist/pine-core/svg/plug.svg +1 -0
- package/dist/pine-core/svg/premium.svg +1 -0
- package/dist/pine-core/svg/present.svg +1 -0
- package/dist/pine-core/svg/preview-off.svg +1 -0
- package/dist/pine-core/svg/preview-on.svg +1 -0
- package/dist/pine-core/svg/products-filled.svg +1 -0
- package/dist/pine-core/svg/products-outline.svg +1 -0
- package/dist/pine-core/svg/question-circle.svg +1 -0
- package/dist/pine-core/svg/quote.svg +1 -0
- package/dist/pine-core/svg/redo.svg +1 -0
- package/dist/pine-core/svg/refresh.svg +1 -0
- package/dist/pine-core/svg/remove-circle.svg +1 -0
- package/dist/pine-core/svg/remove.svg +1 -0
- package/dist/pine-core/svg/rename.svg +1 -0
- package/dist/pine-core/svg/reset-password.svg +1 -0
- package/dist/pine-core/svg/restore.svg +1 -0
- package/dist/pine-core/svg/right-small.svg +1 -0
- package/dist/pine-core/svg/round-dollar.svg +1 -0
- package/dist/pine-core/svg/rows.svg +1 -0
- package/dist/pine-core/svg/sales-filled.svg +1 -0
- package/dist/pine-core/svg/sales-outline.svg +1 -0
- package/dist/pine-core/svg/scissor.svg +1 -0
- package/dist/pine-core/svg/screen-share-off.svg +1 -0
- package/dist/pine-core/svg/screen-share-on.svg +1 -0
- package/dist/pine-core/svg/search-small.svg +1 -0
- package/dist/pine-core/svg/search.svg +1 -0
- package/dist/pine-core/svg/send-message.svg +1 -0
- package/dist/pine-core/svg/sequences.svg +1 -0
- package/dist/pine-core/svg/series.svg +1 -0
- package/dist/pine-core/svg/settings-filled.svg +1 -0
- package/dist/pine-core/svg/settings-outline.svg +1 -0
- package/dist/pine-core/svg/share.svg +1 -0
- package/dist/pine-core/svg/skipped.svg +1 -0
- package/dist/pine-core/svg/slash-divider.svg +1 -0
- package/dist/pine-core/svg/sparkle-filled.svg +1 -0
- package/dist/pine-core/svg/sparkle.svg +1 -0
- package/dist/pine-core/svg/speaker.svg +1 -0
- package/dist/pine-core/svg/stack.svg +1 -0
- package/dist/pine-core/svg/star.svg +1 -0
- package/dist/pine-core/svg/stop.svg +1 -0
- package/dist/pine-core/svg/stopwatch.svg +1 -0
- package/dist/pine-core/svg/strikethrough.svg +1 -0
- package/dist/pine-core/svg/subscript.svg +1 -0
- package/dist/pine-core/svg/subscriptions.svg +1 -0
- package/dist/pine-core/svg/super-admin.svg +1 -0
- package/dist/pine-core/svg/superscript.svg +1 -0
- package/dist/pine-core/svg/sync.svg +1 -0
- package/dist/pine-core/svg/tablet-landscape.svg +1 -0
- package/dist/pine-core/svg/tablet-portrait.svg +1 -0
- package/dist/pine-core/svg/text-styles.svg +1 -0
- package/dist/pine-core/svg/theme-store-filled.svg +1 -0
- package/dist/pine-core/svg/theme-store.svg +1 -0
- package/dist/pine-core/svg/thumbs-down-filled.svg +1 -0
- package/dist/pine-core/svg/thumbs-down.svg +1 -0
- package/dist/pine-core/svg/thumbs-up-filled.svg +1 -0
- package/dist/pine-core/svg/thumbs-up.svg +1 -0
- package/dist/pine-core/svg/tiktok.svg +1 -0
- package/dist/pine-core/svg/trash.svg +1 -0
- package/dist/pine-core/svg/twitter.svg +1 -0
- package/dist/pine-core/svg/underline.svg +1 -0
- package/dist/pine-core/svg/undo.svg +1 -0
- package/dist/pine-core/svg/unlock.svg +1 -0
- package/dist/pine-core/svg/unmapped.svg +1 -0
- package/dist/pine-core/svg/up-small.svg +1 -0
- package/dist/pine-core/svg/upload.svg +1 -0
- package/dist/pine-core/svg/url.svg +1 -0
- package/dist/pine-core/svg/user-filled.svg +1 -0
- package/dist/pine-core/svg/user.svg +1 -0
- package/dist/pine-core/svg/users-wm.svg +1 -0
- package/dist/pine-core/svg/users.svg +1 -0
- package/dist/pine-core/svg/video-off.svg +1 -0
- package/dist/pine-core/svg/video-on.svg +1 -0
- package/dist/pine-core/svg/warning-filled.svg +1 -0
- package/dist/pine-core/svg/warning.svg +1 -0
- package/dist/pine-core/svg/website-filled.svg +1 -0
- package/dist/pine-core/svg/website-outline.svg +1 -0
- package/dist/pine-core/svg/window-paragraph.svg +1 -0
- package/dist/pine-core/svg/world.svg +1 -0
- package/dist/pine-core/svg/wrench.svg +1 -0
- package/dist/pine-core/svg/youtube.svg +1 -0
- package/dist/scripts/build-tokens.js +160 -0
- package/dist/scripts/build-tokens.js.map +1 -0
- package/dist/types/components/_internal/pds-label/pds-label.d.ts +22 -0
- package/dist/types/components/pds-avatar/pds-avatar.d.ts +42 -0
- package/dist/types/components/pds-button/pds-button.d.ts +36 -0
- package/dist/types/components/pds-checkbox/pds-checkbox.d.ts +55 -0
- package/dist/types/components/pds-chip/pds-chip.d.ts +39 -0
- package/dist/types/components/pds-copytext/pds-copytext.d.ts +34 -0
- package/dist/types/components/pds-divider/pds-divider.d.ts +17 -0
- package/dist/types/components/pds-image/pds-image.d.ts +42 -0
- package/dist/types/components/pds-input/pds-input.d.ts +59 -0
- package/dist/types/components/pds-link/pds-link.d.ts +34 -0
- package/dist/types/components/pds-progress/pds-progress.d.ts +31 -0
- package/dist/types/components/pds-radio/pds-radio.d.ts +54 -0
- package/dist/types/components/pds-sortable/pds-sortable-item/pds-sortable-item.d.ts +20 -0
- package/dist/types/components/pds-sortable/pds-sortable.d.ts +28 -0
- package/dist/types/components/pds-switch/pds-switch.d.ts +59 -0
- package/dist/types/components/pds-tabs/pds-tab/pds-tab.d.ts +35 -0
- package/dist/types/components/pds-tabs/pds-tabpanel/pds-tabpanel.d.ts +23 -0
- package/dist/types/components/pds-tabs/pds-tabs.d.ts +40 -0
- package/dist/types/components/pds-textarea/pds-textarea.d.ts +64 -0
- package/dist/types/components/pds-textarea/textarea-interface.d.ts +8 -0
- package/dist/types/components/pds-tooltip/pds-tooltip.d.ts +68 -0
- package/dist/types/components.d.ts +1566 -0
- package/dist/types/global/pine-ui-global.d.ts +1 -0
- package/dist/types/home/runner/work/pine/pine/libs/core/.stencil/scripts/build-tokens.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/interface.d.ts +17 -0
- package/dist/types/stencil-public-runtime.d.ts +1681 -0
- package/dist/types/stories/_helpers/index.d.ts +12 -0
- package/dist/types/utils/form.d.ts +12 -0
- package/dist/types/utils/overlay.d.ts +8 -0
- package/dist/types/utils/types.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +2 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +21 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +115 -0
- package/readme.md +75 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
div {
|
|
6
|
+
--background-color: var(--pine-color-primary-100);
|
|
7
|
+
--badge-background-color: var(--pine-color-base-white);
|
|
8
|
+
--border: var(--pine-border-default);
|
|
9
|
+
--radius-round: 50%;
|
|
10
|
+
align-items: center;
|
|
11
|
+
background-color: var(--background-color);
|
|
12
|
+
border-radius: var(--radius-round);
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
position: relative;
|
|
16
|
+
}
|
|
17
|
+
:host(.pds-avatar--admin) div {
|
|
18
|
+
border-radius: 12px;
|
|
19
|
+
}
|
|
20
|
+
:host(.pds-avatar--has-image) div {
|
|
21
|
+
background: transparent;
|
|
22
|
+
}
|
|
23
|
+
@supports selector(:has) {
|
|
24
|
+
div:has(img) {
|
|
25
|
+
background-color: transparent;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.pds-avatar__button {
|
|
30
|
+
--radius-round: 50%;
|
|
31
|
+
--box-shadow-focus: 0 0 0 4px var(--pine-color-primary-200);
|
|
32
|
+
align-items: center;
|
|
33
|
+
appearance: none;
|
|
34
|
+
background: transparent;
|
|
35
|
+
border: 0;
|
|
36
|
+
border-radius: var(--radius-round);
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
display: flex;
|
|
39
|
+
padding: 0;
|
|
40
|
+
}
|
|
41
|
+
.pds-avatar__button:focus-visible {
|
|
42
|
+
box-shadow: var(--box-shadow-focus);
|
|
43
|
+
outline: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.pds-avatar__badge {
|
|
47
|
+
background-color: var(--badge-background-color);
|
|
48
|
+
border: var(--border);
|
|
49
|
+
border-color: var(--badge-background-color);
|
|
50
|
+
border-radius: var(--radius-round);
|
|
51
|
+
bottom: 0;
|
|
52
|
+
position: absolute;
|
|
53
|
+
right: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
img {
|
|
57
|
+
border-radius: var(--radius-round);
|
|
58
|
+
width: 100%;
|
|
59
|
+
}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class PdsAvatar {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.renderAvatar = () => {
|
|
5
|
+
const style = {
|
|
6
|
+
height: this.avatarSize(),
|
|
7
|
+
width: this.avatarSize(),
|
|
8
|
+
};
|
|
9
|
+
return (this.dropdown
|
|
10
|
+
?
|
|
11
|
+
h("button", { class: "pds-avatar__button", type: "button" }, h("div", { style: style }, this.renderIconOrImage(), this.renderBadge()))
|
|
12
|
+
:
|
|
13
|
+
h("div", { style: style }, this.renderIconOrImage(), this.renderBadge()));
|
|
14
|
+
};
|
|
15
|
+
this.renderBadge = () => (this.badge
|
|
16
|
+
// Percentage is average size of icon in relation to total avatar size
|
|
17
|
+
// of all preset sizes found in Figma.
|
|
18
|
+
// Used to allow icons to scale to container size
|
|
19
|
+
&& h("pds-icon", { class: "pds-avatar__badge", name: "check-circle-filled", size: "33.53%" }));
|
|
20
|
+
this.renderIconOrImage = () => (this.image
|
|
21
|
+
? h("img", { alt: this.alt, src: this.image })
|
|
22
|
+
// Percentage is average size of icon in relation to total avatar size
|
|
23
|
+
// of all preset sizes found in Figma.
|
|
24
|
+
// Used to allow icons to scale to container size
|
|
25
|
+
: h("pds-icon", { name: "user-filled", size: "33.53%" }));
|
|
26
|
+
this.classNames = () => ({
|
|
27
|
+
'pds-avatar': true,
|
|
28
|
+
[`pds-avatar--has-image`]: this.image !== '' && this.image !== null,
|
|
29
|
+
[`pds-avatar--${this.variant}`]: this.variant === 'admin'
|
|
30
|
+
});
|
|
31
|
+
this.alt = null;
|
|
32
|
+
this.badge = false;
|
|
33
|
+
this.componentId = undefined;
|
|
34
|
+
this.dropdown = false;
|
|
35
|
+
this.image = null;
|
|
36
|
+
this.size = 'lg';
|
|
37
|
+
this.variant = 'customer';
|
|
38
|
+
}
|
|
39
|
+
avatarSize() {
|
|
40
|
+
const sizes = {
|
|
41
|
+
xs: '24px',
|
|
42
|
+
sm: '32px',
|
|
43
|
+
md: '40px',
|
|
44
|
+
lg: '56px',
|
|
45
|
+
xl: '64px',
|
|
46
|
+
};
|
|
47
|
+
if (sizes[this.size]) {
|
|
48
|
+
return sizes[this.size];
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return this.size;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
render() {
|
|
55
|
+
return (h(Host, { id: this.componentId, class: Object.assign({}, this.classNames()) }, this.renderAvatar()));
|
|
56
|
+
}
|
|
57
|
+
static get is() { return "pds-avatar"; }
|
|
58
|
+
static get encapsulation() { return "shadow"; }
|
|
59
|
+
static get originalStyleUrls() {
|
|
60
|
+
return {
|
|
61
|
+
"$": ["pds-avatar.scss"]
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
static get styleUrls() {
|
|
65
|
+
return {
|
|
66
|
+
"$": ["pds-avatar.css"]
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
static get properties() {
|
|
70
|
+
return {
|
|
71
|
+
"alt": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"mutable": false,
|
|
74
|
+
"complexType": {
|
|
75
|
+
"original": "string | null",
|
|
76
|
+
"resolved": "string",
|
|
77
|
+
"references": {}
|
|
78
|
+
},
|
|
79
|
+
"required": false,
|
|
80
|
+
"optional": true,
|
|
81
|
+
"docs": {
|
|
82
|
+
"tags": [{
|
|
83
|
+
"name": "defaultValue",
|
|
84
|
+
"text": "null"
|
|
85
|
+
}],
|
|
86
|
+
"text": "The alt for a custom user image."
|
|
87
|
+
},
|
|
88
|
+
"attribute": "alt",
|
|
89
|
+
"reflect": false,
|
|
90
|
+
"defaultValue": "null"
|
|
91
|
+
},
|
|
92
|
+
"badge": {
|
|
93
|
+
"type": "boolean",
|
|
94
|
+
"mutable": false,
|
|
95
|
+
"complexType": {
|
|
96
|
+
"original": "boolean",
|
|
97
|
+
"resolved": "boolean",
|
|
98
|
+
"references": {}
|
|
99
|
+
},
|
|
100
|
+
"required": false,
|
|
101
|
+
"optional": true,
|
|
102
|
+
"docs": {
|
|
103
|
+
"tags": [{
|
|
104
|
+
"name": "defaultValue",
|
|
105
|
+
"text": "false"
|
|
106
|
+
}],
|
|
107
|
+
"text": "Determines whether the badge is visible or not."
|
|
108
|
+
},
|
|
109
|
+
"attribute": "badge",
|
|
110
|
+
"reflect": false,
|
|
111
|
+
"defaultValue": "false"
|
|
112
|
+
},
|
|
113
|
+
"componentId": {
|
|
114
|
+
"type": "string",
|
|
115
|
+
"mutable": false,
|
|
116
|
+
"complexType": {
|
|
117
|
+
"original": "string",
|
|
118
|
+
"resolved": "string",
|
|
119
|
+
"references": {}
|
|
120
|
+
},
|
|
121
|
+
"required": false,
|
|
122
|
+
"optional": false,
|
|
123
|
+
"docs": {
|
|
124
|
+
"tags": [],
|
|
125
|
+
"text": "A unique identifier used for the underlying component `id` attribute."
|
|
126
|
+
},
|
|
127
|
+
"attribute": "component-id",
|
|
128
|
+
"reflect": false
|
|
129
|
+
},
|
|
130
|
+
"dropdown": {
|
|
131
|
+
"type": "boolean",
|
|
132
|
+
"mutable": false,
|
|
133
|
+
"complexType": {
|
|
134
|
+
"original": "boolean",
|
|
135
|
+
"resolved": "boolean",
|
|
136
|
+
"references": {}
|
|
137
|
+
},
|
|
138
|
+
"required": false,
|
|
139
|
+
"optional": true,
|
|
140
|
+
"docs": {
|
|
141
|
+
"tags": [{
|
|
142
|
+
"name": "defaultValue",
|
|
143
|
+
"text": "false"
|
|
144
|
+
}],
|
|
145
|
+
"text": "Determines whether the avatar functions as a dropdown trigger."
|
|
146
|
+
},
|
|
147
|
+
"attribute": "dropdown",
|
|
148
|
+
"reflect": false,
|
|
149
|
+
"defaultValue": "false"
|
|
150
|
+
},
|
|
151
|
+
"image": {
|
|
152
|
+
"type": "string",
|
|
153
|
+
"mutable": false,
|
|
154
|
+
"complexType": {
|
|
155
|
+
"original": "string | null",
|
|
156
|
+
"resolved": "string",
|
|
157
|
+
"references": {}
|
|
158
|
+
},
|
|
159
|
+
"required": false,
|
|
160
|
+
"optional": true,
|
|
161
|
+
"docs": {
|
|
162
|
+
"tags": [{
|
|
163
|
+
"name": "defaultValue",
|
|
164
|
+
"text": "null"
|
|
165
|
+
}],
|
|
166
|
+
"text": "The src for a custom user image."
|
|
167
|
+
},
|
|
168
|
+
"attribute": "image",
|
|
169
|
+
"reflect": false,
|
|
170
|
+
"defaultValue": "null"
|
|
171
|
+
},
|
|
172
|
+
"size": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"mutable": false,
|
|
175
|
+
"complexType": {
|
|
176
|
+
"original": "| 'xl' // 64px\n | 'lg' // 56px\n | 'md' // 40px\n | 'sm' // 32px\n | 'xs' // 24px\n | string",
|
|
177
|
+
"resolved": "string",
|
|
178
|
+
"references": {}
|
|
179
|
+
},
|
|
180
|
+
"required": false,
|
|
181
|
+
"optional": true,
|
|
182
|
+
"docs": {
|
|
183
|
+
"tags": [{
|
|
184
|
+
"name": "defaultValue",
|
|
185
|
+
"text": "lg"
|
|
186
|
+
}],
|
|
187
|
+
"text": "Size of the avatar. Value can be preset or custom."
|
|
188
|
+
},
|
|
189
|
+
"attribute": "size",
|
|
190
|
+
"reflect": true,
|
|
191
|
+
"defaultValue": "'lg'"
|
|
192
|
+
},
|
|
193
|
+
"variant": {
|
|
194
|
+
"type": "string",
|
|
195
|
+
"mutable": false,
|
|
196
|
+
"complexType": {
|
|
197
|
+
"original": "'customer' | 'admin'",
|
|
198
|
+
"resolved": "\"admin\" | \"customer\"",
|
|
199
|
+
"references": {}
|
|
200
|
+
},
|
|
201
|
+
"required": false,
|
|
202
|
+
"optional": true,
|
|
203
|
+
"docs": {
|
|
204
|
+
"tags": [{
|
|
205
|
+
"name": "defaultValue",
|
|
206
|
+
"text": "customer"
|
|
207
|
+
}],
|
|
208
|
+
"text": "Determines the variant of avatar. Changes appearance accordingly."
|
|
209
|
+
},
|
|
210
|
+
"attribute": "variant",
|
|
211
|
+
"reflect": true,
|
|
212
|
+
"defaultValue": "'customer'"
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=pds-avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pds-avatar.js","sourceRoot":"","sources":["../../../../src/components/pds-avatar/pds-avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,OAAO,SAAS;;QAiEZ,iBAAY,GAAG,GAAG,EAAE;YAC1B,MAAM,KAAK,GAAG;gBACZ,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE;gBACzB,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE;aACzB,CAAC;YACF,OAAO,CACL,IAAI,CAAC,QAAQ;gBACX,CAAC;oBACD,cAAQ,KAAK,EAAC,oBAAoB,EAAC,IAAI,EAAC,QAAQ;wBAC9C,WAAK,KAAK,EAAE,KAAK;4BACd,IAAI,CAAC,iBAAiB,EAAE;4BACxB,IAAI,CAAC,WAAW,EAAE,CACf,CACC;gBACT,CAAC;oBACD,WAAK,KAAK,EAAE,KAAK;wBACd,IAAI,CAAC,iBAAiB,EAAE;wBACxB,IAAI,CAAC,WAAW,EAAE,CACf,CACT,CAAA;QACH,CAAC,CAAC;QAEM,gBAAW,GAAG,GAAG,EAAE,CAAC,CAC1B,IAAI,CAAC,KAAK;YACV,sEAAsE;YACtE,sCAAsC;YACtC,iDAAiD;eAC5C,gBAAU,KAAK,EAAC,mBAAmB,EAAC,IAAI,EAAC,qBAAqB,EAAC,IAAI,EAAC,QAAQ,GAAY,CAC9F,CAAC;QAEM,sBAAiB,GAAG,GAAG,EAAE,CAAC,CAChC,IAAI,CAAC,KAAK;YACR,CAAC,CAAC,WAAK,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,GAAI;YACzC,sEAAsE;YACtE,sCAAsC;YACtC,iDAAiD;YACjD,CAAC,CAAC,gBAAU,IAAI,EAAC,aAAa,EAAC,IAAI,EAAC,QAAQ,GAAY,CAC3D,CAAC;QAEM,eAAU,GAAG,GAAG,EAAE,CAAC,CACzB;YACE,YAAY,EAAE,IAAI;YAClB,CAAC,uBAAuB,CAAC,EAAE,IAAI,CAAC,KAAK,KAAK,EAAE,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI;YACnE,CAAC,eAAe,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,KAAK,OAAO;SAC1D,CACF,CAAC;mBAxG4B,IAAI;qBAMjB,KAAK;;wBAWF,KAAK;qBAMO,IAAI;oBAYzB,IAAI;uBAM2C,UAAU;;IAE5D,UAAU;QAChB,MAAM,KAAK,GAA2B;YACpC,EAAE,EAAE,MAAM;YACV,EAAE,EAAE,MAAM;YACV,EAAE,EAAE,MAAM;YACV,EAAE,EAAE,MAAM;YACV,EAAE,EAAE,MAAM;SACX,CAAA;QAED,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACpB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACzB;aAAM;YACL,OAAO,IAAI,CAAC,IAAI,CAAA;SACjB;IACH,CAAC;IAiDD,MAAM;QAEJ,OAAO,CACL,EAAC,IAAI,IACH,EAAE,EAAE,IAAI,CAAC,WAAW,EACpB,KAAK,oBAAM,IAAI,CAAC,UAAU,EAAE,KAE3B,IAAI,CAAC,YAAY,EAAE,CACf,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'pds-avatar',\n styleUrl: 'pds-avatar.scss',\n shadow: true,\n})\nexport class PdsAvatar {\n\n /**\n * The alt for a custom user image.\n * @defaultValue null\n */\n @Prop() alt?: string | null = null;\n\n /**\n * Determines whether the badge is visible or not.\n * @defaultValue false\n */\n @Prop() badge? = false;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * Determines whether the avatar functions as a dropdown trigger.\n * @defaultValue false\n */\n @Prop() dropdown? = false;\n\n /**\n * The src for a custom user image.\n * @defaultValue null\n */\n @Prop() image?: string | null = null;\n\n /**\n * Size of the avatar. Value can be preset or custom.\n * @defaultValue lg\n */\n @Prop({ reflect: true }) size?:\n | 'xl' // 64px\n | 'lg' // 56px\n | 'md' // 40px\n | 'sm' // 32px\n | 'xs' // 24px\n | string = 'lg';\n\n /**\n * Determines the variant of avatar. Changes appearance accordingly.\n * @defaultValue customer\n */\n @Prop({ reflect: true }) variant?: 'customer' | 'admin' = 'customer';\n\n private avatarSize() {\n const sizes: { [key: string]: any } = {\n xs: '24px',\n sm: '32px',\n md: '40px',\n lg: '56px',\n xl: '64px',\n }\n\n if (sizes[this.size]) {\n return sizes[this.size];\n } else {\n return this.size\n }\n }\n\n private renderAvatar = () => {\n const style = {\n height: this.avatarSize(),\n width: this.avatarSize(),\n };\n return (\n this.dropdown\n ?\n <button class=\"pds-avatar__button\" type=\"button\">\n <div style={style}>\n {this.renderIconOrImage()}\n {this.renderBadge()}\n </div>\n </button>\n :\n <div style={style}>\n {this.renderIconOrImage()}\n {this.renderBadge()}\n </div>\n )\n };\n\n private renderBadge = () => (\n this.badge\n // Percentage is average size of icon in relation to total avatar size\n // of all preset sizes found in Figma.\n // Used to allow icons to scale to container size\n && <pds-icon class=\"pds-avatar__badge\" name=\"check-circle-filled\" size=\"33.53%\"></pds-icon>\n );\n\n private renderIconOrImage = () => (\n this.image\n ? <img alt={this.alt} src={this.image} />\n // Percentage is average size of icon in relation to total avatar size\n // of all preset sizes found in Figma.\n // Used to allow icons to scale to container size\n : <pds-icon name=\"user-filled\" size=\"33.53%\"></pds-icon>\n );\n\n private classNames = () => (\n {\n 'pds-avatar': true,\n [`pds-avatar--has-image`]: this.image !== '' && this.image !== null, // Remove when FF supports :has selector\n [`pds-avatar--${this.variant}`]: this.variant === 'admin'\n }\n );\n\n render() {\n\n return (\n <Host\n id={this.componentId}\n class={{...this.classNames()}}\n >\n {this.renderAvatar()}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import imgFile from '../assets/demi_wilkinson.jpg';
|
|
3
|
+
|
|
4
|
+
import { extractArgTypes } from '@pxtrn/storybook-addon-docs-stencil';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
args: {
|
|
8
|
+
alt: null,
|
|
9
|
+
badge: false,
|
|
10
|
+
componentId: null,
|
|
11
|
+
dropdown: false,
|
|
12
|
+
image: null,
|
|
13
|
+
size: null,
|
|
14
|
+
variant: 'customer',
|
|
15
|
+
},
|
|
16
|
+
argTypes: extractArgTypes('pds-avatar'),
|
|
17
|
+
component: 'pds-avatar',
|
|
18
|
+
title: 'components/Avatar',
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const BaseTemplate = (args) => html`<pds-avatar
|
|
22
|
+
alt="${args.alt}"
|
|
23
|
+
badge="${args.badge}"
|
|
24
|
+
dropdown="${args.dropdown}"
|
|
25
|
+
component-id="${args.componentId}"
|
|
26
|
+
image="${args.image}"
|
|
27
|
+
size="${args.size}"
|
|
28
|
+
variant="${args.variant}"
|
|
29
|
+
>
|
|
30
|
+
</pds-avatar>`;
|
|
31
|
+
|
|
32
|
+
export const Default = BaseTemplate.bind();
|
|
33
|
+
Default.args = {
|
|
34
|
+
size: 'sm'
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const Admin = BaseTemplate.bind();
|
|
38
|
+
Admin.args = {
|
|
39
|
+
size: 'lg',
|
|
40
|
+
variant: 'admin',
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const Badge = BaseTemplate.bind();
|
|
44
|
+
Badge.args = {
|
|
45
|
+
badge: true,
|
|
46
|
+
size: 'md'
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const CustomSize = BaseTemplate.bind();
|
|
50
|
+
CustomSize.args = {
|
|
51
|
+
size: '128px'
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const DropdownTrigger = BaseTemplate.bind();
|
|
55
|
+
DropdownTrigger.args = {
|
|
56
|
+
dropdown: true,
|
|
57
|
+
size: 'lg'
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export const Image = BaseTemplate.bind();
|
|
61
|
+
Image.args = {
|
|
62
|
+
alt: 'Customer Profile',
|
|
63
|
+
image: imgFile,
|
|
64
|
+
size: 'xl'
|
|
65
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--border-color: transparent;
|
|
3
|
+
--border-color-hover: transparent;
|
|
4
|
+
--border-color-focus: transparent;
|
|
5
|
+
--border-color-disabled: transparent;
|
|
6
|
+
--background-color-primary: var(--pine-color-neutral-charcoal-400);
|
|
7
|
+
--background-color-hover-primary: var(--pine-color-neutral-charcoal-500);
|
|
8
|
+
--background-color-disabled-primary: var(--pine-color-neutral-grey-300);
|
|
9
|
+
--color-primary: var(--pine-color-base-white);
|
|
10
|
+
--color-disabled-primary: var(--pine-color-neutral-charcoal-100);
|
|
11
|
+
--outline-color-primary: var(--pine-color-primary-200);
|
|
12
|
+
--border-color-secondary: var(--pine-color-neutral-grey-400);
|
|
13
|
+
--border-color-hover-secondary: var(--pine-color-neutral-grey-500);
|
|
14
|
+
--border-color-focus-secondary: var(--pine-color-neutral-grey-300);
|
|
15
|
+
--border-color-disabled-secondary: var(--pine-color-neutral-grey-300);
|
|
16
|
+
--color-secondary: var(--pine-color-neutral-charcoal-400);
|
|
17
|
+
--color-disabled-secondary: var(--pine-color-neutral-charcoal-100);
|
|
18
|
+
--outline-color-secondary: var(--pine-color-primary-200);
|
|
19
|
+
--background-color-accent: var(--pine-color-primary-300);
|
|
20
|
+
--background-color-hover-accent: var(--pine-color-primary-400);
|
|
21
|
+
--background-color-disabled-accent: var(--pine-color-primary-100);
|
|
22
|
+
--color-accent: var(--pine-color-base-white);
|
|
23
|
+
--color-disabled-accent: var(--pine-color-primary-200);
|
|
24
|
+
--outline-color-accent: var(--pine-color-primary-200);
|
|
25
|
+
--background-color-destructive: var(--pine-color-red-300);
|
|
26
|
+
--background-color-hover-destructive: var(--pine-color-red-400);
|
|
27
|
+
--background-color-disabled-destructive: var(--pine-color-red-100);
|
|
28
|
+
--color-destructive: var(--pine-color-base-white);
|
|
29
|
+
--color-disabled-destructive: var(--pine-color-red-200);
|
|
30
|
+
--outline-color-destructive: var(--pine-color-red-200);
|
|
31
|
+
display: inline-flex;
|
|
32
|
+
vertical-align: middle;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.pds-button {
|
|
36
|
+
align-items: center;
|
|
37
|
+
background-color: var(--background-color);
|
|
38
|
+
border: 1px solid var(--border-color);
|
|
39
|
+
border-radius: 10px;
|
|
40
|
+
color: var(--color);
|
|
41
|
+
display: flex;
|
|
42
|
+
font-family: inherit;
|
|
43
|
+
font-size: 1rem;
|
|
44
|
+
font-weight: 500;
|
|
45
|
+
min-height: 40px;
|
|
46
|
+
padding: 0.5rem 1rem;
|
|
47
|
+
}
|
|
48
|
+
.pds-button pds-icon {
|
|
49
|
+
fill: currentColor;
|
|
50
|
+
margin-inline-end: 0.5rem;
|
|
51
|
+
}
|
|
52
|
+
.pds-button:hover {
|
|
53
|
+
background-color: var(--background-color-hover);
|
|
54
|
+
border-color: var(--border-color-hover);
|
|
55
|
+
}
|
|
56
|
+
.pds-button:focus {
|
|
57
|
+
border-color: var(--border-color-focus);
|
|
58
|
+
outline: 4px solid var(--outline-color);
|
|
59
|
+
}
|
|
60
|
+
.pds-button:disabled {
|
|
61
|
+
background-color: var(--background-color-disabled);
|
|
62
|
+
border-color: var(--border-color-disabled);
|
|
63
|
+
color: var(--color-disabled);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.pds-button--primary {
|
|
67
|
+
--background-color: var(--background-color-primary);
|
|
68
|
+
--background-color-hover: var(--background-color-hover-primary);
|
|
69
|
+
--background-color-disabled: var(--background-color-disabled-primary);
|
|
70
|
+
--color: var(--color-primary);
|
|
71
|
+
--color-disabled: var(--color-disabled-primary);
|
|
72
|
+
--outline-color: var(--outline-color-primary);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.pds-button--accent {
|
|
76
|
+
--background-color: var(--background-color-accent);
|
|
77
|
+
--background-color-hover: var(--background-color-hover-accent);
|
|
78
|
+
--background-color-disabled: var(--background-color-disabled-accent);
|
|
79
|
+
--color: var(--color-accent);
|
|
80
|
+
--color-disabled: var(--color-disabled-accent);
|
|
81
|
+
--outline-color: var(--outline-color-accent);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.pds-button--destructive {
|
|
85
|
+
--background-color: var(--background-color-destructive);
|
|
86
|
+
--background-color-hover: var(--background-color-hover-destructive);
|
|
87
|
+
--background-color-disabled: var(--background-color-disabled-destructive);
|
|
88
|
+
--color: var(--color-destructive);
|
|
89
|
+
--color-disabled: var(--color-disabled-destructive);
|
|
90
|
+
--outline-color: var(--outline-color-destructive);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.pds-button--secondary,
|
|
94
|
+
.pds-button--disclosure {
|
|
95
|
+
--background-color: transparent;
|
|
96
|
+
--background-color-hover: transparent;
|
|
97
|
+
--background-color-disabled: transparent;
|
|
98
|
+
--border-color-disabled: var(--border-color-disabled-secondary);
|
|
99
|
+
--border-color-focus: var(--border-color-focus-secondary);
|
|
100
|
+
--border-color-hover: var(--border-color-hover-secondary);
|
|
101
|
+
--border-color: var(--border-color-secondary);
|
|
102
|
+
--color: var(--color-secondary);
|
|
103
|
+
--color-disabled: var(--color-disabled-secondary);
|
|
104
|
+
--outline-color: var(--outline-color-secondary);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.pds-button--disclosure pds-icon {
|
|
108
|
+
margin-inline-end: 0;
|
|
109
|
+
margin-inline-start: 0.5rem;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.pds-button--unstyled {
|
|
113
|
+
--background-color: transparent;
|
|
114
|
+
--background-color-hover: transparent;
|
|
115
|
+
--background-color-disabled: transparent;
|
|
116
|
+
--color: inherit;
|
|
117
|
+
border: 0;
|
|
118
|
+
margin: 0;
|
|
119
|
+
min-height: auto;
|
|
120
|
+
padding: 0;
|
|
121
|
+
width: inherit;
|
|
122
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { hasShadowDom } from "../../utils/utils";
|
|
3
|
+
export class PdsButton {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.handleClick = (ev) => {
|
|
6
|
+
if (this.type != 'button') {
|
|
7
|
+
// If button clicked IS NOT associated with a form
|
|
8
|
+
if (hasShadowDom(this.el)) {
|
|
9
|
+
const form = this.el.closest('form');
|
|
10
|
+
if (form) {
|
|
11
|
+
ev.preventDefault();
|
|
12
|
+
const fakeButton = document.createElement('button');
|
|
13
|
+
fakeButton.type = this.type;
|
|
14
|
+
fakeButton.style.display = 'none';
|
|
15
|
+
form.appendChild(fakeButton);
|
|
16
|
+
fakeButton.click();
|
|
17
|
+
fakeButton.remove();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
this.componentId = undefined;
|
|
23
|
+
this.disabled = false;
|
|
24
|
+
this.icon = null;
|
|
25
|
+
this.name = undefined;
|
|
26
|
+
this.value = undefined;
|
|
27
|
+
this.type = 'button';
|
|
28
|
+
this.variant = 'primary';
|
|
29
|
+
}
|
|
30
|
+
classNames() {
|
|
31
|
+
const classNames = ['pds-button'];
|
|
32
|
+
if (this.variant) {
|
|
33
|
+
classNames.push('pds-button--' + this.variant);
|
|
34
|
+
}
|
|
35
|
+
return classNames.join(' ');
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
return (h(Host, { "aria-disabled": this.disabled ? 'true' : null, id: this.componentId, onClick: this.handleClick, variant: this.variant }, h("button", { class: this.classNames(), disabled: this.disabled, name: this.name, type: this.type, value: this.value }, this.icon && this.variant !== 'disclosure' && h("pds-icon", { name: this.icon }), h("slot", null), this.variant === 'disclosure' && h("pds-icon", { name: "caret-down" }))));
|
|
39
|
+
}
|
|
40
|
+
static get is() { return "pds-button"; }
|
|
41
|
+
static get encapsulation() { return "shadow"; }
|
|
42
|
+
static get originalStyleUrls() {
|
|
43
|
+
return {
|
|
44
|
+
"$": ["pds-button.scss"]
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
static get styleUrls() {
|
|
48
|
+
return {
|
|
49
|
+
"$": ["pds-button.css"]
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
static get properties() {
|
|
53
|
+
return {
|
|
54
|
+
"componentId": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"mutable": false,
|
|
57
|
+
"complexType": {
|
|
58
|
+
"original": "string",
|
|
59
|
+
"resolved": "string",
|
|
60
|
+
"references": {}
|
|
61
|
+
},
|
|
62
|
+
"required": false,
|
|
63
|
+
"optional": false,
|
|
64
|
+
"docs": {
|
|
65
|
+
"tags": [],
|
|
66
|
+
"text": "A unique identifier used for the underlying component `id` attribute."
|
|
67
|
+
},
|
|
68
|
+
"attribute": "component-id",
|
|
69
|
+
"reflect": false
|
|
70
|
+
},
|
|
71
|
+
"disabled": {
|
|
72
|
+
"type": "boolean",
|
|
73
|
+
"mutable": false,
|
|
74
|
+
"complexType": {
|
|
75
|
+
"original": "boolean",
|
|
76
|
+
"resolved": "boolean",
|
|
77
|
+
"references": {}
|
|
78
|
+
},
|
|
79
|
+
"required": false,
|
|
80
|
+
"optional": true,
|
|
81
|
+
"docs": {
|
|
82
|
+
"tags": [{
|
|
83
|
+
"name": "defaultValue",
|
|
84
|
+
"text": "false"
|
|
85
|
+
}],
|
|
86
|
+
"text": "Toggles disabled state of button"
|
|
87
|
+
},
|
|
88
|
+
"attribute": "disabled",
|
|
89
|
+
"reflect": false,
|
|
90
|
+
"defaultValue": "false"
|
|
91
|
+
},
|
|
92
|
+
"icon": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"mutable": false,
|
|
95
|
+
"complexType": {
|
|
96
|
+
"original": "string",
|
|
97
|
+
"resolved": "string",
|
|
98
|
+
"references": {}
|
|
99
|
+
},
|
|
100
|
+
"required": false,
|
|
101
|
+
"optional": true,
|
|
102
|
+
"docs": {
|
|
103
|
+
"tags": [],
|
|
104
|
+
"text": "Displays icon before text when icon string matches an icon name"
|
|
105
|
+
},
|
|
106
|
+
"attribute": "icon",
|
|
107
|
+
"reflect": false,
|
|
108
|
+
"defaultValue": "null"
|
|
109
|
+
},
|
|
110
|
+
"name": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"mutable": false,
|
|
113
|
+
"complexType": {
|
|
114
|
+
"original": "string",
|
|
115
|
+
"resolved": "string",
|
|
116
|
+
"references": {}
|
|
117
|
+
},
|
|
118
|
+
"required": false,
|
|
119
|
+
"optional": true,
|
|
120
|
+
"docs": {
|
|
121
|
+
"tags": [],
|
|
122
|
+
"text": "Provides button with a submittable name"
|
|
123
|
+
},
|
|
124
|
+
"attribute": "name",
|
|
125
|
+
"reflect": false
|
|
126
|
+
},
|
|
127
|
+
"value": {
|
|
128
|
+
"type": "string",
|
|
129
|
+
"mutable": false,
|
|
130
|
+
"complexType": {
|
|
131
|
+
"original": "string",
|
|
132
|
+
"resolved": "string",
|
|
133
|
+
"references": {}
|
|
134
|
+
},
|
|
135
|
+
"required": false,
|
|
136
|
+
"optional": true,
|
|
137
|
+
"docs": {
|
|
138
|
+
"tags": [],
|
|
139
|
+
"text": "Provides button with a submittable value"
|
|
140
|
+
},
|
|
141
|
+
"attribute": "value",
|
|
142
|
+
"reflect": false
|
|
143
|
+
},
|
|
144
|
+
"type": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"mutable": false,
|
|
147
|
+
"complexType": {
|
|
148
|
+
"original": "'button' | 'reset' | 'submit'",
|
|
149
|
+
"resolved": "\"button\" | \"reset\" | \"submit\"",
|
|
150
|
+
"references": {}
|
|
151
|
+
},
|
|
152
|
+
"required": false,
|
|
153
|
+
"optional": true,
|
|
154
|
+
"docs": {
|
|
155
|
+
"tags": [{
|
|
156
|
+
"name": "defaultValue",
|
|
157
|
+
"text": "button"
|
|
158
|
+
}],
|
|
159
|
+
"text": "Provides button with a type"
|
|
160
|
+
},
|
|
161
|
+
"attribute": "type",
|
|
162
|
+
"reflect": false,
|
|
163
|
+
"defaultValue": "'button'"
|
|
164
|
+
},
|
|
165
|
+
"variant": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"mutable": false,
|
|
168
|
+
"complexType": {
|
|
169
|
+
"original": "'primary' | 'secondary' | 'accent' | 'disclosure' | 'destructive' | 'unstyled'",
|
|
170
|
+
"resolved": "\"accent\" | \"destructive\" | \"disclosure\" | \"primary\" | \"secondary\" | \"unstyled\"",
|
|
171
|
+
"references": {}
|
|
172
|
+
},
|
|
173
|
+
"required": false,
|
|
174
|
+
"optional": false,
|
|
175
|
+
"docs": {
|
|
176
|
+
"tags": [],
|
|
177
|
+
"text": "Sets button variant styles as outlined in Figma documentation"
|
|
178
|
+
},
|
|
179
|
+
"attribute": "variant",
|
|
180
|
+
"reflect": false,
|
|
181
|
+
"defaultValue": "'primary'"
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
static get elementRef() { return "el"; }
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=pds-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pds-button.js","sourceRoot":"","sources":["../../../../src/components/pds-button/pds-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAOjD,MAAM,OAAO,SAAS;;QAwCZ,gBAAW,GAAG,CAAC,EAAS,EAAE,EAAE;YAClC,IAAI,IAAI,CAAC,IAAI,IAAI,QAAQ,EAAE;gBACzB,kDAAkD;gBAClD,IAAI,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;oBACzB,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;oBACpC,IAAI,IAAI,EAAE;wBACR,EAAE,CAAC,cAAc,EAAE,CAAA;wBAEnB,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;wBACnD,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;wBAC3B,UAAU,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAA;wBACjC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;wBAC5B,UAAU,CAAC,KAAK,EAAE,CAAA;wBAClB,UAAU,CAAC,MAAM,EAAE,CAAA;qBACpB;iBACF;aACF;QACH,CAAC,CAAA;;wBA7CmB,KAAK;oBAKD,IAAI;;;oBAgBmB,QAAQ;uBAK2C,SAAS;;IAqBnG,UAAU;QAChB,MAAM,UAAU,GAAG,CAAC,YAAY,CAAC,CAAC;QAElC,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,UAAU,CAAC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;SAChD;QAED,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qBACY,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAC5C,EAAE,EAAE,IAAI,CAAC,WAAW,EACpB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,OAAO,EAAE,IAAI,CAAC,OAAO;YAErB,cACE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,IAAI,CAAC,KAAK;gBAEhB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,KAAK,YAAY,IAAI,gBAAU,IAAI,EAAE,IAAI,CAAC,IAAI,GAAa;gBACrF,eAAQ;gBACP,IAAI,CAAC,OAAO,KAAK,YAAY,IAAI,gBAAU,IAAI,EAAC,YAAY,GAAY,CAClE,CACJ,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, h, Prop } from '@stencil/core';\nimport { hasShadowDom } from '../../utils/utils';\n\n@Component({\n tag: 'pds-button',\n styleUrl: 'pds-button.scss',\n shadow: true,\n})\nexport class PdsButton {\n @Element() el: HTMLPdsButtonElement;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * Toggles disabled state of button\n * @defaultValue false\n */\n @Prop() disabled? = false;\n\n /**\n * Displays icon before text when icon string matches an icon name\n */\n @Prop() icon?: string = null;\n\n /**\n * Provides button with a submittable name\n */\n @Prop() name?: string;\n\n /**\n * Provides button with a submittable value\n */\n @Prop() value?: string;\n\n /**\n * Provides button with a type\n * @defaultValue button\n */\n @Prop() type?: 'button' | 'reset' | 'submit' = 'button';\n\n /**\n * Sets button variant styles as outlined in Figma documentation\n */\n @Prop() variant: 'primary' | 'secondary' | 'accent' | 'disclosure' | 'destructive' | 'unstyled' = 'primary';\n\n private handleClick = (ev: Event) => {\n if (this.type != 'button') {\n // If button clicked IS NOT associated with a form\n if (hasShadowDom(this.el)) {\n const form = this.el.closest('form')\n if (form) {\n ev.preventDefault()\n\n const fakeButton = document.createElement('button')\n fakeButton.type = this.type\n fakeButton.style.display = 'none'\n form.appendChild(fakeButton)\n fakeButton.click()\n fakeButton.remove()\n }\n }\n }\n }\n\n private classNames() {\n const classNames = ['pds-button'];\n\n if (this.variant) {\n classNames.push('pds-button--' + this.variant);\n }\n\n return classNames.join(' ');\n }\n\n render() {\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n id={this.componentId}\n onClick={this.handleClick}\n variant={this.variant}\n >\n <button\n class={this.classNames()}\n disabled={this.disabled}\n name={this.name}\n type={this.type}\n value={this.value}\n >\n {this.icon && this.variant !== 'disclosure' && <pds-icon name={this.icon}></pds-icon>}\n <slot />\n {this.variant === 'disclosure' && <pds-icon name=\"caret-down\"></pds-icon>}\n </button>\n </Host>\n );\n }\n}\n"]}
|