@nubisco/ui 4.1.4 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AiLabel-VbZiFHAZ.js → AiLabel-Ci7eROcw.js} +1 -1
- package/dist/{AiLabel-DZ9GkGqL.cjs → AiLabel-DtM5ZCQC.cjs} +1 -1
- package/dist/{Banner-7XsX8ibI.js → Banner-C5Erb75B.js} +1 -1
- package/dist/{Banner-DI5fA8Ow.cjs → Banner-JubX-4yR.cjs} +1 -1
- package/dist/{BlueprintControls-CJAKrQ6U.js → BlueprintControls-BkwhsHI8.js} +1 -1
- package/dist/{BlueprintControls-aF11uokn.cjs → BlueprintControls-CdvNvRkW.cjs} +1 -1
- package/dist/{BlueprintMinimap-C-gCkMIW.cjs → BlueprintMinimap-BIBsnBFs.cjs} +1 -1
- package/dist/{BlueprintMinimap-C-65UzhM.js → BlueprintMinimap-QAw6aiCc.js} +1 -1
- package/dist/{BottomPanel-B-dhgMWB.js → BottomPanel-BoBCdANz.js} +1 -1
- package/dist/{BottomPanel-CmVH0Hsf.cjs → BottomPanel-dbllmH2v.cjs} +1 -1
- package/dist/Button-Dwv0rx46.cjs +1 -0
- package/dist/{Button-Cegx6vaT.js → Button-Q8MBLMvG.js} +12 -4
- package/dist/{Card-Cs-7jXxG.cjs → Card-Cn5OS4q-.cjs} +1 -1
- package/dist/{Card-TjV_N8RU.js → Card-eM6DEphF.js} +1 -1
- package/dist/{Checkbox-BJrnykX9.js → Checkbox-DG82KK8V.js} +1 -1
- package/dist/{Checkbox-D9qW3gph.cjs → Checkbox-vFN3fLyr.cjs} +1 -1
- package/dist/{CheckboxGroup-CUSPscyy.js → CheckboxGroup-5pmdu9fe.js} +1 -1
- package/dist/{CheckboxGroup-mWcKUeq9.cjs → CheckboxGroup-Cyj2NUtI.cjs} +1 -1
- package/dist/{ColorStrip-CR1JDzwX.js → ColorStrip-BBTJU1Ox.js} +47 -45
- package/dist/ColorStrip-D3nbTyfs.cjs +1 -0
- package/dist/CommandPalette-CPJKTiDt.cjs +1 -0
- package/dist/CommandPalette-iaEdat_y.js +223 -0
- package/dist/{Confirm-pgn2HajX.js → Confirm-C-HRTF0s.js} +23 -52
- package/dist/Confirm-w3Ig0L5j.cjs +1 -0
- package/dist/{DataTable-c0ltF6wT.js → DataTable-BVxSUB-h.js} +3 -3
- package/dist/{DataTable-BbiDmA1X.cjs → DataTable-Cnyh04sD.cjs} +1 -1
- package/dist/{DatePicker-YJ8-ViVK.js → DatePicker-BimOzKti.js} +1 -1
- package/dist/{DatePicker-C8_qR25v.cjs → DatePicker-CMPgr4Hp.cjs} +1 -1
- package/dist/{EmptyState-DVg8l-bl.js → EmptyState-CwMG-NeI.js} +1 -1
- package/dist/{EmptyState-henL7JH6.cjs → EmptyState-Cz91HAKF.cjs} +1 -1
- package/dist/{FileUploader-Lzy4bFn7.cjs → FileUploader-BJdRC-Kp.cjs} +1 -1
- package/dist/{FileUploader-BLwR6H3f.js → FileUploader-BO2cDUwP.js} +2 -2
- package/dist/{ImageCropper-CpEGFPKb.cjs → ImageCropper-D7mr-xRE.cjs} +1 -1
- package/dist/{ImageCropper-BX2BnJai.js → ImageCropper-DEaGU0cZ.js} +1 -1
- package/dist/{InfoHint-DesESwdO.cjs → InfoHint-BNpqLVSX.cjs} +1 -1
- package/dist/{InfoHint-JwhhBFZP.js → InfoHint-C663u_NL.js} +1 -1
- package/dist/{InlineEdit-CZEt1vhH.cjs → InlineEdit-D95I45Vt.cjs} +1 -1
- package/dist/{InlineEdit-DNMF_40m.js → InlineEdit-DrhJ0AX2.js} +1 -1
- package/dist/{Message-Daj6hLC4.cjs → Message-Ax7rnAQl.cjs} +1 -1
- package/dist/{Message-BuG5t7bu.js → Message-DqUW3GHc.js} +1 -1
- package/dist/Modal-B1CQyPNo.js +206 -0
- package/dist/Modal-DvukGfHg.cjs +1 -0
- package/dist/{NotificationCenter-DL_Tshyb.js → NotificationCenter-Duu3XZC3.js} +3 -3
- package/dist/{NotificationCenter-D51ty3Lq.cjs → NotificationCenter-oOzClQI-.cjs} +1 -1
- package/dist/{NumberInput-Vc2wzK62.cjs → NumberInput-DKZsdWLv.cjs} +1 -1
- package/dist/{NumberInput-6R8FkJc-.js → NumberInput-_ff3Xi2r.js} +2 -2
- package/dist/{Pagination-B6a62qvI.js → Pagination-6bF88x_p.js} +3 -3
- package/dist/{Pagination-CkBe9Naz.cjs → Pagination-EipK6BGe.cjs} +1 -1
- package/dist/{Panel-BVtGI7YH.js → Panel-D3s_MKfd.js} +1 -1
- package/dist/{Panel-DQfmVtie.cjs → Panel-qDfyu_0v.cjs} +1 -1
- package/dist/{ProgressBar-fAaKT9lD.cjs → ProgressBar-CbqsSdZZ.cjs} +1 -1
- package/dist/{ProgressBar-DjejtCKA.js → ProgressBar-aF2zBoRA.js} +2 -2
- package/dist/{Radio-CQveGtXr.js → Radio-BnI7bi9Y.js} +2 -2
- package/dist/{Radio-DSvkUCxV.cjs → Radio-BqjtCaST.cjs} +1 -1
- package/dist/{ReorderList-Bai4yaIG.cjs → ReorderList-DLQ3rVnX.cjs} +1 -1
- package/dist/{ReorderList-Be-qicSf.js → ReorderList-DpytAupm.js} +1 -1
- package/dist/{Select-swFFQIMN.js → Select-B5t5QtVe.js} +1 -1
- package/dist/{Select-ClCyOqQI.cjs → Select-dAYn2iZO.cjs} +1 -1
- package/dist/{Shell-B8YmApR6.cjs → Shell-9lzopP-w.cjs} +1 -1
- package/dist/{Shell-Dr7LHIqk.js → Shell-B3jhTiNP.js} +99 -96
- package/dist/{ShellPanel-I0ZMGQ4K.js → ShellPanel-B3vZcQhX.js} +1 -1
- package/dist/{ShellPanel-CnN9orWH.cjs → ShellPanel-ChujN0eX.cjs} +1 -1
- package/dist/{SidebarLink-y2If8dtl.js → SidebarLink-B_CGHs0b.js} +1 -1
- package/dist/{SidebarLink-CngTvuB6.cjs → SidebarLink-CZrDLC8g.cjs} +1 -1
- package/dist/{SidebarMenuItem-DoyuIs3w.cjs → SidebarMenuItem-Dc6oh2Nc.cjs} +1 -1
- package/dist/{SidebarMenuItem-DBINoxeA.js → SidebarMenuItem-Dpqr9e0A.js} +1 -1
- package/dist/{Skeleton-D8CHd_4p.cjs → Skeleton-DP9iM6Ku.cjs} +1 -1
- package/dist/{Skeleton-CC7LVdxd.js → Skeleton-sox6qUDk.js} +1 -1
- package/dist/Slider-BNiQaaVa.cjs +1 -0
- package/dist/{Slider-lOhGG7UX.js → Slider-C0761rBk.js} +47 -33
- package/dist/{StepperStep-w1SSX7t7.cjs → StepperStep-B9JEE6WJ.cjs} +1 -1
- package/dist/{StepperStep-DNXUj71b.js → StepperStep-DFeOJ1ju.js} +1 -1
- package/dist/{Tabs-W_4iyGVx.js → Tabs-CQP9zwDw.js} +1 -1
- package/dist/{Tabs-Clg7lzy5.cjs → Tabs-Dp27EDrK.cjs} +1 -1
- package/dist/{TextInput-CGD_wFwo.cjs → TextInput-D4jBlYm9.cjs} +2 -2
- package/dist/{TextInput-CxC2HVj6.js → TextInput-DNrd12uS.js} +2 -2
- package/dist/{Toast-DueO27yl.cjs → Toast-BBsrCQK8.cjs} +1 -1
- package/dist/{Toast-QXobTGZM.js → Toast-cisfK5Zd.js} +1 -1
- package/dist/{Toaster-DcA6PJPt.js → Toaster-C1Uyr6O7.js} +1 -1
- package/dist/{Toaster-DY8o_iiy.cjs → Toaster-Dz_o--LF.cjs} +1 -1
- package/dist/{TreeNode-DS1XJGty.cjs → TreeNode-DB7ipWCg.cjs} +1 -1
- package/dist/{TreeNode-BI-Azvhe.js → TreeNode-a0MHLI27.js} +1 -1
- package/dist/{Walkthrough-DHtLDsOk.cjs → Walkthrough-YD3YYxxM.cjs} +1 -1
- package/dist/{Walkthrough-l7HOZths.js → Walkthrough-qaQ1rved.js} +2 -2
- package/dist/all.cjs +1 -1
- package/dist/all.mjs +137 -135
- package/dist/component-styles.json +1 -1
- package/dist/components/AiLabel.cjs +1 -1
- package/dist/components/AiLabel.mjs +1 -1
- package/dist/components/AiLabel.vue.d.ts.map +1 -1
- package/dist/components/Banner.cjs +1 -1
- package/dist/components/Banner.mjs +1 -1
- package/dist/components/Banner.vue.d.ts.map +1 -1
- package/dist/components/BlueprintControls.cjs +1 -1
- package/dist/components/BlueprintControls.mjs +1 -1
- package/dist/components/BlueprintMinimap.cjs +1 -1
- package/dist/components/BlueprintMinimap.mjs +1 -1
- package/dist/components/BlueprintMinimap.vue.d.ts.map +1 -1
- package/dist/components/Board.vue.d.ts.map +1 -1
- package/dist/components/BottomPanel.cjs +1 -1
- package/dist/components/BottomPanel.mjs +1 -1
- package/dist/components/BottomPanel.vue.d.ts.map +1 -1
- package/dist/components/Button.cjs +1 -1
- package/dist/components/Button.d.ts +25 -1
- package/dist/components/Button.mjs +1 -1
- package/dist/components/Button.vue.d.ts +1 -1
- package/dist/components/Button.vue.d.ts.map +1 -1
- package/dist/components/Calendar.vue.d.ts.map +1 -1
- package/dist/components/Card.cjs +1 -1
- package/dist/components/Card.mjs +1 -1
- package/dist/components/Card.vue.d.ts.map +1 -1
- package/dist/components/Checkbox.cjs +1 -1
- package/dist/components/Checkbox.mjs +1 -1
- package/dist/components/Checkbox.vue.d.ts.map +1 -1
- package/dist/components/CheckboxGroup.cjs +1 -1
- package/dist/components/CheckboxGroup.mjs +1 -1
- package/dist/components/ColorStrip.cjs +1 -1
- package/dist/components/ColorStrip.mjs +1 -1
- package/dist/components/ColorStrip.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette.cjs +1 -1
- package/dist/components/CommandPalette.d.ts +28 -0
- package/dist/components/CommandPalette.mjs +1 -1
- package/dist/components/CommandPalette.vue.d.ts +2 -0
- package/dist/components/CommandPalette.vue.d.ts.map +1 -1
- package/dist/components/Confirm.cjs +1 -1
- package/dist/components/Confirm.mjs +1 -1
- package/dist/components/Confirm.vue.d.ts +1 -1
- package/dist/components/Confirm.vue.d.ts.map +1 -1
- package/dist/components/DataTable.cjs +1 -1
- package/dist/components/DataTable.mjs +1 -1
- package/dist/components/DataTable.vue.d.ts.map +1 -1
- package/dist/components/DatePicker.cjs +1 -1
- package/dist/components/DatePicker.mjs +1 -1
- package/dist/components/DatePicker.vue.d.ts.map +1 -1
- package/dist/components/EmptyState.cjs +1 -1
- package/dist/components/EmptyState.mjs +1 -1
- package/dist/components/EmptyState.vue.d.ts.map +1 -1
- package/dist/components/FileUploader.cjs +1 -1
- package/dist/components/FileUploader.mjs +1 -1
- package/dist/components/FileUploader.vue.d.ts.map +1 -1
- package/dist/components/ImageCropper.cjs +1 -1
- package/dist/components/ImageCropper.mjs +1 -1
- package/dist/components/ImageCropper.vue.d.ts.map +1 -1
- package/dist/components/InfoHint.cjs +1 -1
- package/dist/components/InfoHint.mjs +1 -1
- package/dist/components/InfoHint.vue.d.ts.map +1 -1
- package/dist/components/InlineEdit.cjs +1 -1
- package/dist/components/InlineEdit.mjs +1 -1
- package/dist/components/InlineEdit.vue.d.ts.map +1 -1
- package/dist/components/Menu.vue.d.ts.map +1 -1
- package/dist/components/MenuItem.vue.d.ts.map +1 -1
- package/dist/components/Message.cjs +1 -1
- package/dist/components/Message.mjs +1 -1
- package/dist/components/Message.vue.d.ts.map +1 -1
- package/dist/components/Modal.cjs +1 -1
- package/dist/components/Modal.d.ts +39 -0
- package/dist/components/Modal.mjs +1 -1
- package/dist/components/Modal.vue.d.ts +3 -0
- package/dist/components/Modal.vue.d.ts.map +1 -1
- package/dist/components/NotificationCenter.cjs +1 -1
- package/dist/components/NotificationCenter.mjs +1 -1
- package/dist/components/NotificationCenter.vue.d.ts.map +1 -1
- package/dist/components/NotificationCenterItem.vue.d.ts.map +1 -1
- package/dist/components/NumberInput.cjs +1 -1
- package/dist/components/NumberInput.mjs +1 -1
- package/dist/components/NumberInput.vue.d.ts.map +1 -1
- package/dist/components/Pagination.cjs +1 -1
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/Pagination.vue.d.ts.map +1 -1
- package/dist/components/Panel.cjs +1 -1
- package/dist/components/Panel.mjs +1 -1
- package/dist/components/Panel.vue.d.ts.map +1 -1
- package/dist/components/ProgressBar.cjs +1 -1
- package/dist/components/ProgressBar.mjs +1 -1
- package/dist/components/ProgressBar.vue.d.ts.map +1 -1
- package/dist/components/Radio.cjs +1 -1
- package/dist/components/Radio.mjs +1 -1
- package/dist/components/Radio.vue.d.ts.map +1 -1
- package/dist/components/ReorderList.cjs +1 -1
- package/dist/components/ReorderList.mjs +1 -1
- package/dist/components/ReorderList.vue.d.ts.map +1 -1
- package/dist/components/Select.cjs +1 -1
- package/dist/components/Select.mjs +1 -1
- package/dist/components/Select.vue.d.ts.map +1 -1
- package/dist/components/Shell.cjs +1 -1
- package/dist/components/Shell.mjs +1 -1
- package/dist/components/Shell.vue.d.ts.map +1 -1
- package/dist/components/ShellPanel.cjs +1 -1
- package/dist/components/ShellPanel.mjs +1 -1
- package/dist/components/ShellPanel.vue.d.ts.map +1 -1
- package/dist/components/SidebarLink.cjs +1 -1
- package/dist/components/SidebarLink.mjs +1 -1
- package/dist/components/SidebarLink.vue.d.ts.map +1 -1
- package/dist/components/SidebarMenuItem.cjs +1 -1
- package/dist/components/SidebarMenuItem.mjs +1 -1
- package/dist/components/SidebarMenuItem.vue.d.ts.map +1 -1
- package/dist/components/Skeleton.cjs +1 -1
- package/dist/components/Skeleton.mjs +1 -1
- package/dist/components/Skeleton.vue.d.ts.map +1 -1
- package/dist/components/Slider.cjs +1 -1
- package/dist/components/Slider.d.ts +8 -0
- package/dist/components/Slider.mjs +1 -1
- package/dist/components/Slider.vue.d.ts +1 -0
- package/dist/components/Slider.vue.d.ts.map +1 -1
- package/dist/components/StepperStep.cjs +1 -1
- package/dist/components/StepperStep.mjs +1 -1
- package/dist/components/StepperStep.vue.d.ts.map +1 -1
- package/dist/components/Tabs.cjs +1 -1
- package/dist/components/Tabs.mjs +1 -1
- package/dist/components/Tabs.vue.d.ts.map +1 -1
- package/dist/components/TextInput.cjs +1 -1
- package/dist/components/TextInput.mjs +1 -1
- package/dist/components/TextInput.vue.d.ts.map +1 -1
- package/dist/components/Toast.cjs +1 -1
- package/dist/components/Toast.mjs +1 -1
- package/dist/components/Toast.vue.d.ts.map +1 -1
- package/dist/components/Toaster.cjs +1 -1
- package/dist/components/Toaster.mjs +1 -1
- package/dist/components/TreeNode.cjs +1 -1
- package/dist/components/TreeNode.mjs +1 -1
- package/dist/components/TreeNode.vue.d.ts.map +1 -1
- package/dist/components/UserMenu.vue.d.ts.map +1 -1
- package/dist/components/Walkthrough.cjs +1 -1
- package/dist/components/Walkthrough.mjs +1 -1
- package/dist/components/Walkthrough.vue.d.ts.map +1 -1
- package/dist/composables/useAppearance.composable.cjs +1 -0
- package/dist/composables/useAppearance.composable.d.ts +131 -0
- package/dist/composables/useAppearance.composable.d.ts.map +1 -0
- package/dist/composables/useAppearance.composable.mjs +65 -0
- package/dist/composables/useConfirm.composable.cjs +1 -1
- package/dist/composables/useConfirm.composable.mjs +2 -1
- package/dist/composables/useFocusTrap.composable.cjs +1 -0
- package/dist/composables/useFocusTrap.composable.d.ts +91 -0
- package/dist/composables/useFocusTrap.composable.d.ts.map +1 -0
- package/dist/composables/useFocusTrap.composable.mjs +98 -0
- package/dist/composables/useNamedTheme.composable.cjs +1 -0
- package/dist/composables/useNamedTheme.composable.d.ts +98 -0
- package/dist/composables/useNamedTheme.composable.d.ts.map +1 -0
- package/dist/composables/useNamedTheme.composable.mjs +68 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +45 -43
- package/dist/main.d.ts +5 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/plugins/vite/index.d.ts.map +1 -1
- package/dist/plugins/vite/index.js +59 -0
- package/dist/styles/AiLabel.css +1 -1
- package/dist/styles/Banner.css +1 -1
- package/dist/styles/BlueprintMinimap.css +1 -1
- package/dist/styles/Board.css +1 -1
- package/dist/styles/BottomPanel.css +1 -1
- package/dist/styles/Button.css +1 -1
- package/dist/styles/Calendar.css +1 -1
- package/dist/styles/Card.css +1 -1
- package/dist/styles/Checkbox.css +1 -1
- package/dist/styles/ColorStrip.css +1 -1
- package/dist/styles/CommandPalette.css +1 -1
- package/dist/styles/Confirm.css +1 -1
- package/dist/styles/DataTable.css +1 -1
- package/dist/styles/DatePicker.css +1 -1
- package/dist/styles/EmptyState.css +1 -1
- package/dist/styles/FileUploader.css +1 -1
- package/dist/styles/ImageCropper.css +1 -1
- package/dist/styles/InfoHint.css +1 -1
- package/dist/styles/InlineEdit.css +1 -1
- package/dist/styles/Menu.css +1 -1
- package/dist/styles/MenuItem.css +1 -1
- package/dist/styles/Message.css +1 -1
- package/dist/styles/Modal.css +1 -1
- package/dist/styles/NotificationCenter.css +1 -1
- package/dist/styles/NotificationCenterItem.css +1 -1
- package/dist/styles/NumberInput.css +1 -1
- package/dist/styles/Pagination.css +1 -1
- package/dist/styles/Panel.css +1 -1
- package/dist/styles/ProgressBar.css +1 -1
- package/dist/styles/Radio.css +1 -1
- package/dist/styles/ReorderList.css +1 -1
- package/dist/styles/Select.css +1 -1
- package/dist/styles/Shell.css +1 -1
- package/dist/styles/ShellPanel.css +1 -1
- package/dist/styles/SidebarLink.css +1 -1
- package/dist/styles/SidebarMenuItem.css +1 -1
- package/dist/styles/Skeleton.css +1 -1
- package/dist/styles/Slider.css +1 -1
- package/dist/styles/StepperStep.css +1 -1
- package/dist/styles/Tabs.css +1 -1
- package/dist/styles/TextInput.css +1 -1
- package/dist/styles/Toast.css +1 -1
- package/dist/styles/TreeNode.css +1 -1
- package/dist/styles/UserMenu.css +1 -1
- package/dist/styles/Walkthrough.css +1 -1
- package/dist/ui.css +45 -45
- package/package.json +7 -4
- package/src/plugins/vite/index.ts +62 -0
- package/src/styles/_appearance.scss +144 -0
- package/src/styles/_theme-api.scss +193 -0
- package/src/styles/_theme.scss +91 -5
- package/src/styles/index.scss +8 -0
- package/src/styles/logic/_radius.scss +146 -0
- package/src/styles/logic/index.scss +1 -0
- package/src/styles/presets/_classic-fields.scss +55 -0
- package/dist/Button-Dqtcr4i0.cjs +0 -1
- package/dist/ColorStrip-CAcR1O_R.cjs +0 -1
- package/dist/CommandPalette-BNXzQurN.js +0 -174
- package/dist/CommandPalette-DBjeOPtA.cjs +0 -1
- package/dist/Confirm-CW160zEF.cjs +0 -1
- package/dist/Modal-8lgeNWj8.cjs +0 -1
- package/dist/Modal-iN94HtKE.js +0 -156
- package/dist/Slider-CxrK7cAU.cjs +0 -1
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/// Concentric corner geometry.
|
|
2
|
+
///
|
|
3
|
+
/// Two nested rounded boxes only look like one object if their corners are
|
|
4
|
+
/// concentric: the inner arc has to be the outer arc moved inwards by the
|
|
5
|
+
/// distance between them. The rule is
|
|
6
|
+
///
|
|
7
|
+
/// inner = max(0, outer - inset)
|
|
8
|
+
///
|
|
9
|
+
/// where `inset` is the real distance between the two boundaries. Give both
|
|
10
|
+
/// boxes the same radius and the inner corner looks too round; give the inner
|
|
11
|
+
/// box an unrelated smaller value and the two arcs run at different centres
|
|
12
|
+
/// and the gap between them visibly pinches at the corner.
|
|
13
|
+
///
|
|
14
|
+
/// ## How the context travels
|
|
15
|
+
///
|
|
16
|
+
/// A surface that draws a corner publishes it as `--nb-radius-context`. Custom
|
|
17
|
+
/// properties inherit, so any descendant can read the corner of the nearest
|
|
18
|
+
/// enclosing surface without knowing how deep it is or what is in between.
|
|
19
|
+
///
|
|
20
|
+
/// An inset surface then derives from that context, passing the distance from
|
|
21
|
+
/// the enclosing surface's border-box edge to its own border-box edge. That
|
|
22
|
+
/// distance is a fact the inner component's own stylesheet already knows,
|
|
23
|
+
/// because it is the enclosing surface's padding plus its border, which is
|
|
24
|
+
/// exactly what the layout is built from. Nothing is measured at runtime and
|
|
25
|
+
/// no layout is read back, so this costs nothing and cannot desynchronise.
|
|
26
|
+
///
|
|
27
|
+
/// ## What does *not* derive
|
|
28
|
+
///
|
|
29
|
+
/// DOM nesting alone does not establish a geometric relationship. A button in
|
|
30
|
+
/// the middle of a panel is not an inset boundary of it: it does not follow
|
|
31
|
+
/// the panel's corners, and its radius should not shrink because someone put
|
|
32
|
+
/// it inside something round. Standalone controls use `standalone()` and take
|
|
33
|
+
/// their own semantic role.
|
|
34
|
+
///
|
|
35
|
+
/// Only elements whose edges actually run parallel to the enclosing surface's
|
|
36
|
+
/// edges, at a uniform distance, use `inset()`.
|
|
37
|
+
///
|
|
38
|
+
/// @group @nubisco/radius
|
|
39
|
+
|
|
40
|
+
/// Declares an element as a surface with its own corner, and publishes that
|
|
41
|
+
/// corner to its descendants.
|
|
42
|
+
///
|
|
43
|
+
/// @param {String} $role - a semantic role: control, popover, panel, modal
|
|
44
|
+
/// @param {String} $radius [null] - an explicit value, for the rare surface
|
|
45
|
+
/// whose corner is not one of the roles
|
|
46
|
+
@mixin surface($role: null, $radius: null) {
|
|
47
|
+
@if $radius {
|
|
48
|
+
border-radius: #{$radius};
|
|
49
|
+
--nb-radius-context: #{$radius};
|
|
50
|
+
} @else {
|
|
51
|
+
border-radius: var(--nb-radius-#{$role});
|
|
52
|
+
--nb-radius-context: var(--nb-radius-#{$role});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/// Derives this element's corner from the enclosing surface's.
|
|
57
|
+
///
|
|
58
|
+
/// `$inset` is the distance from the enclosing surface's border-box edge to
|
|
59
|
+
/// this element's border-box edge: its padding plus its border width. Pass the
|
|
60
|
+
/// same expression the layout uses, so the two cannot drift apart.
|
|
61
|
+
///
|
|
62
|
+
/// `max()` floors the result at zero, which is what CSS wants anyway and what
|
|
63
|
+
/// keeps a deeply inset surface from trying to go negative.
|
|
64
|
+
///
|
|
65
|
+
/// The result is also written to `--nb-radius-self`, which is what
|
|
66
|
+
/// `publish-inner()` republishes one level down. This mixin deliberately does
|
|
67
|
+
/// NOT write `--nb-radius-context` itself: a custom property that reads the
|
|
68
|
+
/// same name it declares is self-referential, which CSS treats as invalid at
|
|
69
|
+
/// computed-value time, and the whole chain silently collapses to zero. That
|
|
70
|
+
/// is not a theoretical hazard, it is the bug the first version of this file
|
|
71
|
+
/// shipped with.
|
|
72
|
+
///
|
|
73
|
+
/// @param {String} $inset - distance between the two boundaries
|
|
74
|
+
@mixin inset($inset) {
|
|
75
|
+
--nb-radius-self: max(0px, calc(var(--nb-radius-context, 0px) - #{$inset}));
|
|
76
|
+
|
|
77
|
+
border-radius: var(--nb-radius-self);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/// Republishes a derived corner as the context for the next level down.
|
|
81
|
+
///
|
|
82
|
+
/// Goes on an element that does not itself derive: a component's inner content
|
|
83
|
+
/// wrapper, typically. Because that element declares `--nb-radius-context` but
|
|
84
|
+
/// never declares `--nb-radius-self`, there is no cycle, and concentric
|
|
85
|
+
/// geometry composes to any depth.
|
|
86
|
+
///
|
|
87
|
+
/// ```scss
|
|
88
|
+
/// .card { @include radius.surface(panel); }
|
|
89
|
+
/// .card__media { @include radius.inset(16px); }
|
|
90
|
+
/// .card__body { @include radius.publish-inner(); }
|
|
91
|
+
/// ```
|
|
92
|
+
@mixin publish-inner {
|
|
93
|
+
--nb-radius-context: var(--nb-radius-self, 0px);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/// The two-axis form, for an inset that differs horizontally and vertically.
|
|
97
|
+
///
|
|
98
|
+
/// A padded card whose image bleeds to the left and right edges but not to the
|
|
99
|
+
/// top and bottom is inset by zero on one axis and by the padding on the
|
|
100
|
+
/// other, and a single radius cannot describe that. CSS takes the two axes
|
|
101
|
+
/// either side of a slash.
|
|
102
|
+
///
|
|
103
|
+
/// @param {String} $inset-x - horizontal distance between the boundaries
|
|
104
|
+
/// @param {String} $inset-y - vertical distance between the boundaries
|
|
105
|
+
@mixin inset-xy($inset-x, $inset-y) {
|
|
106
|
+
--nb-radius-self-x: max(
|
|
107
|
+
0px,
|
|
108
|
+
calc(var(--nb-radius-context, 0px) - #{$inset-x})
|
|
109
|
+
);
|
|
110
|
+
--nb-radius-self-y: max(
|
|
111
|
+
0px,
|
|
112
|
+
calc(var(--nb-radius-context, 0px) - #{$inset-y})
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
border-radius: var(--nb-radius-self-x) / var(--nb-radius-self-y);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/// A control that lives inside a surface without following its corners.
|
|
119
|
+
///
|
|
120
|
+
/// Takes its own semantic role and stops the context there, so that anything
|
|
121
|
+
/// nested inside the control derives from the control rather than from the
|
|
122
|
+
/// panel two levels up.
|
|
123
|
+
///
|
|
124
|
+
/// @param {String} $role - a semantic role: control, popover, panel, modal
|
|
125
|
+
@mixin standalone($role: control) {
|
|
126
|
+
border-radius: var(--nb-radius-#{$role});
|
|
127
|
+
--nb-radius-context: var(--nb-radius-#{$role});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/// Geometry that never follows the appearance setting.
|
|
131
|
+
///
|
|
132
|
+
/// Avatars, radios and status dots are round because of what they are, not
|
|
133
|
+
/// because of a style preference, and a switch track is a track at any
|
|
134
|
+
/// appearance. This exists so those cases read as deliberate in the source
|
|
135
|
+
/// rather than looking like values someone forgot to tokenise.
|
|
136
|
+
@mixin circular {
|
|
137
|
+
border-radius: var(--nb-radius-circle);
|
|
138
|
+
// A circle is not a corner anything can be concentric with, and a child
|
|
139
|
+
// deriving from 50% would get a meaningless percentage of its own box.
|
|
140
|
+
--nb-radius-context: 0px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@mixin pill {
|
|
144
|
+
border-radius: var(--nb-radius-pill);
|
|
145
|
+
--nb-radius-context: 0px;
|
|
146
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/// The pre-5.0 field treatment, as an opt-out.
|
|
2
|
+
///
|
|
3
|
+
/// The library's default field fill changed: the enabled state used to be
|
|
4
|
+
/// `#cacbcc` in the light theme, a mid grey darker than every surface it sat
|
|
5
|
+
/// on, which is what most interfaces use to mean "unavailable". Enabled was
|
|
6
|
+
/// wearing the disabled state's clothes, and `disabled` on top of it was only
|
|
7
|
+
/// a `0.45` opacity, so the two differed in brightness rather than in kind.
|
|
8
|
+
///
|
|
9
|
+
/// The new default lightens the enabled fill and gives disabled and read-only
|
|
10
|
+
/// their own boundary contrast. **Geometry is identical**: still a filled box
|
|
11
|
+
/// with a single bottom rule, still square, same height, padding and
|
|
12
|
+
/// alignment. Corner rounding is a separate, global concern and is not
|
|
13
|
+
/// something a field treatment decides.
|
|
14
|
+
///
|
|
15
|
+
/// This preset exists for an application that has calibrated screenshots,
|
|
16
|
+
/// visual regression baselines or printed material against the old fills and
|
|
17
|
+
/// wants to move on its own schedule:
|
|
18
|
+
///
|
|
19
|
+
/// ```html
|
|
20
|
+
/// <html data-nb-preset="classic-fields">
|
|
21
|
+
/// ```
|
|
22
|
+
///
|
|
23
|
+
/// It can also be scoped to a subtree. It restores fills and boundary
|
|
24
|
+
/// contrast only, so it composes with the appearance setting exactly as the
|
|
25
|
+
/// default does.
|
|
26
|
+
///
|
|
27
|
+
/// @group @nubisco/presets
|
|
28
|
+
|
|
29
|
+
@use '../variables/layers';
|
|
30
|
+
|
|
31
|
+
@mixin classic-fields {
|
|
32
|
+
[data-nb-preset='classic-fields'] {
|
|
33
|
+
--nb-c-field-bg: #{layers.token(layers.$light, field-bg)};
|
|
34
|
+
--nb-c-field-border: #{layers.token(layers.$light, field-border)};
|
|
35
|
+
// The old treatment had no separate disabled or read-only values: both
|
|
36
|
+
// fell back to the enabled ones and leaned on opacity alone.
|
|
37
|
+
--nb-c-field-bg-disabled: #{layers.token(layers.$light, field-bg)};
|
|
38
|
+
--nb-c-field-border-disabled: #{layers.token(layers.$light, field-border)};
|
|
39
|
+
--nb-c-field-border-readonly: #{layers.token(layers.$light, field-border)};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/*
|
|
43
|
+
* Two selectors because the theme class and the preset attribute can land on
|
|
44
|
+
* the same element or on different ones, and a compound `.dark[data-...]`
|
|
45
|
+
* alone would miss the nested case.
|
|
46
|
+
*/
|
|
47
|
+
.dark[data-nb-preset='classic-fields'],
|
|
48
|
+
.dark [data-nb-preset='classic-fields'] {
|
|
49
|
+
--nb-c-field-bg: #{layers.token(layers.$dark, field-bg)};
|
|
50
|
+
--nb-c-field-border: #{layers.token(layers.$dark, field-border)};
|
|
51
|
+
--nb-c-field-bg-disabled: #{layers.token(layers.$dark, field-bg)};
|
|
52
|
+
--nb-c-field-border-disabled: #{layers.token(layers.$dark, field-border)};
|
|
53
|
+
--nb-c-field-border-readonly: #{layers.token(layers.$dark, field-border)};
|
|
54
|
+
}
|
|
55
|
+
}
|
package/dist/Button-Dqtcr4i0.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),t=require(`./Size.d-GBIblj2D.cjs`),n=require(`./Icon-C8R_r_In.cjs`),r=require(`./composables/useRouterLink.composable.cjs`);let i=require(`vue`);var a=function(e){return e.Button=`button`,e.Submit=`submit`,e.Reset=`reset`,e}(a||{}),o={key:0,class:`nb-button__decorations`},s={key:0,class:`nb-button__spinner`,"aria-hidden":`true`},c=(0,i.defineComponent)({__name:`Button`,props:{variant:{default:void 0},outlined:{type:Boolean,default:!1},size:{default:t.t.Medium},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},icon:{default:void 0},type:{default:a.Button},href:{default:void 0},target:{default:void 0},rel:{default:void 0},to:{default:void 0}},emits:[`click`],setup(e){let t=e,a=(0,i.useSlots)(),c=(0,i.computed)(()=>!a.default&&!!(t.icon||t.loading)),l=r.useRouterLink(),u=(0,i.computed)(()=>t.to!=null&&!!l.value),d=(0,i.computed)(()=>{if(typeof t.to==`string`)return t.to;if(t.href)return t.href}),f=(0,i.computed)(()=>u.value?l.value:d.value?`a`:`button`),p=(0,i.computed)(()=>f.value===`a`?{href:d.value,target:t.target,rel:t.rel}:{}),m={xxs:10,xs:12,sm:12,md:14,lg:16,xl:16,xxl:20},h=(0,i.computed)(()=>m[t.size??`md`]??14);return(t,r)=>((0,i.openBlock)(),(0,i.createBlock)((0,i.resolveDynamicComponent)(f.value),(0,i.mergeProps)({class:[`nb-button`,`nb-button--${e.variant}`,`nb-button--${e.size}`,{"nb-button--outlined":e.outlined},{"nb-button--loading":e.loading},{"nb-button--icon-only":c.value}],to:u.value?e.to:void 0},p.value,{disabled:f.value===`button`?e.disabled||e.loading:void 0,"aria-disabled":f.value!==`button`&&(e.disabled||e.loading)?!0:void 0,type:f.value===`button`?e.type:void 0,onClick:r[0]||=n=>e.disabled||e.loading?void 0:t.$emit(`click`,n)}),{default:(0,i.withCtx)(()=>[(0,i.renderSlot)(t.$slots,`default`,{},void 0,!0),e.loading||e.icon?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,o,[e.loading?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,s)):e.icon?((0,i.openBlock)(),(0,i.createBlock)(n.t,{key:1,name:e.icon,size:h.value,class:`nb-button__icon`},null,8,[`name`,`size`])):(0,i.createCommentVNode)(``,!0)])):(0,i.createCommentVNode)(``,!0)]),_:3},16,[`class`,`to`,`disabled`,`aria-disabled`,`type`]))}}),l=e.t(c,[[`__scopeId`,`data-v-fc827929`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),n=require(`./Icon-C8R_r_In.cjs`),r=require(`./Label-CXejhF9x.cjs`),i=require(`./Grid-DVT8lBHr.cjs`);let a=require(`vue`),o=require(`@nubisco/ui/icons/empty`);o=e.n(o);var s={key:1,class:`nb-color-strip-wrapper__inner-header`},c={key:1,class:`nb-color-strip-wrapper__inner-label`},l=30,u=8,d=(0,a.defineComponent)({__name:`ColorStrip`,props:(0,a.mergeModels)({options:{default:()=>[`#DCDCDC`,`#C0C0C0`,`#808080`]},onlyView:{type:Boolean,default:!1},allowMultiple:{type:Boolean,default:!1},wrap:{type:Boolean,default:!1},showNull:{type:Boolean,default:!1},variant:{default:`default`},id:{default:void 0},label:{default:void 0}},{modelValue:{},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,d=`nb-color-strip-${(0,a.useId)()}`,f=(0,a.computed)(()=>t.id??d),p=(0,a.useModel)(e,`modelValue`,{set:e=>e}),m=(0,a.computed)(()=>t.options.map(e=>typeof e==`string`?{value:e,color:e}:{...e,color:e.color||`#FFFFFF`,value:e.value===void 0?e.color:e.value})),h={id:`null-option`,value:null,color:`transparent`,label:`None`},g=(0,a.ref)(p.value==null);(0,a.watch)(()=>p.value,e=>{e??(g.value=!0)});let _=(0,a.computed)(()=>t.allowMultiple?!1:t.showNull||g.value),v=(0,a.computed)(()=>_.value?[h,...m.value]:m.value),y=(0,a.computed)(()=>{if(!t.wrap)return{maxWidth:`none`,flexWrap:`nowrap`};let e=v.value.length;if(e<=0)return;let n=Math.ceil(Math.sqrt(e));return{maxWidth:`${n*l+(n-1)*u}px`,flexWrap:`wrap`}}),b=(0,a.computed)(()=>({"nb-color-strip":!0,"only-view":t.onlyView})),x=e=>t.onlyView?!1:e===null?p.value==null:e===void 0?!1:t.allowMultiple?Array.isArray(p.value)&&p.value.includes(e):p.value===e,S=e=>({"nb-color-strip-color":!0,"nb-color-strip-color-null":w(e),selected:!t.onlyView&&x(e.value)}),C=e=>{if(!w(e))return{backgroundColor:e.color}},w=e=>e.id===`null-option`,T=e=>x(e.value)?`duotone`:`regular`,E=e=>{if(e!==void 0){if(!t.allowMultiple&&e===null){p.value=null;return}if(t.allowMultiple){let t=Array.isArray(p.value)?p.value.slice():[],n=t.indexOf(e);n===-1?t.push(e):t.splice(n,1),p.value=t}else p.value=e}};function D(e){let t=typeof e==`string`?e:e.color,{r:n,g:r,b:i}=O((t&&t.startsWith(`var(`)?getComputedStyle(document.documentElement).getPropertyValue(t.slice(4,-1).trim()).trim():t)||`#FFFFFF`);return(.299*n+.587*r+.114*i)/255>.5?`black`:`white`}function O(e){let t=e.replace(`#`,``);t.length===3&&(t=t.split(``).map(e=>e+e).join(``));let n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:n&255}}return(t,l)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{class:(0,a.normalizeClass)([`nb-color-strip-wrapper`,`nb-color-strip-wrapper--${e.variant}`])},[e.variant===`default`?((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:0},[t.$slots.label?(0,a.renderSlot)(t.$slots,`label`,{key:0},void 0,!0):e.label?((0,a.openBlock)(),(0,a.createBlock)(r.t,{key:1,for:f.value,disabled:!1},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(e.label),1)]),_:1},8,[`for`])):(0,a.createCommentVNode)(``,!0)],64)):(0,a.createCommentVNode)(``,!0),e.variant===`fluid`&&(e.label||t.$slots.label)?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,s,[t.$slots.label?(0,a.renderSlot)(t.$slots,`label`,{key:0},void 0,!0):((0,a.openBlock)(),(0,a.createElementBlock)(`label`,c,(0,a.toDisplayString)(e.label),1))])):(0,a.createCommentVNode)(``,!0),(0,a.createVNode)(i.t,{id:f.value,dir:`row`,gap:`xs`,class:(0,a.normalizeClass)(b.value),shrink:!1,style:(0,a.normalizeStyle)(y.value)},{default:(0,a.withCtx)(()=>[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(v.value,t=>((0,a.openBlock)(),(0,a.createBlock)(i.t,{is:`button`,key:`option-${t.id||t.value}`,align:`center`,justify:`center`,class:(0,a.normalizeClass)(S(t)),style:(0,a.normalizeStyle)(C(t)),disabled:t.disabled,onClick:n=>!e.onlyView&&E(t.value)},{default:(0,a.withCtx)(()=>[!e.onlyView&&x(t.value)&&!w(t)?((0,a.openBlock)(),(0,a.createBlock)(n.t,{key:0,name:`check-light`,color:D(t)},null,8,[`color`])):(0,a.createCommentVNode)(``,!0),w(t)?((0,a.openBlock)(),(0,a.createBlock)(n.t,{key:1,name:o,weight:T(t)},null,8,[`weight`])):(0,a.createCommentVNode)(``,!0)]),_:2},1032,[`class`,`style`,`disabled`,`onClick`]))),128))]),_:1},8,[`id`,`class`,`style`])],2))}}),f=t.t(d,[[`__scopeId`,`data-v-5c562edf`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return f}});
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { NB_COMMAND_PALETTE_KEY as e } from "./composables/useCommandPalette.composable.mjs";
|
|
2
|
-
import { t } from "./Icon-rREAqsu0.js";
|
|
3
|
-
import { useScrollLock as n } from "./composables/useScrollLock.composable.mjs";
|
|
4
|
-
import { Fragment as r, Teleport as i, Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createVNode as d, defineComponent as f, inject as p, nextTick as m, normalizeClass as ee, onBeforeUnmount as h, onMounted as g, openBlock as _, ref as v, renderList as y, toDisplayString as b, unref as x, vModelText as S, watch as C, withCtx as w, withDirectives as T, withModifiers as E } from "vue";
|
|
5
|
-
import { regular as D } from "@nubisco/ui/icons/magnifying-glass";
|
|
6
|
-
//#region src/components/CommandPalette.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var O = { class: "nb-command-palette__input-row" }, k = ["placeholder"], A = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "nb-command-palette__results"
|
|
10
|
-
}, j = {
|
|
11
|
-
key: 0,
|
|
12
|
-
class: "nb-command-palette__group-header"
|
|
13
|
-
}, M = ["onClick", "onMouseenter"], N = { class: "nb-command-palette__item-label" }, P = {
|
|
14
|
-
key: 1,
|
|
15
|
-
class: "nb-command-palette__item-shortcut"
|
|
16
|
-
}, F = {
|
|
17
|
-
key: 1,
|
|
18
|
-
class: "nb-command-palette__empty"
|
|
19
|
-
}, I = {
|
|
20
|
-
key: 2,
|
|
21
|
-
class: "nb-command-palette__empty"
|
|
22
|
-
}, L = /* @__PURE__ */ f({
|
|
23
|
-
__name: "CommandPalette",
|
|
24
|
-
props: {
|
|
25
|
-
openShortcut: { default: "Meta+k" },
|
|
26
|
-
placeholder: { default: "Search commands..." },
|
|
27
|
-
maxResults: { default: 50 }
|
|
28
|
-
},
|
|
29
|
-
setup(f) {
|
|
30
|
-
let { lock: L, unlock: R } = n(), z = f, B = p(e), V = v(null), H = v(""), U = v(null);
|
|
31
|
-
function W(e, t) {
|
|
32
|
-
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
33
|
-
if (n.startsWith(r)) return 1e3 + r.length / n.length * 100;
|
|
34
|
-
if (n.split(/[\s\-_./]+/).some((e) => e.startsWith(r))) return 500;
|
|
35
|
-
let i = n.indexOf(r);
|
|
36
|
-
if (i >= 0) return 300 - i;
|
|
37
|
-
let a = 0, o = 0;
|
|
38
|
-
for (let e = 0; e < n.length && a < r.length; e++) n[e] === r[a] && (o += 10, e > 0 && n[e - 1] === (a > 0 ? r[a - 1] : "") && (o += 5), a++);
|
|
39
|
-
return a === r.length ? o : -1;
|
|
40
|
-
}
|
|
41
|
-
function G(e, t) {
|
|
42
|
-
let n = W(e.label, t);
|
|
43
|
-
if (e.namespace && (n = Math.max(n, W(e.namespace, t) * .8)), e.keywords) for (let r of e.keywords) n = Math.max(n, W(r, t) * .7);
|
|
44
|
-
return n;
|
|
45
|
-
}
|
|
46
|
-
let K = o(() => {
|
|
47
|
-
let e = Array.from(B.commands.values()).filter((e) => !e.context || e.context === B.activeContext);
|
|
48
|
-
return H.value ? e.map((e) => ({
|
|
49
|
-
cmd: e,
|
|
50
|
-
score: G(e, H.value)
|
|
51
|
-
})).filter((e) => e.score > 0).sort((e, t) => t.score - e.score).slice(0, z.maxResults).map((e) => e.cmd) : e.slice(0, z.maxResults);
|
|
52
|
-
}), q = o(() => {
|
|
53
|
-
let e = /* @__PURE__ */ new Map();
|
|
54
|
-
for (let t of K.value) {
|
|
55
|
-
let n = t.namespace ?? "";
|
|
56
|
-
e.has(n) || e.set(n, []), e.get(n).push(t);
|
|
57
|
-
}
|
|
58
|
-
return Array.from(e.entries()).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => ({
|
|
59
|
-
namespace: e,
|
|
60
|
-
commands: t.sort((e, t) => e.label.localeCompare(t.label))
|
|
61
|
-
}));
|
|
62
|
-
}), J = o(() => q.value.flatMap((e) => e.commands));
|
|
63
|
-
function Y(e) {
|
|
64
|
-
B.close(), H.value = "", e.handler();
|
|
65
|
-
}
|
|
66
|
-
function X(e) {
|
|
67
|
-
if (e.key === "Escape") {
|
|
68
|
-
e.preventDefault(), B.close(), H.value = "";
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
let t = J.value;
|
|
72
|
-
if (!t.length) return;
|
|
73
|
-
let n = t.findIndex((e) => e.id === U.value);
|
|
74
|
-
if (e.key === "ArrowDown") e.preventDefault(), U.value = t[n < t.length - 1 ? n + 1 : 0].id, Z();
|
|
75
|
-
else if (e.key === "ArrowUp") e.preventDefault(), U.value = t[n > 0 ? n - 1 : t.length - 1].id, Z();
|
|
76
|
-
else if (e.key === "Enter" && U.value) {
|
|
77
|
-
e.preventDefault();
|
|
78
|
-
let n = t.find((e) => e.id === U.value);
|
|
79
|
-
n && Y(n);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
function Z() {
|
|
83
|
-
m(() => {
|
|
84
|
-
document.querySelector(".nb-command-palette__item--highlighted")?.scrollIntoView({ block: "nearest" });
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
C(() => B.isOpen, (e) => {
|
|
88
|
-
e ? (H.value = B.searchFilter ?? "", U.value = null, m(() => {
|
|
89
|
-
V.value?.focus(), m(() => {
|
|
90
|
-
J.value.length > 0 && (U.value = J.value[0].id);
|
|
91
|
-
});
|
|
92
|
-
}), L()) : (H.value = "", R());
|
|
93
|
-
}), C(K, (e) => {
|
|
94
|
-
e.length > 0 && !e.find((e) => e.id === U.value) ? U.value = e[0].id : e.length === 0 && (U.value = null);
|
|
95
|
-
});
|
|
96
|
-
let Q = {
|
|
97
|
-
cmd: "⌘",
|
|
98
|
-
meta: "⌘",
|
|
99
|
-
shift: "⇧",
|
|
100
|
-
alt: "⌥",
|
|
101
|
-
option: "⌥",
|
|
102
|
-
ctrl: "⌃",
|
|
103
|
-
control: "⌃"
|
|
104
|
-
};
|
|
105
|
-
function te(e) {
|
|
106
|
-
return e.split("+").map((e) => Q[e.trim().toLowerCase()] || e.trim());
|
|
107
|
-
}
|
|
108
|
-
function ne(e) {
|
|
109
|
-
let t = e.toLowerCase().split("+");
|
|
110
|
-
return {
|
|
111
|
-
key: t[t.length - 1],
|
|
112
|
-
meta: t.includes("meta") || t.includes("cmd"),
|
|
113
|
-
ctrl: t.includes("ctrl") || t.includes("control"),
|
|
114
|
-
shift: t.includes("shift"),
|
|
115
|
-
alt: t.includes("alt")
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
function $(e) {
|
|
119
|
-
if (e.key === "Escape" && B.isOpen) {
|
|
120
|
-
e.preventDefault(), B.close(), H.value = "";
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
let t = ne(z.openShortcut), n = e.key.toLowerCase() === t.key, r = t.meta ? e.metaKey : !e.metaKey, i = t.ctrl ? e.ctrlKey : !e.ctrlKey, a = t.shift ? e.shiftKey : !e.shiftKey, o = t.alt ? e.altKey : !e.altKey;
|
|
124
|
-
n && r && i && a && o && (e.preventDefault(), B.isOpen ? B.close() : B.open());
|
|
125
|
-
}
|
|
126
|
-
return g(() => {
|
|
127
|
-
document.addEventListener("keydown", $);
|
|
128
|
-
}), h(() => {
|
|
129
|
-
document.removeEventListener("keydown", $), R();
|
|
130
|
-
}), (e, n) => (_(), s(i, { to: "body" }, [d(a, { name: "nb-command-palette" }, {
|
|
131
|
-
default: w(() => [x(B).isOpen ? (_(), l("div", {
|
|
132
|
-
key: 0,
|
|
133
|
-
class: "nb-command-palette__overlay",
|
|
134
|
-
onClick: n[1] ||= E((e) => x(B).close(), ["self"])
|
|
135
|
-
}, [u("div", {
|
|
136
|
-
class: "nb-command-palette",
|
|
137
|
-
onKeydown: X
|
|
138
|
-
}, [u("div", O, [d(t, {
|
|
139
|
-
name: x(D),
|
|
140
|
-
size: 20,
|
|
141
|
-
class: "nb-command-palette__search-icon"
|
|
142
|
-
}, null, 8, ["name"]), T(u("input", {
|
|
143
|
-
ref_key: "inputRef",
|
|
144
|
-
ref: V,
|
|
145
|
-
"onUpdate:modelValue": n[0] ||= (e) => H.value = e,
|
|
146
|
-
type: "text",
|
|
147
|
-
class: "nb-command-palette__input",
|
|
148
|
-
placeholder: f.placeholder,
|
|
149
|
-
autocomplete: "off",
|
|
150
|
-
spellcheck: "false"
|
|
151
|
-
}, null, 8, k), [[S, H.value]])]), q.value.length > 0 ? (_(), l("div", A, [(_(!0), l(r, null, y(q.value, (e) => (_(), l(r, { key: e.namespace }, [e.namespace ? (_(), l("div", j, b(e.namespace), 1)) : c("", !0), (_(!0), l(r, null, y(e.commands, (e) => (_(), l("div", {
|
|
152
|
-
key: e.id,
|
|
153
|
-
class: ee(["nb-command-palette__item", { "nb-command-palette__item--highlighted": e.id === U.value }]),
|
|
154
|
-
onClick: (t) => Y(e),
|
|
155
|
-
onMouseenter: (t) => U.value = e.id
|
|
156
|
-
}, [
|
|
157
|
-
e.icon ? (_(), s(t, {
|
|
158
|
-
key: 0,
|
|
159
|
-
name: e.icon,
|
|
160
|
-
size: 16,
|
|
161
|
-
class: "nb-command-palette__item-icon"
|
|
162
|
-
}, null, 8, ["name"])) : c("", !0),
|
|
163
|
-
u("span", N, b(e.label), 1),
|
|
164
|
-
e.shortcut ? (_(), l("span", P, [(_(!0), l(r, null, y(te(e.shortcut), (e, t) => (_(), l("kbd", {
|
|
165
|
-
key: t,
|
|
166
|
-
class: "nb-command-palette__key"
|
|
167
|
-
}, b(e), 1))), 128))])) : c("", !0)
|
|
168
|
-
], 42, M))), 128))], 64))), 128))])) : H.value ? (_(), l("div", F, " No matching commands ")) : (_(), l("div", I, " Type to search commands "))], 32)])) : c("", !0)]),
|
|
169
|
-
_: 1
|
|
170
|
-
})]));
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
//#endregion
|
|
174
|
-
export { L as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./composables/useCommandPalette.composable.cjs`),t=require(`./Icon-C8R_r_In.cjs`),n=require(`./composables/useScrollLock.composable.cjs`);let r=require(`vue`),i=require(`@nubisco/ui/icons/magnifying-glass`);var a={class:`nb-command-palette__input-row`},o=[`placeholder`],s={key:0,class:`nb-command-palette__results`},c={key:0,class:`nb-command-palette__group-header`},l=[`onClick`,`onMouseenter`],u={class:`nb-command-palette__item-label`},d={key:1,class:`nb-command-palette__item-shortcut`},f={key:1,class:`nb-command-palette__empty`},p={key:2,class:`nb-command-palette__empty`},m=(0,r.defineComponent)({__name:`CommandPalette`,props:{openShortcut:{default:`Meta+k`},placeholder:{default:`Search commands...`},maxResults:{default:50}},setup(m){let{lock:h,unlock:g}=n.useScrollLock(),_=m,v=(0,r.inject)(e.NB_COMMAND_PALETTE_KEY),y=(0,r.ref)(null),b=(0,r.ref)(``),x=(0,r.ref)(null);function S(e,t){let n=e.toLowerCase(),r=t.toLowerCase();if(n.startsWith(r))return 1e3+r.length/n.length*100;if(n.split(/[\s\-_./]+/).some(e=>e.startsWith(r)))return 500;let i=n.indexOf(r);if(i>=0)return 300-i;let a=0,o=0;for(let e=0;e<n.length&&a<r.length;e++)n[e]===r[a]&&(o+=10,e>0&&n[e-1]===(a>0?r[a-1]:``)&&(o+=5),a++);return a===r.length?o:-1}function C(e,t){let n=S(e.label,t);if(e.namespace&&(n=Math.max(n,S(e.namespace,t)*.8)),e.keywords)for(let r of e.keywords)n=Math.max(n,S(r,t)*.7);return n}let w=(0,r.computed)(()=>{let e=Array.from(v.commands.values()).filter(e=>!e.context||e.context===v.activeContext);return b.value?e.map(e=>({cmd:e,score:C(e,b.value)})).filter(e=>e.score>0).sort((e,t)=>t.score-e.score).slice(0,_.maxResults).map(e=>e.cmd):e.slice(0,_.maxResults)}),T=(0,r.computed)(()=>{let e=new Map;for(let t of w.value){let n=t.namespace??``;e.has(n)||e.set(n,[]),e.get(n).push(t)}return Array.from(e.entries()).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({namespace:e,commands:t.sort((e,t)=>e.label.localeCompare(t.label))}))}),E=(0,r.computed)(()=>T.value.flatMap(e=>e.commands));function D(e){v.close(),b.value=``,e.handler()}function O(e){if(e.key===`Escape`){e.preventDefault(),v.close(),b.value=``;return}let t=E.value;if(!t.length)return;let n=t.findIndex(e=>e.id===x.value);if(e.key===`ArrowDown`)e.preventDefault(),x.value=t[n<t.length-1?n+1:0].id,k();else if(e.key===`ArrowUp`)e.preventDefault(),x.value=t[n>0?n-1:t.length-1].id,k();else if(e.key===`Enter`&&x.value){e.preventDefault();let n=t.find(e=>e.id===x.value);n&&D(n)}}function k(){(0,r.nextTick)(()=>{document.querySelector(`.nb-command-palette__item--highlighted`)?.scrollIntoView({block:`nearest`})})}(0,r.watch)(()=>v.isOpen,e=>{e?(b.value=v.searchFilter??``,x.value=null,(0,r.nextTick)(()=>{y.value?.focus(),(0,r.nextTick)(()=>{E.value.length>0&&(x.value=E.value[0].id)})}),h()):(b.value=``,g())}),(0,r.watch)(w,e=>{e.length>0&&!e.find(e=>e.id===x.value)?x.value=e[0].id:e.length===0&&(x.value=null)});let A={cmd:`⌘`,meta:`⌘`,shift:`⇧`,alt:`⌥`,option:`⌥`,ctrl:`⌃`,control:`⌃`};function j(e){return e.split(`+`).map(e=>A[e.trim().toLowerCase()]||e.trim())}function M(e){let t=e.toLowerCase().split(`+`);return{key:t[t.length-1],meta:t.includes(`meta`)||t.includes(`cmd`),ctrl:t.includes(`ctrl`)||t.includes(`control`),shift:t.includes(`shift`),alt:t.includes(`alt`)}}function N(e){if(e.key===`Escape`&&v.isOpen){e.preventDefault(),v.close(),b.value=``;return}let t=M(_.openShortcut),n=e.key.toLowerCase()===t.key,r=t.meta?e.metaKey:!e.metaKey,i=t.ctrl?e.ctrlKey:!e.ctrlKey,a=t.shift?e.shiftKey:!e.shiftKey,o=t.alt?e.altKey:!e.altKey;n&&r&&i&&a&&o&&(e.preventDefault(),v.isOpen?v.close():v.open())}return(0,r.onMounted)(()=>{document.addEventListener(`keydown`,N)}),(0,r.onBeforeUnmount)(()=>{document.removeEventListener(`keydown`,N),g()}),(e,n)=>((0,r.openBlock)(),(0,r.createBlock)(r.Teleport,{to:`body`},[(0,r.createVNode)(r.Transition,{name:`nb-command-palette`},{default:(0,r.withCtx)(()=>[(0,r.unref)(v).isOpen?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:0,class:`nb-command-palette__overlay`,onClick:n[1]||=(0,r.withModifiers)(e=>(0,r.unref)(v).close(),[`self`])},[(0,r.createElementVNode)(`div`,{class:`nb-command-palette`,onKeydown:O},[(0,r.createElementVNode)(`div`,a,[(0,r.createVNode)(t.t,{name:(0,r.unref)(i.regular),size:20,class:`nb-command-palette__search-icon`},null,8,[`name`]),(0,r.withDirectives)((0,r.createElementVNode)(`input`,{ref_key:`inputRef`,ref:y,"onUpdate:modelValue":n[0]||=e=>b.value=e,type:`text`,class:`nb-command-palette__input`,placeholder:m.placeholder,autocomplete:`off`,spellcheck:`false`},null,8,o),[[r.vModelText,b.value]])]),T.value.length>0?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,s,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(T.value,e=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:e.namespace},[e.namespace?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,c,(0,r.toDisplayString)(e.namespace),1)):(0,r.createCommentVNode)(``,!0),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.commands,e=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:e.id,class:(0,r.normalizeClass)([`nb-command-palette__item`,{"nb-command-palette__item--highlighted":e.id===x.value}]),onClick:t=>D(e),onMouseenter:t=>x.value=e.id},[e.icon?((0,r.openBlock)(),(0,r.createBlock)(t.t,{key:0,name:e.icon,size:16,class:`nb-command-palette__item-icon`},null,8,[`name`])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`span`,u,(0,r.toDisplayString)(e.label),1),e.shortcut?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,d,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(j(e.shortcut),(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`kbd`,{key:t,class:`nb-command-palette__key`},(0,r.toDisplayString)(e),1))),128))])):(0,r.createCommentVNode)(``,!0)],42,l))),128))],64))),128))])):b.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,f,` No matching commands `)):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,p,` Type to search commands `))],32)])):(0,r.createCommentVNode)(``,!0)]),_:1})]))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return m}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./composables/useReducedMotion.composable.cjs`),t=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),n=require(`./Icon-C8R_r_In.cjs`),r=require(`./Button-Dqtcr4i0.cjs`),i=require(`./Message-Daj6hLC4.cjs`),a=require(`./Modal-8lgeNWj8.cjs`),ee=require(`./TextInput-CGD_wFwo.cjs`);let o=require(`vue`),s=require(`@nubisco/ui/icons/warning`),c=require(`@nubisco/ui/icons/check`);var l=200,u=[`[data-nb-confirm-floating]`,`.nb-select__dropdown`,`.nb-menu`,`.nb-date-picker__calendar`,`.nb-user-menu__panel`,`.nb-sidebar-menu-item__flyout`],d=new Set;function f(e){let t=e.trim();return t?(d.add(t),()=>{d.delete(t)}):()=>{}}function p(e=[]){return[...u,...d,...e].map(e=>e.trim()).filter(Boolean).join(`,`)}function m(e,t){if(!e)return;let n=`${t?0:200}ms`;e.style.transitionDuration=n;let r=e.parentElement;r instanceof HTMLElement&&(r.style.transitionDuration=n)}var h={key:0,class:`nb-confirm__message`},te={key:0,class:`nb-confirm__subject-kind`},ne={class:`nb-confirm__subject-name`},g={key:1,class:`nb-confirm__gate`},_={class:`nb-confirm__live`},re={key:0,class:`nb-confirm__status`,role:`status`},ie={key:1,class:`nb-confirm__status nb-confirm__status--success`,role:`status`},v=(0,o.defineComponent)({__name:`Confirm`,props:{open:{type:Boolean,default:!1},title:{},message:{default:void 0},subject:{default:void 0},subjectLabel:{default:void 0},confirmLabel:{default:`Confirm`},cancelLabel:{default:`Cancel`},tone:{default:`danger`},typeToConfirm:{default:void 0},typeToConfirmLabel:{default:void 0},typeToConfirmHelper:{default:void 0},busy:{type:Boolean,default:!1},busyLabel:{default:`Working...`},succeeded:{type:Boolean,default:!1},successLabel:{default:void 0},error:{default:void 0},size:{default:`sm`},floatingSelectors:{default:()=>[]},contentClass:{default:void 0}},emits:[`confirm`,`cancel`],setup(t,{expose:l,emit:u}){let d=t,f=u,v=(0,o.useId)(),y=`nb-confirm-title-${v}`,b=`nb-confirm-body-${v}`,x=(0,o.useSlots)(),S=(0,o.ref)(null),C=(0,o.ref)(null),w=(0,o.ref)(null),T=(0,o.ref)(``),E=e.useReducedMotion(),D=(0,o.computed)(()=>d.busy||d.succeeded);function O(){return!!d.message||!!d.subject||!!x.default}let k=(0,o.computed)(()=>d.tone===`danger`?`danger`:`primary`),A=(0,o.computed)(()=>d.typeToConfirmLabel??`Type ${d.typeToConfirm} to confirm`),j=(0,o.computed)(()=>!d.typeToConfirm||T.value.trim()===d.typeToConfirm),M=(0,o.computed)(()=>j.value&&!D.value);function N(){M.value&&f(`confirm`)}function P(){let e=w.value?.$el;return e instanceof HTMLElement?e:null}function F(){return S.value?.closest(`[role="dialog"],[role="alertdialog"]`)??null}function ae(){return typeof document>`u`?[]:Array.from(document.querySelectorAll(`[aria-modal="true"]`))}function I(){let e=F();if(!e)return!1;let t=ae();return t.length===0||t[t.length-1]===e}let L=[`a[href]:not([tabindex="-1"])`,`area[href]:not([tabindex="-1"])`,`button:not([disabled]):not([tabindex="-1"])`,`input:not([disabled]):not([type="hidden"]):not([tabindex="-1"])`,`select:not([disabled]):not([tabindex="-1"])`,`textarea:not([disabled]):not([tabindex="-1"])`,`summary:not([tabindex="-1"])`,`audio[controls]:not([tabindex="-1"])`,`video[controls]:not([tabindex="-1"])`,`iframe:not([tabindex="-1"])`,`[contenteditable]:not([contenteditable="false"]):not([tabindex="-1"])`,`[tabindex]:not([tabindex="-1"])`].map(e=>`${e}:not([hidden]):not([aria-hidden="true"])`).join(`,`);function R(){return p(d.floatingSelectors)}function z(e){return e instanceof Element?!!e.closest(R()):!1}function B(e){let t=F();return!!t&&!!e&&t.contains(e)}function V(){let e=F();return e?Array.from(e.querySelectorAll(L)).filter(e=>e.getAttribute(`aria-disabled`)!==`true`):[]}function H(){let e=F();return e?(e.focus(),!0):!1}function U(){let e=V()[0];e?e.focus():H()}let W=null;function G(){let e=W;W=null,e?.isConnected&&e.focus()}function K(){m(F(),E.value)}(0,o.watch)(E,()=>{d.open&&K()}),(0,o.watch)(()=>[d.busy,d.error],async(e,t)=>{if(!d.open)return;let[n,r]=e,i=t?.[0]??!1;if(await(0,o.nextTick)(),n){V().length===0&&H();return}if(i&&r){let e=C.value;e?e.focus():U();return}let a=document.activeElement;!B(a)&&!z(a)&&U()}),(0,o.watch)(()=>d.open,async e=>{e?(W=document.activeElement instanceof HTMLElement?document.activeElement:null,T.value=``,await(0,o.nextTick)(),K(),P()?P()?.focus():H()):G()},{immediate:!0});function q(){D.value||f(`cancel`)}let J=!1,Y=!1;function X(e){let t=e.target;J=B(t)||z(t)}function Z(e){Y=B(e.target)}function oe(){let e=J&&!Y;J=!1,!e&&q()}function Q(e){if(!d.open||z(document.activeElement))return;if(e.key===`Escape`){if(!I())return;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),q();return}if(e.key!==`Tab`||!I())return;let t=V();if(t.length===0){e.preventDefault(),B(document.activeElement)||H();return}let n=t[0],r=t[t.length-1],i=document.activeElement;e.shiftKey&&(i===n||!B(i))?(e.preventDefault(),r.focus()):!e.shiftKey&&i===r?(e.preventDefault(),n.focus()):B(i)||(e.preventDefault(),n.focus())}function $(e){if(!d.open)return;let t=e.relatedTarget;if(t instanceof Element){if(B(t)||z(t))return}else if(t!==null)return;requestAnimationFrame(()=>{if(!d.open)return;let e=document.activeElement;B(e)||z(e)||e&&e!==document.body&&!e.isConnected||I()&&U()})}return typeof document<`u`&&(document.addEventListener(`keydown`,Q,!0),document.addEventListener(`focusout`,$,!0),document.addEventListener(`mousedown`,X,!0),document.addEventListener(`touchstart`,X,!0),document.addEventListener(`click`,Z,!0)),(0,o.onMounted)(()=>{d.open&&(K(),P()?P()?.focus():H())}),(0,o.onUnmounted)(()=>{typeof document<`u`&&(document.removeEventListener(`keydown`,Q,!0),document.removeEventListener(`focusout`,$,!0),document.removeEventListener(`mousedown`,X,!0),document.removeEventListener(`touchstart`,X,!0),document.removeEventListener(`click`,Z,!0)),G()}),l({focusCancel:()=>P()?.focus(),restoreFocus:G,isTopmost:I}),(e,l)=>((0,o.openBlock)(),(0,o.createBlock)(a.t,{open:t.open,size:t.size,role:t.tone===`danger`?`alertdialog`:`dialog`,"labelled-by":y,"described-by":O()?b:void 0,busy:t.busy,"close-on-overlay":!D.value,"close-disabled":D.value,"close-on-escape":!1,onClose:oe},{header:(0,o.withCtx)(()=>[(0,o.createElementVNode)(`span`,{id:y,class:(0,o.normalizeClass)([`nb-confirm__heading`,`nb-confirm__heading--${t.tone}`])},[t.tone===`danger`?((0,o.openBlock)(),(0,o.createBlock)(n.t,{key:0,name:(0,o.unref)(s.regular),size:16,"aria-hidden":`true`},null,8,[`name`])):(0,o.createCommentVNode)(``,!0),(0,o.createElementVNode)(`span`,null,(0,o.toDisplayString)(t.title),1)],2)]),footer:(0,o.withCtx)(()=>[(0,o.createVNode)(r.t,{ref_key:`cancelRef`,ref:w,class:`nb-confirm__action nb-confirm__action--cancel`,variant:`ghost`,size:`lg`,disabled:D.value,"data-nb-confirm":`cancel`,onClick:q},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(t.cancelLabel),1)]),_:1},8,[`disabled`]),(0,o.createVNode)(r.t,{class:`nb-confirm__action nb-confirm__action--confirm`,variant:k.value,size:`lg`,disabled:!M.value,loading:t.busy,"data-nb-confirm":`confirm`,onClick:N},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(t.confirmLabel),1)]),_:1},8,[`variant`,`disabled`,`loading`])]),default:(0,o.withCtx)(()=>[(0,o.createElementVNode)(`div`,{ref_key:`rootRef`,ref:S,class:(0,o.normalizeClass)([`nb-confirm`,t.contentClass])},[O()?((0,o.openBlock)(),(0,o.createElementBlock)(`div`,{key:0,id:b,class:`nb-confirm__body`},[(0,o.renderSlot)(e.$slots,`default`,{},()=>[t.message?((0,o.openBlock)(),(0,o.createElementBlock)(`p`,h,(0,o.toDisplayString)(t.message),1)):(0,o.createCommentVNode)(``,!0)],!0),t.subject?((0,o.openBlock)(),(0,o.createElementBlock)(`p`,{key:0,class:(0,o.normalizeClass)([`nb-confirm__subject`,`nb-confirm__subject--${t.tone}`])},[t.subjectLabel?((0,o.openBlock)(),(0,o.createElementBlock)(`span`,te,(0,o.toDisplayString)(t.subjectLabel),1)):(0,o.createCommentVNode)(``,!0),(0,o.createElementVNode)(`span`,ne,(0,o.toDisplayString)(t.subject),1)],2)):(0,o.createCommentVNode)(``,!0)])):(0,o.createCommentVNode)(``,!0),t.typeToConfirm?((0,o.openBlock)(),(0,o.createElementBlock)(`div`,g,[(0,o.createVNode)(ee.t,{modelValue:T.value,"onUpdate:modelValue":l[0]||=e=>T.value=e,class:`nb-confirm__gate-field`,label:A.value,helper:t.typeToConfirmHelper,disabled:D.value,autocomplete:`off`,spellcheck:`false`,"data-nb-confirm":`gate`,onKeydown:l[1]||=(0,o.withKeys)((0,o.withModifiers)(()=>{},[`prevent`]),[`enter`])},null,8,[`modelValue`,`label`,`helper`,`disabled`])])):(0,o.createCommentVNode)(``,!0),(0,o.createElementVNode)(`div`,_,[t.busy?((0,o.openBlock)(),(0,o.createElementBlock)(`p`,re,(0,o.toDisplayString)(t.busyLabel),1)):(0,o.createCommentVNode)(``,!0),t.succeeded&&t.successLabel?((0,o.openBlock)(),(0,o.createElementBlock)(`p`,ie,[(0,o.createVNode)(n.t,{name:(0,o.unref)(c.regular),size:14,"aria-hidden":`true`},null,8,[`name`]),(0,o.createElementVNode)(`span`,null,(0,o.toDisplayString)(t.successLabel),1)])):(0,o.createCommentVNode)(``,!0),t.error?((0,o.openBlock)(),(0,o.createElementBlock)(`div`,{key:2,ref_key:`errorRef`,ref:C,class:`nb-confirm__error`,tabindex:`-1`},[(0,o.createVNode)(i.t,{variant:`error`},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(t.error),1)]),_:1})],512)):(0,o.createCommentVNode)(``,!0)])],2)]),_:3},8,[`open`,`size`,`role`,`described-by`,`busy`,`close-on-overlay`,`close-disabled`]))}}),y=t.t(v,[[`__scopeId`,`data-v-828ae71d`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return y}});
|
package/dist/Modal-8lgeNWj8.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),t=require(`./Size.d-GBIblj2D.cjs`),n=require(`./Icon-C8R_r_In.cjs`),r=require(`./composables/useSurfaceLayer.composable.cjs`),i=require(`./Grid-DVT8lBHr.cjs`),a=require(`./composables/useScrollLock.composable.cjs`);let o=require(`vue`),s=require(`@nubisco/ui/icons/x`);var c=[`role`,`aria-labelledby`,`aria-describedby`,`aria-busy`],l={key:0,class:`nb-modal--header`},u=[`disabled`,`aria-disabled`],d=[`tabindex`,`role`,`aria-labelledby`],f=(0,o.defineComponent)({__name:`Modal`,props:{open:{type:Boolean,default:!1},title:{default:void 0},size:{default:t.r.Medium},closeOnOverlay:{type:Boolean,default:!0},role:{default:`dialog`},labelledBy:{default:void 0},describedBy:{default:void 0},busy:{type:Boolean,default:!1},closeDisabled:{type:Boolean,default:!1},closeOnEscape:{type:Boolean,default:!0}},emits:[`close`],setup(e,{expose:t,emit:f}){let p=e,m=f,h=(0,o.useSlots)(),g=(0,o.computed)(()=>!!h.header||!!p.title),_=`nb-modal-title-${(0,o.useId)()}`,v=(0,o.ref)(null),y=(0,o.ref)(null),{layerProps:b}=r.useSurfaceLayer({overlay:!0});function x(){p.closeOnOverlay&&m(`close`)}let S=!1;function C(){S||(S=!0,a.acquireScrollLock())}function w(){S&&(S=!1,a.releaseScrollLock())}let T=(0,o.ref)(!1);function E(){let e=y.value;if(!e)return;let t=e.scrollHeight-e.clientHeight;!T.value&&t>4?T.value=!0:T.value&&t<=0&&(T.value=!1)}let D=null,O=null;function k(){let e=y.value;e&&(A(),typeof ResizeObserver<`u`&&(D=new ResizeObserver(()=>E()),D.observe(e)),typeof MutationObserver<`u`&&(O=new MutationObserver(()=>E()),O.observe(e,{childList:!0,subtree:!0,characterData:!0})),E())}function A(){D?.disconnect(),D=null,O?.disconnect(),O=null}(0,o.watch)(()=>p.open,async e=>{e?C():w(),await(0,o.nextTick)(),e?k():(A(),T.value=!1)},{immediate:!0}),(0,o.onUnmounted)(()=>{w(),A()});function j(){let e=v.value;if(!e)return!1;let t=Array.from(document.querySelectorAll(`[aria-modal="true"]`));return t.length===0||t[t.length-1]===e}function M(e){e.key===`Escape`&&(!p.open||!p.closeOnEscape||p.closeDisabled||j()&&m(`close`))}return(0,o.onMounted)(()=>{document.addEventListener(`keydown`,M),p.open&&k()}),(0,o.onUnmounted)(()=>{document.removeEventListener(`keydown`,M)}),t({dialogEl:()=>v.value,bodyEl:()=>y.value}),(t,r)=>((0,o.openBlock)(),(0,o.createBlock)(o.Teleport,{to:`body`},[(0,o.createVNode)(o.Transition,{name:`nb-modal`},{default:(0,o.withCtx)(()=>[e.open?((0,o.openBlock)(),(0,o.createElementBlock)(`div`,{key:0,class:`nb-modal--overlay`,onClick:(0,o.withModifiers)(x,[`self`])},[(0,o.createElementVNode)(`div`,(0,o.mergeProps)({ref_key:`contentRef`,ref:v,class:[`nb-modal--content`,`nb-modal--content--${e.size}`]},(0,o.unref)(b),{role:e.role,"aria-modal":`true`,"aria-labelledby":e.labelledBy??(g.value?_:void 0),"aria-describedby":e.describedBy,"aria-busy":e.busy?`true`:void 0,tabindex:`-1`,onClick:r[1]||=(0,o.withModifiers)(()=>{},[`stop`])}),[g.value?((0,o.openBlock)(),(0,o.createElementBlock)(`header`,l,[(0,o.createElementVNode)(`span`,{id:_,class:`nb-modal--title`},[(0,o.renderSlot)(t.$slots,`header`,{},()=>[(0,o.createTextVNode)((0,o.toDisplayString)(e.title),1)],!0)]),(0,o.createElementVNode)(`button`,{class:`nb-modal--close`,"aria-label":`Close`,disabled:e.closeDisabled,"aria-disabled":e.closeDisabled?`true`:void 0,onClick:r[0]||=e=>m(`close`)},[(0,o.createVNode)(n.t,{name:(0,o.unref)(s.regular)},null,8,[`name`])],8,u)])):(0,o.createCommentVNode)(``,!0),(0,o.createElementVNode)(`main`,{ref_key:`bodyRef`,ref:y,class:`nb-modal--body`,tabindex:T.value?0:void 0,role:T.value?`region`:void 0,"aria-labelledby":T.value?e.labelledBy??(g.value?_:void 0):void 0},[(0,o.renderSlot)(t.$slots,`default`,{},void 0,!0)],8,d),t.$slots.footer?((0,o.openBlock)(),(0,o.createBlock)(i.t,{key:1,is:`footer`,justify:`end`,class:`nb-modal--footer`,distributed:``},{default:(0,o.withCtx)(()=>[(0,o.renderSlot)(t.$slots,`footer`,{},void 0,!0)]),_:3})):(0,o.createCommentVNode)(``,!0)],16,c)])):(0,o.createCommentVNode)(``,!0)]),_:3})]))}}),p=e.t(f,[[`__scopeId`,`data-v-2dfc5b1b`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
|
package/dist/Modal-iN94HtKE.js
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./_plugin-vue_export-helper-O4QQSku4.js";
|
|
2
|
-
import { r as t } from "./Size.d-Bah6vMl3.js";
|
|
3
|
-
import { t as n } from "./Icon-rREAqsu0.js";
|
|
4
|
-
import { useSurfaceLayer as r } from "./composables/useSurfaceLayer.composable.mjs";
|
|
5
|
-
import { t as i } from "./Grid-CVNb1HcS.js";
|
|
6
|
-
import { acquireScrollLock as a, releaseScrollLock as o } from "./composables/useScrollLock.composable.mjs";
|
|
7
|
-
import { Teleport as s, Transition as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineComponent as g, mergeProps as _, nextTick as v, onMounted as y, onUnmounted as b, openBlock as x, ref as S, renderSlot as C, toDisplayString as w, unref as T, useId as E, useSlots as D, watch as O, withCtx as k, withModifiers as A } from "vue";
|
|
8
|
-
import { regular as ee } from "@nubisco/ui/icons/x";
|
|
9
|
-
//#region src/components/Modal.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var j = [
|
|
11
|
-
"role",
|
|
12
|
-
"aria-labelledby",
|
|
13
|
-
"aria-describedby",
|
|
14
|
-
"aria-busy"
|
|
15
|
-
], M = {
|
|
16
|
-
key: 0,
|
|
17
|
-
class: "nb-modal--header"
|
|
18
|
-
}, N = ["disabled", "aria-disabled"], P = [
|
|
19
|
-
"tabindex",
|
|
20
|
-
"role",
|
|
21
|
-
"aria-labelledby"
|
|
22
|
-
], F = /* @__PURE__ */ e(/* @__PURE__ */ g({
|
|
23
|
-
__name: "Modal",
|
|
24
|
-
props: {
|
|
25
|
-
open: {
|
|
26
|
-
type: Boolean,
|
|
27
|
-
default: !1
|
|
28
|
-
},
|
|
29
|
-
title: { default: void 0 },
|
|
30
|
-
size: { default: t.Medium },
|
|
31
|
-
closeOnOverlay: {
|
|
32
|
-
type: Boolean,
|
|
33
|
-
default: !0
|
|
34
|
-
},
|
|
35
|
-
role: { default: "dialog" },
|
|
36
|
-
labelledBy: { default: void 0 },
|
|
37
|
-
describedBy: { default: void 0 },
|
|
38
|
-
busy: {
|
|
39
|
-
type: Boolean,
|
|
40
|
-
default: !1
|
|
41
|
-
},
|
|
42
|
-
closeDisabled: {
|
|
43
|
-
type: Boolean,
|
|
44
|
-
default: !1
|
|
45
|
-
},
|
|
46
|
-
closeOnEscape: {
|
|
47
|
-
type: Boolean,
|
|
48
|
-
default: !0
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
emits: ["close"],
|
|
52
|
-
setup(e, { expose: t, emit: g }) {
|
|
53
|
-
let F = e, I = g, L = D(), R = l(() => !!L.header || !!F.title), z = `nb-modal-title-${E()}`, B = S(null), V = S(null), { layerProps: H } = r({ overlay: !0 });
|
|
54
|
-
function U() {
|
|
55
|
-
F.closeOnOverlay && I("close");
|
|
56
|
-
}
|
|
57
|
-
let W = !1;
|
|
58
|
-
function G() {
|
|
59
|
-
W || (W = !0, a());
|
|
60
|
-
}
|
|
61
|
-
function K() {
|
|
62
|
-
W && (W = !1, o());
|
|
63
|
-
}
|
|
64
|
-
let q = S(!1);
|
|
65
|
-
function J() {
|
|
66
|
-
let e = V.value;
|
|
67
|
-
if (!e) return;
|
|
68
|
-
let t = e.scrollHeight - e.clientHeight;
|
|
69
|
-
!q.value && t > 4 ? q.value = !0 : q.value && t <= 0 && (q.value = !1);
|
|
70
|
-
}
|
|
71
|
-
let Y = null, X = null;
|
|
72
|
-
function Z() {
|
|
73
|
-
let e = V.value;
|
|
74
|
-
e && (Q(), typeof ResizeObserver < "u" && (Y = new ResizeObserver(() => J()), Y.observe(e)), typeof MutationObserver < "u" && (X = new MutationObserver(() => J()), X.observe(e, {
|
|
75
|
-
childList: !0,
|
|
76
|
-
subtree: !0,
|
|
77
|
-
characterData: !0
|
|
78
|
-
})), J());
|
|
79
|
-
}
|
|
80
|
-
function Q() {
|
|
81
|
-
Y?.disconnect(), Y = null, X?.disconnect(), X = null;
|
|
82
|
-
}
|
|
83
|
-
O(() => F.open, async (e) => {
|
|
84
|
-
e ? G() : K(), await v(), e ? Z() : (Q(), q.value = !1);
|
|
85
|
-
}, { immediate: !0 }), b(() => {
|
|
86
|
-
K(), Q();
|
|
87
|
-
});
|
|
88
|
-
function te() {
|
|
89
|
-
let e = B.value;
|
|
90
|
-
if (!e) return !1;
|
|
91
|
-
let t = Array.from(document.querySelectorAll("[aria-modal=\"true\"]"));
|
|
92
|
-
return t.length === 0 || t[t.length - 1] === e;
|
|
93
|
-
}
|
|
94
|
-
function $(e) {
|
|
95
|
-
e.key === "Escape" && (!F.open || !F.closeOnEscape || F.closeDisabled || te() && I("close"));
|
|
96
|
-
}
|
|
97
|
-
return y(() => {
|
|
98
|
-
document.addEventListener("keydown", $), F.open && Z();
|
|
99
|
-
}), b(() => {
|
|
100
|
-
document.removeEventListener("keydown", $);
|
|
101
|
-
}), t({
|
|
102
|
-
dialogEl: () => B.value,
|
|
103
|
-
bodyEl: () => V.value
|
|
104
|
-
}), (t, r) => (x(), u(s, { to: "body" }, [h(c, { name: "nb-modal" }, {
|
|
105
|
-
default: k(() => [e.open ? (x(), f("div", {
|
|
106
|
-
key: 0,
|
|
107
|
-
class: "nb-modal--overlay",
|
|
108
|
-
onClick: A(U, ["self"])
|
|
109
|
-
}, [p("div", _({
|
|
110
|
-
ref_key: "contentRef",
|
|
111
|
-
ref: B,
|
|
112
|
-
class: ["nb-modal--content", `nb-modal--content--${e.size}`]
|
|
113
|
-
}, T(H), {
|
|
114
|
-
role: e.role,
|
|
115
|
-
"aria-modal": "true",
|
|
116
|
-
"aria-labelledby": e.labelledBy ?? (R.value ? z : void 0),
|
|
117
|
-
"aria-describedby": e.describedBy,
|
|
118
|
-
"aria-busy": e.busy ? "true" : void 0,
|
|
119
|
-
tabindex: "-1",
|
|
120
|
-
onClick: r[1] ||= A(() => {}, ["stop"])
|
|
121
|
-
}), [
|
|
122
|
-
R.value ? (x(), f("header", M, [p("span", {
|
|
123
|
-
id: z,
|
|
124
|
-
class: "nb-modal--title"
|
|
125
|
-
}, [C(t.$slots, "header", {}, () => [m(w(e.title), 1)], !0)]), p("button", {
|
|
126
|
-
class: "nb-modal--close",
|
|
127
|
-
"aria-label": "Close",
|
|
128
|
-
disabled: e.closeDisabled,
|
|
129
|
-
"aria-disabled": e.closeDisabled ? "true" : void 0,
|
|
130
|
-
onClick: r[0] ||= (e) => I("close")
|
|
131
|
-
}, [h(n, { name: T(ee) }, null, 8, ["name"])], 8, N)])) : d("", !0),
|
|
132
|
-
p("main", {
|
|
133
|
-
ref_key: "bodyRef",
|
|
134
|
-
ref: V,
|
|
135
|
-
class: "nb-modal--body",
|
|
136
|
-
tabindex: q.value ? 0 : void 0,
|
|
137
|
-
role: q.value ? "region" : void 0,
|
|
138
|
-
"aria-labelledby": q.value ? e.labelledBy ?? (R.value ? z : void 0) : void 0
|
|
139
|
-
}, [C(t.$slots, "default", {}, void 0, !0)], 8, P),
|
|
140
|
-
t.$slots.footer ? (x(), u(i, {
|
|
141
|
-
key: 1,
|
|
142
|
-
is: "footer",
|
|
143
|
-
justify: "end",
|
|
144
|
-
class: "nb-modal--footer",
|
|
145
|
-
distributed: ""
|
|
146
|
-
}, {
|
|
147
|
-
default: k(() => [C(t.$slots, "footer", {}, void 0, !0)]),
|
|
148
|
-
_: 3
|
|
149
|
-
})) : d("", !0)
|
|
150
|
-
], 16, j)])) : d("", !0)]),
|
|
151
|
-
_: 3
|
|
152
|
-
})]));
|
|
153
|
-
}
|
|
154
|
-
}), [["__scopeId", "data-v-2dfc5b1b"]]);
|
|
155
|
-
//#endregion
|
|
156
|
-
export { F as t };
|
package/dist/Slider-CxrK7cAU.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),t=require(`./Size.d-GBIblj2D.cjs`),n=require(`./Label-CXejhF9x.cjs`),r=require(`./Message-Daj6hLC4.cjs`),i=require(`./Grid-DVT8lBHr.cjs`),a=require(`./NumberInput-Vc2wzK62.cjs`);let o=require(`vue`);var s={class:`nb-slider__field-box`},c={key:0,class:`nb-slider__inner-header`},l={class:`nb-slider__inner-label`},u={class:`nb-slider__track-labels`},d={class:`nb-slider__track-label`},f={class:`nb-slider__track-label`},p=(0,o.defineComponent)({__name:`Slider`,props:{modelValue:{},min:{default:0},max:{default:100},step:{default:1},range:{type:Boolean,default:!1},showInput:{type:Boolean,default:!0},name:{},disabled:{type:Boolean,default:!1},required:{type:Boolean},id:{},label:{},error:{},warning:{},helper:{},variant:{default:`default`},size:{default:t.r.Medium}},emits:[`update:modelValue`,`change`],setup(e,{emit:t}){let p=e,m=t,h=(0,o.ref)(null),g=(0,o.ref)(null),_=(0,o.computed)(()=>p.range||p.modelValue===null||p.modelValue===void 0?p.min??0:Array.isArray(p.modelValue)?p.modelValue[0]??p.min??0:p.modelValue),v=(0,o.computed)(()=>!p.range||!Array.isArray(p.modelValue)?p.min??0:p.modelValue[0]??p.min??0),y=(0,o.computed)(()=>!p.range||!Array.isArray(p.modelValue)?p.max??100:p.modelValue[1]??p.max??100),b=(0,o.computed)(()=>{let e=p.step??1;if(!isFinite(e)||e<=0)return 0;let t=String(e),n=t.indexOf(`.`);return n===-1?0:t.length-n-1});function x(e){let t=b.value;return t>0?Number(e.toFixed(t)):Math.round(e)}let S=(0,o.computed)(()=>x(p.range?y.value:_.value));function C(e){let t=p.min??0,n=p.max??100;return n===t?0:(e-t)/(n-t)*100}function w(e){let t=p.min??0,n=p.max??100,r=p.step??1,i=t+e/100*(n-t),a=Math.round(i/r)*r;return Math.max(t,Math.min(n,a))}function T(e){if(!h.value)return 0;let t=h.value.getBoundingClientRect(),n=`touches`in e?e.touches[0].clientX:e.clientX;return Math.max(0,Math.min(100,(n-t.left)/t.width*100))}let E=(0,o.computed)(()=>{if(!p.range)return{left:`0%`,width:`${C(_.value)}%`};let e=C(v.value),t=C(y.value);return{left:`${e}%`,width:`${t-e}%`}});function D(e){m(`update:modelValue`,e)}function O(e,t){m(`update:modelValue`,[e,t])}function k(e){if(e===null)return;let t=p.min??0,n=p.max??100;D(Math.max(t,Math.min(n,e)))}function A(e){if(e===null)return;let t=p.min??0;O(Math.max(t,Math.min(y.value,e)),y.value)}function j(e){if(e===null)return;let t=p.max??100,n=Math.max(v.value,Math.min(t,e));O(v.value,n)}function M(e){if(!p.range)return null;let t=C(v.value),n=C(y.value);return Math.abs(e-t)<=Math.abs(e-n)?`low`:`high`}function N(e){let t=w(e);if(!p.range){D(t);return}if(g.value===`low`)O(Math.min(t,y.value),y.value);else{let e=Math.max(t,v.value);O(v.value,e)}}function P(e){p.disabled||N(T(e))}function F(e){p.disabled||(m(`change`,p.range?[v.value,y.value]:_.value),N(T(e))),z()}function I(e){p.disabled||N(T(e))}function L(e){p.disabled||(m(`change`,p.range?[v.value,y.value]:_.value),N(T(e))),V()}function R(){document.addEventListener(`mousemove`,P),document.addEventListener(`mouseup`,F)}function z(){g.value=null,document.removeEventListener(`mousemove`,P),document.removeEventListener(`mouseup`,F)}function B(){document.addEventListener(`touchmove`,I,{passive:!0}),document.addEventListener(`touchend`,L)}function V(){g.value=null,document.removeEventListener(`touchmove`,I),document.removeEventListener(`touchend`,L)}function H(e){if(p.disabled)return;let t=T(e);g.value=M(t),N(t),R()}function U(e){if(p.disabled)return;let t=T(e);g.value=M(t),N(t),B()}function W(e,t){p.disabled||(g.value=p.range?e:null,R())}function G(e,t){p.disabled||(g.value=p.range?e:null,B())}(0,o.onBeforeUnmount)(()=>{z(),V()});let K=(0,o.computed)(()=>[`nb-slider`,`nb-slider--${p.size}`,`nb-slider--${p.variant}`,{"nb-slider--range":p.range,"nb-slider--disabled":p.disabled,"nb-slider--error":!!p.error,"nb-slider--warning":!p.error&&!!p.warning}]),q=(0,o.computed)(()=>({"nb-slider__track-area--error":!!p.error,"nb-slider__track-area--warning":!p.error&&!!p.warning}));return(t,p)=>((0,o.openBlock)(),(0,o.createElementBlock)(`div`,{class:(0,o.normalizeClass)(K.value)},[e.variant===`default`&&e.label?((0,o.openBlock)(),(0,o.createBlock)(n.t,{key:0,class:`nb-slider__label`},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(e.label),1)]),_:1})):(0,o.createCommentVNode)(``,!0),(0,o.createElementVNode)(`div`,s,[e.variant===`fluid`&&e.label?((0,o.openBlock)(),(0,o.createElementBlock)(`div`,c,[(0,o.createElementVNode)(`label`,l,(0,o.toDisplayString)(e.label),1)])):(0,o.createCommentVNode)(``,!0),(0,o.createVNode)(i.t,{dir:`row`,align:`center`,gap:`sm`,class:`nb-slider__row`},{default:(0,o.withCtx)(()=>[e.range&&e.showInput?((0,o.openBlock)(),(0,o.createBlock)(a.t,{key:0,size:e.variant===`fluid`?`sm`:e.size,"model-value":v.value,min:e.min,max:y.value,step:e.step,disabled:e.disabled,class:`nb-slider__input`,"onUpdate:modelValue":A,onChange:A},null,8,[`size`,`model-value`,`min`,`max`,`step`,`disabled`])):(0,o.createCommentVNode)(``,!0),(0,o.createVNode)(i.t,{dir:`col`,justify:`end`,gap:`xs`,class:(0,o.normalizeClass)([`nb-slider__track-area`,q.value]),grow:``},{default:(0,o.withCtx)(()=>[(0,o.createElementVNode)(`div`,{ref_key:`trackRef`,ref:h,class:`nb-slider__track`,onMousedown:H,onTouchstartPassive:U},[(0,o.createElementVNode)(`div`,{class:`nb-slider__track__fill`,style:(0,o.normalizeStyle)(E.value)},null,4),e.range?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:1},[(0,o.createElementVNode)(`div`,{class:`nb-slider__track__handle nb-slider__track__handle--low`,style:(0,o.normalizeStyle)({left:`${C(v.value)}%`}),onMousedown:p[2]||=(0,o.withModifiers)(e=>W(`low`,e),[`stop`]),onTouchstartPassive:p[3]||=(0,o.withModifiers)(e=>G(`low`,e),[`stop`])},null,36),(0,o.createElementVNode)(`div`,{class:`nb-slider__track__handle nb-slider__track__handle--high`,style:(0,o.normalizeStyle)({left:`${C(y.value)}%`}),onMousedown:p[4]||=(0,o.withModifiers)(e=>W(`high`,e),[`stop`]),onTouchstartPassive:p[5]||=(0,o.withModifiers)(e=>G(`high`,e),[`stop`])},null,36),p[8]||=(0,o.createElementVNode)(`div`,{class:`nb-slider__tick`},null,-1)],64)):((0,o.openBlock)(),(0,o.createElementBlock)(`div`,{key:0,class:`nb-slider__track__handle`,style:(0,o.normalizeStyle)({left:`${C(_.value)}%`}),onMousedown:p[0]||=(0,o.withModifiers)(e=>W(null,e),[`stop`]),onTouchstartPassive:p[1]||=(0,o.withModifiers)(e=>G(null,e),[`stop`])},null,36))],544),(0,o.createElementVNode)(`div`,u,[(0,o.createElementVNode)(`span`,d,(0,o.toDisplayString)(e.min),1),(0,o.createElementVNode)(`span`,f,(0,o.toDisplayString)(e.max),1)])]),_:1},8,[`class`]),e.showInput?((0,o.openBlock)(),(0,o.createBlock)(a.t,{key:1,size:e.variant===`fluid`?`sm`:e.size,"model-value":S.value,min:e.range?v.value:e.min,max:e.max,step:e.step,disabled:e.disabled,class:`nb-slider__input`,"onUpdate:modelValue":p[6]||=t=>e.range?j(t):k(t),onChange:p[7]||=t=>e.range?j(t):k(t)},null,8,[`size`,`model-value`,`min`,`max`,`step`,`disabled`])):(0,o.createCommentVNode)(``,!0)]),_:1})]),e.error?((0,o.openBlock)(),(0,o.createBlock)(r.t,{key:1,variant:`error`,class:`nb-slider__message`},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(e.error),1)]),_:1})):e.warning?((0,o.openBlock)(),(0,o.createBlock)(r.t,{key:2,variant:`warning`,class:`nb-slider__message`},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(e.warning),1)]),_:1})):e.helper?((0,o.openBlock)(),(0,o.createBlock)(r.t,{key:3,variant:`helper`,class:`nb-slider__message`},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(e.helper),1)]),_:1})):(0,o.createCommentVNode)(``,!0)],2))}}),m=e.t(p,[[`__scopeId`,`data-v-9c9efe18`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return m}});
|