@sekiui/elements 0.1.3 → 0.1.4
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/cdn/index.js +1 -1
- package/dist/{components/p-Bml9QXVd.js → cdn/p--1ROPZet.js} +22 -12
- package/dist/cdn/p-B4SOpX_A.js +155 -0
- package/dist/cdn/{p-B7jKUvZz.js → p-C3WFySZp.js} +29 -3
- package/dist/cdn/p-COBvV3Rw.js +201 -0
- package/dist/cdn/seki-alert-dialog-content.js +10 -24
- package/dist/cdn/seki-alert-dialog.js +8 -10
- package/dist/cdn/seki-carousel-dots.js +1 -1
- package/dist/cdn/seki-carousel-next.js +1 -1
- package/dist/cdn/seki-carousel-previous.js +1 -1
- package/dist/cdn/seki-collapsible-content.js +23 -40
- package/dist/cdn/seki-collapsible-trigger.js +21 -5
- package/dist/cdn/seki-collapsible.js +18 -11
- package/dist/cdn/seki-combobox-content.js +15 -22
- package/dist/cdn/seki-combobox-input.js +1 -1
- package/dist/cdn/seki-combobox-item.js +1 -1
- package/dist/cdn/seki-combobox.js +1 -1
- package/dist/cdn/seki-command-empty.js +6 -22
- package/dist/cdn/seki-command-group.js +11 -13
- package/dist/cdn/seki-command-input.js +23 -8
- package/dist/cdn/seki-command-item.js +17 -0
- package/dist/cdn/seki-command.js +58 -57
- package/dist/cdn/seki-data-table.js +13 -6
- package/dist/cdn/seki-dialog-content.js +10 -25
- package/dist/cdn/seki-dialog-description.js +13 -7
- package/dist/cdn/seki-dialog-overlay.js +6 -15
- package/dist/cdn/seki-dialog-title.js +13 -7
- package/dist/cdn/seki-dialog.js +1 -1
- package/dist/cdn/seki-drawer-content.js +21 -24
- package/dist/cdn/seki-drawer.js +8 -7
- package/dist/cdn/seki-field-label.js +28 -2
- package/dist/cdn/seki-label.js +1 -1
- package/dist/cdn/seki-navigation-menu-content.js +1 -1
- package/dist/cdn/seki-navigation-menu-item.js +1 -1
- package/dist/cdn/seki-navigation-menu-trigger.js +1 -1
- package/dist/cdn/seki-navigation-menu.js +1 -1
- package/dist/cdn/seki-popover-content.js +14 -20
- package/dist/cdn/seki-popover.js +27 -17
- package/dist/cdn/seki-resizable-handle.js +1 -1
- package/dist/cdn/seki-resizable-panel-group.js +1 -1
- package/dist/cdn/seki-resizable-panel.js +1 -1
- package/dist/cdn/seki-select-content.js +14 -17
- package/dist/cdn/seki-select-option.js +23 -25
- package/dist/cdn/seki-select-trigger.js +32 -38
- package/dist/cdn/seki-select.js +30 -7
- package/dist/cdn/seki-sheet-content.js +24 -24
- package/dist/cdn/seki-sheet.js +8 -7
- package/dist/cdn/seki-toggle-group.js +1 -1
- package/dist/cdn/seki-toggle.js +1 -1
- package/dist/cjs/context-bridge-t3FBhOrW.js +159 -0
- package/dist/cjs/index.cjs.js +1 -0
- package/dist/cjs/label-association-sgmb4sai.js +203 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/seki-alert-dialog-content.cjs.entry.js +10 -24
- package/dist/cjs/seki-alert-dialog.cjs.entry.js +7 -9
- package/dist/cjs/seki-carousel-dots.cjs.entry.js +1 -1
- package/dist/cjs/seki-carousel-next.cjs.entry.js +1 -1
- package/dist/cjs/seki-carousel-previous.cjs.entry.js +1 -1
- package/dist/cjs/seki-collapsible-content.cjs.entry.js +20 -39
- package/dist/cjs/seki-collapsible-trigger.cjs.entry.js +19 -4
- package/dist/cjs/seki-collapsible.cjs.entry.js +16 -10
- package/dist/cjs/seki-combobox-content.cjs.entry.js +15 -22
- package/dist/cjs/seki-combobox-input.cjs.entry.js +1 -1
- package/dist/cjs/seki-combobox-item.cjs.entry.js +1 -1
- package/dist/cjs/seki-combobox.cjs.entry.js +1 -1
- package/dist/cjs/seki-command-empty.cjs.entry.js +6 -22
- package/dist/cjs/seki-command-group.cjs.entry.js +11 -13
- package/dist/cjs/seki-command-input.cjs.entry.js +22 -8
- package/dist/cjs/seki-command-item.cjs.entry.js +17 -0
- package/dist/cjs/seki-command.cjs.entry.js +56 -56
- package/dist/cjs/seki-data-table.cjs.entry.js +10 -6
- package/dist/cjs/seki-dialog-content.cjs.entry.js +10 -25
- package/dist/cjs/seki-dialog-description.cjs.entry.js +10 -6
- package/dist/cjs/seki-dialog-overlay.cjs.entry.js +6 -15
- package/dist/cjs/seki-dialog-title.cjs.entry.js +10 -6
- package/dist/cjs/seki-dialog.cjs.entry.js +21 -12
- package/dist/cjs/seki-drawer-content.cjs.entry.js +20 -24
- package/dist/cjs/seki-drawer.cjs.entry.js +8 -7
- package/dist/cjs/seki-field-label.cjs.entry.js +26 -2
- package/dist/cjs/seki-label.cjs.entry.js +27 -3
- package/dist/cjs/seki-navigation-menu-content.cjs.entry.js +1 -1
- package/dist/cjs/seki-navigation-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/seki-navigation-menu-trigger.cjs.entry.js +1 -1
- package/dist/cjs/seki-navigation-menu.cjs.entry.js +1 -1
- package/dist/cjs/seki-popover-content.cjs.entry.js +14 -20
- package/dist/cjs/seki-popover.cjs.entry.js +24 -16
- package/dist/cjs/seki-resizable-handle.cjs.entry.js +1 -1
- package/dist/cjs/seki-resizable-panel-group.cjs.entry.js +1 -1
- package/dist/cjs/seki-resizable-panel.cjs.entry.js +1 -1
- package/dist/cjs/seki-select-content.cjs.entry.js +14 -17
- package/dist/cjs/seki-select-option.cjs.entry.js +23 -25
- package/dist/cjs/seki-select-trigger.cjs.entry.js +32 -38
- package/dist/cjs/seki-select.cjs.entry.js +29 -7
- package/dist/cjs/seki-sheet-content.cjs.entry.js +22 -24
- package/dist/cjs/seki-sheet.cjs.entry.js +8 -7
- package/dist/cjs/seki-toggle-group.cjs.entry.js +1 -1
- package/dist/cjs/seki-toggle.cjs.entry.js +1 -1
- package/dist/cjs/sekiui.cjs.js +1 -1
- package/dist/collection/components/alert-dialog/seki-alert-dialog-content.js +10 -24
- package/dist/collection/components/alert-dialog/seki-alert-dialog.js +21 -9
- package/dist/collection/components/collapsible/seki-collapsible-content.js +23 -40
- package/dist/collection/components/collapsible/seki-collapsible-trigger.js +24 -4
- package/dist/collection/components/collapsible/seki-collapsible.js +31 -9
- package/dist/collection/components/combobox-content/seki-combobox-content.js +15 -22
- package/dist/collection/components/command/seki-command-empty.js +6 -22
- package/dist/collection/components/command/seki-command-group.js +11 -13
- package/dist/collection/components/command/seki-command-input.js +27 -8
- package/dist/collection/components/command/seki-command-item.js +17 -0
- package/dist/collection/components/command/seki-command.js +71 -55
- package/dist/collection/components/data-table/seki-data-table.js +64 -6
- package/dist/collection/components/dialog/seki-dialog-content.js +10 -25
- package/dist/collection/components/dialog/seki-dialog-description.js +17 -6
- package/dist/collection/components/dialog/seki-dialog-overlay.js +6 -15
- package/dist/collection/components/dialog/seki-dialog-title.js +17 -6
- package/dist/collection/components/dialog/seki-dialog.js +37 -12
- package/dist/collection/components/drawer/seki-drawer-content.js +22 -24
- package/dist/collection/components/drawer/seki-drawer.js +22 -7
- package/dist/collection/components/field-label/seki-field-label.js +39 -3
- package/dist/collection/components/label/seki-label.js +40 -4
- package/dist/collection/components/popover/seki-popover-content.js +14 -20
- package/dist/collection/components/popover/seki-popover.js +41 -15
- package/dist/collection/components/select/seki-select.js +30 -6
- package/dist/collection/components/select-content/seki-select-content.js +14 -17
- package/dist/collection/components/select-option/seki-select-option.js +23 -25
- package/dist/collection/components/select-trigger/seki-select-trigger.js +32 -38
- package/dist/collection/components/sheet/seki-sheet-content.js +25 -24
- package/dist/collection/components/sheet/seki-sheet.js +22 -7
- package/dist/collection/utils/context-bridge.js +105 -4
- package/dist/collection/utils/label-association.js +199 -0
- package/dist/components/index.js +1 -1
- package/dist/{cdn/p-Bml9QXVd.js → components/p--1ROPZet.js} +22 -12
- package/dist/components/p-B4SOpX_A.js +155 -0
- package/dist/components/{p-B7jKUvZz.js → p-C3WFySZp.js} +29 -3
- package/dist/components/p-COBvV3Rw.js +201 -0
- package/dist/components/seki-alert-dialog-content.js +10 -24
- package/dist/components/seki-alert-dialog.js +8 -10
- package/dist/components/seki-carousel-dots.js +1 -1
- package/dist/components/seki-carousel-next.js +1 -1
- package/dist/components/seki-carousel-previous.js +1 -1
- package/dist/components/seki-collapsible-content.js +23 -40
- package/dist/components/seki-collapsible-trigger.js +21 -5
- package/dist/components/seki-collapsible.js +18 -11
- package/dist/components/seki-combobox-content.js +15 -22
- package/dist/components/seki-combobox-input.js +1 -1
- package/dist/components/seki-combobox-item.js +1 -1
- package/dist/components/seki-combobox.js +1 -1
- package/dist/components/seki-command-empty.js +6 -22
- package/dist/components/seki-command-group.js +11 -13
- package/dist/components/seki-command-input.js +23 -8
- package/dist/components/seki-command-item.js +17 -0
- package/dist/components/seki-command.js +58 -57
- package/dist/components/seki-data-table.js +13 -6
- package/dist/components/seki-dialog-content.js +10 -25
- package/dist/components/seki-dialog-description.js +13 -7
- package/dist/components/seki-dialog-overlay.js +6 -15
- package/dist/components/seki-dialog-title.js +13 -7
- package/dist/components/seki-dialog.js +1 -1
- package/dist/components/seki-drawer-content.js +21 -24
- package/dist/components/seki-drawer.js +8 -7
- package/dist/components/seki-field-label.js +28 -2
- package/dist/components/seki-label.js +1 -1
- package/dist/components/seki-navigation-menu-content.js +1 -1
- package/dist/components/seki-navigation-menu-item.js +1 -1
- package/dist/components/seki-navigation-menu-trigger.js +1 -1
- package/dist/components/seki-navigation-menu.js +1 -1
- package/dist/components/seki-popover-content.js +14 -20
- package/dist/components/seki-popover.js +27 -17
- package/dist/components/seki-resizable-handle.js +1 -1
- package/dist/components/seki-resizable-panel-group.js +1 -1
- package/dist/components/seki-resizable-panel.js +1 -1
- package/dist/components/seki-select-content.js +14 -17
- package/dist/components/seki-select-option.js +23 -25
- package/dist/components/seki-select-trigger.js +32 -38
- package/dist/components/seki-select.js +30 -7
- package/dist/components/seki-sheet-content.js +24 -24
- package/dist/components/seki-sheet.js +8 -7
- package/dist/components/seki-toggle-group.js +1 -1
- package/dist/components/seki-toggle.js +1 -1
- package/dist/esm/context-bridge-B4SOpX_A.js +155 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/label-association-COBvV3Rw.js +201 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/seki-alert-dialog-content.entry.js +10 -24
- package/dist/esm/seki-alert-dialog.entry.js +7 -9
- package/dist/esm/seki-carousel-dots.entry.js +1 -1
- package/dist/esm/seki-carousel-next.entry.js +1 -1
- package/dist/esm/seki-carousel-previous.entry.js +1 -1
- package/dist/esm/seki-collapsible-content.entry.js +20 -39
- package/dist/esm/seki-collapsible-trigger.entry.js +19 -4
- package/dist/esm/seki-collapsible.entry.js +16 -10
- package/dist/esm/seki-combobox-content.entry.js +15 -22
- package/dist/esm/seki-combobox-input.entry.js +1 -1
- package/dist/esm/seki-combobox-item.entry.js +1 -1
- package/dist/esm/seki-combobox.entry.js +1 -1
- package/dist/esm/seki-command-empty.entry.js +6 -22
- package/dist/esm/seki-command-group.entry.js +11 -13
- package/dist/esm/seki-command-input.entry.js +22 -8
- package/dist/esm/seki-command-item.entry.js +17 -0
- package/dist/esm/seki-command.entry.js +56 -56
- package/dist/esm/seki-data-table.entry.js +10 -6
- package/dist/esm/seki-dialog-content.entry.js +10 -25
- package/dist/esm/seki-dialog-description.entry.js +10 -6
- package/dist/esm/seki-dialog-overlay.entry.js +6 -15
- package/dist/esm/seki-dialog-title.entry.js +10 -6
- package/dist/esm/seki-dialog.entry.js +21 -12
- package/dist/esm/seki-drawer-content.entry.js +20 -24
- package/dist/esm/seki-drawer.entry.js +8 -7
- package/dist/esm/seki-field-label.entry.js +26 -2
- package/dist/esm/seki-label.entry.js +27 -3
- package/dist/esm/seki-navigation-menu-content.entry.js +1 -1
- package/dist/esm/seki-navigation-menu-item.entry.js +1 -1
- package/dist/esm/seki-navigation-menu-trigger.entry.js +1 -1
- package/dist/esm/seki-navigation-menu.entry.js +1 -1
- package/dist/esm/seki-popover-content.entry.js +14 -20
- package/dist/esm/seki-popover.entry.js +24 -16
- package/dist/esm/seki-resizable-handle.entry.js +1 -1
- package/dist/esm/seki-resizable-panel-group.entry.js +1 -1
- package/dist/esm/seki-resizable-panel.entry.js +1 -1
- package/dist/esm/seki-select-content.entry.js +14 -17
- package/dist/esm/seki-select-option.entry.js +23 -25
- package/dist/esm/seki-select-trigger.entry.js +32 -38
- package/dist/esm/seki-select.entry.js +29 -7
- package/dist/esm/seki-sheet-content.entry.js +22 -24
- package/dist/esm/seki-sheet.entry.js +8 -7
- package/dist/esm/seki-toggle-group.entry.js +1 -1
- package/dist/esm/seki-toggle.entry.js +1 -1
- package/dist/esm/sekiui.js +1 -1
- package/dist/sekiui/index.esm.js +1 -1
- package/dist/sekiui/{p-2459de33.entry.js → p-09131578.entry.js} +1 -1
- package/dist/sekiui/p-14ca64d7.entry.js +1 -0
- package/dist/sekiui/p-1564ab34.entry.js +1 -0
- package/dist/sekiui/p-1b7681eb.entry.js +1 -0
- package/dist/sekiui/{p-573fcf7e.entry.js → p-20e5e17a.entry.js} +1 -1
- package/dist/sekiui/p-2bd3c250.entry.js +1 -0
- package/dist/sekiui/p-2d50d0c2.entry.js +1 -0
- package/dist/sekiui/p-31db5c3f.entry.js +1 -0
- package/dist/sekiui/p-33dd3d17.entry.js +1 -0
- package/dist/sekiui/p-360d7dea.entry.js +1 -0
- package/dist/sekiui/p-3c6d6845.entry.js +1 -0
- package/dist/sekiui/{p-731740ec.entry.js → p-3cd3f36e.entry.js} +1 -1
- package/dist/sekiui/{p-1d173026.entry.js → p-3e456430.entry.js} +1 -1
- package/dist/sekiui/{p-e287c9b0.entry.js → p-4191a2cf.entry.js} +1 -1
- package/dist/sekiui/{p-b75f801b.entry.js → p-48fe9b46.entry.js} +1 -1
- package/dist/sekiui/{p-5a60c7f5.entry.js → p-5132d055.entry.js} +1 -1
- package/dist/sekiui/p-5700ac69.entry.js +1 -0
- package/dist/sekiui/{p-d2592287.entry.js → p-57e7170b.entry.js} +1 -1
- package/dist/sekiui/{p-edac50c7.entry.js → p-5dbd46b4.entry.js} +1 -1
- package/dist/sekiui/p-6923d926.entry.js +1 -0
- package/dist/sekiui/{p-22daeb37.entry.js → p-6c2e4ae8.entry.js} +1 -1
- package/dist/sekiui/p-6edbced1.entry.js +1 -0
- package/dist/sekiui/p-7dac94b2.entry.js +1 -0
- package/dist/sekiui/p-80dbf1f5.entry.js +1 -0
- package/dist/sekiui/p-817af69a.entry.js +1 -0
- package/dist/sekiui/{p-ddcdc3da.entry.js → p-8b3bc7c2.entry.js} +1 -1
- package/dist/sekiui/p-8fb55d56.entry.js +1 -0
- package/dist/sekiui/{p-a575f386.entry.js → p-92b800a2.entry.js} +1 -1
- package/dist/sekiui/{p-63e922dc.entry.js → p-938ce866.entry.js} +1 -1
- package/dist/sekiui/{p-d0533172.entry.js → p-95501e60.entry.js} +1 -1
- package/dist/sekiui/p-979708a0.entry.js +1 -0
- package/dist/sekiui/{p-faf09566.entry.js → p-9c921a6c.entry.js} +1 -1
- package/dist/sekiui/p-B4SOpX_A.js +1 -0
- package/dist/sekiui/p-COBvV3Rw.js +1 -0
- package/dist/sekiui/{p-fc6b3691.entry.js → p-a4fc4f1a.entry.js} +1 -1
- package/dist/sekiui/{p-d7bd5d5e.entry.js → p-b94e0f1b.entry.js} +1 -1
- package/dist/sekiui/{p-1c5fe316.entry.js → p-c6efedab.entry.js} +1 -1
- package/dist/sekiui/p-c8da7923.entry.js +1 -0
- package/dist/sekiui/p-c97fbaf2.entry.js +1 -0
- package/dist/sekiui/p-cb28d764.entry.js +1 -0
- package/dist/sekiui/{p-5f52b52d.entry.js → p-cc2ac0f0.entry.js} +1 -1
- package/dist/sekiui/{p-acebf429.entry.js → p-d32614a4.entry.js} +1 -1
- package/dist/sekiui/p-d3449109.entry.js +1 -0
- package/dist/sekiui/p-ddbf98ca.entry.js +1 -0
- package/dist/sekiui/p-eb03eb37.entry.js +1 -0
- package/dist/sekiui/{p-c57bbe35.entry.js → p-fc9e8583.entry.js} +1 -1
- package/dist/sekiui/sekiui.esm.js +1 -1
- package/dist/types/components/alert-dialog/seki-alert-dialog-content.d.ts +6 -3
- package/dist/types/components/alert-dialog/seki-alert-dialog.d.ts +5 -2
- package/dist/types/components/collapsible/seki-collapsible-content.d.ts +4 -5
- package/dist/types/components/collapsible/seki-collapsible-trigger.d.ts +11 -0
- package/dist/types/components/collapsible/seki-collapsible.d.ts +6 -2
- package/dist/types/components/combobox-content/seki-combobox-content.d.ts +3 -4
- package/dist/types/components/command/seki-command-empty.d.ts +2 -4
- package/dist/types/components/command/seki-command-group.d.ts +2 -3
- package/dist/types/components/command/seki-command-input.d.ts +5 -1
- package/dist/types/components/command/seki-command-item.d.ts +3 -0
- package/dist/types/components/command/seki-command.d.ts +19 -1
- package/dist/types/components/command/types.d.ts +9 -1
- package/dist/types/components/data-table/seki-data-table.d.ts +7 -2
- package/dist/types/components/dialog/seki-dialog-content.d.ts +6 -3
- package/dist/types/components/dialog/seki-dialog-description.d.ts +5 -1
- package/dist/types/components/dialog/seki-dialog-overlay.d.ts +2 -3
- package/dist/types/components/dialog/seki-dialog-title.d.ts +5 -1
- package/dist/types/components/dialog/seki-dialog.d.ts +9 -2
- package/dist/types/components/drawer/seki-drawer-content.d.ts +8 -3
- package/dist/types/components/drawer/seki-drawer.d.ts +5 -1
- package/dist/types/components/field-label/seki-field-label.d.ts +9 -1
- package/dist/types/components/label/seki-label.d.ts +11 -2
- package/dist/types/components/popover/seki-popover-content.d.ts +6 -3
- package/dist/types/components/popover/seki-popover.d.ts +7 -1
- package/dist/types/components/select/seki-select.d.ts +8 -0
- package/dist/types/components/select-content/seki-select-content.d.ts +3 -2
- package/dist/types/components/select-option/seki-select-option.d.ts +9 -3
- package/dist/types/components/select-trigger/seki-select-trigger.d.ts +10 -4
- package/dist/types/components/sheet/seki-sheet-content.d.ts +8 -4
- package/dist/types/components/sheet/seki-sheet.d.ts +5 -1
- package/dist/types/components.d.ts +61 -6
- package/dist/types/utils/context-bridge.d.ts +68 -4
- package/dist/types/utils/label-association.d.ts +58 -0
- package/package.json +1 -1
- package/dist/cdn/p-DJMgrCw3.js +0 -54
- package/dist/cjs/context-bridge-CywF7uJm.js +0 -57
- package/dist/components/p-DJMgrCw3.js +0 -54
- package/dist/esm/context-bridge-DJMgrCw3.js +0 -54
- package/dist/sekiui/p-063951fe.entry.js +0 -1
- package/dist/sekiui/p-326909c5.entry.js +0 -1
- package/dist/sekiui/p-3511d6e5.entry.js +0 -1
- package/dist/sekiui/p-4253845a.entry.js +0 -1
- package/dist/sekiui/p-565acaf2.entry.js +0 -1
- package/dist/sekiui/p-5a55a239.entry.js +0 -1
- package/dist/sekiui/p-5fd3b090.entry.js +0 -1
- package/dist/sekiui/p-6466865a.entry.js +0 -1
- package/dist/sekiui/p-9324d212.entry.js +0 -1
- package/dist/sekiui/p-959fef36.entry.js +0 -1
- package/dist/sekiui/p-DJMgrCw3.js +0 -1
- package/dist/sekiui/p-a55bc3d3.entry.js +0 -1
- package/dist/sekiui/p-ab56de7a.entry.js +0 -1
- package/dist/sekiui/p-ad62e316.entry.js +0 -1
- package/dist/sekiui/p-b8d3aa31.entry.js +0 -1
- package/dist/sekiui/p-b99c6433.entry.js +0 -1
- package/dist/sekiui/p-c15c21b4.entry.js +0 -1
- package/dist/sekiui/p-c529a6b8.entry.js +0 -1
- package/dist/sekiui/p-c99961a7.entry.js +0 -1
- package/dist/sekiui/p-d61319d6.entry.js +0 -1
- package/dist/sekiui/p-da9b3eaa.entry.js +0 -1
- package/dist/sekiui/p-eb50f8d5.entry.js +0 -1
- package/dist/sekiui/p-f886fe62.entry.js +0 -1
- package/dist/sekiui/p-fc288df2.entry.js +0 -1
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context Bridge Utility
|
|
3
|
+
*
|
|
4
|
+
* Generalizes the "parent publishes state onto its host element + child
|
|
5
|
+
* subscribes via closest()" pattern used by compound components (select,
|
|
6
|
+
* toggle-group, combobox, dialog, popover, ...).
|
|
7
|
+
*
|
|
8
|
+
* Parent (provider) contract:
|
|
9
|
+
* - call publishContext() from componentWillLoad(), so the context exists
|
|
10
|
+
* before any child renders for the first time, and
|
|
11
|
+
* - call it again on every state change, including changes that arrive as a
|
|
12
|
+
* @Prop assignment (@Watch) rather than through a @Method or user input.
|
|
13
|
+
*
|
|
14
|
+
* Child (consumer) contract — use a ContextConsumer:
|
|
15
|
+
* - call connect(this.el) from connectedCallback() (runs before the first
|
|
16
|
+
* render, and again after the element is moved to a new parent), and
|
|
17
|
+
* - call disconnect() from disconnectedCallback().
|
|
18
|
+
* connect() invokes the callback once immediately, so a child that
|
|
19
|
+
* upgrades after its parent already published still starts from the current
|
|
20
|
+
* state; a child that upgrades before its parent (one-module-per-tag
|
|
21
|
+
* loading, #314) hears the parent's first publish from componentWillLoad().
|
|
22
|
+
*
|
|
23
|
+
* subscribeToContextChange() is the older listener-only form (no immediate
|
|
24
|
+
* read, light-DOM closest() only); prefer ContextConsumer for new code.
|
|
25
|
+
*
|
|
26
|
+
* Extracted after the same bug (child freezes at mount-time state because
|
|
27
|
+
* nothing told it the parent changed) was independently fixed three times
|
|
28
|
+
* for select (#244/#253), toggle-group (#255/#257), and combobox (#258/#259).
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* One event name shared by every compound-component family. Stencil's
|
|
32
|
+
* @Event() emits with { bubbles: true, composed: true } by default, so a
|
|
33
|
+
* nested compound (e.g. a toggle-group rendered inside a select) can cause an
|
|
34
|
+
* inner parent's event to bubble past an outer parent's own children. This is
|
|
35
|
+
* harmless today only because subscribeToContextChange()'s callback takes no
|
|
36
|
+
* payload and every handler re-reads its own closest() parent's live context
|
|
37
|
+
* rather than trusting event.detail — do not add a payload to this event or
|
|
38
|
+
* that bubbling becomes a real cross-family bug.
|
|
39
|
+
*/
|
|
40
|
+
const SEKI_CONTEXT_CHANGE_EVENT = 'sekiContextChange';
|
|
41
|
+
/**
|
|
42
|
+
* Parent-side: publish a fresh context object onto the host element and
|
|
43
|
+
* notify subscribed children. Must assign a plain property, not a class
|
|
44
|
+
* accessor of the same name — in the dist-custom-elements build the class
|
|
45
|
+
* IS the host element, so an accessor collision throws (#254).
|
|
46
|
+
*/
|
|
47
|
+
function publishContext(el, propertyName, context, emitter) {
|
|
48
|
+
el[propertyName] = context;
|
|
49
|
+
emitter.emit();
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Child-side: find the nearest ancestor matching parentSelector and listen
|
|
53
|
+
* for context-change notifications. onChange is called with no payload by
|
|
54
|
+
* design — children re-read the live context property via closest() rather
|
|
55
|
+
* than trusting a stale event.detail snapshot. No-ops safely (null parent,
|
|
56
|
+
* no-op unsubscribe) if no matching parent is found.
|
|
57
|
+
*/
|
|
58
|
+
function subscribeToContextChange(el, parentSelector, onChange) {
|
|
59
|
+
const parent = el.closest(parentSelector);
|
|
60
|
+
if (parent) {
|
|
61
|
+
parent.addEventListener(SEKI_CONTEXT_CHANGE_EVENT, onChange);
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
parent,
|
|
65
|
+
unsubscribe: () => parent === null || parent === void 0 ? void 0 : parent.removeEventListener(SEKI_CONTEXT_CHANGE_EVENT, onChange),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Nearest ancestor matching `selector`, continuing past shadow roots: when the
|
|
70
|
+
* element's own tree has no match, the search resumes from the shadow host.
|
|
71
|
+
* This lets a part rendered inside another component's shadow tree still find
|
|
72
|
+
* the provider that wraps that component.
|
|
73
|
+
*/
|
|
74
|
+
function findContextProvider(el, selector) {
|
|
75
|
+
var _a;
|
|
76
|
+
let node = el;
|
|
77
|
+
while (node) {
|
|
78
|
+
const match = node.closest(selector);
|
|
79
|
+
if (match)
|
|
80
|
+
return match;
|
|
81
|
+
const root = node.getRootNode();
|
|
82
|
+
// A shadow root is a document fragment with a host (no global ShadowRoot
|
|
83
|
+
// reference, so this also runs under mock-doc / hydrate).
|
|
84
|
+
node = root.nodeType === 11 ? ((_a = root.host) !== null && _a !== void 0 ? _a : null) : null;
|
|
85
|
+
}
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Child-side: tracks one provider (see findContextProvider) for a part.
|
|
90
|
+
*
|
|
91
|
+
* private dialog = new ContextConsumer<DialogContext>('seki-dialog', '_dialogContext', () => this.sync());
|
|
92
|
+
* connectedCallback() { this.dialog.connect(this.el); }
|
|
93
|
+
* disconnectedCallback() { this.dialog.disconnect(); }
|
|
94
|
+
*
|
|
95
|
+
* connect() finds the provider, starts listening for its context-change
|
|
96
|
+
* notifications and calls `onChange` once right away, so the part starts from
|
|
97
|
+
* whatever is already published. `parent` and `context` are already set when
|
|
98
|
+
* that first call happens. Calling connect() from connectedCallback runs it
|
|
99
|
+
* before the first render and again after the part is moved to another
|
|
100
|
+
* provider.
|
|
101
|
+
*
|
|
102
|
+
* `onChange` gets no event payload by design (see SEKI_CONTEXT_CHANGE_EVENT):
|
|
103
|
+
* it reads the live `context`. Notifications bubbling up from a nested
|
|
104
|
+
* provider are ignored; only events dispatched by this part's own provider
|
|
105
|
+
* host (or retargeted to it from that host's shadow tree) count.
|
|
106
|
+
*
|
|
107
|
+
* Works whether or not the provider element has been upgraded yet: the
|
|
108
|
+
* listener sits on the element itself, so the provider's first
|
|
109
|
+
* publishContext() from componentWillLoad() reaches it.
|
|
110
|
+
*/
|
|
111
|
+
class ContextConsumer {
|
|
112
|
+
constructor(parentSelector, propertyName, onChange) {
|
|
113
|
+
this.parentSelector = parentSelector;
|
|
114
|
+
this.propertyName = propertyName;
|
|
115
|
+
this.onChange = onChange;
|
|
116
|
+
this.provider = null;
|
|
117
|
+
this.handleEvent = (event) => {
|
|
118
|
+
if (event.target === this.provider) {
|
|
119
|
+
this.onChange(this.context);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/** The provider element found by the last connect(), or null. */
|
|
124
|
+
get parent() {
|
|
125
|
+
return this.provider;
|
|
126
|
+
}
|
|
127
|
+
/** The provider's current context, or null when there is none yet. */
|
|
128
|
+
get context() {
|
|
129
|
+
return readContext(this.provider, this.propertyName);
|
|
130
|
+
}
|
|
131
|
+
connect(host) {
|
|
132
|
+
var _a;
|
|
133
|
+
this.disconnect();
|
|
134
|
+
this.provider = findContextProvider(host, this.parentSelector);
|
|
135
|
+
(_a = this.provider) === null || _a === void 0 ? void 0 : _a.addEventListener(SEKI_CONTEXT_CHANGE_EVENT, this.handleEvent);
|
|
136
|
+
this.onChange(this.context);
|
|
137
|
+
}
|
|
138
|
+
disconnect() {
|
|
139
|
+
var _a;
|
|
140
|
+
(_a = this.provider) === null || _a === void 0 ? void 0 : _a.removeEventListener(SEKI_CONTEXT_CHANGE_EVENT, this.handleEvent);
|
|
141
|
+
this.provider = null;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Read a context object a provider published with publishContext(). Returns
|
|
146
|
+
* null when there is no provider or it has not published yet.
|
|
147
|
+
*/
|
|
148
|
+
function readContext(parent, propertyName) {
|
|
149
|
+
var _a;
|
|
150
|
+
if (!parent)
|
|
151
|
+
return null;
|
|
152
|
+
return ((_a = parent[propertyName]) !== null && _a !== void 0 ? _a : null);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export { ContextConsumer as C, publishContext as p, subscribeToContextChange as s };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h } from './p-jMliCqbB.js';
|
|
2
|
+
import { L as LabelBinding } from './p-COBvV3Rw.js';
|
|
2
3
|
|
|
3
4
|
const sekiLabelCss = ":host{--seki-label-font-size:var(--seki-font-size-sm, 12px);--seki-label-font-weight:var(--seki-font-weight-medium, 500);--seki-label-font-family:var(--seki-font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto);--seki-label-line-height:var(--seki-line-height-tight, 1.25);--seki-label-color:var(--seki-foreground, #1f2937);--seki-label-muted-color:var(--seki-muted-foreground, #6b7280);--seki-label-required-color:var(--seki-destructive, #ef4444);display:inline-block}.seki-label{display:inline-flex;align-items:center;font-family:var(--seki-label-font-family);font-size:var(--seki-label-font-size);font-weight:var(--seki-label-font-weight);line-height:var(--seki-label-line-height);color:var(--seki-label-color);cursor:default;user-select:none}.seki-label--disabled{color:var(--seki-label-muted-color);cursor:not-allowed;opacity:0.7}.seki-label__required{color:var(--seki-label-required-color);font-weight:var(--seki-font-weight-bold, 700);margin-inline-start:var(--seki-spacing-0-5, 0.125rem)}@media (prefers-contrast: more){.seki-label__required{font-weight:var(--seki-font-weight-bold, 700);text-decoration:underline}}@media (prefers-reduced-motion: reduce){.seki-label{transition:none}}";
|
|
4
5
|
|
|
@@ -20,19 +21,44 @@ const SekiLabel = /*@__PURE__*/ proxyCustomElement(class SekiLabel extends H {
|
|
|
20
21
|
*/
|
|
21
22
|
this.disabled = false;
|
|
22
23
|
}
|
|
24
|
+
onForChange() {
|
|
25
|
+
var _a;
|
|
26
|
+
(_a = this.binding) === null || _a === void 0 ? void 0 : _a.sync();
|
|
27
|
+
}
|
|
28
|
+
/** Forward clicks to the labelled control (see utils/label-association.ts). */
|
|
29
|
+
onClick(event) {
|
|
30
|
+
var _a;
|
|
31
|
+
(_a = this.binding) === null || _a === void 0 ? void 0 : _a.handleClick(event);
|
|
32
|
+
}
|
|
33
|
+
connectedCallback() {
|
|
34
|
+
this.binding = new LabelBinding(this.el, () => this.for);
|
|
35
|
+
}
|
|
36
|
+
componentDidLoad() {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
(_a = this.binding) === null || _a === void 0 ? void 0 : _a.sync();
|
|
39
|
+
(_b = this.binding) === null || _b === void 0 ? void 0 : _b.observe();
|
|
40
|
+
}
|
|
41
|
+
disconnectedCallback() {
|
|
42
|
+
var _a;
|
|
43
|
+
(_a = this.binding) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
44
|
+
}
|
|
23
45
|
render() {
|
|
24
|
-
|
|
25
|
-
return (h("label", Object.assign({ key: 'df80b45752def839bec876b26d32861f31404f55', part: "label" }, labelProps, { class: {
|
|
46
|
+
return (h("label", { key: '1aa6ed2ae6c1c16812dd07aa81b88c0df0790b02', part: "label", class: {
|
|
26
47
|
'seki-label': true,
|
|
27
48
|
'seki-label--disabled': !!this.disabled,
|
|
28
|
-
} }
|
|
49
|
+
} }, h("slot", { key: 'a2da93efc7cca1b92d6001b071f5bfa3971f2a8d', onSlotchange: () => { var _a; return (_a = this.binding) === null || _a === void 0 ? void 0 : _a.sync(); } }), this.required && h("span", { key: '81a2056abc5499c86d889ece899797b2fdea437e', class: "seki-label__required" }, " *")));
|
|
29
50
|
}
|
|
30
51
|
get el() { return this; }
|
|
52
|
+
static get watchers() { return {
|
|
53
|
+
"for": ["onForChange"]
|
|
54
|
+
}; }
|
|
31
55
|
static get style() { return sekiLabelCss; }
|
|
32
56
|
}, [257, "seki-label", {
|
|
33
57
|
"for": [1],
|
|
34
58
|
"required": [4],
|
|
35
59
|
"disabled": [4]
|
|
60
|
+
}, [[0, "click", "onClick"]], {
|
|
61
|
+
"for": ["onForChange"]
|
|
36
62
|
}]);
|
|
37
63
|
function defineCustomElement() {
|
|
38
64
|
if (typeof customElements === "undefined") {
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Label association for `seki-label` and `seki-field-label`.
|
|
3
|
+
*
|
|
4
|
+
* ## Why this exists
|
|
5
|
+
*
|
|
6
|
+
* Both labels render their text inside a shadow root. A native `<label for>`
|
|
7
|
+
* resolves its `for` id inside the tree the `<label>` lives in, so a `<label>`
|
|
8
|
+
* in our shadow root can never reach a control in the page's light DOM: clicks
|
|
9
|
+
* did nothing and the control had no accessible name (#329).
|
|
10
|
+
*
|
|
11
|
+
* The host element (`<seki-label>`) *does* live in the consumer's tree, so the
|
|
12
|
+
* wiring is done from the host in script, resolving the id against
|
|
13
|
+
* `host.getRootNode()` (the label's own root, which is where an author expects
|
|
14
|
+
* `for` to point, also when the label sits inside another component's shadow
|
|
15
|
+
* root together with its control).
|
|
16
|
+
*
|
|
17
|
+
* ## Behaviour
|
|
18
|
+
*
|
|
19
|
+
* - **Activation**: a click on the label forwards to the target the way a native
|
|
20
|
+
* label would. Toggles (checkbox, switch, radio) are clicked, text-like
|
|
21
|
+
* controls are focused. A click that originated on the control itself (the
|
|
22
|
+
* wrapping form `<seki-label><seki-checkbox/> Text</seki-label>`) is ignored so
|
|
23
|
+
* the control never toggles twice.
|
|
24
|
+
* - **Accessible name**: a shadow-DOM control hides its real focusable element
|
|
25
|
+
* (`<button role="checkbox">`, `<input>`, ...) inside its own shadow root, and
|
|
26
|
+
* an `aria-labelledby` id reference cannot cross a shadow boundary, so
|
|
27
|
+
* pointing the host at the label would not name the inner element. SekiUI
|
|
28
|
+
* controls all forward their `aria-label` attribute to that inner element, so
|
|
29
|
+
* for them the label text is passed through as `aria-label`. For native
|
|
30
|
+
* elements the reference does resolve, so we use `aria-labelledby` and the
|
|
31
|
+
* name tracks the label's live content.
|
|
32
|
+
* Anything the author set explicitly (`aria-label`, `aria-labelledby`) is
|
|
33
|
+
* never overwritten; we only manage values we wrote ourselves, tracked with a
|
|
34
|
+
* marker attribute so they can be updated and cleaned up.
|
|
35
|
+
* `ElementInternals.ariaLabelledByElements` is deliberately not used: it is
|
|
36
|
+
* unavailable in Firefox and older Safari, and cannot reach the inner element
|
|
37
|
+
* of a shadow-DOM control either.
|
|
38
|
+
*/
|
|
39
|
+
/* global Document */
|
|
40
|
+
const MANAGED_ATTR = 'data-seki-label-managed';
|
|
41
|
+
/** SekiUI form controls that render their focusable element in a shadow root. */
|
|
42
|
+
const SEKI_CONTROLS = [
|
|
43
|
+
'seki-input',
|
|
44
|
+
'seki-textarea',
|
|
45
|
+
'seki-checkbox',
|
|
46
|
+
'seki-switch',
|
|
47
|
+
'seki-select',
|
|
48
|
+
'seki-slider',
|
|
49
|
+
'seki-radio-group',
|
|
50
|
+
'seki-input-otp',
|
|
51
|
+
'seki-date-picker',
|
|
52
|
+
'seki-combobox',
|
|
53
|
+
].join(',');
|
|
54
|
+
const NATIVE_CONTROLS = 'input:not([type="hidden"]), select, textarea, button';
|
|
55
|
+
let uid = 0;
|
|
56
|
+
function focusInside(target) {
|
|
57
|
+
var _a, _b, _c;
|
|
58
|
+
const inner = (_a = target.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('input:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]');
|
|
59
|
+
(_c = (_b = (inner !== null && inner !== void 0 ? inner : target)).focus) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
60
|
+
}
|
|
61
|
+
class LabelBinding {
|
|
62
|
+
constructor(host, getFor) {
|
|
63
|
+
this.host = host;
|
|
64
|
+
this.getFor = getFor;
|
|
65
|
+
this.target = null;
|
|
66
|
+
}
|
|
67
|
+
/** Resolve the control this label is for, in the label's own root. */
|
|
68
|
+
resolveTarget() {
|
|
69
|
+
var _a, _b, _c;
|
|
70
|
+
const id = this.getFor();
|
|
71
|
+
if (id) {
|
|
72
|
+
const root = this.host.getRootNode();
|
|
73
|
+
return (_b = (_a = root.getElementById) === null || _a === void 0 ? void 0 : _a.call(root, id)) !== null && _b !== void 0 ? _b : null;
|
|
74
|
+
}
|
|
75
|
+
const controls = `${SEKI_CONTROLS}, ${NATIVE_CONTROLS}`;
|
|
76
|
+
// Implicit association: <seki-label><seki-checkbox></seki-checkbox> Text</seki-label>
|
|
77
|
+
const nested = this.host.querySelector(controls);
|
|
78
|
+
if (nested)
|
|
79
|
+
return nested;
|
|
80
|
+
// Inside <seki-field>, a label without `for` names the field's control.
|
|
81
|
+
if (this.host.getAttribute('slot') === 'label') {
|
|
82
|
+
const field = this.host.closest('seki-field');
|
|
83
|
+
return (_c = field === null || field === void 0 ? void 0 : field.querySelector(`:scope > :not([slot]):is(${controls})`)) !== null && _c !== void 0 ? _c : null;
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
/** Label text, without the text of a control nested inside the label. */
|
|
88
|
+
labelText(skip) {
|
|
89
|
+
const parts = [];
|
|
90
|
+
const walk = (node) => {
|
|
91
|
+
var _a;
|
|
92
|
+
if (node === skip)
|
|
93
|
+
return;
|
|
94
|
+
if (node.nodeType === Node.TEXT_NODE)
|
|
95
|
+
parts.push((_a = node.textContent) !== null && _a !== void 0 ? _a : '');
|
|
96
|
+
else
|
|
97
|
+
node.childNodes.forEach(walk);
|
|
98
|
+
};
|
|
99
|
+
this.host.childNodes.forEach(walk);
|
|
100
|
+
return parts.join(' ').replace(/\s+/g, ' ').trim();
|
|
101
|
+
}
|
|
102
|
+
/** (Re)apply the accessible name. Call on load, `for` change and slot change. */
|
|
103
|
+
sync() {
|
|
104
|
+
const next = this.resolveTarget();
|
|
105
|
+
if (next !== this.target) {
|
|
106
|
+
this.release();
|
|
107
|
+
this.target = next;
|
|
108
|
+
}
|
|
109
|
+
const target = this.target;
|
|
110
|
+
if (!target)
|
|
111
|
+
return;
|
|
112
|
+
const managed = target.getAttribute(MANAGED_ATTR);
|
|
113
|
+
const authored = (name) => target.hasAttribute(name) && managed !== name;
|
|
114
|
+
if (target.tagName.includes('-')) {
|
|
115
|
+
if (authored('aria-label'))
|
|
116
|
+
return;
|
|
117
|
+
const text = this.labelText(this.host.contains(target) ? target : null);
|
|
118
|
+
if (text) {
|
|
119
|
+
target.setAttribute('aria-label', text);
|
|
120
|
+
target.setAttribute(MANAGED_ATTR, 'aria-label');
|
|
121
|
+
}
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (authored('aria-labelledby') || authored('aria-label'))
|
|
125
|
+
return;
|
|
126
|
+
if (!this.host.id)
|
|
127
|
+
this.host.id = `seki-label-${++uid}`;
|
|
128
|
+
target.setAttribute('aria-labelledby', this.host.id);
|
|
129
|
+
target.setAttribute(MANAGED_ATTR, 'aria-labelledby');
|
|
130
|
+
}
|
|
131
|
+
/** Remove anything this binding wrote on the current target. */
|
|
132
|
+
release() {
|
|
133
|
+
const target = this.target;
|
|
134
|
+
const managed = target === null || target === void 0 ? void 0 : target.getAttribute(MANAGED_ATTR);
|
|
135
|
+
if (target && managed) {
|
|
136
|
+
target.removeAttribute(managed);
|
|
137
|
+
target.removeAttribute(MANAGED_ATTR);
|
|
138
|
+
}
|
|
139
|
+
this.target = null;
|
|
140
|
+
}
|
|
141
|
+
/** Re-sync when the control is added after the label (async rendering). */
|
|
142
|
+
observe() {
|
|
143
|
+
if (this.observer || typeof MutationObserver === 'undefined')
|
|
144
|
+
return;
|
|
145
|
+
this.observer = new MutationObserver(() => {
|
|
146
|
+
if (this.resolveTarget() !== this.target)
|
|
147
|
+
this.sync();
|
|
148
|
+
});
|
|
149
|
+
this.observer.observe(this.host.getRootNode(), { childList: true, subtree: true });
|
|
150
|
+
}
|
|
151
|
+
disconnect() {
|
|
152
|
+
var _a;
|
|
153
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
154
|
+
this.observer = undefined;
|
|
155
|
+
this.release();
|
|
156
|
+
}
|
|
157
|
+
/** Forward a click on the label to its control, as a native label would. */
|
|
158
|
+
handleClick(event) {
|
|
159
|
+
var _a, _b;
|
|
160
|
+
if (event.defaultPrevented)
|
|
161
|
+
return;
|
|
162
|
+
const target = this.resolveTarget();
|
|
163
|
+
if (!target)
|
|
164
|
+
return;
|
|
165
|
+
const path = event.composedPath();
|
|
166
|
+
// The click came from the control itself: it already handled it.
|
|
167
|
+
if (path.includes(target))
|
|
168
|
+
return;
|
|
169
|
+
// Don't hijack clicks on other interactive content placed inside the label.
|
|
170
|
+
for (const node of path) {
|
|
171
|
+
if (node === this.host)
|
|
172
|
+
break;
|
|
173
|
+
if (node instanceof HTMLElement && node.matches('a[href], button, input, select, textarea'))
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
if (target.hasAttribute('disabled') || target.getAttribute('aria-disabled') === 'true')
|
|
177
|
+
return;
|
|
178
|
+
const toggle = (_a = target.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('[role="checkbox"], [role="switch"]');
|
|
179
|
+
if (toggle) {
|
|
180
|
+
toggle.focus();
|
|
181
|
+
toggle.click();
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (target instanceof HTMLInputElement &&
|
|
185
|
+
['checkbox', 'radio', 'button', 'submit', 'reset'].includes(target.type)) {
|
|
186
|
+
target.focus();
|
|
187
|
+
target.click();
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
if (target instanceof HTMLButtonElement) {
|
|
191
|
+
target.click();
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
if (target.shadowRoot)
|
|
195
|
+
focusInside(target);
|
|
196
|
+
else
|
|
197
|
+
(_b = target.focus) === null || _b === void 0 ? void 0 : _b.call(target);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export { LabelBinding as L };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, d as createEvent, h, e as Host } from './p-jMliCqbB.js';
|
|
2
2
|
import { f as focusFirst, t as trapFocus } from './p-D50kwTtW.js';
|
|
3
|
+
import { C as ContextConsumer } from './p-B4SOpX_A.js';
|
|
3
4
|
|
|
4
5
|
const sekiAlertDialogContentCss = ":host{--seki-neutral-50:hsl(0, 0%, 98%);--seki-neutral-100:hsl(0, 0%, 96.1%);--seki-neutral-200:hsl(0, 0%, 89.8%);--seki-neutral-300:hsl(0, 0%, 83.1%);--seki-neutral-400:hsl(0, 0%, 63.9%);--seki-neutral-500:hsl(0, 0%, 45.1%);--seki-neutral-600:hsl(0, 0%, 32.2%);--seki-neutral-700:hsl(0, 0%, 25.1%);--seki-neutral-800:hsl(0, 0%, 14.9%);--seki-neutral-900:hsl(0, 0%, 9%);--seki-neutral-950:hsl(0, 0%, 3.9%);--seki-primary-50:hsl(210, 100%, 97%);--seki-primary-100:hsl(210, 95%, 93%);--seki-primary-200:hsl(210, 95%, 85%);--seki-primary-300:hsl(210, 90%, 73%);--seki-primary-400:hsl(210, 85%, 58%);--seki-primary-500:hsl(210, 80%, 48%);--seki-primary-600:hsl(210, 75%, 40%);--seki-primary-700:hsl(210, 70%, 32%);--seki-primary-800:hsl(210, 65%, 25%);--seki-primary-900:hsl(210, 60%, 18%);--seki-primary-950:hsl(210, 55%, 10%);--seki-success-500:hsl(142, 71%, 45%);--seki-success-600:hsl(142, 71%, 35%);--seki-warning-500:hsl(38, 92%, 50%);--seki-warning-600:hsl(38, 92%, 40%);--seki-destructive-500:hsl(0, 84.2%, 60.2%);--seki-destructive-600:hsl(0, 72%, 41%);--seki-chart-1:hsl(12, 76%, 61%);--seki-chart-2:hsl(173, 58%, 39%);--seki-chart-3:hsl(197, 37%, 24%);--seki-chart-4:hsl(43, 74%, 66%);--seki-chart-5:hsl(27, 87%, 67%)}:host([data-theme='dark']){color-scheme:dark}:host([data-theme='light']){color-scheme:light}:host{--seki-background:light-dark(hsl(0, 0%, 100%), hsl(0, 0%, 3.9%));--seki-foreground:light-dark(hsl(0, 0%, 3.9%), hsl(0, 0%, 98%));--seki-muted:light-dark(hsl(0, 0%, 96.1%), hsl(0, 0%, 14.9%));--seki-muted-foreground:light-dark(hsl(0, 0%, 42%), hsl(0, 0%, 63.9%));--seki-card:light-dark(hsl(0, 0%, 100%), hsl(0, 0%, 3.9%));--seki-card-foreground:light-dark(hsl(0, 0%, 3.9%), hsl(0, 0%, 98%));--seki-popover:light-dark(hsl(0, 0%, 100%), hsl(0, 0%, 3.9%));--seki-popover-foreground:light-dark(hsl(0, 0%, 3.9%), hsl(0, 0%, 98%));--seki-border:light-dark(hsl(0, 0%, 89.8%), hsl(0, 0%, 14.9%));--seki-input:light-dark(hsl(0, 0%, 89.8%), hsl(0, 0%, 14.9%));--seki-primary:light-dark(hsl(0, 0%, 9%), hsl(0, 0%, 98%));--seki-primary-foreground:light-dark(hsl(0, 0%, 98%), hsl(0, 0%, 9%));--seki-primary-tint:light-dark(hsl(0, 0%, 9%, 0.06), hsl(0, 0%, 98%, 0.1));--seki-primary-tint-foreground:var(--seki-foreground);--seki-secondary:light-dark(hsl(0, 0%, 96.1%), hsl(0, 0%, 14.9%));--seki-secondary-foreground:light-dark(hsl(0, 0%, 9%), hsl(0, 0%, 98%));--seki-accent:light-dark(hsl(0, 0%, 96.1%), hsl(0, 0%, 14.9%));--seki-accent-foreground:light-dark(hsl(0, 0%, 9%), hsl(0, 0%, 98%));--seki-destructive:light-dark(hsl(0, 84.2%, 60.2%), hsl(0, 62.8%, 30.6%));--seki-destructive-foreground:hsl(0, 0%, 98%);--seki-destructive-bg:light-dark(hsl(0, 86%, 97%), rgba(239, 68, 68, 0.1));--seki-destructive-soft-foreground:light-dark(hsl(0, 63%, 31%), hsl(0, 91%, 71%));--seki-success:light-dark(hsl(142, 71%, 45%), hsl(142, 69%, 58%));--seki-success-foreground:light-dark(hsl(142, 64%, 24%), hsl(142, 69%, 58%));--seki-success-bg:light-dark(hsl(142, 76%, 97%), rgba(34, 197, 94, 0.1));--seki-warning:light-dark(hsl(38, 92%, 50%), hsl(43, 96%, 56%));--seki-warning-foreground:light-dark(hsl(21, 77%, 27%), hsl(43, 96%, 56%));--seki-warning-bg:light-dark(hsl(48, 96%, 96%), rgba(245, 158, 11, 0.1));--seki-info:light-dark(hsl(217, 91%, 60%), hsl(217, 92%, 68%));--seki-info-foreground:light-dark(hsl(224, 64%, 33%), hsl(217, 92%, 68%));--seki-info-bg:light-dark(hsl(214, 100%, 97%), rgba(59, 130, 246, 0.1));--seki-ring:light-dark(hsl(0, 0%, 3.9%), hsl(0, 0%, 83.1%));--seki-ring-shadow:hsl(0, 0%, 3.9%, 0.1);--seki-bg-primary:var(--seki-background);--seki-bg-secondary:var(--seki-muted);--seki-bg-tertiary:var(--seki-accent);--seki-text-primary:var(--seki-foreground);--seki-text-secondary:var(--seki-muted-foreground);--seki-text-tertiary:light-dark(var(--seki-neutral-400), var(--seki-neutral-600));--seki-border-default:var(--seki-border);--seki-border-emphasis:light-dark(var(--seki-neutral-300), var(--seki-neutral-700))}:host{--seki-button-primary-bg:var(--seki-primary);--seki-button-primary-text:var(--seki-primary-foreground);--seki-button-primary-border:transparent;--seki-button-primary-hover-bg:light-dark(hsl(0, 0%, 9%, 0.9), hsl(0, 0%, 98%, 0.9));--seki-button-primary-hover-text:var(--seki-primary-foreground);--seki-button-primary-hover-border:transparent;--seki-button-secondary-bg:var(--seki-secondary);--seki-button-secondary-text:var(--seki-secondary-foreground);--seki-button-secondary-border:transparent;--seki-button-secondary-hover-bg:light-dark(hsl(0, 0%, 96.1%, 0.8), hsl(0, 0%, 14.9%, 0.8));--seki-button-secondary-hover-text:var(--seki-secondary-foreground);--seki-button-secondary-hover-border:transparent;--seki-button-outline-bg:transparent;--seki-button-outline-text:var(--seki-foreground);--seki-button-outline-border:var(--seki-input);--seki-button-outline-hover-bg:var(--seki-accent);--seki-button-outline-hover-text:var(--seki-accent-foreground);--seki-button-outline-hover-border:var(--seki-input);--seki-button-ghost-bg:transparent;--seki-button-ghost-text:var(--seki-foreground);--seki-button-ghost-border:transparent;--seki-button-ghost-hover-bg:var(--seki-accent);--seki-button-ghost-hover-text:var(--seki-accent-foreground);--seki-button-ghost-hover-border:transparent;--seki-button-destructive-bg:var(--seki-destructive);--seki-button-destructive-text:var(--seki-destructive-foreground);--seki-button-destructive-border:transparent;--seki-button-destructive-hover-bg:hsl(0, 84.2%, 60.2%, 0.9);--seki-button-destructive-hover-border:transparent;--seki-button-sm-padding-x:var(--seki-spacing-3, 0.75rem);--seki-button-sm-padding-y:0.375rem;--seki-button-sm-font-size:var(--seki-text-sm, 0.875rem);--seki-button-sm-height:2.25rem;--seki-button-md-padding-x:var(--seki-spacing-4, 1rem);--seki-button-md-padding-y:var(--seki-spacing-2, 0.5rem);--seki-button-md-font-size:var(--seki-text-base, 1rem);--seki-button-md-height:2.5rem;--seki-button-lg-padding-x:2rem;--seki-button-lg-padding-y:0.5rem;--seki-button-lg-font-size:1rem;--seki-button-lg-height:2.75rem;--seki-button-icon-sm-size:2rem;--seki-button-icon-size:2.5rem;--seki-button-icon-lg-size:3rem;--seki-button-icon-gap:0.5rem;--seki-button-link-bg:transparent;--seki-button-link-text:var(--seki-primary);--seki-button-link-border:transparent;--seki-button-link-hover-bg:transparent;--seki-button-link-hover-text:var(--seki-primary);--seki-button-link-hover-border:transparent;--seki-button-radius:var(--seki-radius-md, 0.375rem);--seki-button-font-weight:var(--seki-font-medium, 500);--seki-button-transition-duration:150ms;--seki-button-transition-timing:ease-in-out;--seki-button-shadow:var(--seki-shadow-sm, 0 1px 2px 0 rgb(0 0 0 / 0.05));--seki-button-shadow-hover:var(--seki-shadow-md, 0 4px 6px -1px rgb(0 0 0 / 0.1));--seki-button-disabled-opacity:0.5;--seki-input-bg:var(--seki-background);--seki-input-border:var(--seki-border);--seki-input-text:var(--seki-foreground);--seki-input-placeholder:var(--seki-muted-foreground);--seki-input-ring:var(--seki-ring);--seki-input-invalid-border:var(--seki-destructive);--seki-input-invalid-ring:var(--seki-destructive);--seki-input-disabled-opacity:0.5;--seki-input-radius:var(--seki-radius-md);--seki-input-ring-offset:2px;--seki-select-trigger-bg:var(--seki-background);--seki-select-trigger-border:1px solid var(--seki-border);--seki-select-trigger-bg-hover:var(--seki-muted);--seki-select-trigger-radius:var(--seki-radius-md);--seki-select-trigger-min-height:2.5rem;--seki-select-trigger-padding:0.5rem 0.75rem;--seki-select-trigger-gap:0.5rem;--seki-select-content-bg:var(--seki-popover);--seki-select-content-border:1px solid var(--seki-border);--seki-select-content-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1);--seki-select-content-radius:var(--seki-radius-md);--seki-select-content-padding:0.5rem 0;--seki-select-option-padding:0.5rem 0.75rem;--seki-select-option-gap:0.5rem;--seki-select-option-radius:var(--seki-radius-sm);--seki-select-option-bg-hover:var(--seki-muted);--seki-select-option-bg-selected:var(--seki-muted);--seki-select-group-label-padding:0.5rem 0.75rem;--seki-select-group-label-font-size:var(--seki-font-size-xs);--seki-select-group-label-font-weight:var(--seki-font-semibold);--seki-select-group-label-color:var(--seki-muted-foreground);--seki-select-group-separator:1px solid var(--seki-border)}:host{--seki-spacing-0:0;--seki-spacing-0-5:0.125rem;--seki-spacing-1:0.25rem;--seki-spacing-1-5:0.375rem;--seki-spacing-2:0.5rem;--seki-spacing-2-5:0.625rem;--seki-spacing-3:0.75rem;--seki-spacing-3-5:0.875rem;--seki-spacing-4:1rem;--seki-spacing-5:1.25rem;--seki-spacing-6:1.5rem;--seki-spacing-8:2rem;--seki-spacing-10:2.5rem;--seki-spacing-12:3rem;--seki-spacing-16:4rem;--seki-spacing-20:5rem;--seki-spacing-24:6rem;--seki-input-height-sm:2rem;--seki-input-height-md:2.5rem;--seki-input-height-lg:3rem;--seki-input-padding-x:0.75rem;--seki-input-padding-y:0.5rem;--seki-input-font-size:0.875rem;--seki-input-ring-offset:2px}:host{--seki-shadow-sm:0 1px 2px 0 rgb(0 0 0 / 0.05);--seki-shadow-md:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--seki-shadow-lg:0 10px 15px -3px rgb(0 0 0 / 0.15), 0 4px 6px -4px rgb(0 0 0 / 0.1);--seki-shadow-xl:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)}:host{--seki-font-sans:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',\n Arial, sans-serif;--seki-font-mono:ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;--seki-text-xs:0.75rem;--seki-text-sm:0.875rem;--seki-text-base:1rem;--seki-text-lg:1.125rem;--seki-text-xl:1.25rem;--seki-text-2xl:1.5rem;--seki-text-3xl:1.875rem;--seki-text-4xl:2.25rem;--seki-font-normal:400;--seki-font-medium:500;--seki-font-semibold:600;--seki-font-bold:700;--seki-leading-none:1;--seki-leading-tight:1.25;--seki-leading-normal:1.5;--seki-leading-relaxed:1.75}:host{--seki-radius-sm:0.25rem;--seki-radius-md:0.375rem;--seki-radius-lg:0.5rem;--seki-radius-xl:1rem;--seki-radius-full:9999px;}:host{--seki-sidebar-width:16rem;--seki-sidebar-width-icon:3rem;--seki-sidebar-width-mobile:18rem;--seki-sidebar-background:light-dark(hsl(0, 0%, 98%), hsl(240, 5.9%, 10%));--seki-sidebar-foreground:light-dark(hsl(240, 5.3%, 26.1%), hsl(240, 4.8%, 95.9%));--seki-sidebar-primary:light-dark(hsl(240, 5.9%, 10%), hsl(0, 0%, 98%));--seki-sidebar-primary-foreground:light-dark(hsl(0, 0%, 98%), hsl(240, 5.9%, 10%));--seki-sidebar-accent:light-dark(hsl(240, 4.8%, 95.9%), hsl(240, 3.7%, 15.9%));--seki-sidebar-accent-foreground:light-dark(hsl(240, 5.9%, 10%), hsl(240, 4.8%, 95.9%));--seki-sidebar-border:light-dark(hsl(220, 13%, 91%), hsl(240, 3.7%, 15.9%));--seki-sidebar-ring:hsl(217.2, 91.2%, 59.8%);--seki-sidebar-muted-foreground:light-dark(hsl(240, 3.8%, 46.1%), hsl(240, 5%, 64.9%));--seki-sidebar-menu-button-height:2rem;--seki-sidebar-menu-button-height-lg:3rem;--seki-sidebar-menu-button-padding:0.5rem;--seki-sidebar-menu-button-gap:0.5rem;--seki-sidebar-menu-button-radius:var(--seki-radius-md, 0.375rem);--seki-sidebar-menu-sub-padding-left:1.75rem;--seki-sidebar-menu-sub-border-width:1px;--seki-sidebar-group-padding:0.5rem;--seki-sidebar-group-label-height:2rem;--seki-sidebar-group-label-padding:0.5rem;--seki-sidebar-header-height:auto;--seki-sidebar-footer-height:auto;--seki-sidebar-header-padding:0.5rem;--seki-sidebar-footer-padding:0.5rem;--seki-sidebar-content-padding:0.5rem;--seki-sidebar-rail-width:1rem;--seki-sidebar-transition-duration:200ms;--seki-sidebar-transition-timing:ease-in-out;--seki-sidebar-mobile-breakpoint:768px;--seki-sidebar-overlay-bg:hsla(0, 0%, 0%, 0.8)}:host{--seki-animation-fast:150ms;--seki-animation-normal:200ms;--seki-animation-slow:300ms;--seki-ease-in:cubic-bezier(0.4, 0, 1, 1);--seki-ease-out:cubic-bezier(0, 0, 0.2, 1);--seki-ease-in-out:cubic-bezier(0.4, 0, 0.2, 1);--seki-accordion-content-height:auto}@keyframes seki-fade-in{from{opacity:0}to{opacity:1}}@keyframes seki-fade-out{from{opacity:1}to{opacity:0}}@keyframes seki-scale-in{from{opacity:0;transform:scale(0.95)}to{opacity:1;transform:scale(1)}}@keyframes seki-scale-out{from{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(0.95)}}@keyframes seki-slide-in-from-top{from{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes seki-slide-out-to-top{from{transform:translateY(0)}to{transform:translateY(-100%)}}@keyframes seki-slide-in-from-bottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes seki-slide-out-to-bottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes seki-slide-in-from-left{from{transform:translateX(-100%)}to{transform:translateX(0)}}@keyframes seki-slide-out-to-left{from{transform:translateX(0)}to{transform:translateX(-100%)}}@keyframes seki-slide-in-from-right{from{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes seki-slide-out-to-right{from{transform:translateX(0)}to{transform:translateX(100%)}}@keyframes seki-accordion-down{from{height:0;opacity:0}to{height:var(--seki-accordion-content-height);opacity:1}}@keyframes seki-accordion-up{from{height:var(--seki-accordion-content-height);opacity:1}to{height:0;opacity:0}}@keyframes seki-zoom-in{from{opacity:0;transform:scale(0.96)}to{opacity:1;transform:scale(1)}}@keyframes seki-zoom-out{from{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(0.96)}}@keyframes seki-spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}@keyframes seki-pulse{0%,100%{opacity:1}50%{opacity:0.5}}@keyframes seki-bounce{0%,100%{transform:translateY(-25%);animation-timing-function:cubic-bezier(0.8, 0, 1, 1)}50%{transform:translateY(0);animation-timing-function:cubic-bezier(0, 0, 0.2, 1)}}@keyframes seki-collapsible-open{from{height:0;overflow:hidden}to{height:var(--seki-collapsible-content-height, auto)}}@keyframes seki-collapsible-close{from{height:var(--seki-collapsible-content-height, auto)}to{height:0;overflow:hidden}}@keyframes seki-toast-slide-in-right{from{transform:translateX(calc(100% + 1rem))}to{transform:translateX(0)}}@keyframes seki-toast-slide-out-right{from{transform:translateX(0)}to{transform:translateX(calc(100% + 1rem))}}@keyframes seki-toast-swipe-out{from{transform:translateX(var(--seki-toast-swipe-end-x, 0))}to{transform:translateX(calc(100% + 1rem))}}.seki-animate-fade-in{animation:seki-fade-in var(--seki-animation-normal) var(--seki-ease-out)}.seki-animate-fade-out{animation:seki-fade-out var(--seki-animation-normal) var(--seki-ease-in)}.seki-animate-scale-in{animation:seki-scale-in var(--seki-animation-normal) var(--seki-ease-out)}.seki-animate-scale-out{animation:seki-scale-out var(--seki-animation-normal) var(--seki-ease-in)}.seki-animate-spin{animation:seki-spin 1s linear infinite}.seki-animate-pulse{animation:seki-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite}.seki-animate-bounce{animation:seki-bounce 1s infinite}@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important}}[data-theme='dark']{color-scheme:dark}[data-theme='light']{color-scheme:light}:host{display:contents}:host(:not([data-state=\"open\"])){display:none}.alert-dialog-content{position:fixed;left:50%;top:50%;z-index:50;transform:translate(-50%, -50%);width:100%;max-width:32rem;max-height:calc(100vh - 4rem);overflow:auto;display:grid;gap:var(--seki-spacing-4, 1rem);padding:var(--seki-spacing-6, 1.5rem);background-color:var(--seki-background, hsl(0 0% 100%));border:1px solid var(--seki-border, hsl(240 5.9% 90%));border-radius:var(--seki-radius-lg, 0.5rem);box-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1),\n 0 4px 6px -4px rgb(0 0 0 / 0.1);animation:seki-alert-dialog-in var(--seki-animation-normal, 200ms) ease-out}@keyframes seki-alert-dialog-in{from{opacity:0;transform:translate(-50%, -48%) scale(0.96)}to{opacity:1;transform:translate(-50%, -50%) scale(1)}}@keyframes seki-alert-dialog-out{from{opacity:1;transform:translate(-50%, -50%) scale(1)}to{opacity:0;transform:translate(-50%, -48%) scale(0.96)}}@media (max-width: 640px){.alert-dialog-content{max-width:calc(100% - 2rem);padding:var(--seki-spacing-4, 1rem)}}@media (prefers-reduced-motion: reduce){.alert-dialog-content{animation:none}}";
|
|
5
6
|
|
|
@@ -12,6 +13,11 @@ const SekiAlertDialogContent$1 = /*@__PURE__*/ proxyCustomElement(class SekiAler
|
|
|
12
13
|
this.__attachShadow();
|
|
13
14
|
this.requestClose = createEvent(this, "sekiAlertDialogRequestClose");
|
|
14
15
|
this.cancelEvent = createEvent(this, "sekiCancel");
|
|
16
|
+
this.alertDialogConsumer = new ContextConsumer('seki-alert-dialog', '_alertDialogContext', () => this.onAlertDialogOpenChange());
|
|
17
|
+
/**
|
|
18
|
+
* Re-read the parent's context. Runs once on connect (picking up an alert
|
|
19
|
+
* dialog that is already open) and on every publish.
|
|
20
|
+
*/
|
|
15
21
|
this.onAlertDialogOpenChange = () => {
|
|
16
22
|
var _a, _b;
|
|
17
23
|
const context = this.getContext();
|
|
@@ -55,23 +61,10 @@ const SekiAlertDialogContent$1 = /*@__PURE__*/ proxyCustomElement(class SekiAler
|
|
|
55
61
|
* Get context from parent alert dialog
|
|
56
62
|
*/
|
|
57
63
|
getContext() {
|
|
58
|
-
|
|
59
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
60
|
-
return alertDialog ? alertDialog._alertDialogContext : null;
|
|
64
|
+
return this.alertDialogConsumer.context;
|
|
61
65
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const context = this.getContext();
|
|
65
|
-
const wasOpen = this._isOpen;
|
|
66
|
-
this._isOpen = (_a = context === null || context === void 0 ? void 0 : context.isOpen) !== null && _a !== void 0 ? _a : false;
|
|
67
|
-
// Save focus reference when opening
|
|
68
|
-
if (!wasOpen && this._isOpen) {
|
|
69
|
-
this.previousActiveElement = document.activeElement;
|
|
70
|
-
}
|
|
71
|
-
// Restore focus when closing
|
|
72
|
-
if (wasOpen && !this._isOpen) {
|
|
73
|
-
(_b = this.previousActiveElement) === null || _b === void 0 ? void 0 : _b.focus();
|
|
74
|
-
}
|
|
66
|
+
connectedCallback() {
|
|
67
|
+
this.alertDialogConsumer.connect(this.el);
|
|
75
68
|
}
|
|
76
69
|
componentDidRender() {
|
|
77
70
|
if (this._isOpen && this.contentRef) {
|
|
@@ -83,12 +76,6 @@ const SekiAlertDialogContent$1 = /*@__PURE__*/ proxyCustomElement(class SekiAler
|
|
|
83
76
|
});
|
|
84
77
|
}
|
|
85
78
|
}
|
|
86
|
-
componentDidLoad() {
|
|
87
|
-
var _a, _b;
|
|
88
|
-
// Listen for context changes from parent
|
|
89
|
-
this.alertDialogEl = (_a = this.el.closest('seki-alert-dialog')) !== null && _a !== void 0 ? _a : undefined;
|
|
90
|
-
(_b = this.alertDialogEl) === null || _b === void 0 ? void 0 : _b.addEventListener('sekiOpenChange', this.onAlertDialogOpenChange);
|
|
91
|
-
}
|
|
92
79
|
handleKeyDown(event) {
|
|
93
80
|
if (!this._isOpen)
|
|
94
81
|
return;
|
|
@@ -106,8 +93,7 @@ const SekiAlertDialogContent$1 = /*@__PURE__*/ proxyCustomElement(class SekiAler
|
|
|
106
93
|
}
|
|
107
94
|
}
|
|
108
95
|
disconnectedCallback() {
|
|
109
|
-
|
|
110
|
-
(_a = this.alertDialogEl) === null || _a === void 0 ? void 0 : _a.removeEventListener('sekiOpenChange', this.onAlertDialogOpenChange);
|
|
96
|
+
this.alertDialogConsumer.disconnect();
|
|
111
97
|
}
|
|
112
98
|
render() {
|
|
113
99
|
if (!this._isOpen) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, d as createEvent, h, e as Host } from './p-jMliCqbB.js';
|
|
2
|
-
import {
|
|
2
|
+
import { p as publishContext } from './p-B4SOpX_A.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './p--1ROPZet.js';
|
|
3
4
|
|
|
4
5
|
const sekiAlertDialogCss = ":host{display:contents}";
|
|
5
6
|
|
|
@@ -11,6 +12,7 @@ const SekiAlertDialog$1 = /*@__PURE__*/ proxyCustomElement(class SekiAlertDialog
|
|
|
11
12
|
}
|
|
12
13
|
this.__attachShadow();
|
|
13
14
|
this.sekiOpenChange = createEvent(this, "sekiOpenChange");
|
|
15
|
+
this.alertDialogContextChange = createEvent(this, "sekiContextChange");
|
|
14
16
|
/**
|
|
15
17
|
* Controlled open state
|
|
16
18
|
*/
|
|
@@ -33,6 +35,9 @@ const SekiAlertDialog$1 = /*@__PURE__*/ proxyCustomElement(class SekiAlertDialog
|
|
|
33
35
|
}
|
|
34
36
|
componentWillLoad() {
|
|
35
37
|
this._isOpen = this.open || this.defaultOpen;
|
|
38
|
+
// Publish before the first render so `<seki-alert-dialog open>` shows its
|
|
39
|
+
// content at first paint (#323).
|
|
40
|
+
this.updateContext();
|
|
36
41
|
}
|
|
37
42
|
openChanged(newValue) {
|
|
38
43
|
var _a, _b;
|
|
@@ -73,17 +78,10 @@ const SekiAlertDialog$1 = /*@__PURE__*/ proxyCustomElement(class SekiAlertDialog
|
|
|
73
78
|
};
|
|
74
79
|
}
|
|
75
80
|
updateContext() {
|
|
76
|
-
|
|
77
|
-
this.el._alertDialogContext = this.getContext();
|
|
78
|
-
}
|
|
79
|
-
componentDidLoad() {
|
|
80
|
-
this.updateContext();
|
|
81
|
-
}
|
|
82
|
-
componentDidUpdate() {
|
|
83
|
-
this.updateContext();
|
|
81
|
+
publishContext(this.el, '_alertDialogContext', this.getContext(), this.alertDialogContextChange);
|
|
84
82
|
}
|
|
85
83
|
render() {
|
|
86
|
-
return (h(Host, { key: '
|
|
84
|
+
return (h(Host, { key: 'f72986a610922423c3c4b59fd96612924d831333', "data-state": this._isOpen ? 'open' : 'closed' }, h("seki-dialog", { key: '153c7b3e814d0d032ae6c3005c2686e209270f34', ref: (el) => (this.dialogRef = el), open: this._isOpen, modal: true, onSekiOpenChange: this.handleOpenChange }, h("slot", { key: '98963ad9cd86e70f8727686b8cbe1cf59bbc6d1b' }))));
|
|
87
85
|
}
|
|
88
86
|
get el() { return this; }
|
|
89
87
|
static get watchers() { return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, e as Host } from './p-jMliCqbB.js';
|
|
2
|
-
import { s as subscribeToContextChange } from './p-
|
|
2
|
+
import { s as subscribeToContextChange } from './p-B4SOpX_A.js';
|
|
3
3
|
import { w as whenDefined } from './p-C9-yH6MD.js';
|
|
4
4
|
|
|
5
5
|
const sekiCarouselDotsCss = ":host{display:flex;justify-content:center;width:100%;padding-top:0.75rem}.carousel-dots__container{display:flex;align-items:center;justify-content:center;gap:var(--seki-carousel-dot-gap, 0.5rem)}.carousel-dots__dot{display:flex;align-items:center;justify-content:center;padding:0.25rem;border:none;background:transparent;cursor:pointer;transition:transform 0.2s ease}.carousel-dots__dot:hover{transform:scale(1.2)}.carousel-dots__dot:focus-visible{outline:2px solid var(--seki-ring, hsl(0, 0%, 3.9%));outline-offset:2px;border-radius:50%}.carousel-dots__dot-inner{display:block;width:var(--seki-carousel-dot-size, 0.5rem);height:var(--seki-carousel-dot-size, 0.5rem);border-radius:50%;background:var(--seki-carousel-dot-color, var(--seki-muted-foreground, hsl(0, 0%, 42%)));transition:background-color 0.2s ease, width 0.2s ease, height 0.2s ease}.carousel-dots__dot--active .carousel-dots__dot-inner{width:var(--seki-carousel-dot-active-size, 0.625rem);height:var(--seki-carousel-dot-active-size, 0.625rem);background:var(--seki-carousel-dot-active-color, var(--seki-foreground, hsl(0, 0%, 3.9%)))}@media (prefers-reduced-motion: reduce){.carousel-dots__dot,.carousel-dots__dot-inner{transition:none}}";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, e as Host } from './p-jMliCqbB.js';
|
|
2
|
-
import { s as subscribeToContextChange } from './p-
|
|
2
|
+
import { s as subscribeToContextChange } from './p-B4SOpX_A.js';
|
|
3
3
|
import { w as whenDefined } from './p-C9-yH6MD.js';
|
|
4
4
|
|
|
5
5
|
const sekiCarouselNavigationCss = ":host{display:flex;align-items:center;justify-content:center;position:absolute;top:50%;transform:translateY(-50%);z-index:10}:host(.carousel-nav--prev){left:0.5rem}:host(.carousel-nav--next){right:0.5rem}.carousel-nav__button{display:flex;align-items:center;justify-content:center;width:var(--seki-carousel-arrow-size, 2.5rem);height:var(--seki-carousel-arrow-size, 2.5rem);padding:0;border:none;border-radius:50%;background:var(--seki-carousel-arrow-bg, var(--seki-background, hsl(0, 0%, 100%)));color:var(--seki-carousel-arrow-color, var(--seki-foreground, hsl(0, 0%, 3.9%)));cursor:pointer;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);transition:background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;box-shadow:0 2px 8px rgba(0, 0, 0, 0.1)}.carousel-nav__button:hover:not(:disabled){background:var(--seki-carousel-arrow-bg-hover, var(--seki-accent, hsl(0, 0%, 96.1%)));transform:scale(1.05)}.carousel-nav__button:focus-visible{outline:2px solid var(--seki-ring, hsl(0, 0%, 3.9%));outline-offset:2px}.carousel-nav__button:disabled{opacity:0.5;cursor:not-allowed;pointer-events:none}.carousel-nav__icon{width:1.25rem;height:1.25rem;flex-shrink:0}@media (max-width: 480px){:host(.carousel-nav--prev){left:0.25rem}:host(.carousel-nav--next){right:0.25rem}.carousel-nav__button{width:2rem;height:2rem}.carousel-nav__icon{width:1rem;height:1rem}}@media (prefers-reduced-motion: reduce){.carousel-nav__button{transition:none}.carousel-nav__button:hover:not(:disabled){transform:none}}";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, e as Host } from './p-jMliCqbB.js';
|
|
2
|
-
import { s as subscribeToContextChange } from './p-
|
|
2
|
+
import { s as subscribeToContextChange } from './p-B4SOpX_A.js';
|
|
3
3
|
import { w as whenDefined } from './p-C9-yH6MD.js';
|
|
4
4
|
|
|
5
5
|
const sekiCarouselNavigationCss = ":host{display:flex;align-items:center;justify-content:center;position:absolute;top:50%;transform:translateY(-50%);z-index:10}:host(.carousel-nav--prev){left:0.5rem}:host(.carousel-nav--next){right:0.5rem}.carousel-nav__button{display:flex;align-items:center;justify-content:center;width:var(--seki-carousel-arrow-size, 2.5rem);height:var(--seki-carousel-arrow-size, 2.5rem);padding:0;border:none;border-radius:50%;background:var(--seki-carousel-arrow-bg, var(--seki-background, hsl(0, 0%, 100%)));color:var(--seki-carousel-arrow-color, var(--seki-foreground, hsl(0, 0%, 3.9%)));cursor:pointer;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);transition:background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;box-shadow:0 2px 8px rgba(0, 0, 0, 0.1)}.carousel-nav__button:hover:not(:disabled){background:var(--seki-carousel-arrow-bg-hover, var(--seki-accent, hsl(0, 0%, 96.1%)));transform:scale(1.05)}.carousel-nav__button:focus-visible{outline:2px solid var(--seki-ring, hsl(0, 0%, 3.9%));outline-offset:2px}.carousel-nav__button:disabled{opacity:0.5;cursor:not-allowed;pointer-events:none}.carousel-nav__icon{width:1.25rem;height:1.25rem;flex-shrink:0}@media (max-width: 480px){:host(.carousel-nav--prev){left:0.25rem}:host(.carousel-nav--next){right:0.25rem}.carousel-nav__button{width:2rem;height:2rem}.carousel-nav__icon{width:1rem;height:1rem}}@media (prefers-reduced-motion: reduce){.carousel-nav__button{transition:none}.carousel-nav__button:hover:not(:disabled){transform:none}}";
|