@aquera/nile-elements 0.0.80 → 0.0.82
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/README.md +12 -0
- package/demo/filenames.txt +1 -1
- package/demo/variables.css +54 -0
- package/demo/variables_v2.css +51 -0
- package/dist/fixture-1a9fb5f1.cjs.js +395 -0
- package/dist/fixture-1a9fb5f1.cjs.js.map +1 -0
- package/dist/fixture-81e5a936.esm.js +569 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.iife.js +976 -563
- package/dist/internal/animate.cjs.js +1 -1
- package/dist/internal/animate.cjs.js.map +1 -1
- package/dist/internal/animate.esm.js +1 -1
- package/dist/internal/drag.cjs.js +2 -0
- package/dist/internal/drag.cjs.js.map +1 -0
- package/dist/internal/drag.esm.js +1 -0
- package/dist/internal/math.cjs.js +2 -0
- package/dist/internal/math.cjs.js.map +1 -0
- package/dist/internal/math.esm.js +1 -0
- 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 +7 -8
- package/dist/nile-avatar/nile-avatar.test.cjs.js +2 -0
- package/dist/nile-avatar/nile-avatar.test.cjs.js.map +1 -0
- package/dist/nile-avatar/nile-avatar.test.esm.js +1 -0
- 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.css.cjs.js +1 -1
- package/dist/nile-badge/nile-badge.css.cjs.js.map +1 -1
- package/dist/nile-badge/nile-badge.css.esm.js +47 -47
- package/dist/nile-badge/nile-badge.esm.js +1 -1
- package/dist/nile-badge/nile-badge.test.cjs.js +2 -0
- package/dist/nile-badge/nile-badge.test.cjs.js.map +1 -0
- package/dist/nile-badge/nile-badge.test.esm.js +1 -0
- package/dist/nile-breadcrumb-item/nile-breadcrumb-item.css.cjs.js +1 -1
- package/dist/nile-breadcrumb-item/nile-breadcrumb-item.css.cjs.js.map +1 -1
- package/dist/nile-breadcrumb-item/nile-breadcrumb-item.css.esm.js +3 -4
- 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-button/nile-button.test.cjs.js +2 -0
- package/dist/nile-button/nile-button.test.cjs.js.map +1 -0
- package/dist/nile-button/nile-button.test.esm.js +4 -0
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +2 -0
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js.map +1 -0
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +49 -0
- package/dist/nile-calendar/index.cjs.js +1 -1
- package/dist/nile-calendar/index.esm.js +1 -1
- package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.css.esm.js +122 -191
- package/dist/nile-calendar/nile-calendar.esm.js +135 -135
- package/dist/nile-card/nile-card.test.cjs.js +2 -0
- package/dist/nile-card/nile-card.test.cjs.js.map +1 -0
- package/dist/nile-card/nile-card.test.esm.js +51 -0
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js +1 -394
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js.map +1 -1
- package/dist/nile-checkbox/nile-checkbox.test.esm.js +3 -571
- package/dist/nile-date-picker/nile-date-picker.cjs.js +1 -1
- package/dist/nile-date-picker/nile-date-picker.cjs.js.map +1 -1
- package/dist/nile-date-picker/nile-date-picker.esm.js +1 -1
- 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.css.cjs.js +1 -1
- package/dist/nile-dialog/nile-dialog.css.cjs.js.map +1 -1
- package/dist/nile-dialog/nile-dialog.css.esm.js +4 -1
- package/dist/nile-dialog/nile-dialog.esm.js +5 -4
- 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-drawer/nile-drawer.test.cjs.js +2 -0
- package/dist/nile-drawer/nile-drawer.test.cjs.js.map +1 -0
- package/dist/nile-drawer/nile-drawer.test.esm.js +18 -0
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js +2 -0
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js.map +1 -0
- package/dist/nile-empty-state/nile-empty-state.test.esm.js +9 -0
- package/dist/nile-error-message/nile-error-message.test.cjs.js +2 -0
- package/dist/nile-error-message/nile-error-message.test.cjs.js.map +1 -0
- package/dist/nile-error-message/nile-error-message.test.esm.js +1 -0
- package/dist/nile-form-group/nile-form-group.test.cjs.js +2 -0
- package/dist/nile-form-group/nile-form-group.test.cjs.js.map +1 -0
- package/dist/nile-form-group/nile-form-group.test.esm.js +1 -0
- package/dist/nile-hero/nile-hero.test.cjs.js +2 -0
- package/dist/nile-hero/nile-hero.test.cjs.js.map +1 -0
- package/dist/nile-hero/nile-hero.test.esm.js +14 -0
- package/dist/nile-icon/icons/svg/alert.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/alert.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/alert.esm.js +1 -0
- package/dist/nile-icon/icons/svg/file-check-02.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/file-check-02.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/file-check-02.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/monitor-01.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/monitor-01.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/monitor-01.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 +1 -1
- package/dist/nile-icon/nile-icon.test.cjs.js +2 -0
- package/dist/nile-icon/nile-icon.test.cjs.js.map +1 -0
- package/dist/nile-icon/nile-icon.test.esm.js +1 -0
- 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.esm.js +1 -1
- package/dist/nile-input/nile-input.test.cjs.js +2 -0
- package/dist/nile-input/nile-input.test.cjs.js.map +1 -0
- package/dist/nile-input/nile-input.test.esm.js +17 -0
- package/dist/nile-link/nile-link.test.cjs.js +2 -0
- package/dist/nile-link/nile-link.test.cjs.js.map +1 -0
- package/dist/nile-link/nile-link.test.esm.js +1 -0
- package/dist/nile-list/index.cjs.js +2 -0
- package/dist/nile-list/index.cjs.js.map +1 -0
- package/dist/nile-list/index.esm.js +1 -0
- package/dist/nile-list/nile-list.cjs.js +2 -0
- package/dist/nile-list/nile-list.cjs.js.map +1 -0
- package/dist/nile-list/nile-list.css.cjs.js +2 -0
- package/dist/nile-list/nile-list.css.cjs.js.map +1 -0
- package/dist/nile-list/nile-list.css.esm.js +8 -0
- package/dist/nile-list/nile-list.esm.js +3 -0
- package/dist/nile-list-item/index.cjs.js +2 -0
- package/dist/nile-list-item/index.cjs.js.map +1 -0
- package/dist/nile-list-item/index.esm.js +1 -0
- package/dist/nile-list-item/nile-list-item.cjs.js +2 -0
- package/dist/nile-list-item/nile-list-item.cjs.js.map +1 -0
- package/dist/nile-list-item/nile-list-item.css.cjs.js +2 -0
- package/dist/nile-list-item/nile-list-item.css.cjs.js.map +1 -0
- package/dist/nile-list-item/nile-list-item.css.esm.js +54 -0
- package/dist/nile-list-item/nile-list-item.esm.js +21 -0
- package/dist/nile-loader/nile-loader.test.cjs.js +2 -0
- package/dist/nile-loader/nile-loader.test.cjs.js.map +1 -0
- package/dist/nile-loader/nile-loader.test.esm.js +1 -0
- package/dist/nile-menu/nile-menu.cjs.js +1 -1
- package/dist/nile-menu/nile-menu.cjs.js.map +1 -1
- package/dist/nile-menu/nile-menu.css.cjs.js +1 -1
- package/dist/nile-menu/nile-menu.css.cjs.js.map +1 -1
- package/dist/nile-menu/nile-menu.css.esm.js +21 -7
- package/dist/nile-menu/nile-menu.esm.js +17 -15
- 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-popover/nile-popover.cjs.js +1 -1
- package/dist/nile-popover/nile-popover.cjs.js.map +1 -1
- package/dist/nile-popover/nile-popover.css.cjs.js +1 -1
- package/dist/nile-popover/nile-popover.css.cjs.js.map +1 -1
- package/dist/nile-popover/nile-popover.css.esm.js +6 -4
- package/dist/nile-popover/nile-popover.esm.js +4 -7
- package/dist/nile-popover/nile-popover.test.cjs.js +2 -0
- package/dist/nile-popover/nile-popover.test.cjs.js.map +1 -0
- package/dist/nile-popover/nile-popover.test.esm.js +21 -0
- package/dist/nile-popup/nile-popup.css.cjs.js +1 -1
- package/dist/nile-popup/nile-popup.css.cjs.js.map +1 -1
- package/dist/nile-popup/nile-popup.css.esm.js +8 -4
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +2 -0
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js.map +1 -0
- package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +1 -0
- package/dist/nile-radio/nile-radio.test.cjs.js +2 -0
- package/dist/nile-radio/nile-radio.test.cjs.js.map +1 -0
- package/dist/nile-radio/nile-radio.test.esm.js +1 -0
- 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 +3 -3
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +2 -0
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js.map +1 -0
- package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +1 -0
- package/dist/nile-split-panel/index.cjs.js +2 -0
- package/dist/nile-split-panel/index.cjs.js.map +1 -0
- package/dist/nile-split-panel/index.esm.js +1 -0
- package/dist/nile-split-panel/nile-split-panel.cjs.js +2 -0
- package/dist/nile-split-panel/nile-split-panel.cjs.js.map +1 -0
- package/dist/nile-split-panel/nile-split-panel.css.cjs.js +2 -0
- package/dist/nile-split-panel/nile-split-panel.css.cjs.js.map +1 -0
- package/dist/nile-split-panel/nile-split-panel.css.esm.js +87 -0
- package/dist/nile-split-panel/nile-split-panel.esm.js +21 -0
- 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.esm.js +1 -1
- package/dist/nile-stepper/nile-stepper.test.cjs.js +2 -0
- package/dist/nile-stepper/nile-stepper.test.cjs.js.map +1 -0
- package/dist/nile-stepper/nile-stepper.test.esm.js +1 -0
- 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.css.cjs.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.css.cjs.js.map +1 -1
- package/dist/nile-tab-group/nile-tab-group.css.esm.js +2 -2
- package/dist/nile-tab-group/nile-tab-group.esm.js +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js.map +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.css.esm.js +0 -4
- 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.esm.js +1 -1
- package/dist/nile-textarea/nile-textarea.test.cjs.js +2 -0
- package/dist/nile-textarea/nile-textarea.test.cjs.js.map +1 -0
- package/dist/nile-textarea/nile-textarea.test.esm.js +1 -0
- 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.esm.js +1 -1
- package/dist/nile-tree/index.cjs.js +2 -0
- package/dist/nile-tree/index.cjs.js.map +1 -0
- package/dist/nile-tree/index.esm.js +1 -0
- package/dist/nile-tree/nile-tree.cjs.js +2 -0
- package/dist/nile-tree/nile-tree.cjs.js.map +1 -0
- package/dist/nile-tree/nile-tree.css.cjs.js +2 -0
- package/dist/nile-tree/nile-tree.css.cjs.js.map +1 -0
- package/dist/nile-tree/nile-tree.css.esm.js +36 -0
- package/dist/nile-tree/nile-tree.esm.js +13 -0
- package/dist/nile-tree-item/index.cjs.js +2 -0
- package/dist/nile-tree-item/index.cjs.js.map +1 -0
- package/dist/nile-tree-item/index.esm.js +1 -0
- package/dist/nile-tree-item/nile-tree-item.cjs.js +2 -0
- package/dist/nile-tree-item/nile-tree-item.cjs.js.map +1 -0
- package/dist/nile-tree-item/nile-tree-item.css.cjs.js +2 -0
- package/dist/nile-tree-item/nile-tree-item.css.cjs.js.map +1 -0
- package/dist/nile-tree-item/nile-tree-item.css.esm.js +164 -0
- package/dist/nile-tree-item/nile-tree-item.esm.js +63 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.js +5 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal/drag.d.ts +15 -0
- package/dist/src/internal/drag.js +28 -0
- package/dist/src/internal/drag.js.map +1 -0
- package/dist/src/internal/math.d.ts +2 -0
- package/dist/src/internal/math.js +12 -0
- package/dist/src/internal/math.js.map +1 -0
- package/dist/src/nile-avatar/nile-avatar.css.js +5 -6
- package/dist/src/nile-avatar/nile-avatar.css.js.map +1 -1
- package/dist/src/nile-avatar/nile-avatar.test.d.ts +1 -0
- package/dist/src/nile-avatar/nile-avatar.test.js +58 -0
- package/dist/src/nile-avatar/nile-avatar.test.js.map +1 -0
- package/dist/src/nile-badge/nile-badge.css.js +45 -45
- package/dist/src/nile-badge/nile-badge.css.js.map +1 -1
- package/dist/src/nile-badge/nile-badge.test.d.ts +1 -0
- package/dist/src/nile-badge/nile-badge.test.js +42 -0
- package/dist/src/nile-badge/nile-badge.test.js.map +1 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.css.js +3 -4
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.css.js.map +1 -1
- package/dist/src/nile-button/nile-button.test.d.ts +1 -0
- package/dist/src/nile-button/nile-button.test.js +86 -0
- package/dist/src/nile-button/nile-button.test.js.map +1 -0
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.d.ts +2 -0
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.js +108 -0
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.js.map +1 -0
- package/dist/src/nile-calendar/nile-calendar.css.js +122 -191
- package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.d.ts +8 -0
- package/dist/src/nile-calendar/nile-calendar.js +164 -167
- package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
- package/dist/src/nile-card/nile-card.test.d.ts +1 -0
- package/dist/src/nile-card/nile-card.test.js +69 -0
- package/dist/src/nile-card/nile-card.test.js.map +1 -0
- package/dist/src/nile-date-picker/nile-date-picker.js +1 -0
- package/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
- package/dist/src/nile-dialog/nile-dialog.css.js +4 -1
- package/dist/src/nile-dialog/nile-dialog.css.js.map +1 -1
- package/dist/src/nile-dialog/nile-dialog.js +4 -3
- package/dist/src/nile-dialog/nile-dialog.js.map +1 -1
- package/dist/src/nile-drawer/nile-drawer.test.d.ts +1 -0
- package/dist/src/nile-drawer/nile-drawer.test.js +88 -0
- package/dist/src/nile-drawer/nile-drawer.test.js.map +1 -0
- package/dist/src/nile-empty-state/nile-empty-state.test.d.ts +1 -0
- package/dist/src/nile-empty-state/nile-empty-state.test.js +63 -0
- package/dist/src/nile-empty-state/nile-empty-state.test.js.map +1 -0
- package/dist/src/nile-error-message/nile-error-message.test.d.ts +1 -0
- package/dist/src/nile-error-message/nile-error-message.test.js +61 -0
- package/dist/src/nile-error-message/nile-error-message.test.js.map +1 -0
- package/dist/src/nile-form-group/nile-form-group.test.d.ts +1 -0
- package/dist/src/nile-form-group/nile-form-group.test.js +55 -0
- package/dist/src/nile-form-group/nile-form-group.test.js.map +1 -0
- package/dist/src/nile-hero/nile-hero.test.d.ts +1 -0
- package/dist/src/nile-hero/nile-hero.test.js +42 -0
- package/dist/src/nile-hero/nile-hero.test.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/alert.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/alert.js +5 -0
- package/dist/src/nile-icon/icons/svg/alert.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/file-check-02.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/file-check-02.js +5 -0
- package/dist/src/nile-icon/icons/svg/file-check-02.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/index.d.ts +3 -0
- package/dist/src/nile-icon/icons/svg/index.js +3 -0
- package/dist/src/nile-icon/icons/svg/index.js.map +1 -1
- package/dist/src/nile-icon/icons/svg/monitor-01.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/monitor-01.js +5 -0
- package/dist/src/nile-icon/icons/svg/monitor-01.js.map +1 -0
- package/dist/src/nile-icon/nile-icon.test.d.ts +1 -0
- package/dist/src/nile-icon/nile-icon.test.js +45 -0
- package/dist/src/nile-icon/nile-icon.test.js.map +1 -0
- package/dist/src/nile-input/nile-input.test.d.ts +1 -0
- package/dist/src/nile-input/nile-input.test.js +139 -0
- package/dist/src/nile-input/nile-input.test.js.map +1 -0
- package/dist/src/nile-link/nile-link.test.d.ts +1 -0
- package/dist/src/nile-link/nile-link.test.js +72 -0
- package/dist/src/nile-link/nile-link.test.js.map +1 -0
- package/dist/src/nile-list/index.d.ts +1 -0
- package/dist/src/nile-list/index.js +2 -0
- package/dist/src/nile-list/index.js.map +1 -0
- package/dist/src/nile-list/nile-list.css.d.ts +12 -0
- package/dist/src/nile-list/nile-list.css.js +20 -0
- package/dist/src/nile-list/nile-list.css.js.map +1 -0
- package/dist/src/nile-list/nile-list.d.ts +33 -0
- package/dist/src/nile-list/nile-list.js +47 -0
- package/dist/src/nile-list/nile-list.js.map +1 -0
- package/dist/src/nile-list-item/index.d.ts +1 -0
- package/dist/src/nile-list-item/index.js +2 -0
- package/dist/src/nile-list-item/index.js.map +1 -0
- package/dist/src/nile-list-item/nile-list-item.css.d.ts +12 -0
- package/dist/src/nile-list-item/nile-list-item.css.js +66 -0
- package/dist/src/nile-list-item/nile-list-item.css.js.map +1 -0
- package/dist/src/nile-list-item/nile-list-item.d.ts +38 -0
- package/dist/src/nile-list-item/nile-list-item.js +96 -0
- package/dist/src/nile-list-item/nile-list-item.js.map +1 -0
- package/dist/src/nile-loader/nile-loader.test.d.ts +1 -0
- package/dist/src/nile-loader/nile-loader.test.js +39 -0
- package/dist/src/nile-loader/nile-loader.test.js.map +1 -0
- package/dist/src/nile-menu/nile-menu.css.js +19 -5
- package/dist/src/nile-menu/nile-menu.css.js.map +1 -1
- package/dist/src/nile-menu/nile-menu.d.ts +1 -0
- package/dist/src/nile-menu/nile-menu.js +25 -14
- package/dist/src/nile-menu/nile-menu.js.map +1 -1
- package/dist/src/nile-popover/nile-popover.css.js +6 -4
- package/dist/src/nile-popover/nile-popover.css.js.map +1 -1
- package/dist/src/nile-popover/nile-popover.d.ts +1 -0
- package/dist/src/nile-popover/nile-popover.js +7 -6
- package/dist/src/nile-popover/nile-popover.js.map +1 -1
- package/dist/src/nile-popover/nile-popover.test.d.ts +1 -0
- package/dist/src/nile-popover/nile-popover.test.js +73 -0
- package/dist/src/nile-popover/nile-popover.test.js.map +1 -0
- package/dist/src/nile-popup/nile-popup.css.d.ts +5 -5
- package/dist/src/nile-popup/nile-popup.css.js +13 -9
- package/dist/src/nile-popup/nile-popup.css.js.map +1 -1
- package/dist/src/nile-progress-bar/nile-progress-bar.test.d.ts +1 -0
- package/dist/src/nile-progress-bar/nile-progress-bar.test.js +48 -0
- package/dist/src/nile-progress-bar/nile-progress-bar.test.js.map +1 -0
- package/dist/src/nile-radio/nile-radio.test.d.ts +1 -0
- package/dist/src/nile-radio/nile-radio.test.js +71 -0
- package/dist/src/nile-radio/nile-radio.test.js.map +1 -0
- package/dist/src/nile-select/nile-select.d.ts +1 -0
- package/dist/src/nile-select/nile-select.js +5 -1
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/src/nile-slide-toggle/nile-slide-toggle.test.d.ts +1 -0
- package/dist/src/nile-slide-toggle/nile-slide-toggle.test.js +54 -0
- package/dist/src/nile-slide-toggle/nile-slide-toggle.test.js.map +1 -0
- package/dist/src/nile-split-panel/index.d.ts +1 -0
- package/dist/src/nile-split-panel/index.js +2 -0
- package/dist/src/nile-split-panel/index.js.map +1 -0
- package/dist/src/nile-split-panel/nile-split-panel.css.d.ts +12 -0
- package/dist/src/nile-split-panel/nile-split-panel.css.js +99 -0
- package/dist/src/nile-split-panel/nile-split-panel.css.js.map +1 -0
- package/dist/src/nile-split-panel/nile-split-panel.d.ts +78 -0
- package/dist/src/nile-split-panel/nile-split-panel.js +251 -0
- package/dist/src/nile-split-panel/nile-split-panel.js.map +1 -0
- package/dist/src/nile-stepper/nile-stepper.js +1 -1
- package/dist/src/nile-stepper/nile-stepper.js.map +1 -1
- package/dist/src/nile-stepper/nile-stepper.test.d.ts +0 -0
- package/dist/src/nile-stepper/nile-stepper.test.js +165 -0
- package/dist/src/nile-stepper/nile-stepper.test.js.map +1 -0
- package/dist/src/nile-tab-group/nile-tab-group.css.js +2 -2
- package/dist/src/nile-tab-group/nile-tab-group.css.js.map +1 -1
- package/dist/src/nile-tab-group/nile-tab-group.js +16 -15
- package/dist/src/nile-tab-group/nile-tab-group.js.map +1 -1
- package/dist/src/nile-table-header-item/nile-table-header-item.css.js +0 -4
- package/dist/src/nile-table-header-item/nile-table-header-item.css.js.map +1 -1
- package/dist/src/nile-textarea/nile-textarea.test.d.ts +1 -0
- package/dist/src/nile-textarea/nile-textarea.test.js +87 -0
- package/dist/src/nile-textarea/nile-textarea.test.js.map +1 -0
- package/dist/src/nile-tree/index.d.ts +1 -0
- package/dist/src/nile-tree/index.js +2 -0
- package/dist/src/nile-tree/index.js.map +1 -0
- package/dist/src/nile-tree/nile-tree.css.d.ts +12 -0
- package/dist/src/nile-tree/nile-tree.css.js +48 -0
- package/dist/src/nile-tree/nile-tree.css.js.map +1 -0
- package/dist/src/nile-tree/nile-tree.d.ts +69 -0
- package/dist/src/nile-tree/nile-tree.js +376 -0
- package/dist/src/nile-tree/nile-tree.js.map +1 -0
- package/dist/src/nile-tree-item/index.d.ts +1 -0
- package/dist/src/nile-tree-item/index.js +2 -0
- package/dist/src/nile-tree-item/index.js.map +1 -0
- package/dist/src/nile-tree-item/nile-tree-item.css.d.ts +12 -0
- package/dist/src/nile-tree-item/nile-tree-item.css.js +176 -0
- package/dist/src/nile-tree-item/nile-tree-item.css.js.map +1 -0
- package/dist/src/nile-tree-item/nile-tree-item.d.ts +96 -0
- package/dist/src/nile-tree-item/nile-tree-item.js +324 -0
- package/dist/src/nile-tree-item/nile-tree-item.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +71 -2
- package/plopfile.js +11 -0
- package/src/index.ts +6 -1
- package/src/internal/drag.ts +45 -0
- package/src/internal/math.ts +14 -0
- package/src/nile-avatar/nile-avatar.css.ts +5 -6
- package/src/nile-avatar/nile-avatar.test.ts +65 -0
- package/src/nile-badge/nile-badge.css.ts +45 -45
- package/src/nile-badge/nile-badge.test.ts +48 -0
- package/src/nile-breadcrumb-item/nile-breadcrumb-item.css.ts +3 -4
- package/src/nile-button/nile-button.test.ts +117 -0
- package/src/nile-button-toggle-group/nile-button-toggle-group.test.ts +130 -0
- package/src/nile-calendar/nile-calendar.css.ts +122 -191
- package/src/nile-calendar/nile-calendar.ts +170 -213
- package/src/nile-card/nile-card.test.ts +74 -0
- package/src/nile-date-picker/nile-date-picker.ts +5 -6
- package/src/nile-dialog/nile-dialog.css.ts +4 -1
- package/src/nile-dialog/nile-dialog.ts +4 -4
- package/src/nile-drawer/nile-drawer.test.ts +106 -0
- package/src/nile-empty-state/nile-empty-state.test.ts +69 -0
- package/src/nile-error-message/nile-error-message.test.ts +69 -0
- package/src/nile-form-group/nile-form-group.test.ts +63 -0
- package/src/nile-hero/nile-hero.test.ts +45 -0
- package/src/nile-icon/icons/svg/alert.ts +5 -0
- package/src/nile-icon/icons/svg/file-check-02.ts +5 -0
- package/src/nile-icon/icons/svg/index.ts +3 -0
- package/src/nile-icon/icons/svg/monitor-01.ts +5 -0
- package/src/nile-icon/nile-icon.test.ts +53 -0
- package/src/nile-input/nile-input.test.ts +160 -0
- package/src/nile-link/nile-link.test.ts +83 -0
- package/src/nile-list/index.ts +1 -0
- package/src/nile-list/nile-list.css.ts +22 -0
- package/src/nile-list/nile-list.ts +64 -0
- package/src/nile-list-item/index.ts +1 -0
- package/src/nile-list-item/nile-list-item.css.ts +68 -0
- package/src/nile-list-item/nile-list-item.ts +104 -0
- package/src/nile-loader/nile-loader.test.ts +45 -0
- package/src/nile-menu/nile-menu.css.ts +19 -5
- package/src/nile-menu/nile-menu.ts +27 -17
- package/src/nile-popover/nile-popover.css.ts +6 -4
- package/src/nile-popover/nile-popover.test.ts +86 -0
- package/src/nile-popover/nile-popover.ts +7 -10
- package/src/nile-popup/nile-popup.css.ts +14 -10
- package/src/nile-progress-bar/nile-progress-bar.test.ts +55 -0
- package/src/nile-radio/nile-radio.test.ts +81 -0
- package/src/nile-select/nile-select.ts +3 -1
- package/src/nile-slide-toggle/nile-slide-toggle.test.ts +61 -0
- package/src/nile-split-panel/index.ts +1 -0
- package/src/nile-split-panel/nile-split-panel.css.ts +101 -0
- package/src/nile-split-panel/nile-split-panel.ts +285 -0
- package/src/nile-stepper/nile-stepper.test.ts +174 -0
- package/src/nile-stepper/nile-stepper.ts +2 -2
- package/src/nile-tab-group/nile-tab-group.css.ts +2 -2
- package/src/nile-tab-group/nile-tab-group.ts +2 -1
- package/src/nile-table-header-item/nile-table-header-item.css.ts +0 -4
- package/src/nile-textarea/nile-textarea.test.ts +102 -0
- package/src/nile-tree/index.ts +1 -0
- package/src/nile-tree/nile-tree.css.ts +50 -0
- package/src/nile-tree/nile-tree.ts +433 -0
- package/src/nile-tree-item/index.ts +1 -0
- package/src/nile-tree-item/nile-tree-item.css.ts +178 -0
- package/src/nile-tree-item/nile-tree-item.ts +330 -0
@@ -0,0 +1,78 @@
|
|
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
|
+
import { TemplateResult } from 'lit-element';
|
8
|
+
import NileElement from '../internal/nile-element';
|
9
|
+
import type { CSSResultGroup } from 'lit';
|
10
|
+
/**
|
11
|
+
* @summary Split panels display two adjacent panels, allowing the user to reposition them.
|
12
|
+
*
|
13
|
+
* @event nile-reposition - Emitted when the divider's position changes.
|
14
|
+
*
|
15
|
+
* @slot start - Content to place in the start panel.
|
16
|
+
* @slot end - Content to place in the end panel.
|
17
|
+
* @slot divider - The divider. Useful for slotting in a custom icon that renders as a handle.
|
18
|
+
*
|
19
|
+
* @csspart start - The start panel.
|
20
|
+
* @csspart end - The end panel.
|
21
|
+
* @csspart panel - Targets both the start and end panels.
|
22
|
+
* @csspart divider - The divider that separates the start and end panels.
|
23
|
+
*
|
24
|
+
* @cssproperty [--divider-width=4px] - The width of the visible divider.
|
25
|
+
* @cssproperty [--divider-hit-area=12px] - The invisible region around the divider where dragging can occur. This is
|
26
|
+
* usually wider than the divider to facilitate easier dragging.
|
27
|
+
* @cssproperty [--min=0] - The minimum allowed size of the primary panel.
|
28
|
+
* @cssproperty [--max=100%] - The maximum allowed size of the primary panel.
|
29
|
+
*/
|
30
|
+
export declare class NileSplitPanel extends NileElement {
|
31
|
+
static styles: CSSResultGroup;
|
32
|
+
private cachedPositionInPixels;
|
33
|
+
private resizeObserver;
|
34
|
+
private size;
|
35
|
+
divider: HTMLElement;
|
36
|
+
/**
|
37
|
+
* The current position of the divider from the primary panel's edge as a percentage 0-100. Defaults to 50% of the
|
38
|
+
* container's initial size.
|
39
|
+
*/
|
40
|
+
position: number;
|
41
|
+
/** The current position of the divider from the primary panel's edge in pixels. */
|
42
|
+
positionInPixels: number;
|
43
|
+
/** Draws the split panel in a vertical orientation with the start and end panels stacked. */
|
44
|
+
vertical: boolean;
|
45
|
+
/** Disables resizing. Note that the position may still change as a result of resizing the host element. */
|
46
|
+
disabled: boolean;
|
47
|
+
/**
|
48
|
+
* If no primary panel is designated, both panels will resize proportionally when the host element is resized. If a
|
49
|
+
* primary panel is designated, it will maintain its size and the other panel will grow or shrink as needed when the
|
50
|
+
* host element is resized.
|
51
|
+
*/
|
52
|
+
primary?: 'start' | 'end';
|
53
|
+
/**
|
54
|
+
* One or more space-separated values at which the divider should snap. Values can be in pixels or percentages, e.g.
|
55
|
+
* `"100px 50%"`.
|
56
|
+
*/
|
57
|
+
snap?: string;
|
58
|
+
/** How close the divider must be to a snap point until snapping occurs. */
|
59
|
+
snapThreshold: number;
|
60
|
+
connectedCallback(): void;
|
61
|
+
disconnectedCallback(): void;
|
62
|
+
private detectSize;
|
63
|
+
private percentageToPixels;
|
64
|
+
private pixelsToPercentage;
|
65
|
+
private handleDrag;
|
66
|
+
private handleKeyDown;
|
67
|
+
private handleResize;
|
68
|
+
handlePositionChange(): void;
|
69
|
+
handlePositionInPixelsChange(): void;
|
70
|
+
handleVerticalChange(): void;
|
71
|
+
render(): TemplateResult<1>;
|
72
|
+
}
|
73
|
+
export default NileSplitPanel;
|
74
|
+
declare global {
|
75
|
+
interface HTMLElementTagNameMap {
|
76
|
+
'nile-split-panel': NileSplitPanel;
|
77
|
+
}
|
78
|
+
}
|
@@ -0,0 +1,251 @@
|
|
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
|
+
import { __decorate } from "tslib";
|
8
|
+
import { styles } from './nile-split-panel.css';
|
9
|
+
import NileElement from '../internal/nile-element';
|
10
|
+
import { clamp } from '../internal/math';
|
11
|
+
import { customElement, property, query } from 'lit/decorators.js';
|
12
|
+
import { drag } from '../internal/drag';
|
13
|
+
import { html } from 'lit';
|
14
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
15
|
+
import { watch } from '../internal/watch';
|
16
|
+
/**
|
17
|
+
* @summary Split panels display two adjacent panels, allowing the user to reposition them.
|
18
|
+
*
|
19
|
+
* @event nile-reposition - Emitted when the divider's position changes.
|
20
|
+
*
|
21
|
+
* @slot start - Content to place in the start panel.
|
22
|
+
* @slot end - Content to place in the end panel.
|
23
|
+
* @slot divider - The divider. Useful for slotting in a custom icon that renders as a handle.
|
24
|
+
*
|
25
|
+
* @csspart start - The start panel.
|
26
|
+
* @csspart end - The end panel.
|
27
|
+
* @csspart panel - Targets both the start and end panels.
|
28
|
+
* @csspart divider - The divider that separates the start and end panels.
|
29
|
+
*
|
30
|
+
* @cssproperty [--divider-width=4px] - The width of the visible divider.
|
31
|
+
* @cssproperty [--divider-hit-area=12px] - The invisible region around the divider where dragging can occur. This is
|
32
|
+
* usually wider than the divider to facilitate easier dragging.
|
33
|
+
* @cssproperty [--min=0] - The minimum allowed size of the primary panel.
|
34
|
+
* @cssproperty [--max=100%] - The maximum allowed size of the primary panel.
|
35
|
+
*/
|
36
|
+
let NileSplitPanel = class NileSplitPanel extends NileElement {
|
37
|
+
constructor() {
|
38
|
+
super(...arguments);
|
39
|
+
/**
|
40
|
+
* The current position of the divider from the primary panel's edge as a percentage 0-100. Defaults to 50% of the
|
41
|
+
* container's initial size.
|
42
|
+
*/
|
43
|
+
this.position = 50;
|
44
|
+
/** Draws the split panel in a vertical orientation with the start and end panels stacked. */
|
45
|
+
this.vertical = false;
|
46
|
+
/** Disables resizing. Note that the position may still change as a result of resizing the host element. */
|
47
|
+
this.disabled = false;
|
48
|
+
/** How close the divider must be to a snap point until snapping occurs. */
|
49
|
+
this.snapThreshold = 12;
|
50
|
+
}
|
51
|
+
connectedCallback() {
|
52
|
+
super.connectedCallback();
|
53
|
+
this.resizeObserver = new ResizeObserver(entries => this.handleResize(entries));
|
54
|
+
this.updateComplete.then(() => this.resizeObserver.observe(this));
|
55
|
+
this.detectSize();
|
56
|
+
this.cachedPositionInPixels = this.percentageToPixels(this.position);
|
57
|
+
}
|
58
|
+
disconnectedCallback() {
|
59
|
+
super.disconnectedCallback();
|
60
|
+
this.resizeObserver.unobserve(this);
|
61
|
+
}
|
62
|
+
detectSize() {
|
63
|
+
const { width, height } = this.getBoundingClientRect();
|
64
|
+
this.size = this.vertical ? height : width;
|
65
|
+
}
|
66
|
+
percentageToPixels(value) {
|
67
|
+
return this.size * (value / 100);
|
68
|
+
}
|
69
|
+
pixelsToPercentage(value) {
|
70
|
+
return (value / this.size) * 100;
|
71
|
+
}
|
72
|
+
handleDrag(event) {
|
73
|
+
const isRtl = false;
|
74
|
+
if (this.disabled) {
|
75
|
+
return;
|
76
|
+
}
|
77
|
+
// Prevent text selection when dragging
|
78
|
+
if (event.cancelable) {
|
79
|
+
event.preventDefault();
|
80
|
+
}
|
81
|
+
drag(this, {
|
82
|
+
onMove: (x, y) => {
|
83
|
+
let newPositionInPixels = this.vertical ? y : x;
|
84
|
+
// Flip for end panels
|
85
|
+
if (this.primary === 'end') {
|
86
|
+
newPositionInPixels = this.size - newPositionInPixels;
|
87
|
+
}
|
88
|
+
// Check snap points
|
89
|
+
if (this.snap) {
|
90
|
+
const snaps = this.snap.split(' ');
|
91
|
+
snaps.forEach(value => {
|
92
|
+
let snapPoint;
|
93
|
+
if (value.endsWith('%')) {
|
94
|
+
snapPoint = this.size * (parseFloat(value) / 100);
|
95
|
+
}
|
96
|
+
else {
|
97
|
+
snapPoint = parseFloat(value);
|
98
|
+
}
|
99
|
+
if (isRtl && !this.vertical) {
|
100
|
+
snapPoint = this.size - snapPoint;
|
101
|
+
}
|
102
|
+
if (newPositionInPixels >= snapPoint - this.snapThreshold &&
|
103
|
+
newPositionInPixels <= snapPoint + this.snapThreshold) {
|
104
|
+
newPositionInPixels = snapPoint;
|
105
|
+
}
|
106
|
+
});
|
107
|
+
}
|
108
|
+
this.position = clamp(this.pixelsToPercentage(newPositionInPixels), 0, 100);
|
109
|
+
},
|
110
|
+
initialEvent: event
|
111
|
+
});
|
112
|
+
}
|
113
|
+
handleKeyDown(event) {
|
114
|
+
if (this.disabled) {
|
115
|
+
return;
|
116
|
+
}
|
117
|
+
if (['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Home', 'End'].includes(event.key)) {
|
118
|
+
let newPosition = this.position;
|
119
|
+
const incr = (event.shiftKey ? 10 : 1) * (this.primary === 'end' ? -1 : 1);
|
120
|
+
event.preventDefault();
|
121
|
+
if ((event.key === 'ArrowLeft' && !this.vertical) || (event.key === 'ArrowUp' && this.vertical)) {
|
122
|
+
newPosition -= incr;
|
123
|
+
}
|
124
|
+
if ((event.key === 'ArrowRight' && !this.vertical) || (event.key === 'ArrowDown' && this.vertical)) {
|
125
|
+
newPosition += incr;
|
126
|
+
}
|
127
|
+
if (event.key === 'Home') {
|
128
|
+
newPosition = this.primary === 'end' ? 100 : 0;
|
129
|
+
}
|
130
|
+
if (event.key === 'End') {
|
131
|
+
newPosition = this.primary === 'end' ? 0 : 100;
|
132
|
+
}
|
133
|
+
this.position = clamp(newPosition, 0, 100);
|
134
|
+
}
|
135
|
+
}
|
136
|
+
handleResize(entries) {
|
137
|
+
const { width, height } = entries[0].contentRect;
|
138
|
+
this.size = this.vertical ? height : width;
|
139
|
+
// Resize when a primary panel is set
|
140
|
+
if (this.primary) {
|
141
|
+
this.position = this.pixelsToPercentage(this.cachedPositionInPixels);
|
142
|
+
}
|
143
|
+
}
|
144
|
+
handlePositionChange() {
|
145
|
+
this.cachedPositionInPixels = this.percentageToPixels(this.position);
|
146
|
+
this.positionInPixels = this.percentageToPixels(this.position);
|
147
|
+
this.emit('nile-reposition');
|
148
|
+
}
|
149
|
+
handlePositionInPixelsChange() {
|
150
|
+
this.position = this.pixelsToPercentage(this.positionInPixels);
|
151
|
+
}
|
152
|
+
handleVerticalChange() {
|
153
|
+
this.detectSize();
|
154
|
+
}
|
155
|
+
render() {
|
156
|
+
const gridTemplate = this.vertical ? 'gridTemplateRows' : 'gridTemplateColumns';
|
157
|
+
const gridTemplateAlt = this.vertical ? 'gridTemplateColumns' : 'gridTemplateRows';
|
158
|
+
const isRtl = false;
|
159
|
+
const primary = `
|
160
|
+
clamp(
|
161
|
+
0%,
|
162
|
+
clamp(
|
163
|
+
var(--min),
|
164
|
+
${this.position}% - var(--divider-width) / 2,
|
165
|
+
var(--max)
|
166
|
+
),
|
167
|
+
calc(100% - var(--divider-width))
|
168
|
+
)
|
169
|
+
`;
|
170
|
+
const secondary = 'auto';
|
171
|
+
if (this.primary === 'end') {
|
172
|
+
if (isRtl && !this.vertical) {
|
173
|
+
this.style[gridTemplate] = `${primary} var(--divider-width) ${secondary}`;
|
174
|
+
}
|
175
|
+
else {
|
176
|
+
this.style[gridTemplate] = `${secondary} var(--divider-width) ${primary}`;
|
177
|
+
}
|
178
|
+
}
|
179
|
+
else {
|
180
|
+
if (isRtl && !this.vertical) {
|
181
|
+
this.style[gridTemplate] = `${secondary} var(--divider-width) ${primary}`;
|
182
|
+
}
|
183
|
+
else {
|
184
|
+
this.style[gridTemplate] = `${primary} var(--divider-width) ${secondary}`;
|
185
|
+
}
|
186
|
+
}
|
187
|
+
// Unset the alt grid template property
|
188
|
+
this.style[gridTemplateAlt] = '';
|
189
|
+
return html `
|
190
|
+
<slot name="start" part="panel start" class="start"></slot>
|
191
|
+
|
192
|
+
<div
|
193
|
+
part="divider"
|
194
|
+
class="divider"
|
195
|
+
tabindex=${ifDefined(this.disabled ? undefined : '0')}
|
196
|
+
role="separator"
|
197
|
+
aria-valuenow=${this.position}
|
198
|
+
aria-valuemin="0"
|
199
|
+
aria-valuemax="100"
|
200
|
+
aria-label="resize"
|
201
|
+
@keydown=${this.handleKeyDown}
|
202
|
+
@mousedown=${this.handleDrag}
|
203
|
+
@touchstart=${this.handleDrag}
|
204
|
+
>
|
205
|
+
<slot name="divider"></slot>
|
206
|
+
</div>
|
207
|
+
|
208
|
+
<slot name="end" part="panel end" class="end"></slot>
|
209
|
+
`;
|
210
|
+
}
|
211
|
+
};
|
212
|
+
NileSplitPanel.styles = styles;
|
213
|
+
__decorate([
|
214
|
+
query('.divider')
|
215
|
+
], NileSplitPanel.prototype, "divider", void 0);
|
216
|
+
__decorate([
|
217
|
+
property({ type: Number, reflect: true })
|
218
|
+
], NileSplitPanel.prototype, "position", void 0);
|
219
|
+
__decorate([
|
220
|
+
property({ attribute: 'position-in-pixels', type: Number })
|
221
|
+
], NileSplitPanel.prototype, "positionInPixels", void 0);
|
222
|
+
__decorate([
|
223
|
+
property({ type: Boolean, reflect: true })
|
224
|
+
], NileSplitPanel.prototype, "vertical", void 0);
|
225
|
+
__decorate([
|
226
|
+
property({ type: Boolean, reflect: true })
|
227
|
+
], NileSplitPanel.prototype, "disabled", void 0);
|
228
|
+
__decorate([
|
229
|
+
property()
|
230
|
+
], NileSplitPanel.prototype, "primary", void 0);
|
231
|
+
__decorate([
|
232
|
+
property()
|
233
|
+
], NileSplitPanel.prototype, "snap", void 0);
|
234
|
+
__decorate([
|
235
|
+
property({ type: Number, attribute: 'snap-threshold' })
|
236
|
+
], NileSplitPanel.prototype, "snapThreshold", void 0);
|
237
|
+
__decorate([
|
238
|
+
watch('position')
|
239
|
+
], NileSplitPanel.prototype, "handlePositionChange", null);
|
240
|
+
__decorate([
|
241
|
+
watch('positionInPixels')
|
242
|
+
], NileSplitPanel.prototype, "handlePositionInPixelsChange", null);
|
243
|
+
__decorate([
|
244
|
+
watch('vertical')
|
245
|
+
], NileSplitPanel.prototype, "handleVerticalChange", null);
|
246
|
+
NileSplitPanel = __decorate([
|
247
|
+
customElement('nile-split-panel')
|
248
|
+
], NileSplitPanel);
|
249
|
+
export { NileSplitPanel };
|
250
|
+
export default NileSplitPanel;
|
251
|
+
//# sourceMappingURL=nile-split-panel.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"nile-split-panel.js","sourceRoot":"","sources":["../../../src/nile-split-panel/nile-split-panel.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAGH,OAAO,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAC;AAC9C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAGnD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG1C;;;;;;;;;;;;;;;;;;;GAmBG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,WAAW;IAAxC;;QAUL;;;WAGG;QACwC,aAAQ,GAAG,EAAE,CAAC;QAKzD,6FAA6F;QACjD,aAAQ,GAAG,KAAK,CAAC;QAE7D,2GAA2G;QAC/D,aAAQ,GAAG,KAAK,CAAC;QAe7D,2EAA2E;QAClB,kBAAa,GAAG,EAAE,CAAC;IAoM9E,CAAC;IAlMC,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;QAChF,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,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AAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;qDAAoB;AA4H5E;IADC,KAAK,CAAC,UAAU,CAAC;0DAKjB;AAGD;IADC,KAAK,CAAC,kBAAkB,CAAC;kEAGzB;AAGD;IADC,KAAK,CAAC,UAAU,CAAC;0DAGjB;AAjLU,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA2O1B;SA3OY,cAAc;AA6O3B,eAAe,cAAc,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, CSSResultArray, TemplateResult} from 'lit-element';\nimport {styles} from './nile-split-panel.css';\nimport NileElement from '../internal/nile-element';\n\n\nimport { clamp } from '../internal/math';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { drag } from '../internal/drag';\nimport { html } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { watch } from '../internal/watch';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * @summary Split panels display two adjacent panels, allowing the user to reposition them.\n *\n * @event nile-reposition - Emitted when the divider's position changes.\n *\n * @slot start - Content to place in the start panel.\n * @slot end - Content to place in the end panel.\n * @slot divider - The divider. Useful for slotting in a custom icon that renders as a handle.\n *\n * @csspart start - The start panel.\n * @csspart end - The end panel.\n * @csspart panel - Targets both the start and end panels.\n * @csspart divider - The divider that separates the start and end panels.\n *\n * @cssproperty [--divider-width=4px] - The width of the visible divider.\n * @cssproperty [--divider-hit-area=12px] - The invisible region around the divider where dragging can occur. This is\n * usually wider than the divider to facilitate easier dragging.\n * @cssproperty [--min=0] - The minimum allowed size of the primary panel.\n * @cssproperty [--max=100%] - The maximum allowed size of the primary panel.\n */\n@customElement('nile-split-panel')\nexport class NileSplitPanel extends NileElement {\n\n\tstatic styles: CSSResultGroup = styles;\n\n private cachedPositionInPixels: number;\n private resizeObserver: ResizeObserver;\n private size: number;\n\n @query('.divider') divider: HTMLElement;\n\n /**\n * The current position of the divider from the primary panel's edge as a percentage 0-100. Defaults to 50% of the\n * container's initial size.\n */\n @property({ type: Number, reflect: true }) position = 50;\n\n /** The current position of the divider from the primary panel's edge in pixels. */\n @property({ attribute: 'position-in-pixels', type: Number }) positionInPixels: number;\n\n /** Draws the split panel in a vertical orientation with the start and end panels stacked. */\n @property({ type: Boolean, reflect: true }) vertical = false;\n\n /** Disables resizing. Note that the position may still change as a result of resizing the host element. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * If no primary panel is designated, both panels will resize proportionally when the host element is resized. If a\n * primary panel is designated, it will maintain its size and the other panel will grow or shrink as needed when the\n * host element is resized.\n */\n @property() primary?: 'start' | 'end';\n\n /**\n * One or more space-separated values at which the divider should snap. Values can be in pixels or percentages, e.g.\n * `\"100px 50%\"`.\n */\n @property() snap?: string;\n\n /** How close the divider must be to a snap point until snapping occurs. */\n @property({ type: Number, attribute: 'snap-threshold' }) snapThreshold = 12;\n\n connectedCallback() {\n super.connectedCallback();\n this.resizeObserver = new ResizeObserver(entries => this.handleResize(entries));\n this.updateComplete.then(() => this.resizeObserver.observe(this));\n\n this.detectSize();\n this.cachedPositionInPixels = this.percentageToPixels(this.position);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.resizeObserver.unobserve(this);\n }\n\n private detectSize() {\n const { width, height } = this.getBoundingClientRect();\n this.size = this.vertical ? height : width;\n }\n\n private percentageToPixels(value: number) {\n return this.size * (value / 100);\n }\n\n private pixelsToPercentage(value: number) {\n return (value / this.size) * 100;\n }\n\n private handleDrag(event: PointerEvent) {\n const isRtl = false;\n\n if (this.disabled) {\n return;\n }\n\n // Prevent text selection when dragging\n if (event.cancelable) {\n event.preventDefault();\n }\n\n drag(this, {\n onMove: (x, y) => {\n let newPositionInPixels = this.vertical ? y : x;\n\n // Flip for end panels\n if (this.primary === 'end') {\n newPositionInPixels = this.size - newPositionInPixels;\n }\n\n // Check snap points\n if (this.snap) {\n const snaps = this.snap.split(' ');\n\n snaps.forEach(value => {\n let snapPoint: number;\n\n if (value.endsWith('%')) {\n snapPoint = this.size * (parseFloat(value) / 100);\n } else {\n snapPoint = parseFloat(value);\n }\n\n if (isRtl && !this.vertical) {\n snapPoint = this.size - snapPoint;\n }\n\n if (\n newPositionInPixels >= snapPoint - this.snapThreshold &&\n newPositionInPixels <= snapPoint + this.snapThreshold\n ) {\n newPositionInPixels = snapPoint;\n }\n });\n }\n\n this.position = clamp(this.pixelsToPercentage(newPositionInPixels), 0, 100);\n },\n initialEvent: event\n });\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (this.disabled) {\n return;\n }\n\n if (['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Home', 'End'].includes(event.key)) {\n let newPosition = this.position;\n const incr = (event.shiftKey ? 10 : 1) * (this.primary === 'end' ? -1 : 1);\n\n event.preventDefault();\n\n if ((event.key === 'ArrowLeft' && !this.vertical) || (event.key === 'ArrowUp' && this.vertical)) {\n newPosition -= incr;\n }\n\n if ((event.key === 'ArrowRight' && !this.vertical) || (event.key === 'ArrowDown' && this.vertical)) {\n newPosition += incr;\n }\n\n if (event.key === 'Home') {\n newPosition = this.primary === 'end' ? 100 : 0;\n }\n\n if (event.key === 'End') {\n newPosition = this.primary === 'end' ? 0 : 100;\n }\n\n this.position = clamp(newPosition, 0, 100);\n }\n }\n\n private handleResize(entries: ResizeObserverEntry[]) {\n const { width, height } = entries[0].contentRect;\n this.size = this.vertical ? height : width;\n\n // Resize when a primary panel is set\n if (this.primary) {\n this.position = this.pixelsToPercentage(this.cachedPositionInPixels);\n }\n }\n\n @watch('position')\n handlePositionChange() {\n this.cachedPositionInPixels = this.percentageToPixels(this.position);\n this.positionInPixels = this.percentageToPixels(this.position);\n this.emit('nile-reposition');\n }\n\n @watch('positionInPixels')\n handlePositionInPixelsChange() {\n this.position = this.pixelsToPercentage(this.positionInPixels);\n }\n\n @watch('vertical')\n handleVerticalChange() {\n this.detectSize();\n }\n\n render() {\n const gridTemplate = this.vertical ? 'gridTemplateRows' : 'gridTemplateColumns';\n const gridTemplateAlt = this.vertical ? 'gridTemplateColumns' : 'gridTemplateRows';\n const isRtl = false;\n const primary = `\n clamp(\n 0%,\n clamp(\n var(--min),\n ${this.position}% - var(--divider-width) / 2,\n var(--max)\n ),\n calc(100% - var(--divider-width))\n )\n `;\n const secondary = 'auto';\n\n if (this.primary === 'end') {\n if (isRtl && !this.vertical) {\n this.style[gridTemplate] = `${primary} var(--divider-width) ${secondary}`;\n } else {\n this.style[gridTemplate] = `${secondary} var(--divider-width) ${primary}`;\n }\n } else {\n if (isRtl && !this.vertical) {\n this.style[gridTemplate] = `${secondary} var(--divider-width) ${primary}`;\n } else {\n this.style[gridTemplate] = `${primary} var(--divider-width) ${secondary}`;\n }\n }\n\n // Unset the alt grid template property\n this.style[gridTemplateAlt] = '';\n\n return html`\n <slot name=\"start\" part=\"panel start\" class=\"start\"></slot>\n\n <div\n part=\"divider\"\n class=\"divider\"\n tabindex=${ifDefined(this.disabled ? undefined : '0')}\n role=\"separator\"\n aria-valuenow=${this.position}\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n aria-label=\"resize\"\n @keydown=${this.handleKeyDown}\n @mousedown=${this.handleDrag}\n @touchstart=${this.handleDrag}\n >\n <slot name=\"divider\"></slot>\n </div>\n\n <slot name=\"end\" part=\"panel end\" class=\"end\"></slot>\n `;\n }\n}\n\nexport default NileSplitPanel;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-split-panel': NileSplitPanel;\n }\n}\n"]}
|
@@ -107,7 +107,7 @@ let NileStepper = class NileStepper extends NileElement {
|
|
107
107
|
'nile-stepper': true,
|
108
108
|
'nile-stepper--horizontal': !this.isVertical,
|
109
109
|
'nile-stepper--vertical': this.isVertical
|
110
|
-
})}>
|
110
|
+
})}>
|
111
111
|
<slot
|
112
112
|
@slotchange=${this.updateItems}
|
113
113
|
></slot>
|
@@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mBAEc,IAAI,CAAC,WAAW;;;IAG/B,CAAC;IACJ,CAAC;CAGD,CAAA;AAtGoD;IAAnD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;+CAA6B;AACvB;IAAxD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;iDAA+B;AAChC;IAAtD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;gDAAyB;AACtB;IAAxD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;kDAA2B;AACpC;IAA9C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;yCAAiC;AACnE;IAAX,QAAQ,EAAE;yCAAuB;AAUlC;IADC,KAAK,CAAC,aAAa,CAAC;2DAIpB;AAGD;IADC,KAAK,CAAC,eAAe,CAAC;6DAItB;AA1BW,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAwGvB;SAxGY,WAAW;AA0GxB,eAAe,WAAW,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html, property, CSSResultArray, TemplateResult } from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-stepper.css';\nimport NileElement from '../internal/nile-element';\nimport { watch } from '../internal/watch';\nimport { classMap } from 'lit/directives/class-map.js';\n\n\n/**\n * Nile stepper component.\n *\n * @tag nile-stepper\n *\n */\n@customElement('nile-stepper')\nexport class NileStepper extends NileElement {\n\n\t@property({ type: Boolean, attribute: 'vertical' }) isVertical: boolean = false;\n\t@property({ type: Boolean, attribute: 'content-below' }) contentBelow: boolean = false;\n\t@property({ type: Number, attribute: 'current-step' }) currentStep: number = 0;\n\t@property({ type: Number, attribute: 'completed-step' }) completedStep: number = 0;\n\t@property({ type: String, attribute: 'size' }) size: 'sm' | 'md' | 'lg' = 'md';\n\t@property() icon: string = 'tick';\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis.updateComplete.then(() => {\n\t\t\tthis.updateItems();\n\t\t});\n\t}\n\n\t@watch('currentStep')\n\thandleCurrentStepChanges() {\n\t\tthis.updateItems();\n\t\tthis.emit('nile-current-change', { value: this.currentStep });\n\t}\n\n\t@watch('completedStep')\n\thandleCompletedStepChanges() {\n\t\tthis.updateItems()\n\t\tthis.emit('nile-completed-change', { value: this.completedStep });\n\t}\n\n\tprivate updateItems() {\n\t\tconst items: any = [...this.querySelectorAll(this.isVertical?'nile-vertical-stepper-item':'nile-stepper-item')];\n\t\tif (!items.length) return;\n\t\tconst haveFlex = items.length < 3;\n\n\t\tconst current = (this.currentStep == 0 || this.currentStep > items.length) ? 1 : this.currentStep;\n\t\tconst calculatedCompleted = this.completedStep > items.length ? current : this.completedStep < current ? current : this.completedStep;\n\t\tconst completed = this.completedStep > items.length ? 0 : this.completedStep;\n\n\t\titems.forEach((el: any, index: number) => {\n\t\t\t// set item is complete and is current values\n\t\t\tif (index + 1 < current) {\n\t\t\t\tel.isComplete = true;\n\t\t\t\tel.isCurrent = false;\n\t\t\t}\n\t\t\telse if (index + 1 == current) {\n\t\t\t\tif (index + 1 <= calculatedCompleted) el.isComplete = true;\n\t\t\t\telse el.isComplete = false;\n\t\t\t\tel.isCurrent = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (index + 1 <= calculatedCompleted) el.isComplete = true;\n\t\t\t\telse el.isComplete = false;\n\t\t\t\tel.isCurrent = false;\n\t\t\t}\n\n\t\t\t// Set isLast and isFirst\n\t\t\tif (index == 0) el.isFirst = true;\n\t\t\tif (index == items.length - 1) el.isLast = true;\n\n\t\t\t// setting default values\n\t\t\tel.currentStepValue = current;\n\t\t\tel.calculatedCompletedStepValue = calculatedCompleted;\n\t\t\tel.completedStepValue = completed;\n\n\t\t\tel.icon = this.icon;\n\t\t\tel.size = this.size;\n\t\t\tel.value = index + 1;\n\t\t\tel.contentBelow = this.contentBelow\n\t\t\tif (index == 0 || index == items.length - 1) {\n\t\t\t\tel.haveFlex = haveFlex;\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * The styles for nile-stepper\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\n\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\treturn html`\n\t\t\t<div class=${classMap({\n\t\t\t\t'nile-stepper':true,\n\t\t\t\t'nile-stepper--horizontal':!this.isVertical,\n\t\t\t\t'nile-stepper--vertical':this.isVertical\n\t\t\t})}
|
1
|
+
{"version":3,"file":"nile-stepper.js","sourceRoot":"","sources":["../../../src/nile-stepper/nile-stepper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAc,IAAI,EAAE,QAAQ,EAAkC,MAAM,aAAa,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAGvD;;;;;GAKG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,WAAW;IAArC;;QAE8C,eAAU,GAAY,KAAK,CAAC;QACvB,iBAAY,GAAY,KAAK,CAAC;QAChC,gBAAW,GAAW,CAAC,CAAC;QACtB,kBAAa,GAAW,CAAC,CAAC;QACpC,SAAI,GAAuB,IAA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CAAC;6DAItB;AA1BW,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAwGvB;SAxGY,WAAW;AA0GxB,eAAe,WAAW,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html, property, CSSResultArray, TemplateResult } from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-stepper.css';\nimport NileElement from '../internal/nile-element';\nimport { watch } from '../internal/watch';\nimport { classMap } from 'lit/directives/class-map.js';\n\n\n/**\n * Nile stepper component.\n *\n * @tag nile-stepper\n *\n */\n@customElement('nile-stepper')\nexport class NileStepper extends NileElement {\n\n\t@property({ type: Boolean, attribute: 'vertical' }) isVertical: boolean = false;\n\t@property({ type: Boolean, attribute: 'content-below' }) contentBelow: boolean = false;\n\t@property({ type: Number, attribute: 'current-step' }) currentStep: number = 0;\n\t@property({ type: Number, attribute: 'completed-step' }) completedStep: number = 0;\n\t@property({ type: String, attribute: 'size' }) size: 'sm' | 'md' | 'lg' = 'md';\n\t@property() icon: string = 'tick';\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis.updateComplete.then(() => {\n\t\t\tthis.updateItems();\n\t\t});\n\t}\n\n\t@watch('currentStep')\n\thandleCurrentStepChanges() {\n\t\tthis.updateItems();\n\t\tthis.emit('nile-current-change', { value: this.currentStep });\n\t}\n\n\t@watch('completedStep')\n\thandleCompletedStepChanges() {\n\t\tthis.updateItems()\n\t\tthis.emit('nile-completed-change', { value: this.completedStep });\n\t}\n\n\tprivate updateItems() {\n\t\tconst items: any = [...this.querySelectorAll(this.isVertical?'nile-vertical-stepper-item':'nile-stepper-item')];\n\t\tif (!items.length) return;\n\t\tconst haveFlex = items.length < 3;\n\n\t\tconst current = (this.currentStep == 0 || this.currentStep > items.length) ? 1 : this.currentStep;\n\t\tconst calculatedCompleted = this.completedStep > items.length ? current : this.completedStep < current ? current : this.completedStep;\n\t\tconst completed = this.completedStep > items.length ? 0 : this.completedStep;\n\n\t\titems.forEach((el: any, index: number) => {\n\t\t\t// set item is complete and is current values\n\t\t\tif (index + 1 < current) {\n\t\t\t\tel.isComplete = true;\n\t\t\t\tel.isCurrent = false;\n\t\t\t}\n\t\t\telse if (index + 1 == current) {\n\t\t\t\tif (index + 1 <= calculatedCompleted) el.isComplete = true;\n\t\t\t\telse el.isComplete = false;\n\t\t\t\tel.isCurrent = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (index + 1 <= calculatedCompleted) el.isComplete = true;\n\t\t\t\telse el.isComplete = false;\n\t\t\t\tel.isCurrent = false;\n\t\t\t}\n\n\t\t\t// Set isLast and isFirst\n\t\t\tif (index == 0) el.isFirst = true;\n\t\t\tif (index == items.length - 1) el.isLast = true;\n\n\t\t\t// setting default values\n\t\t\tel.currentStepValue = current;\n\t\t\tel.calculatedCompletedStepValue = calculatedCompleted;\n\t\t\tel.completedStepValue = completed;\n\n\t\t\tel.icon = this.icon;\n\t\t\tel.size = this.size;\n\t\t\tel.value = index + 1;\n\t\t\tel.contentBelow = this.contentBelow\n\t\t\tif (index == 0 || index == items.length - 1) {\n\t\t\t\tel.haveFlex = haveFlex;\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * The styles for nile-stepper\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\n\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\treturn html`\n\t\t\t<div class=${classMap({\n\t\t\t\t'nile-stepper':true,\n\t\t\t\t'nile-stepper--horizontal':!this.isVertical,\n\t\t\t\t'nile-stepper--vertical':this.isVertical\n\t\t\t})}>\n\t\t\t\t<slot\n\t\t\t\t\t@slotchange=${this.updateItems}\n\t\t\t\t></slot>\n\t\t\t</div>\n\t\t\t`;\n\t}\n\n\t/* #endregion */\n}\n\nexport default NileStepper;\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'nile-stepper': NileStepper;\n\t}\n}\n"]}
|
File without changes
|
@@ -0,0 +1,165 @@
|
|
1
|
+
"use strict";
|
2
|
+
// import { fixture, expect, html } from "@open-wc/testing"
|
3
|
+
// import './nile-stepper';
|
4
|
+
// import { NileStepper } from "./nile-stepper";
|
5
|
+
// import { NileStepperItem } from "../nile-stepper-item";
|
6
|
+
// import { NileVerticalStepperItem } from "../nile-vertical-stepper-item";
|
7
|
+
// describe('NileStepper', () => {
|
8
|
+
// it('should have default properties in NileStepper', async () => {
|
9
|
+
// const stepper = await fixture<NileStepper>(html`<nile-stepper></nile-stepper>`);
|
10
|
+
// expect(stepper.isVertical).to.be.false;
|
11
|
+
// expect(stepper.contentBelow).to.be.false;
|
12
|
+
// expect(stepper.currentStep).to.equal(0);
|
13
|
+
// expect(stepper.completedStep).to.equal(0);
|
14
|
+
// expect(stepper.size).to.equal('md');
|
15
|
+
// expect(stepper.icon).to.equal('tick');
|
16
|
+
// });
|
17
|
+
// it('should reflect properties to attributes in NileStepper', async () => {
|
18
|
+
// const stepper = await fixture<NileStepper>(html`
|
19
|
+
// <nile-stepper vertical contentBelow current-step="1" completed-step="2" size="lg" icon="check"></nile-stepper>
|
20
|
+
// `);
|
21
|
+
// expect(stepper.getAttribute('vertical')).to.equal('');
|
22
|
+
// expect(stepper.getAttribute('contentBelow')).to.equal('');
|
23
|
+
// expect(stepper.getAttribute('current-step')).to.equal('1');
|
24
|
+
// expect(stepper.getAttribute('completed-step')).to.equal('2');
|
25
|
+
// expect(stepper.getAttribute('size')).to.equal('lg');
|
26
|
+
// expect(stepper.getAttribute('icon')).to.equal('check');
|
27
|
+
// });
|
28
|
+
// it('should render vertical stepper correctly', async () => {
|
29
|
+
// const stepper = await fixture<NileStepper>(html`
|
30
|
+
// <nile-stepper vertical>
|
31
|
+
// <nile-vertical-stepper-item></nile-vertical-stepper-item>
|
32
|
+
// <nile-vertical-stepper-item></nile-vertical-stepper-item>
|
33
|
+
// </nile-stepper>
|
34
|
+
// `);
|
35
|
+
// const container = stepper.shadowRoot!.querySelector('.nile-stepper')!;
|
36
|
+
// expect(container.classList.contains('nile-stepper--vertical')).to.be.true;
|
37
|
+
// });
|
38
|
+
// it('should update NileStepperItems when NileStepper properties change', async () => {
|
39
|
+
// const stepper = await fixture<NileStepper>(html`
|
40
|
+
// <nile-stepper>
|
41
|
+
// <nile-stepper-item></nile-stepper-item>
|
42
|
+
// <nile-stepper-item></nile-stepper-item>
|
43
|
+
// <nile-stepper-item></nile-stepper-item>
|
44
|
+
// </nile-stepper>
|
45
|
+
// `);
|
46
|
+
// stepper.currentStep = 2;
|
47
|
+
// stepper.completedStep = 3;
|
48
|
+
// await stepper.updateComplete;
|
49
|
+
// const items = stepper.querySelectorAll('nile-stepper-item');
|
50
|
+
// expect(items[0].isComplete).to.be.true;
|
51
|
+
// expect(items[1].isCurrent).to.be.true;
|
52
|
+
// expect(items[2].isComplete).to.be.true;
|
53
|
+
// });
|
54
|
+
// it('should render stepper with content below items correctly', async () => {
|
55
|
+
// const stepper = await fixture<NileStepper>(html`
|
56
|
+
// <nile-stepper content-below>
|
57
|
+
// <nile-stepper-item title="Step 1" subtitle="Subtitle 1"></nile-stepper-item>
|
58
|
+
// <nile-stepper-item title="Step 2" subtitle="Subtitle 2"></nile-stepper-item>
|
59
|
+
// </nile-stepper>
|
60
|
+
// `);
|
61
|
+
// const items = stepper.querySelectorAll('nile-stepper-item');
|
62
|
+
// expect(items[0].contentBelow).to.be.true;
|
63
|
+
// expect(items[1].contentBelow).to.be.true;
|
64
|
+
// });
|
65
|
+
// // CUSTOM ICONS NOT SUPPORTED YET IGNORE TEST CASE
|
66
|
+
// // it('should render stepper items with correct icons', async () => {
|
67
|
+
// // const stepper = await fixture<NileStepper>(html`
|
68
|
+
// // <nile-stepper icon="star">
|
69
|
+
// // <nile-stepper-item></nile-stepper-item>
|
70
|
+
// // <nile-stepper-item></nile-stepper-item>
|
71
|
+
// // </nile-stepper>
|
72
|
+
// // `);
|
73
|
+
// // const items = stepper.querySelectorAll('nile-stepper-item');
|
74
|
+
// // expect(items[0].icon).to.equal('star');
|
75
|
+
// // expect(items[1].icon).to.equal('star');
|
76
|
+
// // });
|
77
|
+
// it('should emit events when currentStep changes', async () => {
|
78
|
+
// const stepper = await fixture<NileStepper>(html`
|
79
|
+
// <nile-stepper current-step="1" completed-step="4">
|
80
|
+
// <nile-stepper-item></nile-stepper-item>
|
81
|
+
// <nile-stepper-item></nile-stepper-item>
|
82
|
+
// <nile-stepper-item></nile-stepper-item>
|
83
|
+
// <nile-stepper-item></nile-stepper-item>
|
84
|
+
// </nile-stepper>
|
85
|
+
// `);
|
86
|
+
// const items = stepper.querySelectorAll('nile-stepper-item');
|
87
|
+
// let currentChangeEvent: CustomEvent | null = null;
|
88
|
+
// stepper.addEventListener('nile-current-change', (event) => {
|
89
|
+
// currentChangeEvent = event as CustomEvent;
|
90
|
+
// });
|
91
|
+
// stepper.currentStep = 2;
|
92
|
+
// await stepper.updateComplete;
|
93
|
+
// expect(currentChangeEvent).to.exist;
|
94
|
+
// expect(currentChangeEvent!.detail.value).to.equal(2);
|
95
|
+
// expect(items[1].isCurrent).to.equal(true);
|
96
|
+
// expect(items[0].isComplete).to.equal(true);
|
97
|
+
// });
|
98
|
+
// it('should emit events when completedStep changes', async () => {
|
99
|
+
// const stepper = await fixture<NileStepper>(html`
|
100
|
+
// <nile-stepper completed-step="1"></nile-stepper>
|
101
|
+
// `);
|
102
|
+
// let completedChangeEvent: CustomEvent | null = null;
|
103
|
+
// stepper.addEventListener('nile-completed-change', (event) => {
|
104
|
+
// completedChangeEvent = event as CustomEvent;
|
105
|
+
// });
|
106
|
+
// stepper.completedStep = 2;
|
107
|
+
// await stepper.updateComplete;
|
108
|
+
// expect(completedChangeEvent).to.exist;
|
109
|
+
// expect(completedChangeEvent!.detail.value).to.equal(2);
|
110
|
+
// });
|
111
|
+
// it('should render slot content inside stepper', async () => {
|
112
|
+
// const stepper = await fixture<NileStepper>(html`
|
113
|
+
// <nile-stepper current-step="2">
|
114
|
+
// <nile-stepper-item title="Step 1"></nile-stepper-item>
|
115
|
+
// <nile-stepper-item title="Step 2"></nile-stepper-item>
|
116
|
+
// </nile-stepper>
|
117
|
+
// `);
|
118
|
+
// const items = stepper.querySelectorAll('nile-stepper-item');
|
119
|
+
// expect(items.length).to.equal(2);
|
120
|
+
// expect(items[0].title).to.equal('Step 1');
|
121
|
+
// expect(items[1].title).to.equal('Step 2');
|
122
|
+
// expect(items[1].isCurrent).to.equal(true);
|
123
|
+
// });
|
124
|
+
// })
|
125
|
+
// describe('NileVerticalStepperItem', () => {
|
126
|
+
// it('should render vertical stepper correctly', async () => {
|
127
|
+
// const stepper = await fixture<NileStepper>(html`
|
128
|
+
// <nile-stepper vertical>
|
129
|
+
// <nile-stepper-item></nile-stepper-item>
|
130
|
+
// <nile-stepper-item></nile-stepper-item>
|
131
|
+
// </nile-stepper>
|
132
|
+
// `);
|
133
|
+
// const container = stepper.shadowRoot!.querySelector('.nile-stepper')!;
|
134
|
+
// expect(container.classList.contains('nile-stepper--vertical')).to.be.true;
|
135
|
+
// });
|
136
|
+
// it('should update NileVerticalStepperItems when NileStepper properties change', async () => {
|
137
|
+
// const stepper = await fixture<NileStepper>(html`
|
138
|
+
// <nile-stepper vertical>
|
139
|
+
// <nile-vertical-stepper-item></nile-vertical-stepper-item>
|
140
|
+
// <nile-vertical-stepper-item></nile-vertical-stepper-item>
|
141
|
+
// <nile-vertical-stepper-item></nile-vertical-stepper-item>
|
142
|
+
// </nile-stepper>
|
143
|
+
// `);
|
144
|
+
// stepper.currentStep = 2;
|
145
|
+
// stepper.completedStep = 3;
|
146
|
+
// await stepper.updateComplete;
|
147
|
+
// const items = stepper.querySelectorAll('nile-vertical-stepper-item');
|
148
|
+
// expect(items[0].isComplete).to.be.true;
|
149
|
+
// expect(items[1].isCurrent).to.be.true;
|
150
|
+
// expect(items[2].isComplete).to.be.true;
|
151
|
+
// });
|
152
|
+
// it('should render slot content inside vertical stepper', async () => {
|
153
|
+
// const stepper = await fixture<NileStepper>(html`
|
154
|
+
// <nile-stepper vertical>
|
155
|
+
// <nile-vertical-stepper-item title="Step 1"></nile-vertical-stepper-item>
|
156
|
+
// <nile-vertical-stepper-item title="Step 2"></nile-vertical-stepper-item>
|
157
|
+
// </nile-stepper>
|
158
|
+
// `);
|
159
|
+
// const items = stepper.querySelectorAll('nile-vertical-stepper-item');
|
160
|
+
// expect(items.length).to.equal(2);
|
161
|
+
// expect(items[0].title).to.equal('Step 1');
|
162
|
+
// expect(items[1].title).to.equal('Step 2');
|
163
|
+
// });
|
164
|
+
// })
|
165
|
+
//# sourceMappingURL=nile-stepper.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"nile-stepper.test.js","sourceRoot":"","sources":["../../../src/nile-stepper/nile-stepper.test.ts"],"names":[],"mappings":";AAAA,2DAA2D;AAC3D,2BAA2B;AAC3B,gDAAgD;AAChD,0DAA0D;AAC1D,2EAA2E;AAC3E,kCAAkC;AAClC,wEAAwE;AACxE,2FAA2F;AAC3F,kDAAkD;AAClD,oDAAoD;AACpD,mDAAmD;AACnD,qDAAqD;AACrD,+CAA+C;AAC/C,iDAAiD;AACjD,UAAU;AAEV,iFAAiF;AACjF,2DAA2D;AAC3D,yHAAyH;AACzH,UAAU;AACV,iEAAiE;AACjE,qEAAqE;AACrE,sEAAsE;AACtE,wEAAwE;AACxE,+DAA+D;AAC/D,kEAAkE;AAClE,UAAU;AAEV,mEAAmE;AACnE,2DAA2D;AAC3D,kCAAkC;AAClC,wEAAwE;AACxE,wEAAwE;AACxE,0BAA0B;AAC1B,cAAc;AACd,iFAAiF;AACjF,qFAAqF;AACrF,UAAU;AAEV,4FAA4F;AAC5F,2DAA2D;AAC3D,yBAAyB;AACzB,kDAAkD;AAClD,kD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,kDAAkD;AAClD,kDAAkD;AAClD,0BAA0B;AAC1B,UAAU;AACV,iFAAiF;AACjF,qFAAqF;AACrF,UAAU;AAEV,oGAAoG;AACpG,2DAA2D;AAC3D,oCAAoC;AACpC,wEAAwE;AACxE,wEAAwE;AACxE,wEAAwE;AACxE,4BAA4B;AAC5B,cAAc;AACd,mCAAmC;AACnC,qCAAqC;AACrC,wCAAwC;AACxC,gFAAgF;AAChF,kDAAkD;AAClD,iDAAiD;AACjD,kDAAkD;AAClD,UAAU;AAEV,6EAA6E;AAC7E,2DAA2D;AAC3D,oCAAoC;AACpC,uFAAuF;AACvF,uFAAuF;AACvF,4BAA4B;AAC5B,cAAc;AACd,gFAAgF;AAChF,4CAA4C;AAC5C,qDAAqD;AACrD,qDAAqD;AACrD,UAAU;AACV,KAAK","sourcesContent":["// import { fixture, expect, html } from \"@open-wc/testing\"\n// import './nile-stepper';\n// import { NileStepper } from \"./nile-stepper\";\n// import { NileStepperItem } from \"../nile-stepper-item\";\n// import { NileVerticalStepperItem } from \"../nile-vertical-stepper-item\";\n// describe('NileStepper', () => {\n// it('should have default properties in NileStepper', async () => {\n// const stepper = await fixture<NileStepper>(html`<nile-stepper></nile-stepper>`);\n// expect(stepper.isVertical).to.be.false;\n// expect(stepper.contentBelow).to.be.false;\n// expect(stepper.currentStep).to.equal(0);\n// expect(stepper.completedStep).to.equal(0);\n// expect(stepper.size).to.equal('md');\n// expect(stepper.icon).to.equal('tick');\n// });\n\n// it('should reflect properties to attributes in NileStepper', async () => {\n// const stepper = await fixture<NileStepper>(html`\n// <nile-stepper vertical contentBelow current-step=\"1\" completed-step=\"2\" size=\"lg\" icon=\"check\"></nile-stepper>\n// `);\n// expect(stepper.getAttribute('vertical')).to.equal('');\n// expect(stepper.getAttribute('contentBelow')).to.equal('');\n// expect(stepper.getAttribute('current-step')).to.equal('1');\n// expect(stepper.getAttribute('completed-step')).to.equal('2');\n// expect(stepper.getAttribute('size')).to.equal('lg');\n// expect(stepper.getAttribute('icon')).to.equal('check');\n// });\n\n// it('should render vertical stepper correctly', async () => {\n// const stepper = await fixture<NileStepper>(html`\n// <nile-stepper vertical>\n// <nile-vertical-stepper-item></nile-vertical-stepper-item>\n// <nile-vertical-stepper-item></nile-vertical-stepper-item>\n// </nile-stepper>\n// `);\n// const container = stepper.shadowRoot!.querySelector('.nile-stepper')!;\n// expect(container.classList.contains('nile-stepper--vertical')).to.be.true;\n// });\n\n// it('should update NileStepperItems when NileStepper properties change', async () => {\n// const stepper = await fixture<NileStepper>(html`\n// <nile-stepper>\n// <nile-stepper-item></nile-stepper-item>\n// <nile-stepper-item></nile-stepper-item>\n// <nile-stepper-item></nile-stepper-item>\n// </nile-stepper>\n// `);\n// stepper.currentStep = 2;\n// stepper.completedStep = 3;\n// await stepper.updateComplete;\n// const items = stepper.querySelectorAll('nile-stepper-item');\n// expect(items[0].isComplete).to.be.true;\n// expect(items[1].isCurrent).to.be.true;\n// expect(items[2].isComplete).to.be.true;\n// });\n\n// it('should render stepper with content below items correctly', async () => {\n// const stepper = await fixture<NileStepper>(html`\n// <nile-stepper content-below>\n// <nile-stepper-item title=\"Step 1\" subtitle=\"Subtitle 1\"></nile-stepper-item>\n// <nile-stepper-item title=\"Step 2\" subtitle=\"Subtitle 2\"></nile-stepper-item>\n// </nile-stepper>\n// `);\n// const items = stepper.querySelectorAll('nile-stepper-item');\n// expect(items[0].contentBelow).to.be.true;\n// expect(items[1].contentBelow).to.be.true;\n// });\n\n// // CUSTOM ICONS NOT SUPPORTED YET IGNORE TEST CASE\n// // it('should render stepper items with correct icons', async () => {\n// // const stepper = await fixture<NileStepper>(html`\n// // <nile-stepper icon=\"star\">\n// // <nile-stepper-item></nile-stepper-item>\n// // <nile-stepper-item></nile-stepper-item>\n// // </nile-stepper>\n// // `);\n// // const items = stepper.querySelectorAll('nile-stepper-item');\n// // expect(items[0].icon).to.equal('star');\n// // expect(items[1].icon).to.equal('star');\n// // });\n\n// it('should emit events when currentStep changes', async () => {\n// const stepper = await fixture<NileStepper>(html`\n// <nile-stepper current-step=\"1\" completed-step=\"4\">\n// <nile-stepper-item></nile-stepper-item>\n// <nile-stepper-item></nile-stepper-item>\n// <nile-stepper-item></nile-stepper-item>\n// <nile-stepper-item></nile-stepper-item>\n// </nile-stepper>\n// `);\n// const items = stepper.querySelectorAll('nile-stepper-item');\n// let currentChangeEvent: CustomEvent | null = null;\n// stepper.addEventListener('nile-current-change', (event) => {\n// currentChangeEvent = event as CustomEvent;\n// });\n// stepper.currentStep = 2;\n// await stepper.updateComplete;\n// expect(currentChangeEvent).to.exist;\n// expect(currentChangeEvent!.detail.value).to.equal(2);\n// expect(items[1].isCurrent).to.equal(true);\n// expect(items[0].isComplete).to.equal(true);\n// });\n\n// it('should emit events when completedStep changes', async () => {\n// const stepper = await fixture<NileStepper>(html`\n// <nile-stepper completed-step=\"1\"></nile-stepper>\n// `);\n// let completedChangeEvent: CustomEvent | null = null;\n// stepper.addEventListener('nile-completed-change', (event) => {\n// completedChangeEvent = event as CustomEvent;\n// });\n// stepper.completedStep = 2;\n// await stepper.updateComplete;\n// expect(completedChangeEvent).to.exist;\n// expect(completedChangeEvent!.detail.value).to.equal(2);\n// });\n\n// it('should render slot content inside stepper', async () => {\n// const stepper = await fixture<NileStepper>(html`\n// <nile-stepper current-step=\"2\">\n// <nile-stepper-item title=\"Step 1\"></nile-stepper-item>\n// <nile-stepper-item title=\"Step 2\"></nile-stepper-item>\n// </nile-stepper>\n// `);\n// const items = stepper.querySelectorAll('nile-stepper-item');\n// expect(items.length).to.equal(2);\n// expect(items[0].title).to.equal('Step 1');\n// expect(items[1].title).to.equal('Step 2');\n// expect(items[1].isCurrent).to.equal(true);\n// });\n// })\n\n// describe('NileVerticalStepperItem', () => {\n// it('should render vertical stepper correctly', async () => {\n// const stepper = await fixture<NileStepper>(html`\n// <nile-stepper vertical>\n// <nile-stepper-item></nile-stepper-item>\n// <nile-stepper-item></nile-stepper-item>\n// </nile-stepper>\n// `);\n// const container = stepper.shadowRoot!.querySelector('.nile-stepper')!;\n// expect(container.classList.contains('nile-stepper--vertical')).to.be.true;\n// });\n\n// it('should update NileVerticalStepperItems when NileStepper properties change', async () => {\n// const stepper = await fixture<NileStepper>(html`\n// <nile-stepper vertical>\n// <nile-vertical-stepper-item></nile-vertical-stepper-item>\n// <nile-vertical-stepper-item></nile-vertical-stepper-item>\n// <nile-vertical-stepper-item></nile-vertical-stepper-item>\n// </nile-stepper>\n// `);\n// stepper.currentStep = 2;\n// stepper.completedStep = 3;\n// await stepper.updateComplete;\n// const items = stepper.querySelectorAll('nile-vertical-stepper-item');\n// expect(items[0].isComplete).to.be.true;\n// expect(items[1].isCurrent).to.be.true;\n// expect(items[2].isComplete).to.be.true;\n// });\n\n// it('should render slot content inside vertical stepper', async () => {\n// const stepper = await fixture<NileStepper>(html`\n// <nile-stepper vertical>\n// <nile-vertical-stepper-item title=\"Step 1\"></nile-vertical-stepper-item>\n// <nile-vertical-stepper-item title=\"Step 2\"></nile-vertical-stepper-item>\n// </nile-stepper>\n// `);\n// const items = stepper.querySelectorAll('nile-vertical-stepper-item');\n// expect(items.length).to.equal(2);\n// expect(items[0].title).to.equal('Step 1');\n// expect(items[1].title).to.equal('Step 2');\n// });\n// })\n"]}
|
@@ -112,11 +112,11 @@ export const styles = css `
|
|
112
112
|
position: relative;
|
113
113
|
flex-direction: row;
|
114
114
|
border-bottom: solid var(--track-width)
|
115
|
-
var(--nile-colors-gray-light-mode-200);
|
115
|
+
var(--nile-colors-gray-light-mode-200,#eaecf0);
|
116
116
|
}
|
117
117
|
|
118
118
|
.tab-group--top .tab-group__indicator {
|
119
|
-
bottom: 2px;
|
119
|
+
bottom: -2px;
|
120
120
|
border-bottom: 2px solid var(--nile-colors-primary-600);
|
121
121
|
}
|
122
122
|
|