snice 2.1.5 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/snice-accordion-item.d.ts +25 -0
- package/dist/components/accordion/snice-accordion-item.js +255 -0
- package/dist/components/accordion/snice-accordion-item.js.map +1 -0
- package/dist/components/accordion/snice-accordion.d.ts +28 -0
- package/dist/components/accordion/snice-accordion.js +206 -0
- package/dist/components/accordion/snice-accordion.js.map +1 -0
- package/dist/components/accordion/snice-accordion.types.d.ts +29 -0
- package/dist/components/alert/snice-alert.d.ts +26 -0
- package/dist/components/alert/snice-alert.js +180 -0
- package/dist/components/alert/snice-alert.js.map +1 -0
- package/{components/alert/snice-alert.types.ts → dist/components/alert/snice-alert.types.d.ts} +8 -9
- package/dist/components/avatar/snice-avatar.d.ts +24 -0
- package/dist/components/avatar/snice-avatar.js +180 -0
- package/dist/components/avatar/snice-avatar.js.map +1 -0
- package/dist/components/avatar/snice-avatar.types.d.ts +12 -0
- package/dist/components/badge/snice-badge.d.ts +25 -0
- package/dist/components/badge/snice-badge.js +169 -0
- package/dist/components/badge/snice-badge.js.map +1 -0
- package/{components/badge/snice-badge.types.ts → dist/components/badge/snice-badge.types.d.ts} +11 -12
- package/dist/components/breadcrumbs/snice-breadcrumbs.d.ts +27 -0
- package/dist/components/breadcrumbs/snice-breadcrumbs.js +214 -0
- package/dist/components/breadcrumbs/snice-breadcrumbs.js.map +1 -0
- package/dist/components/breadcrumbs/snice-breadcrumbs.types.d.ts +23 -0
- package/dist/components/breadcrumbs/snice-crumb.d.ts +9 -0
- package/dist/components/breadcrumbs/snice-crumb.js +63 -0
- package/dist/components/breadcrumbs/snice-crumb.js.map +1 -0
- package/dist/components/button/snice-button.d.ts +32 -0
- package/dist/components/button/snice-button.js +232 -0
- package/dist/components/button/snice-button.js.map +1 -0
- package/dist/components/button/snice-button.types.d.ts +23 -0
- package/dist/components/card/snice-card.d.ts +19 -0
- package/dist/components/card/snice-card.js +136 -0
- package/dist/components/card/snice-card.js.map +1 -0
- package/{components/card/snice-card.types.ts → dist/components/card/snice-card.types.d.ts} +6 -7
- package/dist/components/checkbox/snice-checkbox.d.ts +34 -0
- package/dist/components/checkbox/snice-checkbox.js +286 -0
- package/dist/components/checkbox/snice-checkbox.js.map +1 -0
- package/dist/components/checkbox/snice-checkbox.types.d.ts +20 -0
- package/dist/components/chip/snice-chip.d.ts +28 -0
- package/dist/components/chip/snice-chip.js +199 -0
- package/dist/components/chip/snice-chip.js.map +1 -0
- package/dist/components/chip/snice-chip.types.d.ts +14 -0
- package/dist/components/date-picker/snice-date-picker.d.ts +82 -0
- package/dist/components/date-picker/snice-date-picker.js +847 -0
- package/dist/components/date-picker/snice-date-picker.js.map +1 -0
- package/dist/components/date-picker/snice-date-picker.types.d.ts +71 -0
- package/dist/components/divider/snice-divider.d.ts +17 -0
- package/dist/components/divider/snice-divider.js +122 -0
- package/dist/components/divider/snice-divider.js.map +1 -0
- package/{components/divider/snice-divider.types.ts → dist/components/divider/snice-divider.types.d.ts} +9 -10
- package/dist/components/drawer/snice-drawer.d.ts +37 -0
- package/dist/components/drawer/snice-drawer.js +337 -0
- package/dist/components/drawer/snice-drawer.js.map +1 -0
- package/dist/components/drawer/snice-drawer.types.d.ts +16 -0
- package/dist/components/input/snice-input.d.ts +65 -0
- package/dist/components/input/snice-input.js +567 -0
- package/dist/components/input/snice-input.js.map +1 -0
- package/dist/components/input/snice-input.types.d.ts +53 -0
- package/dist/components/layout/snice-layout-blog.d.ts +4 -0
- package/dist/components/layout/snice-layout-blog.js +67 -0
- package/dist/components/layout/snice-layout-blog.js.map +1 -0
- package/dist/components/layout/snice-layout-card.d.ts +6 -0
- package/dist/components/layout/snice-layout-card.js +64 -0
- package/dist/components/layout/snice-layout-card.js.map +1 -0
- package/dist/components/layout/snice-layout-centered.d.ts +5 -0
- package/dist/components/layout/snice-layout-centered.js +48 -0
- package/dist/components/layout/snice-layout-centered.js.map +1 -0
- package/dist/components/layout/snice-layout-dashboard.d.ts +4 -0
- package/dist/components/layout/snice-layout-dashboard.js +64 -0
- package/dist/components/layout/snice-layout-dashboard.js.map +1 -0
- package/dist/components/layout/snice-layout-fullscreen.d.ts +5 -0
- package/dist/components/layout/snice-layout-fullscreen.js +60 -0
- package/dist/components/layout/snice-layout-fullscreen.js.map +1 -0
- package/dist/components/layout/snice-layout-landing.d.ts +4 -0
- package/dist/components/layout/snice-layout-landing.js +66 -0
- package/dist/components/layout/snice-layout-landing.js.map +1 -0
- package/dist/components/layout/snice-layout-minimal.d.ts +4 -0
- package/dist/components/layout/snice-layout-minimal.js +38 -0
- package/dist/components/layout/snice-layout-minimal.js.map +1 -0
- package/dist/components/layout/snice-layout-sidebar.d.ts +5 -0
- package/dist/components/layout/snice-layout-sidebar.js +74 -0
- package/dist/components/layout/snice-layout-sidebar.js.map +1 -0
- package/dist/components/layout/snice-layout-split.d.ts +6 -0
- package/dist/components/layout/snice-layout-split.js +58 -0
- package/dist/components/layout/snice-layout-split.js.map +1 -0
- package/dist/components/layout/snice-layout.d.ts +4 -0
- package/dist/components/layout/snice-layout.js +54 -0
- package/dist/components/layout/snice-layout.js.map +1 -0
- package/{components/layout/snice-layout.types.ts → dist/components/layout/snice-layout.types.d.ts} +1 -3
- package/dist/components/login/snice-login.d.ts +44 -0
- package/dist/components/login/snice-login.js +382 -0
- package/dist/components/login/snice-login.js.map +1 -0
- package/dist/components/login/snice-login.types.d.ts +26 -0
- package/dist/components/modal/snice-modal.d.ts +32 -0
- package/dist/components/modal/snice-modal.js +280 -0
- package/dist/components/modal/snice-modal.js.map +1 -0
- package/dist/components/modal/snice-modal.types.d.ts +18 -0
- package/dist/components/pagination/snice-pagination.d.ts +26 -0
- package/dist/components/pagination/snice-pagination.js +373 -0
- package/dist/components/pagination/snice-pagination.js.map +1 -0
- package/dist/components/pagination/snice-pagination.types.d.ts +18 -0
- package/dist/components/progress/snice-progress.d.ts +35 -0
- package/dist/components/progress/snice-progress.js +305 -0
- package/dist/components/progress/snice-progress.js.map +1 -0
- package/dist/components/progress/snice-progress.types.d.ts +18 -0
- package/dist/components/radio/snice-radio.d.ts +33 -0
- package/dist/components/radio/snice-radio.js +279 -0
- package/dist/components/radio/snice-radio.js.map +1 -0
- package/dist/components/radio/snice-radio.types.d.ts +19 -0
- package/dist/components/select/snice-option.d.ts +17 -0
- package/dist/components/select/snice-option.js +88 -0
- package/dist/components/select/snice-option.js.map +1 -0
- package/{components/select/snice-option.types.ts → dist/components/select/snice-option.types.d.ts} +8 -8
- package/dist/components/select/snice-select.d.ts +89 -0
- package/dist/components/select/snice-select.js +864 -0
- package/dist/components/select/snice-select.js.map +1 -0
- package/dist/components/select/snice-select.types.d.ts +49 -0
- package/dist/components/skeleton/snice-skeleton.d.ts +16 -0
- package/dist/components/skeleton/snice-skeleton.js +166 -0
- package/dist/components/skeleton/snice-skeleton.js.map +1 -0
- package/{components/skeleton/snice-skeleton.types.ts → dist/components/skeleton/snice-skeleton.types.d.ts} +7 -8
- package/dist/components/snice-cell-C8aBfN72.js +4 -0
- package/dist/components/snice-cell-C8aBfN72.js.map +1 -0
- package/dist/components/switch/snice-switch.d.ts +38 -0
- package/dist/components/switch/snice-switch.js +305 -0
- package/dist/components/switch/snice-switch.js.map +1 -0
- package/dist/components/switch/snice-switch.types.d.ts +21 -0
- package/dist/components/symbols.d.ts +1 -0
- package/dist/components/symbols.js +22 -0
- package/dist/components/symbols.js.map +1 -0
- package/dist/components/table/snice-cell-boolean.d.ts +21 -0
- package/dist/components/table/snice-cell-boolean.js +164 -0
- package/dist/components/table/snice-cell-boolean.js.map +1 -0
- package/dist/components/table/snice-cell-date.d.ts +24 -0
- package/dist/components/table/snice-cell-date.js +253 -0
- package/dist/components/table/snice-cell-date.js.map +1 -0
- package/dist/components/table/snice-cell-duration.d.ts +16 -0
- package/dist/components/table/snice-cell-duration.js +130 -0
- package/dist/components/table/snice-cell-duration.js.map +1 -0
- package/dist/components/table/snice-cell-filesize.d.ts +16 -0
- package/dist/components/table/snice-cell-filesize.js +126 -0
- package/dist/components/table/snice-cell-filesize.js.map +1 -0
- package/dist/components/table/snice-cell-number.d.ts +23 -0
- package/dist/components/table/snice-cell-number.js +215 -0
- package/dist/components/table/snice-cell-number.js.map +1 -0
- package/dist/components/table/snice-cell-progress.d.ts +17 -0
- package/dist/components/table/snice-cell-progress.js +121 -0
- package/dist/components/table/snice-cell-progress.js.map +1 -0
- package/dist/components/table/snice-cell-rating.d.ts +17 -0
- package/dist/components/table/snice-cell-rating.js +120 -0
- package/dist/components/table/snice-cell-rating.js.map +1 -0
- package/dist/components/table/snice-cell-sparkline.d.ts +29 -0
- package/dist/components/table/snice-cell-sparkline.js +306 -0
- package/dist/components/table/snice-cell-sparkline.js.map +1 -0
- package/dist/components/table/snice-cell-text.d.ts +19 -0
- package/dist/components/table/snice-cell-text.js +161 -0
- package/dist/components/table/snice-cell-text.js.map +1 -0
- package/dist/components/table/snice-cell.d.ts +32 -0
- package/dist/components/table/snice-cell.js +458 -0
- package/dist/components/table/snice-cell.js.map +1 -0
- package/dist/components/table/snice-column.d.ts +62 -0
- package/dist/components/table/snice-column.js +506 -0
- package/dist/components/table/snice-column.js.map +1 -0
- package/dist/components/table/snice-header.d.ts +33 -0
- package/dist/components/table/snice-header.js +289 -0
- package/dist/components/table/snice-header.js.map +1 -0
- package/dist/components/table/snice-progress.d.ts +10 -0
- package/dist/components/table/snice-progress.js +105 -0
- package/dist/components/table/snice-progress.js.map +1 -0
- package/dist/components/table/snice-rating.d.ts +9 -0
- package/dist/components/table/snice-rating.js +81 -0
- package/dist/components/table/snice-rating.js.map +1 -0
- package/dist/components/table/snice-row.d.ts +43 -0
- package/dist/components/table/snice-row.js +353 -0
- package/dist/components/table/snice-row.js.map +1 -0
- package/dist/components/table/snice-table.d.ts +69 -0
- package/dist/components/table/snice-table.js +792 -0
- package/dist/components/table/snice-table.js.map +1 -0
- package/dist/components/table/snice-table.types.d.ts +137 -0
- package/dist/components/tabs/snice-tab-panel.d.ts +12 -0
- package/dist/components/tabs/snice-tab-panel.js +87 -0
- package/dist/components/tabs/snice-tab-panel.js.map +1 -0
- package/dist/components/tabs/snice-tab.d.ts +13 -0
- package/dist/components/tabs/snice-tab.js +98 -0
- package/dist/components/tabs/snice-tab.js.map +1 -0
- package/dist/components/tabs/snice-tabs.d.ts +34 -0
- package/dist/components/tabs/snice-tabs.js +375 -0
- package/dist/components/tabs/snice-tabs.js.map +1 -0
- package/dist/components/tabs/snice-tabs.types.d.ts +23 -0
- package/dist/components/toast/snice-toast-container.d.ts +25 -0
- package/dist/components/toast/snice-toast-container.js +252 -0
- package/dist/components/toast/snice-toast-container.js.map +1 -0
- package/dist/components/toast/snice-toast.d.ts +23 -0
- package/dist/components/toast/snice-toast.js +321 -0
- package/dist/components/toast/snice-toast.js.map +1 -0
- package/dist/components/toast/snice-toast.types.d.ts +30 -0
- package/dist/components/tooltip/snice-tooltip.d.ts +50 -0
- package/dist/components/tooltip/snice-tooltip.js +644 -0
- package/dist/components/tooltip/snice-tooltip.js.map +1 -0
- package/dist/components/tooltip/snice-tooltip.types.d.ts +18 -0
- package/dist/components/transitions.d.ts +11 -0
- package/dist/components/transitions.js +72 -0
- package/dist/components/transitions.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.iife.js +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/symbols.esm.js +1 -1
- package/dist/transitions.esm.js +1 -1
- package/package.json +10 -6
- package/components/accordion/demo.html +0 -403
- package/components/accordion/snice-accordion-item.css +0 -85
- package/components/accordion/snice-accordion-item.ts +0 -226
- package/components/accordion/snice-accordion.css +0 -31
- package/components/accordion/snice-accordion.ts +0 -182
- package/components/accordion/snice-accordion.types.ts +0 -32
- package/components/alert/demo.html +0 -445
- package/components/alert/snice-alert.css +0 -195
- package/components/alert/snice-alert.ts +0 -141
- package/components/avatar/demo.html +0 -598
- package/components/avatar/snice-avatar.css +0 -131
- package/components/avatar/snice-avatar.ts +0 -136
- package/components/avatar/snice-avatar.types.ts +0 -13
- package/components/badge/demo.html +0 -523
- package/components/badge/snice-badge.css +0 -161
- package/components/badge/snice-badge.ts +0 -117
- package/components/breadcrumbs/demo.html +0 -404
- package/components/breadcrumbs/snice-breadcrumbs.css +0 -133
- package/components/breadcrumbs/snice-breadcrumbs.ts +0 -191
- package/components/breadcrumbs/snice-breadcrumbs.types.ts +0 -26
- package/components/breadcrumbs/snice-crumb.ts +0 -26
- package/components/button/demo.html +0 -42
- package/components/button/snice-button.css +0 -230
- package/components/button/snice-button.ts +0 -169
- package/components/button/snice-button.types.ts +0 -25
- package/components/card/demo.html +0 -525
- package/components/card/snice-card.css +0 -140
- package/components/card/snice-card.ts +0 -102
- package/components/checkbox/demo.html +0 -253
- package/components/checkbox/snice-checkbox.css +0 -164
- package/components/checkbox/snice-checkbox.ts +0 -223
- package/components/checkbox/snice-checkbox.types.ts +0 -22
- package/components/chip/demo.html +0 -383
- package/components/chip/snice-chip.css +0 -195
- package/components/chip/snice-chip.ts +0 -139
- package/components/chip/snice-chip.types.ts +0 -15
- package/components/date-picker/README.md +0 -233
- package/components/date-picker/demo.html +0 -191
- package/components/date-picker/snice-date-picker.css +0 -330
- package/components/date-picker/snice-date-picker.ts +0 -777
- package/components/date-picker/snice-date-picker.types.ts +0 -83
- package/components/divider/demo.html +0 -233
- package/components/divider/snice-divider.css +0 -155
- package/components/divider/snice-divider.ts +0 -69
- package/components/drawer/demo.html +0 -328
- package/components/drawer/snice-drawer.css +0 -476
- package/components/drawer/snice-drawer.ts +0 -287
- package/components/drawer/snice-drawer.types.ts +0 -17
- package/components/global.d.ts +0 -14
- package/components/input/demo.html +0 -303
- package/components/input/snice-input.css +0 -257
- package/components/input/snice-input.ts +0 -442
- package/components/input/snice-input.types.ts +0 -59
- package/components/input/test.html +0 -77
- package/components/layout/README.md +0 -260
- package/components/layout/demo.html +0 -538
- package/components/layout/snice-layout-blog.css +0 -129
- package/components/layout/snice-layout-blog.ts +0 -48
- package/components/layout/snice-layout-card.css +0 -104
- package/components/layout/snice-layout-card.ts +0 -35
- package/components/layout/snice-layout-centered.css +0 -51
- package/components/layout/snice-layout-centered.ts +0 -22
- package/components/layout/snice-layout-dashboard.css +0 -98
- package/components/layout/snice-layout-dashboard.ts +0 -45
- package/components/layout/snice-layout-fullscreen.css +0 -72
- package/components/layout/snice-layout-fullscreen.ts +0 -34
- package/components/layout/snice-layout-landing.css +0 -92
- package/components/layout/snice-layout-landing.ts +0 -47
- package/components/layout/snice-layout-minimal.css +0 -16
- package/components/layout/snice-layout-minimal.ts +0 -19
- package/components/layout/snice-layout-sidebar.css +0 -117
- package/components/layout/snice-layout-sidebar.ts +0 -48
- package/components/layout/snice-layout-split.css +0 -103
- package/components/layout/snice-layout-split.ts +0 -29
- package/components/layout/snice-layout.css +0 -72
- package/components/layout/snice-layout.ts +0 -35
- package/components/login/demo-auth-controller.ts +0 -185
- package/components/login/demo.html +0 -470
- package/components/login/snice-login.css +0 -204
- package/components/login/snice-login.ts +0 -326
- package/components/login/snice-login.types.ts +0 -29
- package/components/modal/demo.html +0 -291
- package/components/modal/snice-modal.css +0 -203
- package/components/modal/snice-modal.ts +0 -233
- package/components/modal/snice-modal.types.ts +0 -21
- package/components/pagination/demo.html +0 -395
- package/components/pagination/snice-pagination.ts +0 -333
- package/components/pagination/snice-pagination.types.ts +0 -21
- package/components/progress/demo.html +0 -510
- package/components/progress/snice-progress.css +0 -267
- package/components/progress/snice-progress.ts +0 -247
- package/components/progress/snice-progress.types.ts +0 -19
- package/components/radio/demo.html +0 -287
- package/components/radio/snice-radio.css +0 -171
- package/components/radio/snice-radio.ts +0 -218
- package/components/radio/snice-radio.types.ts +0 -21
- package/components/select/demo.html +0 -511
- package/components/select/snice-option.ts +0 -52
- package/components/select/snice-select.css +0 -392
- package/components/select/snice-select.ts +0 -796
- package/components/select/snice-select.types.ts +0 -55
- package/components/skeleton/demo.html +0 -514
- package/components/skeleton/snice-skeleton.css +0 -109
- package/components/skeleton/snice-skeleton.ts +0 -126
- package/components/switch/demo.html +0 -284
- package/components/switch/snice-switch.css +0 -221
- package/components/switch/snice-switch.ts +0 -229
- package/components/switch/snice-switch.types.ts +0 -23
- package/components/symbols.ts +0 -23
- package/components/table/demo-table-controller.ts +0 -100
- package/components/table/demo.html +0 -480
- package/components/table/snice-cell-boolean.ts +0 -112
- package/components/table/snice-cell-date.ts +0 -210
- package/components/table/snice-cell-duration.ts +0 -91
- package/components/table/snice-cell-filesize.ts +0 -90
- package/components/table/snice-cell-number.ts +0 -165
- package/components/table/snice-cell-progress.ts +0 -83
- package/components/table/snice-cell-rating.ts +0 -82
- package/components/table/snice-cell-sparkline.ts +0 -253
- package/components/table/snice-cell-text.ts +0 -125
- package/components/table/snice-cell.css +0 -296
- package/components/table/snice-cell.ts +0 -473
- package/components/table/snice-column.ts +0 -353
- package/components/table/snice-header.css +0 -243
- package/components/table/snice-header.ts +0 -261
- package/components/table/snice-progress.ts +0 -66
- package/components/table/snice-rating.ts +0 -45
- package/components/table/snice-row.css +0 -255
- package/components/table/snice-row.ts +0 -331
- package/components/table/snice-table.css +0 -241
- package/components/table/snice-table.ts +0 -737
- package/components/table/snice-table.types.ts +0 -158
- package/components/tabs/demo.html +0 -487
- package/components/tabs/snice-tab-panel.css +0 -264
- package/components/tabs/snice-tab-panel.ts +0 -47
- package/components/tabs/snice-tab.css +0 -96
- package/components/tabs/snice-tab.ts +0 -65
- package/components/tabs/snice-tabs.css +0 -189
- package/components/tabs/snice-tabs.ts +0 -332
- package/components/tabs/snice-tabs.types.ts +0 -28
- package/components/theme/theme.css +0 -234
- package/components/toast/demo.html +0 -329
- package/components/toast/snice-toast-container.ts +0 -256
- package/components/toast/snice-toast.css +0 -213
- package/components/toast/snice-toast.ts +0 -276
- package/components/toast/snice-toast.types.ts +0 -35
- package/components/tooltip/demo.html +0 -350
- package/components/tooltip/snice-tooltip-portal.css +0 -79
- package/components/tooltip/snice-tooltip.css +0 -117
- package/components/tooltip/snice-tooltip.ts +0 -612
- package/components/tooltip/snice-tooltip.types.ts +0 -32
- package/components/transitions.ts +0 -94
- package/components/tsconfig.json +0 -18
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
import { element, property, query, queryAll, on, watch, ready, dispatch } from 'snice';
|
|
2
|
-
import css from './snice-tabs.css?inline';
|
|
3
|
-
import type { TabsPlacement, SniceTabElement, SniceTabPanelElement, TabChangeDetail, TabSelectDetail } from './snice-tabs.types';
|
|
4
|
-
import { transitions } from '../transitions';
|
|
5
|
-
|
|
6
|
-
@element('snice-tabs')
|
|
7
|
-
export class SniceTabs extends HTMLElement {
|
|
8
|
-
@property({ reflect: true })
|
|
9
|
-
placement: TabsPlacement = 'top';
|
|
10
|
-
|
|
11
|
-
@property({ reflect: true })
|
|
12
|
-
selected = 0;
|
|
13
|
-
|
|
14
|
-
@property({ type: Boolean, reflect: true })
|
|
15
|
-
noScrollControls = false;
|
|
16
|
-
|
|
17
|
-
@property({ reflect: true })
|
|
18
|
-
transition = 'none';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
@query('.tabs__nav')
|
|
23
|
-
nav?: HTMLElement;
|
|
24
|
-
|
|
25
|
-
@query('.tabs__nav-track')
|
|
26
|
-
navTrack?: HTMLElement;
|
|
27
|
-
|
|
28
|
-
@query('.tabs__indicator')
|
|
29
|
-
indicator?: HTMLElement;
|
|
30
|
-
|
|
31
|
-
@query('.tabs__scroll-button--start')
|
|
32
|
-
scrollButtonStart?: HTMLButtonElement;
|
|
33
|
-
|
|
34
|
-
@query('.tabs__scroll-button--end')
|
|
35
|
-
scrollButtonEnd?: HTMLButtonElement;
|
|
36
|
-
|
|
37
|
-
@query('.tabs')
|
|
38
|
-
tabsContainer?: HTMLElement;
|
|
39
|
-
|
|
40
|
-
@queryAll('snice-tab[slot="nav"]', { light: true, shadow: false })
|
|
41
|
-
tabs?: NodeListOf<SniceTabElement>;
|
|
42
|
-
|
|
43
|
-
@queryAll('snice-tab-panel', { light: true, shadow: false })
|
|
44
|
-
panels?: NodeListOf<SniceTabPanelElement>;
|
|
45
|
-
|
|
46
|
-
@query('.tabs__panels')
|
|
47
|
-
panelsContainer?: HTMLElement;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
html() {
|
|
51
|
-
return /*html*/`
|
|
52
|
-
<div class="tabs tabs--${this.placement}" part="base">
|
|
53
|
-
<div class="tabs__nav-container" part="nav-container">
|
|
54
|
-
${!this.noScrollControls ? /*html*/`
|
|
55
|
-
<button class="tabs__scroll-button tabs__scroll-button--start" part="scroll-button scroll-button-start" tabindex="-1" aria-label="Scroll left">
|
|
56
|
-
<svg viewBox="0 0 24 24" width="16" height="16">
|
|
57
|
-
<path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z" fill="currentColor"/>
|
|
58
|
-
</svg>
|
|
59
|
-
</button>
|
|
60
|
-
` : ''}
|
|
61
|
-
|
|
62
|
-
<div class="tabs__nav" part="nav" role="tablist">
|
|
63
|
-
<div class="tabs__nav-track">
|
|
64
|
-
<slot name="nav"></slot>
|
|
65
|
-
<div class="tabs__indicator" part="indicator"></div>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
|
|
69
|
-
${!this.noScrollControls ? /*html*/`
|
|
70
|
-
<button class="tabs__scroll-button tabs__scroll-button--end" part="scroll-button scroll-button-end" tabindex="-1" aria-label="Scroll right">
|
|
71
|
-
<svg viewBox="0 0 24 24" width="16" height="16">
|
|
72
|
-
<path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" fill="currentColor"/>
|
|
73
|
-
</svg>
|
|
74
|
-
</button>
|
|
75
|
-
` : ''}
|
|
76
|
-
</div>
|
|
77
|
-
|
|
78
|
-
<div class="tabs__panels" part="panels">
|
|
79
|
-
<slot></slot>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
`;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
css() {
|
|
86
|
-
return css;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
@ready()
|
|
90
|
-
init() {
|
|
91
|
-
this.setupTabs();
|
|
92
|
-
this.updateScrollButtons();
|
|
93
|
-
|
|
94
|
-
// Update scroll buttons on resize
|
|
95
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
96
|
-
this.updateScrollButtons();
|
|
97
|
-
this.updateIndicator();
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
if (this.nav) {
|
|
101
|
-
resizeObserver.observe(this.nav);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
@watch('selected')
|
|
106
|
-
handleSelectedChange() {
|
|
107
|
-
this.updateSelection();
|
|
108
|
-
this.updateIndicator();
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
@watch('placement')
|
|
112
|
-
handlePlacementChange() {
|
|
113
|
-
if (!this.tabsContainer) return;
|
|
114
|
-
|
|
115
|
-
// Remove all placement classes
|
|
116
|
-
this.tabsContainer.classList.remove('tabs--top', 'tabs--bottom', 'tabs--start', 'tabs--end');
|
|
117
|
-
// Add the new placement class
|
|
118
|
-
this.tabsContainer.classList.add(`tabs--${this.placement}`);
|
|
119
|
-
// Update indicator position
|
|
120
|
-
this.updateIndicator();
|
|
121
|
-
// Update scroll buttons visibility
|
|
122
|
-
this.updateScrollButtons();
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
@on('click', '.tabs__scroll-button--start')
|
|
126
|
-
scrollStart() {
|
|
127
|
-
if (!this.nav) return;
|
|
128
|
-
|
|
129
|
-
const isHorizontal = this.placement === 'top' || this.placement === 'bottom';
|
|
130
|
-
if (isHorizontal) {
|
|
131
|
-
this.nav.scrollBy({ left: -200, behavior: 'smooth' });
|
|
132
|
-
} else {
|
|
133
|
-
this.nav.scrollBy({ top: -200, behavior: 'smooth' });
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
@on('click', '.tabs__scroll-button--end')
|
|
138
|
-
scrollEnd() {
|
|
139
|
-
if (!this.nav) return;
|
|
140
|
-
|
|
141
|
-
const isHorizontal = this.placement === 'top' || this.placement === 'bottom';
|
|
142
|
-
if (isHorizontal) {
|
|
143
|
-
this.nav.scrollBy({ left: 200, behavior: 'smooth' });
|
|
144
|
-
} else {
|
|
145
|
-
this.nav.scrollBy({ top: 200, behavior: 'smooth' });
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
@on('scroll', '.tabs__nav')
|
|
150
|
-
handleScroll() {
|
|
151
|
-
this.updateScrollButtons();
|
|
152
|
-
this.updateIndicator();
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
@on('@snice/tab-select')
|
|
156
|
-
handleTabSelect(event: CustomEvent<TabSelectDetail>) {
|
|
157
|
-
if (!this.tabs) return;
|
|
158
|
-
const tab = event.detail.tab;
|
|
159
|
-
const index = Array.from(this.tabs).indexOf(tab);
|
|
160
|
-
if (index >= 0) {
|
|
161
|
-
this.selectTab(index);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
setupTabs() {
|
|
166
|
-
this.updateSelection();
|
|
167
|
-
// Delay indicator update to ensure DOM is ready
|
|
168
|
-
requestAnimationFrame(() => {
|
|
169
|
-
this.updateIndicator();
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
@dispatch('@snice/tab-change', { bubbles: true, composed: true })
|
|
174
|
-
selectTab(index: number): TabChangeDetail | undefined {
|
|
175
|
-
if (!this.tabs || !this.panels || index < 0 || index >= this.tabs.length) return;
|
|
176
|
-
|
|
177
|
-
const oldIndex = this.selected;
|
|
178
|
-
this.selected = index;
|
|
179
|
-
|
|
180
|
-
return {
|
|
181
|
-
index,
|
|
182
|
-
oldIndex,
|
|
183
|
-
tab: this.tabs[index],
|
|
184
|
-
panel: this.panels[index]
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
private previousSelected = -1;
|
|
189
|
-
|
|
190
|
-
updateSelection() {
|
|
191
|
-
if (!this.tabs || !this.panels) return;
|
|
192
|
-
|
|
193
|
-
this.tabs.forEach((tab, index) => {
|
|
194
|
-
const isSelected = index === this.selected;
|
|
195
|
-
tab.setAttribute('aria-selected', String(isSelected));
|
|
196
|
-
tab.setAttribute('tabindex', isSelected ? '0' : '-1');
|
|
197
|
-
tab.classList.toggle('snice-tab--active', isSelected);
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
// Handle panel transitions
|
|
201
|
-
const oldPanel = this.previousSelected >= 0 ? this.panels[this.previousSelected] : null;
|
|
202
|
-
const newPanel = this.panels[this.selected];
|
|
203
|
-
|
|
204
|
-
if (this.transition && this.transition !== 'none' && oldPanel && newPanel && oldPanel !== newPanel) {
|
|
205
|
-
// Get transition config and set CSS variables for timing
|
|
206
|
-
const transitionConfig = transitions[this.transition];
|
|
207
|
-
const outDuration = transitionConfig?.outDuration || 300;
|
|
208
|
-
const inDuration = transitionConfig?.inDuration || 300;
|
|
209
|
-
const maxDuration = Math.max(outDuration, inDuration);
|
|
210
|
-
|
|
211
|
-
// Update CSS custom property for transition duration
|
|
212
|
-
this.style.setProperty('--snice-tabs-transition-duration', `${maxDuration}ms`);
|
|
213
|
-
|
|
214
|
-
// Lock container height BEFORE any changes to prevent ANY reflow
|
|
215
|
-
if (this.panelsContainer) {
|
|
216
|
-
const currentHeight = this.panelsContainer.offsetHeight;
|
|
217
|
-
this.panelsContainer.style.height = `${currentHeight}px`;
|
|
218
|
-
this.panelsContainer.style.overflow = 'hidden';
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
// Now show new panel to measure it
|
|
222
|
-
newPanel.hidden = false;
|
|
223
|
-
newPanel.setAttribute('transition-in', this.transition);
|
|
224
|
-
oldPanel.setAttribute('transition-out', this.transition);
|
|
225
|
-
|
|
226
|
-
// Pass timing info to panels via properties
|
|
227
|
-
(newPanel as any).transitionDuration = inDuration;
|
|
228
|
-
(oldPanel as any).transitionDuration = outDuration;
|
|
229
|
-
|
|
230
|
-
// Hide old panel well before transition completes to avoid flicker
|
|
231
|
-
setTimeout(() => {
|
|
232
|
-
oldPanel.hidden = true;
|
|
233
|
-
oldPanel.removeAttribute('transition-out');
|
|
234
|
-
}, outDuration - 50); // Hide 50ms early to prevent flicker
|
|
235
|
-
|
|
236
|
-
// Clean up new panel transition attribute and unlock height
|
|
237
|
-
setTimeout(() => {
|
|
238
|
-
newPanel.removeAttribute('transition-in');
|
|
239
|
-
if (this.panelsContainer) {
|
|
240
|
-
// Reset to auto height without animation to prevent bounce
|
|
241
|
-
this.panelsContainer.style.height = '';
|
|
242
|
-
this.panelsContainer.style.overflow = '';
|
|
243
|
-
}
|
|
244
|
-
}, maxDuration);
|
|
245
|
-
} else {
|
|
246
|
-
// No transition - immediate switch
|
|
247
|
-
this.panels.forEach((panel, index) => {
|
|
248
|
-
const isSelected = index === this.selected;
|
|
249
|
-
panel.setAttribute('aria-hidden', String(!isSelected));
|
|
250
|
-
panel.hidden = !isSelected;
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
// Update aria attributes
|
|
255
|
-
this.panels.forEach((panel, index) => {
|
|
256
|
-
panel.setAttribute('aria-hidden', String(index !== this.selected));
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
this.previousSelected = this.selected;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
updateIndicator() {
|
|
263
|
-
if (!this.indicator || !this.tabs || !this.tabs.length || !this.navTrack) return;
|
|
264
|
-
|
|
265
|
-
const activeTab = this.tabs[this.selected];
|
|
266
|
-
if (!activeTab) return;
|
|
267
|
-
|
|
268
|
-
const isHorizontal = this.placement === 'top' || this.placement === 'bottom';
|
|
269
|
-
|
|
270
|
-
// Get the position of the active tab relative to the nav track container
|
|
271
|
-
// We need to calculate this manually since tabs are in light DOM and indicator is in shadow DOM
|
|
272
|
-
let offset = 0;
|
|
273
|
-
|
|
274
|
-
// Sum up the widths/heights of all tabs before the active one
|
|
275
|
-
for (let i = 0; i < this.selected; i++) {
|
|
276
|
-
if (isHorizontal) {
|
|
277
|
-
offset += this.tabs[i].offsetWidth;
|
|
278
|
-
} else {
|
|
279
|
-
offset += this.tabs[i].offsetHeight;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
if (isHorizontal) {
|
|
284
|
-
this.indicator.style.width = `${activeTab.offsetWidth}px`;
|
|
285
|
-
this.indicator.style.height = '2px';
|
|
286
|
-
this.indicator.style.transform = `translateX(${offset}px)`;
|
|
287
|
-
} else {
|
|
288
|
-
this.indicator.style.width = '2px';
|
|
289
|
-
this.indicator.style.height = `${activeTab.offsetHeight}px`;
|
|
290
|
-
this.indicator.style.transform = `translateY(${offset}px)`;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
updateScrollButtons() {
|
|
295
|
-
if (!this.nav || this.noScrollControls) return;
|
|
296
|
-
|
|
297
|
-
const isHorizontal = this.placement === 'top' || this.placement === 'bottom';
|
|
298
|
-
|
|
299
|
-
const hasOverflow = isHorizontal
|
|
300
|
-
? this.nav.scrollWidth > this.nav.clientWidth
|
|
301
|
-
: this.nav.scrollHeight > this.nav.clientHeight;
|
|
302
|
-
|
|
303
|
-
const canScrollStart = isHorizontal
|
|
304
|
-
? this.nav.scrollLeft > 0
|
|
305
|
-
: this.nav.scrollTop > 0;
|
|
306
|
-
|
|
307
|
-
const canScrollEnd = isHorizontal
|
|
308
|
-
? this.nav.scrollLeft < this.nav.scrollWidth - this.nav.clientWidth
|
|
309
|
-
: this.nav.scrollTop < this.nav.scrollHeight - this.nav.clientHeight;
|
|
310
|
-
|
|
311
|
-
// Show/hide buttons based on overflow
|
|
312
|
-
this.scrollButtonStart?.classList.toggle('tabs__scroll-button--visible', hasOverflow);
|
|
313
|
-
this.scrollButtonEnd?.classList.toggle('tabs__scroll-button--visible', hasOverflow);
|
|
314
|
-
|
|
315
|
-
// Disable buttons when can't scroll in that direction
|
|
316
|
-
this.scrollButtonStart?.classList.toggle('tabs__scroll-button--disabled', !canScrollStart);
|
|
317
|
-
this.scrollButtonEnd?.classList.toggle('tabs__scroll-button--disabled', !canScrollEnd);
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
show(index: number) {
|
|
322
|
-
this.selectTab(index);
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
getTab(index: number): SniceTabElement | undefined {
|
|
326
|
-
return this.tabs?.[index];
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
getPanel(index: number): SniceTabPanelElement | undefined {
|
|
330
|
-
return this.panels?.[index];
|
|
331
|
-
}
|
|
332
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export type TabsPlacement = 'top' | 'bottom' | 'start' | 'end';
|
|
2
|
-
|
|
3
|
-
export interface SniceTabElement extends HTMLElement {
|
|
4
|
-
disabled: boolean;
|
|
5
|
-
closable: boolean;
|
|
6
|
-
focus(options?: FocusOptions): void;
|
|
7
|
-
blur(): void;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface SniceTabPanelElement extends HTMLElement {
|
|
11
|
-
name: string;
|
|
12
|
-
hidden: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface TabChangeDetail {
|
|
16
|
-
index: number;
|
|
17
|
-
oldIndex: number;
|
|
18
|
-
tab: SniceTabElement;
|
|
19
|
-
panel: SniceTabPanelElement;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface TabSelectDetail {
|
|
23
|
-
tab: SniceTabElement;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface TabCloseDetail {
|
|
27
|
-
tab: SniceTabElement;
|
|
28
|
-
}
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
/* Color primitives */
|
|
3
|
-
--snice-color-gray-50: 250 250 250;
|
|
4
|
-
--snice-color-gray-100: 241 241 241;
|
|
5
|
-
--snice-color-gray-200: 226 226 226;
|
|
6
|
-
--snice-color-gray-300: 204 204 204;
|
|
7
|
-
--snice-color-gray-400: 163 163 163;
|
|
8
|
-
--snice-color-gray-500: 115 115 115;
|
|
9
|
-
--snice-color-gray-600: 82 82 82;
|
|
10
|
-
--snice-color-gray-700: 64 64 64;
|
|
11
|
-
--snice-color-gray-800: 38 38 38;
|
|
12
|
-
--snice-color-gray-900: 23 23 23;
|
|
13
|
-
--snice-color-gray-950: 10 10 10;
|
|
14
|
-
|
|
15
|
-
--snice-color-blue-50: 239 246 255;
|
|
16
|
-
--snice-color-blue-100: 219 234 254;
|
|
17
|
-
--snice-color-blue-200: 191 219 254;
|
|
18
|
-
--snice-color-blue-300: 147 197 253;
|
|
19
|
-
--snice-color-blue-400: 96 165 250;
|
|
20
|
-
--snice-color-blue-500: 59 130 246;
|
|
21
|
-
--snice-color-blue-600: 37 99 235;
|
|
22
|
-
--snice-color-blue-700: 29 78 216;
|
|
23
|
-
--snice-color-blue-800: 30 64 175;
|
|
24
|
-
--snice-color-blue-900: 30 58 138;
|
|
25
|
-
--snice-color-blue-950: 23 37 84;
|
|
26
|
-
|
|
27
|
-
--snice-color-green-50: 240 253 244;
|
|
28
|
-
--snice-color-green-100: 220 252 231;
|
|
29
|
-
--snice-color-green-200: 187 247 208;
|
|
30
|
-
--snice-color-green-300: 134 239 172;
|
|
31
|
-
--snice-color-green-400: 74 222 128;
|
|
32
|
-
--snice-color-green-500: 34 197 94;
|
|
33
|
-
--snice-color-green-600: 22 163 74;
|
|
34
|
-
--snice-color-green-700: 21 128 61;
|
|
35
|
-
--snice-color-green-800: 22 101 52;
|
|
36
|
-
--snice-color-green-900: 20 83 45;
|
|
37
|
-
--snice-color-green-950: 5 46 22;
|
|
38
|
-
|
|
39
|
-
--snice-color-red-50: 254 242 242;
|
|
40
|
-
--snice-color-red-100: 254 226 226;
|
|
41
|
-
--snice-color-red-200: 254 202 202;
|
|
42
|
-
--snice-color-red-300: 252 165 165;
|
|
43
|
-
--snice-color-red-400: 248 113 113;
|
|
44
|
-
--snice-color-red-500: 239 68 68;
|
|
45
|
-
--snice-color-red-600: 220 38 38;
|
|
46
|
-
--snice-color-red-700: 185 28 28;
|
|
47
|
-
--snice-color-red-800: 153 27 27;
|
|
48
|
-
--snice-color-red-900: 127 29 29;
|
|
49
|
-
--snice-color-red-950: 69 10 10;
|
|
50
|
-
|
|
51
|
-
--snice-color-yellow-50: 254 252 232;
|
|
52
|
-
--snice-color-yellow-100: 254 249 195;
|
|
53
|
-
--snice-color-yellow-200: 254 240 138;
|
|
54
|
-
--snice-color-yellow-300: 253 224 71;
|
|
55
|
-
--snice-color-yellow-400: 250 204 21;
|
|
56
|
-
--snice-color-yellow-500: 234 179 8;
|
|
57
|
-
--snice-color-yellow-600: 202 138 4;
|
|
58
|
-
--snice-color-yellow-700: 161 98 7;
|
|
59
|
-
--snice-color-yellow-800: 133 77 14;
|
|
60
|
-
--snice-color-yellow-900: 113 63 18;
|
|
61
|
-
--snice-color-yellow-950: 66 32 6;
|
|
62
|
-
|
|
63
|
-
/* Light theme (default) */
|
|
64
|
-
--snice-color-primary: rgb(var(--snice-color-blue-600));
|
|
65
|
-
--snice-color-success: rgb(var(--snice-color-green-600));
|
|
66
|
-
--snice-color-warning: rgb(var(--snice-color-yellow-600));
|
|
67
|
-
--snice-color-danger: rgb(var(--snice-color-red-600));
|
|
68
|
-
--snice-color-neutral: rgb(var(--snice-color-gray-600));
|
|
69
|
-
|
|
70
|
-
--snice-color-primary-hover: rgb(var(--snice-color-blue-700));
|
|
71
|
-
--snice-color-success-hover: rgb(var(--snice-color-green-700));
|
|
72
|
-
--snice-color-warning-hover: rgb(var(--snice-color-yellow-700));
|
|
73
|
-
--snice-color-danger-hover: rgb(var(--snice-color-red-700));
|
|
74
|
-
--snice-color-neutral-hover: rgb(var(--snice-color-gray-700));
|
|
75
|
-
|
|
76
|
-
/* Semantic colors */
|
|
77
|
-
--snice-color-text: rgb(var(--snice-color-gray-900));
|
|
78
|
-
--snice-color-text-secondary: rgb(var(--snice-color-gray-600));
|
|
79
|
-
--snice-color-text-tertiary: rgb(var(--snice-color-gray-500));
|
|
80
|
-
--snice-color-text-inverse: rgb(var(--snice-color-gray-50));
|
|
81
|
-
|
|
82
|
-
--snice-color-background: rgb(255 255 255);
|
|
83
|
-
--snice-color-background-secondary: rgb(var(--snice-color-gray-50));
|
|
84
|
-
--snice-color-background-tertiary: rgb(var(--snice-color-gray-100));
|
|
85
|
-
--snice-color-background-element: rgb(252 251 249);
|
|
86
|
-
|
|
87
|
-
--snice-color-border: rgb(var(--snice-color-gray-200));
|
|
88
|
-
--snice-color-border-hover: rgb(var(--snice-color-gray-300));
|
|
89
|
-
--snice-color-border-focus: rgb(var(--snice-color-blue-500));
|
|
90
|
-
|
|
91
|
-
/* Spacing */
|
|
92
|
-
--snice-spacing-3xs: 0.125rem; /* 2px */
|
|
93
|
-
--snice-spacing-2xs: 0.25rem; /* 4px */
|
|
94
|
-
--snice-spacing-xs: 0.5rem; /* 8px */
|
|
95
|
-
--snice-spacing-sm: 0.75rem; /* 12px */
|
|
96
|
-
--snice-spacing-md: 1rem; /* 16px */
|
|
97
|
-
--snice-spacing-lg: 1.5rem; /* 24px */
|
|
98
|
-
--snice-spacing-xl: 2rem; /* 32px */
|
|
99
|
-
--snice-spacing-2xl: 3rem; /* 48px */
|
|
100
|
-
--snice-spacing-3xl: 4rem; /* 64px */
|
|
101
|
-
|
|
102
|
-
/* Typography */
|
|
103
|
-
--snice-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
104
|
-
--snice-font-family-mono: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
|
|
105
|
-
|
|
106
|
-
--snice-font-size-2xs: 0.625rem; /* 10px */
|
|
107
|
-
--snice-font-size-xs: 0.75rem; /* 12px */
|
|
108
|
-
--snice-font-size-sm: 0.875rem; /* 14px */
|
|
109
|
-
--snice-font-size-md: 1rem; /* 16px */
|
|
110
|
-
--snice-font-size-lg: 1.125rem; /* 18px */
|
|
111
|
-
--snice-font-size-xl: 1.25rem; /* 20px */
|
|
112
|
-
--snice-font-size-2xl: 1.5rem; /* 24px */
|
|
113
|
-
--snice-font-size-3xl: 1.875rem; /* 30px */
|
|
114
|
-
--snice-font-size-4xl: 2.25rem; /* 36px */
|
|
115
|
-
|
|
116
|
-
--snice-font-weight-light: 300;
|
|
117
|
-
--snice-font-weight-normal: 400;
|
|
118
|
-
--snice-font-weight-medium: 500;
|
|
119
|
-
--snice-font-weight-semibold: 600;
|
|
120
|
-
--snice-font-weight-bold: 700;
|
|
121
|
-
|
|
122
|
-
--snice-line-height-dense: 1.25;
|
|
123
|
-
--snice-line-height-normal: 1.5;
|
|
124
|
-
--snice-line-height-loose: 1.75;
|
|
125
|
-
|
|
126
|
-
/* Border radius */
|
|
127
|
-
--snice-border-radius-sm: 0.125rem; /* 2px */
|
|
128
|
-
--snice-border-radius-md: 0.25rem; /* 4px */
|
|
129
|
-
--snice-border-radius-lg: 0.5rem; /* 8px */
|
|
130
|
-
--snice-border-radius-xl: 1rem; /* 16px */
|
|
131
|
-
--snice-border-radius-circle: 50%;
|
|
132
|
-
--snice-border-radius-pill: 9999px;
|
|
133
|
-
|
|
134
|
-
/* Shadows */
|
|
135
|
-
--snice-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
136
|
-
--snice-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
137
|
-
--snice-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
|
138
|
-
--snice-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
139
|
-
--snice-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
|
|
140
|
-
--snice-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
|
|
141
|
-
|
|
142
|
-
/* Transitions */
|
|
143
|
-
--snice-transition-fast: 150ms;
|
|
144
|
-
--snice-transition-medium: 250ms;
|
|
145
|
-
--snice-transition-slow: 350ms;
|
|
146
|
-
|
|
147
|
-
/* Z-index */
|
|
148
|
-
--snice-z-index-dropdown: 1000;
|
|
149
|
-
--snice-z-index-sticky: 1020;
|
|
150
|
-
--snice-z-index-fixed: 1030;
|
|
151
|
-
--snice-z-index-modal-backdrop: 1040;
|
|
152
|
-
--snice-z-index-modal: 1050;
|
|
153
|
-
--snice-z-index-popover: 1060;
|
|
154
|
-
--snice-z-index-tooltip: 1070;
|
|
155
|
-
|
|
156
|
-
/* Focus */
|
|
157
|
-
--snice-focus-ring-width: 2px;
|
|
158
|
-
--snice-focus-ring-color: rgb(var(--snice-color-blue-500) / 0.5);
|
|
159
|
-
--snice-focus-ring-offset: 2px;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/* Dark theme */
|
|
163
|
-
[data-theme="dark"] {
|
|
164
|
-
--snice-color-primary: rgb(var(--snice-color-blue-500));
|
|
165
|
-
--snice-color-success: rgb(var(--snice-color-green-500));
|
|
166
|
-
--snice-color-warning: rgb(var(--snice-color-yellow-500));
|
|
167
|
-
--snice-color-danger: rgb(var(--snice-color-red-500));
|
|
168
|
-
--snice-color-neutral: rgb(var(--snice-color-gray-400));
|
|
169
|
-
|
|
170
|
-
--snice-color-primary-hover: rgb(var(--snice-color-blue-400));
|
|
171
|
-
--snice-color-success-hover: rgb(var(--snice-color-green-400));
|
|
172
|
-
--snice-color-warning-hover: rgb(var(--snice-color-yellow-400));
|
|
173
|
-
--snice-color-danger-hover: rgb(var(--snice-color-red-400));
|
|
174
|
-
--snice-color-neutral-hover: rgb(var(--snice-color-gray-300));
|
|
175
|
-
|
|
176
|
-
--snice-color-text: rgb(var(--snice-color-gray-50));
|
|
177
|
-
--snice-color-text-secondary: rgb(var(--snice-color-gray-300));
|
|
178
|
-
--snice-color-text-tertiary: rgb(var(--snice-color-gray-400));
|
|
179
|
-
--snice-color-text-inverse: rgb(var(--snice-color-gray-900));
|
|
180
|
-
|
|
181
|
-
--snice-color-background: rgb(var(--snice-color-gray-900));
|
|
182
|
-
--snice-color-background-secondary: rgb(var(--snice-color-gray-800));
|
|
183
|
-
--snice-color-background-tertiary: rgb(var(--snice-color-gray-700));
|
|
184
|
-
--snice-color-background-element: rgb(47 45 43);
|
|
185
|
-
|
|
186
|
-
--snice-color-border: rgb(var(--snice-color-gray-700));
|
|
187
|
-
--snice-color-border-hover: rgb(var(--snice-color-gray-600));
|
|
188
|
-
--snice-color-border-focus: rgb(var(--snice-color-blue-400));
|
|
189
|
-
|
|
190
|
-
--snice-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.1);
|
|
191
|
-
--snice-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.15), 0 1px 2px -1px rgb(0 0 0 / 0.15);
|
|
192
|
-
--snice-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.15), 0 2px 4px -2px rgb(0 0 0 / 0.15);
|
|
193
|
-
--snice-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.15), 0 4px 6px -4px rgb(0 0 0 / 0.15);
|
|
194
|
-
--snice-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.15), 0 8px 10px -6px rgb(0 0 0 / 0.15);
|
|
195
|
-
--snice-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.35);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/* Auto dark theme based on system preference */
|
|
199
|
-
@media (prefers-color-scheme: dark) {
|
|
200
|
-
:root:not([data-theme="light"]) {
|
|
201
|
-
--snice-color-primary: rgb(var(--snice-color-blue-500));
|
|
202
|
-
--snice-color-success: rgb(var(--snice-color-green-500));
|
|
203
|
-
--snice-color-warning: rgb(var(--snice-color-yellow-500));
|
|
204
|
-
--snice-color-danger: rgb(var(--snice-color-red-500));
|
|
205
|
-
--snice-color-neutral: rgb(var(--snice-color-gray-400));
|
|
206
|
-
|
|
207
|
-
--snice-color-primary-hover: rgb(var(--snice-color-blue-400));
|
|
208
|
-
--snice-color-success-hover: rgb(var(--snice-color-green-400));
|
|
209
|
-
--snice-color-warning-hover: rgb(var(--snice-color-yellow-400));
|
|
210
|
-
--snice-color-danger-hover: rgb(var(--snice-color-red-400));
|
|
211
|
-
--snice-color-neutral-hover: rgb(var(--snice-color-gray-300));
|
|
212
|
-
|
|
213
|
-
--snice-color-text: rgb(var(--snice-color-gray-50));
|
|
214
|
-
--snice-color-text-secondary: rgb(var(--snice-color-gray-300));
|
|
215
|
-
--snice-color-text-tertiary: rgb(var(--snice-color-gray-400));
|
|
216
|
-
--snice-color-text-inverse: rgb(var(--snice-color-gray-900));
|
|
217
|
-
|
|
218
|
-
--snice-color-background: rgb(var(--snice-color-gray-900));
|
|
219
|
-
--snice-color-background-secondary: rgb(var(--snice-color-gray-800));
|
|
220
|
-
--snice-color-background-tertiary: rgb(var(--snice-color-gray-700));
|
|
221
|
-
--snice-color-background-element: rgb(47 45 43);
|
|
222
|
-
|
|
223
|
-
--snice-color-border: rgb(var(--snice-color-gray-700));
|
|
224
|
-
--snice-color-border-hover: rgb(var(--snice-color-gray-600));
|
|
225
|
-
--snice-color-border-focus: rgb(var(--snice-color-blue-400));
|
|
226
|
-
|
|
227
|
-
--snice-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.1);
|
|
228
|
-
--snice-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.15), 0 1px 2px -1px rgb(0 0 0 / 0.15);
|
|
229
|
-
--snice-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.15), 0 2px 4px -2px rgb(0 0 0 / 0.15);
|
|
230
|
-
--snice-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.15), 0 4px 6px -4px rgb(0 0 0 / 0.15);
|
|
231
|
-
--snice-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.15), 0 8px 10px -6px rgb(0 0 0 / 0.15);
|
|
232
|
-
--snice-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.35);
|
|
233
|
-
}
|
|
234
|
-
}
|