@aquera/nile-elements 0.0.69 → 0.0.71
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/.nycrc +17 -0
- package/README.md +19 -0
- package/demo/filenames.txt +1 -1
- package/demo/variables.css +21 -1
- package/demo/variables_v2.css +6 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.iife.js +974 -636
- package/dist/nile-avatar/nile-avatar.cjs.js +1 -1
- package/dist/nile-avatar/nile-avatar.cjs.js.map +1 -1
- package/dist/nile-avatar/nile-avatar.css.cjs.js +1 -1
- package/dist/nile-avatar/nile-avatar.css.cjs.js.map +1 -1
- package/dist/nile-avatar/nile-avatar.css.esm.js +2 -3
- package/dist/nile-avatar/nile-avatar.esm.js +12 -6
- package/dist/nile-badge/index.cjs.js +1 -1
- package/dist/nile-badge/index.esm.js +1 -1
- package/dist/nile-badge/nile-badge.cjs.js +1 -1
- package/dist/nile-badge/nile-badge.cjs.js.map +1 -1
- package/dist/nile-badge/nile-badge.esm.js +1 -1
- package/dist/nile-button/index.cjs.js +1 -1
- package/dist/nile-button/index.esm.js +1 -1
- package/dist/nile-button/nile-button.cjs.js +1 -1
- package/dist/nile-button/nile-button.cjs.js.map +1 -1
- package/dist/nile-button/nile-button.esm.js +1 -1
- package/dist/nile-card/nile-card.cjs.js +1 -1
- package/dist/nile-card/nile-card.cjs.js.map +1 -1
- package/dist/nile-card/nile-card.css.cjs.js +1 -1
- package/dist/nile-card/nile-card.css.cjs.js.map +1 -1
- package/dist/nile-card/nile-card.css.esm.js +23 -4
- package/dist/nile-card/nile-card.esm.js +13 -5
- package/dist/nile-checkbox/nile-checkbox.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.cjs.js.map +1 -1
- package/dist/nile-checkbox/nile-checkbox.css.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.css.cjs.js.map +1 -1
- package/dist/nile-checkbox/nile-checkbox.css.esm.js +2 -4
- package/dist/nile-checkbox/nile-checkbox.esm.js +24 -28
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js +4 -4
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js.map +1 -1
- package/dist/nile-checkbox/nile-checkbox.test.esm.js +9 -4
- package/dist/nile-dialog/index.cjs.js +1 -1
- package/dist/nile-dialog/index.esm.js +1 -1
- package/dist/nile-dialog/nile-dialog.cjs.js +1 -1
- package/dist/nile-dialog/nile-dialog.cjs.js.map +1 -1
- package/dist/nile-dialog/nile-dialog.esm.js +1 -1
- package/dist/nile-drawer/index.cjs.js +1 -1
- package/dist/nile-drawer/index.esm.js +1 -1
- package/dist/nile-drawer/nile-drawer.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.cjs.js.map +1 -1
- package/dist/nile-drawer/nile-drawer.esm.js +1 -1
- package/dist/nile-format-date/index.cjs.js +2 -0
- package/dist/nile-format-date/index.cjs.js.map +1 -0
- package/dist/nile-format-date/index.esm.js +1 -0
- package/dist/nile-format-date/nile-format-date.cjs.js +2 -0
- package/dist/nile-format-date/nile-format-date.cjs.js.map +1 -0
- package/dist/nile-format-date/nile-format-date.css.cjs.js +2 -0
- package/dist/nile-format-date/nile-format-date.css.cjs.js.map +1 -0
- package/dist/nile-format-date/nile-format-date.css.esm.js +5 -0
- package/dist/nile-format-date/nile-format-date.esm.js +5 -0
- package/dist/nile-hero/nile-hero.cjs.js +1 -1
- package/dist/nile-hero/nile-hero.cjs.js.map +1 -1
- package/dist/nile-hero/nile-hero.css.cjs.js +1 -1
- package/dist/nile-hero/nile-hero.css.cjs.js.map +1 -1
- package/dist/nile-hero/nile-hero.css.esm.js +37 -10
- package/dist/nile-hero/nile-hero.esm.js +11 -8
- package/dist/nile-hero-header/nile-hero-header.css.cjs.js +1 -1
- package/dist/nile-hero-header/nile-hero-header.css.cjs.js.map +1 -1
- package/dist/nile-hero-header/nile-hero-header.css.esm.js +1 -0
- package/dist/nile-icon/icons/svg/bar-and-line-chart.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/bar-and-line-chart.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/bar-and-line-chart.esm.js +1 -0
- package/dist/nile-icon/icons/svg/bubble-chart.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/bubble-chart.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/bubble-chart.esm.js +1 -0
- package/dist/nile-icon/icons/svg/funnel-02.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/funnel-02.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/funnel-02.esm.js +1 -0
- package/dist/nile-icon/icons/svg/gauge.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/gauge.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/gauge.esm.js +1 -0
- package/dist/nile-icon/icons/svg/index.cjs.js +1 -1
- package/dist/nile-icon/icons/svg/index.esm.js +1 -1
- package/dist/nile-icon/icons/svg/key-performance-indicator.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/key-performance-indicator.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/key-performance-indicator.esm.js +1 -0
- package/dist/nile-icon/icons/svg/nightingale-chart.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/nightingale-chart.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/nightingale-chart.esm.js +1 -0
- package/dist/nile-icon/icons/svg/priority-high.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/priority-high.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/priority-high.esm.js +1 -0
- package/dist/nile-icon/icons/svg/priority-highest.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/priority-highest.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/priority-highest.esm.js +1 -0
- package/dist/nile-icon/icons/svg/priority-low.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/priority-low.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/priority-low.esm.js +1 -0
- package/dist/nile-icon/icons/svg/priority-medium.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/priority-medium.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/priority-medium.esm.js +1 -0
- package/dist/nile-icon/icons/svg/radar.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/radar.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/radar.esm.js +1 -0
- package/dist/nile-icon/icons/svg/sankey.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/sankey.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/sankey.esm.js +1 -0
- package/dist/nile-icon/icons/svg/scatter-plot.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/scatter-plot.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/scatter-plot.esm.js +1 -0
- package/dist/nile-icon/icons/svg/semi-circle-donut-chart.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/semi-circle-donut-chart.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/semi-circle-donut-chart.esm.js +1 -0
- package/dist/nile-icon/icons/svg/stacked-bar-chart.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/stacked-bar-chart.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/stacked-bar-chart.esm.js +1 -0
- package/dist/nile-icon/index.cjs.js +1 -1
- package/dist/nile-icon/index.cjs.js.map +1 -1
- package/dist/nile-icon/index.esm.js +2 -2
- package/dist/nile-icon-button/index.cjs.js +1 -1
- package/dist/nile-icon-button/index.esm.js +1 -1
- package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
- package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
- package/dist/nile-icon-button/nile-icon-button.esm.js +1 -1
- package/dist/nile-input/index.cjs.js +1 -1
- package/dist/nile-input/index.esm.js +1 -1
- package/dist/nile-input/nile-input.cjs.js +1 -1
- package/dist/nile-input/nile-input.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.css.cjs.js +1 -1
- package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.css.esm.js +0 -5
- package/dist/nile-input/nile-input.esm.js +2 -2
- package/dist/nile-loader/index.cjs.js +1 -1
- package/dist/nile-loader/index.esm.js +1 -1
- package/dist/nile-loader/nile-loader.cjs.js +1 -1
- package/dist/nile-loader/nile-loader.cjs.js.map +1 -1
- package/dist/nile-loader/nile-loader.css.cjs.js +1 -1
- package/dist/nile-loader/nile-loader.css.cjs.js.map +1 -1
- package/dist/nile-loader/nile-loader.css.esm.js +44 -2
- package/dist/nile-loader/nile-loader.esm.js +11 -3
- package/dist/nile-menu-item/index.cjs.js +1 -1
- package/dist/nile-menu-item/index.esm.js +1 -1
- package/dist/nile-menu-item/nile-menu-item.cjs.js +1 -1
- package/dist/nile-menu-item/nile-menu-item.cjs.js.map +1 -1
- package/dist/nile-menu-item/nile-menu-item.esm.js +1 -1
- package/dist/nile-option/index.cjs.js +1 -1
- package/dist/nile-option/index.esm.js +1 -1
- package/dist/nile-option/nile-option.cjs.js +1 -1
- package/dist/nile-option/nile-option.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.esm.js +1 -1
- package/dist/nile-select/index.cjs.js +1 -1
- package/dist/nile-select/index.esm.js +1 -1
- package/dist/nile-select/nile-select.cjs.js +1 -1
- package/dist/nile-select/nile-select.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.esm.js +9 -9
- package/dist/nile-stepper/index.cjs.js +1 -1
- package/dist/nile-stepper/index.esm.js +1 -1
- package/dist/nile-stepper/nile-stepper.cjs.js +1 -1
- package/dist/nile-stepper/nile-stepper.cjs.js.map +1 -1
- package/dist/nile-stepper/nile-stepper.css.cjs.js +1 -1
- package/dist/nile-stepper/nile-stepper.css.cjs.js.map +1 -1
- package/dist/nile-stepper/nile-stepper.css.esm.js +11 -3
- package/dist/nile-stepper/nile-stepper.esm.js +7 -5
- package/dist/nile-stepper-item/nile-stepper-item.cjs.js +2 -2
- package/dist/nile-stepper-item/nile-stepper-item.cjs.js.map +1 -1
- package/dist/nile-stepper-item/nile-stepper-item.css.cjs.js +1 -1
- package/dist/nile-stepper-item/nile-stepper-item.css.cjs.js.map +1 -1
- package/dist/nile-stepper-item/nile-stepper-item.css.esm.js +42 -21
- package/dist/nile-stepper-item/nile-stepper-item.esm.js +18 -10
- package/dist/nile-tab/index.cjs.js +1 -1
- package/dist/nile-tab/index.esm.js +1 -1
- package/dist/nile-tab/nile-tab.cjs.js +1 -1
- package/dist/nile-tab/nile-tab.cjs.js.map +1 -1
- package/dist/nile-tab/nile-tab.esm.js +1 -1
- package/dist/nile-tab-group/index.cjs.js +1 -1
- package/dist/nile-tab-group/index.esm.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.cjs.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.cjs.js.map +1 -1
- package/dist/nile-tab-group/nile-tab-group.esm.js +1 -1
- package/dist/nile-tag/index.cjs.js +1 -1
- package/dist/nile-tag/index.esm.js +1 -1
- package/dist/nile-tag/nile-tag.cjs.js +1 -1
- package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
- package/dist/nile-tag/nile-tag.css.cjs.js +1 -1
- package/dist/nile-tag/nile-tag.css.cjs.js.map +1 -1
- package/dist/nile-tag/nile-tag.css.esm.js +91 -42
- package/dist/nile-tag/nile-tag.esm.js +14 -13
- package/dist/nile-toast/index.cjs.js +1 -1
- package/dist/nile-toast/index.esm.js +1 -1
- package/dist/nile-toast/nile-toast.cjs.js +1 -1
- package/dist/nile-toast/nile-toast.cjs.js.map +1 -1
- package/dist/nile-toast/nile-toast.css.cjs.js +1 -1
- package/dist/nile-toast/nile-toast.css.cjs.js.map +1 -1
- package/dist/nile-toast/nile-toast.css.esm.js +4 -0
- package/dist/nile-toast/nile-toast.esm.js +11 -12
- package/dist/nile-vertical-stepper-item/index.cjs.js +2 -0
- package/dist/nile-vertical-stepper-item/index.cjs.js.map +1 -0
- package/dist/nile-vertical-stepper-item/index.esm.js +1 -0
- package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.cjs.js +2 -0
- package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.cjs.js.map +1 -0
- package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.css.cjs.js +2 -0
- package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.css.cjs.js.map +1 -0
- package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.css.esm.js +116 -0
- package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.esm.js +22 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/nile-avatar/nile-avatar.css.js +2 -3
- package/dist/src/nile-avatar/nile-avatar.css.js.map +1 -1
- package/dist/src/nile-avatar/nile-avatar.d.ts +1 -0
- package/dist/src/nile-avatar/nile-avatar.js +25 -2
- package/dist/src/nile-avatar/nile-avatar.js.map +1 -1
- package/dist/src/nile-card/nile-card.css.js +23 -4
- package/dist/src/nile-card/nile-card.css.js.map +1 -1
- package/dist/src/nile-card/nile-card.js +12 -4
- package/dist/src/nile-card/nile-card.js.map +1 -1
- package/dist/src/nile-checkbox/nile-checkbox.css.js +2 -4
- package/dist/src/nile-checkbox/nile-checkbox.css.js.map +1 -1
- package/dist/src/nile-checkbox/nile-checkbox.d.ts +0 -2
- package/dist/src/nile-checkbox/nile-checkbox.js +24 -34
- package/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
- package/dist/src/nile-checkbox/nile-checkbox.test.js +34 -0
- package/dist/src/nile-checkbox/nile-checkbox.test.js.map +1 -1
- package/dist/src/nile-format-date/index.d.ts +1 -0
- package/dist/src/nile-format-date/index.js +2 -0
- package/dist/src/nile-format-date/index.js.map +1 -0
- package/dist/src/nile-format-date/nile-format-date.css.d.ts +12 -0
- package/dist/src/nile-format-date/nile-format-date.css.js +17 -0
- package/dist/src/nile-format-date/nile-format-date.css.js.map +1 -0
- package/dist/src/nile-format-date/nile-format-date.d.ts +59 -0
- package/dist/src/nile-format-date/nile-format-date.js +129 -0
- package/dist/src/nile-format-date/nile-format-date.js.map +1 -0
- package/dist/src/nile-hero/nile-hero.css.js +35 -8
- package/dist/src/nile-hero/nile-hero.css.js.map +1 -1
- package/dist/src/nile-hero/nile-hero.js +10 -11
- package/dist/src/nile-hero/nile-hero.js.map +1 -1
- package/dist/src/nile-hero-header/nile-hero-header.css.js +1 -0
- package/dist/src/nile-hero-header/nile-hero-header.css.js.map +1 -1
- package/dist/src/nile-icon/icons/svg/bar-and-line-chart.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/bar-and-line-chart.js +5 -0
- package/dist/src/nile-icon/icons/svg/bar-and-line-chart.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/bubble-chart.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/bubble-chart.js +5 -0
- package/dist/src/nile-icon/icons/svg/bubble-chart.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/funnel-02.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/funnel-02.js +5 -0
- package/dist/src/nile-icon/icons/svg/funnel-02.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/gauge.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/gauge.js +5 -0
- package/dist/src/nile-icon/icons/svg/gauge.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/index.d.ts +15 -0
- package/dist/src/nile-icon/icons/svg/index.js +15 -0
- package/dist/src/nile-icon/icons/svg/index.js.map +1 -1
- package/dist/src/nile-icon/icons/svg/key-performance-indicator.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/key-performance-indicator.js +5 -0
- package/dist/src/nile-icon/icons/svg/key-performance-indicator.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/nightingale-chart.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/nightingale-chart.js +5 -0
- package/dist/src/nile-icon/icons/svg/nightingale-chart.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/priority-high.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/priority-high.js +5 -0
- package/dist/src/nile-icon/icons/svg/priority-high.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/priority-highest.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/priority-highest.js +5 -0
- package/dist/src/nile-icon/icons/svg/priority-highest.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/priority-low.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/priority-low.js +5 -0
- package/dist/src/nile-icon/icons/svg/priority-low.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/priority-medium.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/priority-medium.js +5 -0
- package/dist/src/nile-icon/icons/svg/priority-medium.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/radar.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/radar.js +5 -0
- package/dist/src/nile-icon/icons/svg/radar.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/sankey.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/sankey.js +5 -0
- package/dist/src/nile-icon/icons/svg/sankey.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/scatter-plot.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/scatter-plot.js +5 -0
- package/dist/src/nile-icon/icons/svg/scatter-plot.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/semi-circle-donut-chart.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/semi-circle-donut-chart.js +5 -0
- package/dist/src/nile-icon/icons/svg/semi-circle-donut-chart.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/stacked-bar-chart.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/stacked-bar-chart.js +5 -0
- package/dist/src/nile-icon/icons/svg/stacked-bar-chart.js.map +1 -0
- package/dist/src/nile-input/nile-input.css.js +0 -5
- package/dist/src/nile-input/nile-input.css.js.map +1 -1
- package/dist/src/nile-loader/nile-loader.css.js +42 -0
- package/dist/src/nile-loader/nile-loader.css.js.map +1 -1
- package/dist/src/nile-loader/nile-loader.d.ts +14 -4
- package/dist/src/nile-loader/nile-loader.js +66 -10
- package/dist/src/nile-loader/nile-loader.js.map +1 -1
- package/dist/src/nile-stepper/nile-stepper.css.js +9 -1
- package/dist/src/nile-stepper/nile-stepper.css.js.map +1 -1
- package/dist/src/nile-stepper/nile-stepper.d.ts +1 -0
- package/dist/src/nile-stepper/nile-stepper.js +16 -4
- package/dist/src/nile-stepper/nile-stepper.js.map +1 -1
- package/dist/src/nile-stepper-item/nile-stepper-item.css.js +42 -21
- package/dist/src/nile-stepper-item/nile-stepper-item.css.js.map +1 -1
- package/dist/src/nile-stepper-item/nile-stepper-item.js +17 -8
- package/dist/src/nile-stepper-item/nile-stepper-item.js.map +1 -1
- package/dist/src/nile-tab-group/nile-tab-group.js +2 -2
- package/dist/src/nile-tab-group/nile-tab-group.js.map +1 -1
- package/dist/src/nile-tag/nile-tag.css.js +89 -40
- package/dist/src/nile-tag/nile-tag.css.js.map +1 -1
- package/dist/src/nile-tag/nile-tag.d.ts +1 -2
- package/dist/src/nile-tag/nile-tag.js +13 -30
- package/dist/src/nile-tag/nile-tag.js.map +1 -1
- package/dist/src/nile-toast/nile-toast.css.js +4 -0
- package/dist/src/nile-toast/nile-toast.css.js.map +1 -1
- package/dist/src/nile-toast/nile-toast.js +15 -12
- package/dist/src/nile-toast/nile-toast.js.map +1 -1
- package/dist/src/nile-vertical-stepper-item/index.d.ts +1 -0
- package/dist/src/nile-vertical-stepper-item/index.js +2 -0
- package/dist/src/nile-vertical-stepper-item/index.js.map +1 -0
- package/dist/src/nile-vertical-stepper-item/nile-vertical-stepper-item.css.d.ts +12 -0
- package/dist/src/nile-vertical-stepper-item/nile-vertical-stepper-item.css.js +128 -0
- package/dist/src/nile-vertical-stepper-item/nile-vertical-stepper-item.css.js.map +1 -0
- package/dist/src/nile-vertical-stepper-item/nile-vertical-stepper-item.d.ts +46 -0
- package/dist/src/nile-vertical-stepper-item/nile-vertical-stepper-item.js +145 -0
- package/dist/src/nile-vertical-stepper-item/nile-vertical-stepper-item.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -3
- package/postinstall.js +40 -0
- package/src/index.ts +3 -1
- package/src/nile-avatar/nile-avatar.css.ts +2 -3
- package/src/nile-avatar/nile-avatar.ts +30 -4
- package/src/nile-card/nile-card.css.ts +23 -4
- package/src/nile-card/nile-card.ts +19 -8
- package/src/nile-checkbox/nile-checkbox.css.ts +2 -4
- package/src/nile-checkbox/nile-checkbox.test.ts +43 -1
- package/src/nile-checkbox/nile-checkbox.ts +25 -38
- package/src/nile-format-date/index.ts +1 -0
- package/src/nile-format-date/nile-format-date.css.ts +19 -0
- package/src/nile-format-date/nile-format-date.ts +133 -0
- package/src/nile-hero/nile-hero.css.ts +35 -8
- package/src/nile-hero/nile-hero.ts +23 -24
- package/src/nile-hero-header/nile-hero-header.css.ts +1 -0
- package/src/nile-icon/icons/svg/bar-and-line-chart.ts +5 -0
- package/src/nile-icon/icons/svg/bubble-chart.ts +5 -0
- package/src/nile-icon/icons/svg/funnel-02.ts +5 -0
- package/src/nile-icon/icons/svg/gauge.ts +5 -0
- package/src/nile-icon/icons/svg/index.ts +15 -0
- package/src/nile-icon/icons/svg/key-performance-indicator.ts +5 -0
- package/src/nile-icon/icons/svg/nightingale-chart.ts +5 -0
- package/src/nile-icon/icons/svg/priority-high.ts +5 -0
- package/src/nile-icon/icons/svg/priority-highest.ts +5 -0
- package/src/nile-icon/icons/svg/priority-low.ts +5 -0
- package/src/nile-icon/icons/svg/priority-medium.ts +5 -0
- package/src/nile-icon/icons/svg/radar.ts +5 -0
- package/src/nile-icon/icons/svg/sankey.ts +5 -0
- package/src/nile-icon/icons/svg/scatter-plot.ts +5 -0
- package/src/nile-icon/icons/svg/semi-circle-donut-chart.ts +5 -0
- package/src/nile-icon/icons/svg/stacked-bar-chart.ts +5 -0
- package/src/nile-input/nile-input.css.ts +0 -5
- package/src/nile-loader/nile-loader.css.ts +42 -0
- package/src/nile-loader/nile-loader.ts +71 -10
- package/src/nile-stepper/nile-stepper.css.ts +9 -1
- package/src/nile-stepper/nile-stepper.ts +13 -5
- package/src/nile-stepper-item/nile-stepper-item.css.ts +42 -21
- package/src/nile-stepper-item/nile-stepper-item.ts +22 -13
- package/src/nile-tab-group/nile-tab-group.ts +2 -2
- package/src/nile-tag/nile-tag.css.ts +89 -40
- package/src/nile-tag/nile-tag.ts +15 -34
- package/src/nile-toast/nile-toast.css.ts +4 -0
- package/src/nile-toast/nile-toast.ts +15 -12
- package/src/nile-vertical-stepper-item/index.ts +1 -0
- package/src/nile-vertical-stepper-item/nile-vertical-stepper-item.css.ts +130 -0
- package/src/nile-vertical-stepper-item/nile-vertical-stepper-item.ts +121 -0
- package/web-test-runner.config.mjs +13 -0
package/package.json
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
"description": "Webcomponent nile-elements following open-wc recommendations",
|
4
4
|
"license": "MIT",
|
5
5
|
"author": "nile-elements",
|
6
|
-
"version": "0.0.
|
6
|
+
"version": "0.0.71",
|
7
7
|
"main": "dist/src/index.js",
|
8
8
|
"type": "module",
|
9
9
|
"module": "dist/src/index.js",
|
@@ -23,7 +23,8 @@
|
|
23
23
|
"storybook": "tsc && yarn analyze -- --exclude dist && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds -c .storybook/server.mjs\"",
|
24
24
|
"storybook:build": "tsc && yarn analyze -- --exclude dist && build-storybook",
|
25
25
|
"build:vscode-schema": "wca src --format vscode --outFile vscode-html-custom-data.json",
|
26
|
-
"clean": "rimraf dist/*"
|
26
|
+
"clean": "rimraf dist/*",
|
27
|
+
"postinstall": "node postinstall.js"
|
27
28
|
},
|
28
29
|
"dependencies": {
|
29
30
|
"@aquera/nile": "latest",
|
@@ -36,7 +37,9 @@
|
|
36
37
|
"@floating-ui/dom": "^1.2.1",
|
37
38
|
"composed-offset-position": "^0.0.4",
|
38
39
|
"@codemirror/lang-javascript": "6.2.1",
|
39
|
-
"codemirror": "6.0.1"
|
40
|
+
"codemirror": "6.0.1",
|
41
|
+
"chalk": "5.3.0",
|
42
|
+
"figlet": "1.7.0"
|
40
43
|
},
|
41
44
|
"devDependencies": {
|
42
45
|
"@custom-elements-manifest/analyzer": "^0.4.17",
|
package/postinstall.js
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
import figlet from 'figlet';
|
2
|
+
import chalk from 'chalk';
|
3
|
+
|
4
|
+
const fonts = [
|
5
|
+
'Standard', 'Big', 'Slant', 'Banner', 'Block', 'Bubble',
|
6
|
+
'Digital', 'Doom', 'Lean', 'Mini', 'Script', 'Shadow',
|
7
|
+
'Small', 'Star Wars'
|
8
|
+
];
|
9
|
+
|
10
|
+
const colorfulText = (text) => {
|
11
|
+
const colors = [
|
12
|
+
chalk.red,
|
13
|
+
chalk.green,
|
14
|
+
chalk.yellow,
|
15
|
+
chalk.blue,
|
16
|
+
chalk.magenta,
|
17
|
+
chalk.cyan,
|
18
|
+
];
|
19
|
+
return text.split('').map((char, i) => colors[i % colors.length](char)).join('');
|
20
|
+
};
|
21
|
+
|
22
|
+
const chosenFont = fonts[Math.floor(Math.random() * fonts.length)];
|
23
|
+
|
24
|
+
figlet.text('Nile Elements', {
|
25
|
+
font: chosenFont,
|
26
|
+
horizontalLayout: 'default',
|
27
|
+
verticalLayout: 'default',
|
28
|
+
width: 80,
|
29
|
+
whitespaceBreak: true
|
30
|
+
}, (err, data) => {
|
31
|
+
if (err) {
|
32
|
+
console.error('Something went wrong...');
|
33
|
+
console.error(err);
|
34
|
+
return;
|
35
|
+
}
|
36
|
+
|
37
|
+
const coloredData = data.split('\n').map(line => colorfulText(line)).join('\n');
|
38
|
+
console.log(coloredData);
|
39
|
+
console.log(chalk.green('Whoooohooooo! Nile has been installed!'));
|
40
|
+
});
|
package/src/index.ts
CHANGED
@@ -61,4 +61,6 @@ export { NileEmptyState } from './nile-empty-state';
|
|
61
61
|
export { NileHero } from './nile-hero';
|
62
62
|
export { NileStepperItem } from './nile-stepper-item';
|
63
63
|
export { NileStepper } from './nile-stepper';
|
64
|
-
export { NileHeroHeader } from './nile-hero-header';
|
64
|
+
export { NileHeroHeader } from './nile-hero-header';
|
65
|
+
export { NileVerticalStepperItem } from './nile-vertical-stepper-item';
|
66
|
+
export { NileFormatDate } from './nile-format-date';
|
@@ -27,16 +27,15 @@ export const styles = css`
|
|
27
27
|
justify-content: center;
|
28
28
|
align-items: center;
|
29
29
|
box-sizing: border-box;
|
30
|
-
border: 0.5px solid;
|
31
|
-
border-color: rgba(0, 0, 0, 0.08);
|
32
30
|
}
|
33
31
|
|
34
32
|
.avatar {
|
35
33
|
box-sizing: border-box;
|
36
|
-
border:
|
34
|
+
border: 0.5px solid var(--nile-colors-neutral-500);
|
37
35
|
background-position: 50% 50%;
|
38
36
|
background-size: cover;
|
39
37
|
background-repeat: no-repeat;
|
38
|
+
overflow: hidden;
|
40
39
|
}
|
41
40
|
|
42
41
|
.avatar__small {
|
@@ -42,7 +42,8 @@ export class NileAvatar extends NileElement {
|
|
42
42
|
@property({ type: String, reflect: true }) name = '';
|
43
43
|
|
44
44
|
/** Gives the default bg color to the Avatar */
|
45
|
-
@property({ type: String, reflect: true,attribute: 'bg-color' }) bgColor =
|
45
|
+
@property({ type: String, reflect: true, attribute: 'bg-color' }) bgColor =
|
46
|
+
'';
|
46
47
|
|
47
48
|
/** Gives the default text color to the Avatar */
|
48
49
|
@property({ type: String, reflect: true, attribute: 'text-color' })
|
@@ -57,7 +58,8 @@ export class NileAvatar extends NileElement {
|
|
57
58
|
| 'small'
|
58
59
|
| 'medium'
|
59
60
|
| 'large'
|
60
|
-
| 'extralarge'
|
61
|
+
| 'extralarge'
|
62
|
+
| '2xl' = 'medium';
|
61
63
|
|
62
64
|
/** Gives a border radius of 50% to the Avatar */
|
63
65
|
@property({ type: Boolean, reflect: true }) isRounded = false;
|
@@ -93,6 +95,23 @@ export class NileAvatar extends NileElement {
|
|
93
95
|
return multifactor % 5;
|
94
96
|
}
|
95
97
|
|
98
|
+
private getDefaultIconSize() {
|
99
|
+
switch (this.size) {
|
100
|
+
case 'small':
|
101
|
+
return '10';
|
102
|
+
case 'medium':
|
103
|
+
return '16';
|
104
|
+
case 'large':
|
105
|
+
return '20';
|
106
|
+
case 'extralarge':
|
107
|
+
return '24';
|
108
|
+
case '2xl':
|
109
|
+
return '28';
|
110
|
+
default:
|
111
|
+
return '16';
|
112
|
+
}
|
113
|
+
}
|
114
|
+
|
96
115
|
private handleImageError(event: Event): void {
|
97
116
|
const defaultInitials = this.generateInitials(this.name);
|
98
117
|
const variant__code = this.generateVariantCode(defaultInitials);
|
@@ -113,11 +132,17 @@ export class NileAvatar extends NileElement {
|
|
113
132
|
variant__green: variant__code === 4 && !this.bgColor,
|
114
133
|
})}
|
115
134
|
style="background-color: ${this.bgColor};color:${this
|
116
|
-
.textColor};border
|
135
|
+
.textColor};border: 0.5px solid ${this.borderColor};
|
136
|
+
border-color:${defaultInitials ? 'rgba(0, 0, 0, 0.08)' : '#C7CED4'}"
|
117
137
|
>
|
118
138
|
${defaultInitials
|
119
139
|
? defaultInitials
|
120
|
-
: html`<nile-icon
|
140
|
+
: html`<nile-icon
|
141
|
+
name="user"
|
142
|
+
color="grey"
|
143
|
+
part="error__icon"
|
144
|
+
size="${this.getDefaultIconSize()}"
|
145
|
+
></nile-icon>`}
|
121
146
|
</div>`;
|
122
147
|
|
123
148
|
this.isDefaultAvatar = false;
|
@@ -135,6 +160,7 @@ export class NileAvatar extends NileElement {
|
|
135
160
|
avatar__medium: this.size === 'medium',
|
136
161
|
avatar__large: this.size === 'large',
|
137
162
|
avatar__extralarge: this.size === 'extralarge',
|
163
|
+
avatar__2xl: this.size === '2xl',
|
138
164
|
avatar__rounded: this.isRounded,
|
139
165
|
})}
|
140
166
|
style=" background-image: url(${this
|
@@ -28,7 +28,7 @@ export const styles = css`
|
|
28
28
|
:host {
|
29
29
|
--border-color: var(--nile-card-color-border);
|
30
30
|
--border-radius: 8px;
|
31
|
-
--border-width:
|
31
|
+
--border-width: 0.5px;
|
32
32
|
--padding: 18px;
|
33
33
|
display: inline-block;
|
34
34
|
}
|
@@ -36,11 +36,24 @@ export const styles = css`
|
|
36
36
|
.card {
|
37
37
|
display: flex;
|
38
38
|
flex-direction: column;
|
39
|
+
justify-items: strecth;
|
39
40
|
background-color: var(--nile-colors-white-base);
|
40
41
|
border: solid var(--border-width) var(--border-color);
|
41
42
|
border-radius: var(--border-radius);
|
42
|
-
|
43
|
-
|
43
|
+
min-width: 273px;
|
44
|
+
max-width: 350px;
|
45
|
+
overflow: hidden;
|
46
|
+
}
|
47
|
+
|
48
|
+
.body__wrapper {
|
49
|
+
display: flex;
|
50
|
+
flex-direction: column;
|
51
|
+
gap: 12px;
|
52
|
+
padding: 12px 16px 0 16px;
|
53
|
+
}
|
54
|
+
|
55
|
+
.card__header {
|
56
|
+
display: block;
|
44
57
|
}
|
45
58
|
|
46
59
|
.card__body {
|
@@ -48,8 +61,14 @@ export const styles = css`
|
|
48
61
|
}
|
49
62
|
|
50
63
|
.card__footer {
|
64
|
+
margin-top: 12px;
|
51
65
|
display: block;
|
52
|
-
|
66
|
+
box-sizing: border-box;
|
67
|
+
align-content: center;
|
68
|
+
align-items: center;
|
69
|
+
padding: 8px 16px;
|
70
|
+
background-color: #f9fafb;
|
71
|
+
height: 40px;
|
53
72
|
}
|
54
73
|
|
55
74
|
.card:not(.card--has-footer) .card__footer {
|
@@ -5,15 +5,20 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
import {
|
8
|
+
import {
|
9
|
+
LitElement,
|
10
|
+
html,
|
11
|
+
property,
|
12
|
+
CSSResultArray,
|
13
|
+
TemplateResult,
|
14
|
+
} from 'lit-element';
|
9
15
|
import { customElement } from 'lit/decorators.js';
|
10
|
-
import {styles} from './nile-card.css';
|
16
|
+
import { styles } from './nile-card.css';
|
11
17
|
import { classMap } from 'lit/directives/class-map.js';
|
12
18
|
import { HasSlotController } from '../internal/slot';
|
13
19
|
import NileElements from '../internal/nile-element';
|
14
20
|
import { CSSResultGroup } from 'lit';
|
15
21
|
|
16
|
-
|
17
22
|
/**
|
18
23
|
* Nile icon component.
|
19
24
|
*
|
@@ -22,7 +27,6 @@ import { CSSResultGroup } from 'lit';
|
|
22
27
|
*/
|
23
28
|
@customElement('nile-card')
|
24
29
|
export class NileCard extends NileElements {
|
25
|
-
|
26
30
|
static styles: CSSResultGroup = styles;
|
27
31
|
|
28
32
|
private readonly hasSlotController = new HasSlotController(this, 'footer');
|
@@ -36,15 +40,22 @@ export class NileCard extends NileElements {
|
|
36
40
|
'card--has-footer': this.hasSlotController.test('footer'),
|
37
41
|
})}
|
38
42
|
>
|
39
|
-
<
|
40
|
-
|
43
|
+
<div class="body__wrapper" part="body__wrapper">
|
44
|
+
<slot name="header" part="header" class="card__header"></slot>
|
45
|
+
<slot part="body" class="card__body"></slot>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<slot
|
49
|
+
name="footer"
|
50
|
+
part="footer"
|
51
|
+
?hidden="${!this.hasSlotController.test('footer')}"
|
52
|
+
class="card__footer"
|
53
|
+
></slot>
|
41
54
|
</div>
|
42
|
-
|
43
55
|
`;
|
44
56
|
}
|
45
57
|
}
|
46
58
|
|
47
|
-
|
48
59
|
export default NileCard;
|
49
60
|
|
50
61
|
declare global {
|
@@ -29,10 +29,8 @@ export const styles = css`
|
|
29
29
|
cursor: pointer;
|
30
30
|
}
|
31
31
|
|
32
|
-
.checkbox--
|
33
|
-
|
34
|
-
--toggle-size: var(--nile-type-scale-3);
|
35
|
-
font-size: var(--nile-type-scale-3);
|
32
|
+
.checkbox--only__subtitle{
|
33
|
+
align-items: center;
|
36
34
|
}
|
37
35
|
|
38
36
|
.checkbox__control {
|
@@ -72,7 +72,7 @@ describe('NileCheckbox', () => {
|
|
72
72
|
expect(el.getAttribute('name')).to.equal('test-name');
|
73
73
|
expect(el.getAttribute('title')).to.equal('test-title');
|
74
74
|
expect(el.getAttribute('disabled')).to.equal('');
|
75
|
-
expect(el.getAttribute('required')).
|
75
|
+
expect(el.getAttribute('required')).to.equal('');
|
76
76
|
expect(el.getAttribute('label')).to.equal('test-label');
|
77
77
|
expect(el.getAttribute('sub-label')).to.equal('test-sublabel');
|
78
78
|
expect(el.getAttribute('help-text')).to.equal('test-help');
|
@@ -143,4 +143,46 @@ describe('NileCheckbox', () => {
|
|
143
143
|
const blurEvent = await oneEvent(el, 'blur');
|
144
144
|
expect(blurEvent).to.exist;
|
145
145
|
});
|
146
|
+
|
147
|
+
it('reflects checked attribute to property', async () => {
|
148
|
+
const el = await fixture<NileCheckbox>(html`<nile-checkbox checked></nile-checkbox>`);
|
149
|
+
expect(el.checked).to.be.true;
|
150
|
+
});
|
151
|
+
|
152
|
+
it('reflects indeterminate attribute to property', async () => {
|
153
|
+
const el = await fixture<NileCheckbox>(html`<nile-checkbox indeterminate></nile-checkbox>`);
|
154
|
+
expect(el.indeterminate).to.be.true;
|
155
|
+
});
|
156
|
+
|
157
|
+
it('associates form using form attribute', async () => {
|
158
|
+
const el = await fixture(html`
|
159
|
+
<div>
|
160
|
+
<form id="test-form"></form>
|
161
|
+
<nile-checkbox form="test-form"></nile-checkbox>
|
162
|
+
</div>
|
163
|
+
`);
|
164
|
+
const checkbox = el.querySelector('nile-checkbox') as NileCheckbox;
|
165
|
+
expect(checkbox).to.not.be.null;
|
166
|
+
expect(checkbox.getAttribute('form')).to.equal('test-form');
|
167
|
+
});
|
168
|
+
|
169
|
+
it('displays and hides help text correctly', async () => {
|
170
|
+
const el = await fixture<NileCheckbox>(html`<nile-checkbox help-text="test-help"></nile-checkbox>`);
|
171
|
+
|
172
|
+
// Initially, help text should not be shown
|
173
|
+
expect(el.showHelpText).to.be.false;
|
174
|
+
|
175
|
+
// Show the help text
|
176
|
+
el.showHelpText = true;
|
177
|
+
await el.updateComplete;
|
178
|
+
let helpTextIcon = el.shadowRoot!.querySelector('.checkbox__helptext-icon');
|
179
|
+
expect(helpTextIcon).to.exist;
|
180
|
+
|
181
|
+
// Hide the help text
|
182
|
+
el.showHelpText = false;
|
183
|
+
await el.updateComplete;
|
184
|
+
helpTextIcon = el.shadowRoot!.querySelector('.checkbox__helptext-icon');
|
185
|
+
expect(helpTextIcon).to.be.exist;
|
186
|
+
});
|
146
187
|
});
|
188
|
+
|
@@ -9,6 +9,7 @@ import {
|
|
9
9
|
LitElement,
|
10
10
|
html,
|
11
11
|
property,
|
12
|
+
nothing,
|
12
13
|
CSSResultArray,
|
13
14
|
TemplateResult,
|
14
15
|
} from 'lit-element';
|
@@ -35,7 +36,6 @@ import type { CSSResultGroup } from 'lit';
|
|
35
36
|
* @event nile-change - Emitted when the checked state changes.
|
36
37
|
* @event nile-focus - Emitted when the checkbox gains focus.
|
37
38
|
* @event nile-input - Emitted when the checkbox receives input.
|
38
|
-
* @event nile-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.
|
39
39
|
*
|
40
40
|
* @csspart base - The component's base wrapper.
|
41
41
|
* @csspart control - The square container that wraps the checkbox's checked state.
|
@@ -85,8 +85,7 @@ export class NileCheckbox extends NileElement {
|
|
85
85
|
@property({ type: String, reflect: true }) label = '';
|
86
86
|
|
87
87
|
/** Sublabel, declared this property for backward compatibility of old component */
|
88
|
-
@property({ type: String, reflect: true, attribute: 'sub-label' }) subLabel =
|
89
|
-
'';
|
88
|
+
@property({ type: String, reflect: true, attribute: 'sub-label' }) subLabel = '';
|
90
89
|
|
91
90
|
/**
|
92
91
|
* Draws the checkbox in an indeterminate state. This is usually applied to checkboxes that represents a "select
|
@@ -113,10 +112,6 @@ export class NileCheckbox extends NileElement {
|
|
113
112
|
/** Makes the checkbox a required field. */
|
114
113
|
@property({ type: Boolean, reflect: true }) required = false;
|
115
114
|
|
116
|
-
private toggleHelpText() {
|
117
|
-
this.showHelpText = !this.showHelpText;
|
118
|
-
}
|
119
|
-
|
120
115
|
private handleClick() {
|
121
116
|
this.checked = !this.checked;
|
122
117
|
this.indeterminate = false;
|
@@ -204,30 +199,9 @@ export class NileCheckbox extends NileElement {
|
|
204
199
|
'checkbox--checked': this.checked,
|
205
200
|
'checkbox--disabled': this.disabled,
|
206
201
|
'checkbox--focused': this.hasFocus,
|
207
|
-
'checkbox--indeterminate': this.indeterminate
|
208
|
-
'checkbox--medium': this.size === 'medium',
|
202
|
+
'checkbox--indeterminate': this.indeterminate
|
209
203
|
})}
|
210
204
|
>
|
211
|
-
<input
|
212
|
-
class="checkbox__input"
|
213
|
-
type="checkbox"
|
214
|
-
title=${
|
215
|
-
this
|
216
|
-
.title /* An empty title prevents browser validation tooltips from appearing on hover */
|
217
|
-
}
|
218
|
-
name=${this.name}
|
219
|
-
value=${ifDefined(this.value)}
|
220
|
-
.indeterminate=${live(this.indeterminate)}
|
221
|
-
.checked=${live(this.checked)}
|
222
|
-
.disabled=${this.disabled}
|
223
|
-
.required=${this.required}
|
224
|
-
aria-checked=${this.checked ? 'true' : 'false'}
|
225
|
-
@click=${this.handleClick}
|
226
|
-
@input=${this.handleInput}
|
227
|
-
@blur=${this.handleBlur}
|
228
|
-
@focus=${this.handleFocus}
|
229
|
-
/>
|
230
|
-
|
231
205
|
<span
|
232
206
|
part="control${this.checked ? ' control--checked' : ''}${this
|
233
207
|
.indeterminate
|
@@ -235,6 +209,23 @@ export class NileCheckbox extends NileElement {
|
|
235
209
|
: ''}"
|
236
210
|
class="checkbox__control"
|
237
211
|
>
|
212
|
+
<!-- An empty title prevents browser validation tooltips from appearing on hover -->
|
213
|
+
<input
|
214
|
+
class="checkbox__input"
|
215
|
+
type="checkbox"
|
216
|
+
title=${ this.title }
|
217
|
+
name=${this.name}
|
218
|
+
value=${ifDefined(this.value)}
|
219
|
+
.indeterminate=${live(this.indeterminate)}
|
220
|
+
.checked=${live(this.checked)}
|
221
|
+
.disabled=${this.disabled}
|
222
|
+
.required=${this.required}
|
223
|
+
aria-checked=${this.checked ? 'true' : 'false'}
|
224
|
+
@click=${this.handleClick}
|
225
|
+
@input=${this.handleInput}
|
226
|
+
@blur=${this.handleBlur}
|
227
|
+
@focus=${this.handleFocus}
|
228
|
+
/>
|
238
229
|
${this.checked
|
239
230
|
? html`
|
240
231
|
<nile-icon
|
@@ -261,9 +252,9 @@ export class NileCheckbox extends NileElement {
|
|
261
252
|
: ''}
|
262
253
|
</span>
|
263
254
|
|
264
|
-
<div part="label" class="checkbox__label">
|
255
|
+
<div part="label" class="checkbox__label" style="${!this.label && !this.subLabel?'margin-left:0;':''}">
|
265
256
|
${this.label ? html`<span class="checkbox__label__text">${this.label}</span>` : ``}
|
266
|
-
${this.
|
257
|
+
${this.subLabel ? html`<span class="checkbox__sublabel__text">${this.subLabel}</span>` : ``}
|
267
258
|
<slot></slot>
|
268
259
|
</div>
|
269
260
|
</label>
|
@@ -277,14 +268,10 @@ export class NileCheckbox extends NileElement {
|
|
277
268
|
></nile-icon>
|
278
269
|
</nile-tooltip>
|
279
270
|
`
|
280
|
-
:
|
271
|
+
: nothing}
|
281
272
|
${hasErrorMessage
|
282
|
-
? html
|
283
|
-
|
284
|
-
>${this.errorMessage}</nile-form-error-message
|
285
|
-
>
|
286
|
-
`
|
287
|
-
: ``}
|
273
|
+
? html`<nile-form-error-message>${this.errorMessage}</nile-form-error-message>`
|
274
|
+
: nothing}
|
288
275
|
`;
|
289
276
|
}
|
290
277
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { NileFormatDate } from './nile-format-date';
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import {css} from 'lit-element';
|
9
|
+
|
10
|
+
/**
|
11
|
+
* FormatDate CSS
|
12
|
+
*/
|
13
|
+
export const styles = css`
|
14
|
+
:host {
|
15
|
+
|
16
|
+
}
|
17
|
+
`;
|
18
|
+
|
19
|
+
export default [styles];
|
@@ -0,0 +1,133 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import {LitElement, html, property, CSSResultArray, TemplateResult} from 'lit-element';
|
9
|
+
import { customElement } from 'lit/decorators.js';
|
10
|
+
import {styles} from './nile-format-date.css';
|
11
|
+
import NileElement from '../internal/nile-element';
|
12
|
+
|
13
|
+
|
14
|
+
/**
|
15
|
+
* Nile format-date component.
|
16
|
+
*
|
17
|
+
* @tag nile-format-date
|
18
|
+
*
|
19
|
+
*/
|
20
|
+
@customElement('nile-format-date')
|
21
|
+
export class NileFormatDate extends NileElement {
|
22
|
+
/**
|
23
|
+
* The styles for nile-format-date
|
24
|
+
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
25
|
+
*/
|
26
|
+
public static get styles(): CSSResultArray {
|
27
|
+
return [styles];
|
28
|
+
}
|
29
|
+
|
30
|
+
/**
|
31
|
+
* The date/time to format. If not set, the current date and time will be used. When passing a string, it's strongly
|
32
|
+
* recommended to use the ISO 8601 format to ensure timezones are handled correctly. To convert a date to this format
|
33
|
+
* in JavaScript, use [`date.toISOString()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString).
|
34
|
+
*/
|
35
|
+
@property() date: Date | string = new Date();
|
36
|
+
|
37
|
+
/** The format for displaying the weekday. */
|
38
|
+
@property() weekday: 'narrow' | 'short' | 'long';
|
39
|
+
|
40
|
+
/** The format for displaying the era. */
|
41
|
+
@property() era: 'narrow' | 'short' | 'long';
|
42
|
+
|
43
|
+
/** The format for displaying the year. */
|
44
|
+
@property() year: 'numeric' | '2-digit';
|
45
|
+
|
46
|
+
/** The format for displaying the month. */
|
47
|
+
@property() month: 'numeric' | '2-digit' | 'narrow' | 'short' | 'long';
|
48
|
+
|
49
|
+
/** The format for displaying the day. */
|
50
|
+
@property() day: 'numeric' | '2-digit';
|
51
|
+
|
52
|
+
/** The format for displaying the hour. */
|
53
|
+
@property() hour: 'numeric' | '2-digit';
|
54
|
+
|
55
|
+
/** The format for displaying the minute. */
|
56
|
+
@property() minute: 'numeric' | '2-digit';
|
57
|
+
|
58
|
+
/** The format for displaying the second. */
|
59
|
+
@property() second: 'numeric' | '2-digit';
|
60
|
+
|
61
|
+
/** The format for displaying the time. */
|
62
|
+
@property({ attribute: 'time-zone-name' }) timeZoneName: 'short' | 'long';
|
63
|
+
|
64
|
+
/** The time zone to express the time in. */
|
65
|
+
@property({ attribute: 'time-zone' }) timeZone: string;
|
66
|
+
|
67
|
+
/** The format for displaying the hour. */
|
68
|
+
@property({ attribute: 'hour-format' }) hourFormat: 'auto' | '12' | '24' =
|
69
|
+
'auto';
|
70
|
+
|
71
|
+
/** The separator for the date format. */
|
72
|
+
@property({ attribute: 'date-separator' }) dateSeparator: '-' | '/' = '-';
|
73
|
+
|
74
|
+
formatDate(dateToFormat: Date | string, options?: Intl.DateTimeFormatOptions): string {
|
75
|
+
dateToFormat = new Date(dateToFormat);
|
76
|
+
const formatter = new Intl.DateTimeFormat('en-GB', options);
|
77
|
+
const parts = formatter.formatToParts(dateToFormat);
|
78
|
+
const formattedDate = parts.map(({ type, value }) => {
|
79
|
+
if (type === 'day' || type === 'month' || type === 'year') {
|
80
|
+
return value;
|
81
|
+
}
|
82
|
+
if (type === 'literal' && value === '/') {
|
83
|
+
return this.dateSeparator;
|
84
|
+
}
|
85
|
+
return value;
|
86
|
+
}).join('');
|
87
|
+
return formattedDate;
|
88
|
+
}
|
89
|
+
|
90
|
+
// formatDate(dateToFormat: Date | string, options?: Intl.DateTimeFormatOptions): string {
|
91
|
+
// dateToFormat = new Date(dateToFormat);
|
92
|
+
// return new Intl.DateTimeFormat('en-GB', options).format(dateToFormat);
|
93
|
+
// }
|
94
|
+
|
95
|
+
|
96
|
+
render() {
|
97
|
+
const date = new Date(this.date);
|
98
|
+
const hour12 =
|
99
|
+
this.hourFormat === 'auto' ? undefined : this.hourFormat === '12';
|
100
|
+
|
101
|
+
// Check for an invalid date
|
102
|
+
if (isNaN(date.getMilliseconds())) {
|
103
|
+
return undefined;
|
104
|
+
}
|
105
|
+
|
106
|
+
return html`
|
107
|
+
<time datetime=${date.toISOString()}>
|
108
|
+
${this.formatDate(date, {
|
109
|
+
weekday: this.weekday,
|
110
|
+
era: this.era,
|
111
|
+
year: this.year,
|
112
|
+
month: this.month,
|
113
|
+
day: this.day,
|
114
|
+
hour: this.hour,
|
115
|
+
minute: this.minute,
|
116
|
+
second: this.second,
|
117
|
+
timeZoneName: this.timeZoneName,
|
118
|
+
timeZone: this.timeZone,
|
119
|
+
hour12: hour12,
|
120
|
+
})}
|
121
|
+
</time>
|
122
|
+
`;
|
123
|
+
}
|
124
|
+
}
|
125
|
+
/* #endregion */
|
126
|
+
|
127
|
+
export default NileFormatDate;
|
128
|
+
|
129
|
+
declare global {
|
130
|
+
interface HTMLElementTagNameMap {
|
131
|
+
'nile-format-date': NileFormatDate;
|
132
|
+
}
|
133
|
+
}
|