snice 2.1.5 → 2.2.1
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-C9N6yGxQ.js +4 -0
- package/dist/components/snice-cell-C9N6yGxQ.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.iife.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
- package/dist/index.cjs.min.map +0 -1
- package/dist/index.esm.min.js +0 -14
- package/dist/index.esm.min.js.map +0 -1
- package/dist/index.iife.min.js +0 -15
- package/dist/index.iife.min.js.map +0 -1
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
/* Toast Container */
|
|
2
|
-
:host {
|
|
3
|
-
position: fixed;
|
|
4
|
-
z-index: var(--snice-z-index-tooltip);
|
|
5
|
-
pointer-events: none;
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
gap: var(--snice-spacing-sm);
|
|
9
|
-
padding: var(--snice-spacing-md);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/* Position variants */
|
|
13
|
-
:host([position="top-left"]) {
|
|
14
|
-
top: 0;
|
|
15
|
-
left: 0;
|
|
16
|
-
align-items: flex-start;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
:host([position="top-center"]) {
|
|
20
|
-
top: 0;
|
|
21
|
-
left: 50%;
|
|
22
|
-
transform: translateX(-50%);
|
|
23
|
-
align-items: center;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
:host([position="top-right"]) {
|
|
27
|
-
top: 0;
|
|
28
|
-
right: 0;
|
|
29
|
-
align-items: flex-end;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
:host([position="bottom-left"]) {
|
|
33
|
-
bottom: 0;
|
|
34
|
-
left: 0;
|
|
35
|
-
align-items: flex-start;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
:host([position="bottom-center"]) {
|
|
39
|
-
bottom: 0;
|
|
40
|
-
left: 50%;
|
|
41
|
-
transform: translateX(-50%);
|
|
42
|
-
align-items: center;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
:host([position="bottom-right"]) {
|
|
46
|
-
bottom: 0;
|
|
47
|
-
right: 0;
|
|
48
|
-
align-items: flex-end;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/* Toast Item */
|
|
52
|
-
.toast {
|
|
53
|
-
pointer-events: auto;
|
|
54
|
-
display: flex;
|
|
55
|
-
align-items: center;
|
|
56
|
-
gap: var(--snice-spacing-sm);
|
|
57
|
-
min-width: 12.5rem; /* 200px */
|
|
58
|
-
max-width: 20rem; /* 320px */
|
|
59
|
-
padding: var(--snice-spacing-sm) var(--snice-spacing-md);
|
|
60
|
-
border-radius: var(--snice-border-radius-lg);
|
|
61
|
-
box-shadow: var(--snice-shadow-lg);
|
|
62
|
-
font-family: var(--snice-font-family);
|
|
63
|
-
font-size: var(--snice-font-size-sm);
|
|
64
|
-
line-height: var(--snice-line-height-normal);
|
|
65
|
-
animation: slideIn var(--snice-transition-medium) ease-out;
|
|
66
|
-
transition: all var(--snice-transition-medium) ease;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
[hidden] {
|
|
70
|
-
display: none !important;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.toast.toast--hiding {
|
|
74
|
-
animation: slideOut 0.3s ease-out;
|
|
75
|
-
opacity: 0;
|
|
76
|
-
transform: translateY(100%);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/* Type variants */
|
|
80
|
-
.toast--success {
|
|
81
|
-
background-color: var(--snice-color-success);
|
|
82
|
-
color: var(--snice-color-text-inverse);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.toast--error {
|
|
86
|
-
background-color: var(--snice-color-danger);
|
|
87
|
-
color: var(--snice-color-text-inverse);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.toast--warning {
|
|
91
|
-
background-color: var(--snice-color-warning);
|
|
92
|
-
color: var(--snice-color-text-inverse);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.toast--info {
|
|
96
|
-
background-color: var(--snice-color-primary);
|
|
97
|
-
color: var(--snice-color-text-inverse);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/* Toast icon */
|
|
101
|
-
.toast-icon {
|
|
102
|
-
flex-shrink: 0;
|
|
103
|
-
width: 1.25rem; /* 20px */
|
|
104
|
-
height: 1.25rem; /* 20px */
|
|
105
|
-
display: flex;
|
|
106
|
-
align-items: center;
|
|
107
|
-
justify-content: center;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.toast-icon svg {
|
|
111
|
-
width: 100%;
|
|
112
|
-
height: 100%;
|
|
113
|
-
fill: currentColor;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/* Toast content */
|
|
117
|
-
.toast-content {
|
|
118
|
-
flex: 1;
|
|
119
|
-
word-wrap: break-word;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/* Close button */
|
|
123
|
-
.toast-close {
|
|
124
|
-
flex-shrink: 0;
|
|
125
|
-
width: 1.25rem; /* 20px */
|
|
126
|
-
height: 1.25rem; /* 20px */
|
|
127
|
-
display: flex;
|
|
128
|
-
align-items: center;
|
|
129
|
-
justify-content: center;
|
|
130
|
-
cursor: pointer;
|
|
131
|
-
opacity: 0.7;
|
|
132
|
-
transition: opacity var(--snice-transition-fast);
|
|
133
|
-
background: none;
|
|
134
|
-
border: none;
|
|
135
|
-
color: inherit;
|
|
136
|
-
padding: 0;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.toast-close:hover {
|
|
140
|
-
opacity: 1;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.toast-close svg {
|
|
144
|
-
width: 0.875rem; /* 14px */
|
|
145
|
-
height: 0.875rem; /* 14px */
|
|
146
|
-
fill: currentColor;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/* Animations - Pop up like toast */
|
|
150
|
-
@keyframes slideIn {
|
|
151
|
-
from {
|
|
152
|
-
opacity: 0;
|
|
153
|
-
transform: translateY(100%);
|
|
154
|
-
}
|
|
155
|
-
to {
|
|
156
|
-
opacity: 1;
|
|
157
|
-
transform: translateY(0);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
@keyframes slideOut {
|
|
162
|
-
from {
|
|
163
|
-
opacity: 1;
|
|
164
|
-
transform: translateY(0);
|
|
165
|
-
}
|
|
166
|
-
to {
|
|
167
|
-
opacity: 0;
|
|
168
|
-
transform: translateY(100%);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/* For top-positioned toasts - slide down */
|
|
173
|
-
:host([position^="top"]) .toast {
|
|
174
|
-
animation: slideInTop var(--snice-transition-medium) ease-out;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
:host([position^="top"]) .toast.toast--hiding {
|
|
178
|
-
animation: slideOutTop var(--snice-transition-medium) ease-out;
|
|
179
|
-
transform: translateY(-100%);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
@keyframes slideInTop {
|
|
183
|
-
from {
|
|
184
|
-
opacity: 0;
|
|
185
|
-
transform: translateY(-100%);
|
|
186
|
-
}
|
|
187
|
-
to {
|
|
188
|
-
opacity: 1;
|
|
189
|
-
transform: translateY(0);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
@keyframes slideOutTop {
|
|
194
|
-
from {
|
|
195
|
-
opacity: 1;
|
|
196
|
-
transform: translateY(0);
|
|
197
|
-
}
|
|
198
|
-
to {
|
|
199
|
-
opacity: 0;
|
|
200
|
-
transform: translateY(-100%);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/* Progress bar for auto-dismiss */
|
|
205
|
-
.toast-progress {
|
|
206
|
-
position: absolute;
|
|
207
|
-
bottom: 0;
|
|
208
|
-
left: 0;
|
|
209
|
-
height: 0.1875rem; /* 3px */
|
|
210
|
-
background-color: rgba(255, 255, 255, 0.3);
|
|
211
|
-
border-radius: 0 0 var(--snice-toast-border-radius) var(--snice-toast-border-radius);
|
|
212
|
-
transition: width linear;
|
|
213
|
-
}
|
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
import { element, property, query, on, watch, dispatch } from 'snice';
|
|
2
|
-
import type { ToastType, SniceToastElement } from './snice-toast.types';
|
|
3
|
-
|
|
4
|
-
@element('snice-toast')
|
|
5
|
-
export class SniceToast extends HTMLElement implements SniceToastElement {
|
|
6
|
-
@property({ reflect: true })
|
|
7
|
-
type: ToastType = 'info';
|
|
8
|
-
|
|
9
|
-
@property({ reflect: true })
|
|
10
|
-
message: string = '';
|
|
11
|
-
|
|
12
|
-
@property({ type: Boolean, reflect: true })
|
|
13
|
-
closable: boolean = true;
|
|
14
|
-
|
|
15
|
-
@property({ type: Boolean, reflect: true })
|
|
16
|
-
icon: boolean = true;
|
|
17
|
-
|
|
18
|
-
@query('.toast')
|
|
19
|
-
toastElement?: HTMLElement;
|
|
20
|
-
|
|
21
|
-
@query('.toast-icon')
|
|
22
|
-
iconElement?: HTMLElement;
|
|
23
|
-
|
|
24
|
-
@query('.toast-content')
|
|
25
|
-
contentElement?: HTMLElement;
|
|
26
|
-
|
|
27
|
-
@query('.toast-close')
|
|
28
|
-
closeButton?: HTMLElement;
|
|
29
|
-
|
|
30
|
-
html() {
|
|
31
|
-
return /*html*/`
|
|
32
|
-
<div class="toast toast--${this.type}" role="alert" aria-live="polite">
|
|
33
|
-
<span class="toast-icon">${this.getIcon(this.type)}</span>
|
|
34
|
-
<span class="toast-content">${this.message}</span>
|
|
35
|
-
<button class="toast-close" aria-label="Close">
|
|
36
|
-
<svg width="14" height="14" viewBox="0 0 14 14" fill="currentColor">
|
|
37
|
-
<path d="M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z"/>
|
|
38
|
-
</svg>
|
|
39
|
-
</button>
|
|
40
|
-
</div>
|
|
41
|
-
`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
css() {
|
|
45
|
-
return /*css*/`
|
|
46
|
-
:host {
|
|
47
|
-
pointer-events: auto;
|
|
48
|
-
display: block;
|
|
49
|
-
animation: slideIn 0.3s ease-out;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.toast {
|
|
53
|
-
display: flex;
|
|
54
|
-
align-items: center;
|
|
55
|
-
gap: 12px;
|
|
56
|
-
min-width: 200px;
|
|
57
|
-
max-width: 320px;
|
|
58
|
-
padding: 12px 16px;
|
|
59
|
-
border-radius: 8px;
|
|
60
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
61
|
-
font-family: system-ui, -apple-system, sans-serif;
|
|
62
|
-
font-size: 14px;
|
|
63
|
-
line-height: 1.5;
|
|
64
|
-
transition: all 0.3s ease;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.toast--success {
|
|
68
|
-
background-color: #10b981;
|
|
69
|
-
color: white;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.toast--error {
|
|
73
|
-
background-color: #ef4444;
|
|
74
|
-
color: white;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.toast--warning {
|
|
78
|
-
background-color: #f59e0b;
|
|
79
|
-
color: white;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.toast--info {
|
|
83
|
-
background-color: #3b82f6;
|
|
84
|
-
color: white;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.toast-icon {
|
|
88
|
-
flex-shrink: 0;
|
|
89
|
-
width: 20px;
|
|
90
|
-
height: 20px;
|
|
91
|
-
display: flex;
|
|
92
|
-
align-items: center;
|
|
93
|
-
justify-content: center;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.toast-icon[hidden] {
|
|
97
|
-
display: none;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.toast-icon svg {
|
|
101
|
-
width: 100%;
|
|
102
|
-
height: 100%;
|
|
103
|
-
fill: currentColor;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.toast-content {
|
|
107
|
-
flex: 1;
|
|
108
|
-
word-wrap: break-word;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.toast-close {
|
|
112
|
-
flex-shrink: 0;
|
|
113
|
-
width: 20px;
|
|
114
|
-
height: 20px;
|
|
115
|
-
display: flex;
|
|
116
|
-
align-items: center;
|
|
117
|
-
justify-content: center;
|
|
118
|
-
cursor: pointer;
|
|
119
|
-
opacity: 0.7;
|
|
120
|
-
transition: opacity 0.2s;
|
|
121
|
-
background: none;
|
|
122
|
-
border: none;
|
|
123
|
-
color: inherit;
|
|
124
|
-
padding: 0;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.toast-close[hidden] {
|
|
128
|
-
display: none;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.toast-close:hover {
|
|
132
|
-
opacity: 1;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/* Animations */
|
|
136
|
-
@keyframes slideIn {
|
|
137
|
-
from {
|
|
138
|
-
opacity: 0;
|
|
139
|
-
transform: translateY(100%);
|
|
140
|
-
}
|
|
141
|
-
to {
|
|
142
|
-
opacity: 1;
|
|
143
|
-
transform: translateY(0);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
:host(.hiding) {
|
|
148
|
-
animation: slideOut 0.3s ease-out;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
@keyframes slideOut {
|
|
152
|
-
from {
|
|
153
|
-
opacity: 1;
|
|
154
|
-
transform: translateY(0);
|
|
155
|
-
}
|
|
156
|
-
to {
|
|
157
|
-
opacity: 0;
|
|
158
|
-
transform: translateY(100%);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/* For top-positioned container - slide down */
|
|
163
|
-
:host-context(snice-toast-container[position^="top"]) {
|
|
164
|
-
animation: slideInTop 0.3s ease-out;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
:host-context(snice-toast-container[position^="top"]):host(.hiding) {
|
|
168
|
-
animation: slideOutTop 0.3s ease-out;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
@keyframes slideInTop {
|
|
172
|
-
from {
|
|
173
|
-
opacity: 0;
|
|
174
|
-
transform: translateY(-100%);
|
|
175
|
-
}
|
|
176
|
-
to {
|
|
177
|
-
opacity: 1;
|
|
178
|
-
transform: translateY(0);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
@keyframes slideOutTop {
|
|
183
|
-
from {
|
|
184
|
-
opacity: 1;
|
|
185
|
-
transform: translateY(0);
|
|
186
|
-
}
|
|
187
|
-
to {
|
|
188
|
-
opacity: 0;
|
|
189
|
-
transform: translateY(-100%);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
[hidden] {
|
|
194
|
-
display: none !important;
|
|
195
|
-
}
|
|
196
|
-
`;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// Helper function to hide/show elements
|
|
200
|
-
private setHidden(selector: string, hide: boolean): void {
|
|
201
|
-
const element = this.shadowRoot?.querySelector(selector) as HTMLElement;
|
|
202
|
-
if (element) {
|
|
203
|
-
if (hide) {
|
|
204
|
-
element.setAttribute('hidden', '');
|
|
205
|
-
} else {
|
|
206
|
-
element.removeAttribute('hidden');
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
@watch('type')
|
|
212
|
-
updateType() {
|
|
213
|
-
if (this.toastElement) {
|
|
214
|
-
// Remove old type class
|
|
215
|
-
this.toastElement.className = this.toastElement.className.replace(/toast--\w+/, '');
|
|
216
|
-
// Add new type class
|
|
217
|
-
this.toastElement.classList.add(`toast--${this.type}`);
|
|
218
|
-
}
|
|
219
|
-
// Update icon
|
|
220
|
-
if (this.iconElement) {
|
|
221
|
-
this.iconElement.innerHTML = this.getIcon(this.type);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
@watch('message')
|
|
226
|
-
updateMessage() {
|
|
227
|
-
if (this.contentElement) {
|
|
228
|
-
this.contentElement.textContent = this.message;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
@watch('closable')
|
|
233
|
-
updateClosable() {
|
|
234
|
-
this.setHidden('.toast-close', !this.closable);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
@watch('icon')
|
|
238
|
-
updateIcon() {
|
|
239
|
-
this.setHidden('.toast-icon', !this.icon);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
@on('click', '.toast-close')
|
|
243
|
-
@dispatch('close-toast')
|
|
244
|
-
handleClose() {
|
|
245
|
-
return { id: this.getAttribute('toast-id') };
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
hide() {
|
|
249
|
-
this.classList.add('hiding');
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
private getIcon(type: ToastType): string {
|
|
253
|
-
switch (type) {
|
|
254
|
-
case 'success':
|
|
255
|
-
return `<svg viewBox="0 0 20 20" fill="currentColor">
|
|
256
|
-
<path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>
|
|
257
|
-
</svg>`;
|
|
258
|
-
|
|
259
|
-
case 'error':
|
|
260
|
-
return `<svg viewBox="0 0 20 20" fill="currentColor">
|
|
261
|
-
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zM10 7a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1zm0 8a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"/>
|
|
262
|
-
</svg>`;
|
|
263
|
-
|
|
264
|
-
case 'warning':
|
|
265
|
-
return `<svg viewBox="0 0 20 20" fill="currentColor">
|
|
266
|
-
<path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"/>
|
|
267
|
-
</svg>`;
|
|
268
|
-
|
|
269
|
-
case 'info':
|
|
270
|
-
default:
|
|
271
|
-
return `<svg viewBox="0 0 20 20" fill="currentColor">
|
|
272
|
-
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/>
|
|
273
|
-
</svg>`;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export type ToastType = 'success' | 'error' | 'warning' | 'info';
|
|
2
|
-
export type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
3
|
-
|
|
4
|
-
export interface ToastOptions {
|
|
5
|
-
type?: ToastType;
|
|
6
|
-
duration?: number; // ms, 0 for no auto-dismiss
|
|
7
|
-
position?: ToastPosition;
|
|
8
|
-
closable?: boolean;
|
|
9
|
-
icon?: boolean;
|
|
10
|
-
id?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface SniceToastElement extends HTMLElement {
|
|
14
|
-
type: ToastType;
|
|
15
|
-
message: string;
|
|
16
|
-
closable: boolean;
|
|
17
|
-
icon: boolean;
|
|
18
|
-
hide(): void;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface SniceToastContainerElement extends HTMLElement {
|
|
22
|
-
position: ToastPosition;
|
|
23
|
-
show(message: string, options?: ToastOptions): string;
|
|
24
|
-
hide(id: string): void;
|
|
25
|
-
clear(): void;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface ToastEventDetail {
|
|
29
|
-
message: string;
|
|
30
|
-
options?: ToastOptions;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface ToastResponseEventDetail {
|
|
34
|
-
toastId: string;
|
|
35
|
-
}
|