@astryx-vue/core 0.2.0 → 0.2.2
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/AppShell/index.js +1 -1
- package/dist/{AppShell-EiGyPFbA.js → AppShell-Cb41gIAj.js} +2 -2
- package/dist/Avatar/index.d.ts +1 -1
- package/dist/Avatar/index.js +1 -1
- package/dist/Avatar-jmHInHwj.js +244 -0
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/{AvatarGroup-CZcgAMjM.js → AvatarGroup-QyzSrpYA.js} +8 -7
- package/dist/Badge/index.d.ts +2 -1
- package/dist/Badge/index.js +1 -1
- package/dist/Badge-CjDQPF5g.js +30 -0
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Breadcrumbs/index.d.ts +2 -2
- package/dist/Breadcrumbs/index.js +1 -1
- package/dist/{Breadcrumbs-C3YZFQ9w.js → Breadcrumbs-CTQ7fjDn.js} +45 -11
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.d.ts +2 -2
- package/dist/Calendar/index.js +1 -1
- package/dist/Calendar-BFaI5AMv.js +352 -0
- package/dist/Card/index.d.ts +1 -1
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-BTtHkKea.js → Carousel-X0cuQkvg.js} +2 -2
- package/dist/Chat/index.d.ts +2 -2
- package/dist/Chat/index.js +2 -2
- package/dist/Chat-M0tiGrNT.js +3148 -0
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/Citation/index.js +1 -1
- package/dist/{Citation-DijdbUUu.js → Citation-C1veUk5p.js} +2 -2
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/Code/index.js +1 -1
- package/dist/{CodeBlock-CxTb6j9_.js → CodeBlock-DesTJAkm.js} +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-9MC08X39.js → Collapsible-BestK35V.js} +1 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-BD2iODF5.js → CommandPalette-BArt97V8.js} +1 -1
- package/dist/ComplexSelector/index.d.ts +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-D9iXd5cH.js → ComplexSelector-CAoig1RK.js} +2 -2
- package/dist/ContextMenu/index.d.ts +2 -2
- package/dist/ContextMenu/index.js +1 -1
- package/dist/{ContextMenu-HS_WqYIg.js → ContextMenu-9Im6i43E.js} +101 -63
- package/dist/DateInput/index.d.ts +2 -2
- package/dist/DateInput/index.js +1 -1
- package/dist/DateInput-BLocxqC3.js +376 -0
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-1bhPGG2s.js → DateRangeInput-DwDy3eRo.js} +2 -2
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-SnPdgk6P.js → DateTimeInput-BYiaC9bn.js} +5 -3
- package/dist/DropdownMenu/index.d.ts +3 -2
- package/dist/DropdownMenu/index.js +3 -2
- package/dist/DropdownMenu-Ddfr-aEC.js +164 -0
- package/dist/{DropdownMenu-UJGych6v.js → DropdownMenu-Dh-WAHKb.js} +63 -16
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-BQiwE-GB.js → FileInput-DLO6V12n.js} +2 -2
- package/dist/Icon/index.d.ts +4 -3
- package/dist/Icon/index.js +3 -2
- package/dist/Icon/plugin.d.ts +45 -0
- package/dist/Icon/plugin.js +177 -0
- package/dist/Icon-CJKjdJy-.js +198 -0
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-CshKoB0r.js → Lightbox-CdFCS_EA.js} +2 -2
- package/dist/Link/index.d.ts +1 -1
- package/dist/Link/index.js +1 -1
- package/dist/Link-DqdQZ37C.js +141 -0
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-D-Ua055V.js → Markdown-BqKloI3w.js} +3 -3
- package/dist/MetadataList/index.js +1 -1
- package/dist/{MetadataList-sYph_d8Q.js → MetadataList-CvZkmisf.js} +1 -1
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-DD9D01aj.js → MobileNavToggle-Bwi0qXXM.js} +1 -1
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-BVrK5kkk.js → MoreMenu-BwJaJrkB.js} +2 -2
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-DiYov9sF.js → MultiSelector-C-ETfFy_.js} +2 -2
- package/dist/NumberInput/index.d.ts +2 -2
- package/dist/NumberInput/index.js +1 -1
- package/dist/NumberInput-DjetVB8O.js +210 -0
- package/dist/Outline/index.js +1 -1
- package/dist/{Outline-DQfEBxlc.js → Outline-Bz9c-u5y.js} +1 -1
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-BU5VCntl.js → OverflowList-ED-KN9Y5.js} +1 -1
- package/dist/Overlay/index.d.ts +1 -1
- package/dist/Pagination/index.d.ts +2 -2
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-HdhtykeF.js → Pagination-Cb66HMEf.js} +76 -22
- package/dist/PowerSearch/index.d.ts +2 -0
- package/dist/PowerSearch/index.js +2 -0
- package/dist/PowerSearch-CjU8y4mi.js +2386 -0
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/ProgressBar/index.js +1 -1
- package/dist/{ProgressBar-ChDp-7oe.js → ProgressBar-DO9Chic6.js} +31 -11
- package/dist/Radio/index.d.ts +1 -1
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/Resizable/index.d.ts +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{Resizable-BhSMfO5B.js → Resizable-D-TBCg0Y.js} +1 -1
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/Selector/index.d.ts +2 -2
- package/dist/Selector/index.js +1 -1
- package/dist/Selector-DE2IEFML.js +468 -0
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-B-Om6Bz3.js → SideNav-DonEfiAx.js} +17 -17
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-BZ_8SEZt.js → Stepper-D2ZIcUNx.js} +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/TabList/index.d.ts +1 -1
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-Cnc2Hs1H.js → TabList-D3F-stq-.js} +10 -3
- package/dist/Table/index.d.ts +3 -3
- package/dist/Table/index.js +2 -2
- package/dist/Table-CrP2Uffq.js +1982 -0
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-Cv9UVbzS.js → TextArea-CPwSytdO.js} +12 -6
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-Dc1UpykG.js → Thumbnail-BC5JGPGZ.js} +11 -11
- package/dist/{TimeField-C7t9Knq9.js → TimeField-DpHFrNv0.js} +2 -2
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-BXxCOY98.js → TimeInput-DJLV0_4z.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +2 -1
- package/dist/{Timestamp-DlZSmgCJ.js → Timestamp-GKNjjt5g.js} +4 -121
- package/dist/Toast/index.d.ts +2 -2
- package/dist/Toast/index.js +1 -1
- package/dist/{Toast-BKXPvEMp.js → Toast-C2ML-bmi.js} +37 -7
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-wt4e80IM.js → Token-Chu_eCVs.js} +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-nmTqdS9n.js → Tokenizer-DRDpvQ_l.js} +3 -3
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-notp-mJx.js → TopNav-CEyWddtA.js} +3 -3
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-s1xBQ0qq.js → TreeList-COS8US8e.js} +3 -3
- package/dist/Typeahead/index.js +1 -1
- package/dist/{Typeahead-VAuiCurV.js → Typeahead-P7cCqtaQ.js} +3 -3
- package/dist/{useTypeaheadMenu-Ba7XpcZl.js → TypeaheadMenu-CGvo0Tud.js} +107 -107
- package/dist/composables/index.d.ts +3 -3
- package/dist/{context-Dbo22sck.js → context-CiKncNSH.js} +184 -6
- package/dist/formatInstant-BDWUIxS7.js +119 -0
- package/dist/{index-SMh42NI8.d.ts → index-B1TG2GPS.d.ts} +2 -2
- package/dist/{index-DRmb-oUa.d.ts → index-B9WzWqzk.d.ts} +3 -29
- package/dist/{index-BuubzuE8.d.ts → index-BDZCJ9ri.d.ts} +2 -2
- package/dist/{index-z4p2k9VR.d.ts → index-Bgv4ZmBl.d.ts} +20 -2
- package/dist/{index-BoRIw-bP.d.ts → index-Bt7ewoz2.d.ts} +32 -2
- package/dist/{index-uQrLBZfF.d.ts → index-Bu3oXIIS.d.ts} +24 -0
- package/dist/index-CJlBAXwj.d.ts +100 -0
- package/dist/{index-DT9S92sh.d.ts → index-CNjbOgty.d.ts} +15 -0
- package/dist/{index-DXSs3rwa.d.ts → index-CngORuiq.d.ts} +137 -2
- package/dist/index-Cs5pcwY3.d.ts +416 -0
- package/dist/{index-NzLDrOkk.d.ts → index-D4I_obqR.d.ts} +14 -1
- package/dist/{index-BtPZKO20.d.ts → index-DGXviOlp.d.ts} +49 -7
- package/dist/{index-CTolyeii.d.ts → index-DN7MXPHM.d.ts} +15 -1
- package/dist/{index-C6iJwTL0.d.ts → index-DNRBbwp_.d.ts} +165 -55
- package/dist/{index-C59PdX9L.d.ts → index-DWH_HzXi.d.ts} +1 -1
- package/dist/{index-BfOtLyNH.d.ts → index-D_nYxnNv.d.ts} +1 -1
- package/dist/{index-Bn_odHQ9.d.ts → index-Dg3ZmwEg.d.ts} +12 -1
- package/dist/{index-BiMGXtD-.d.ts → index-DimuSES0.d.ts} +14 -1
- package/dist/{index-DEeJowZf.d.ts → index-cGagYM1g.d.ts} +15 -2
- package/dist/{index-Ck8qy6Rf.d.ts → index-c_TaW8mM.d.ts} +24 -2
- package/dist/index-kVhSuA9t.d.ts +902 -0
- package/dist/{index-1uRMrk63.d.ts → index-nCEmW6wa.d.ts} +1 -1
- package/dist/{index-DoFCm2Q2.d.ts → index-qiZtHnGK.d.ts} +26 -0
- package/dist/{index-Bainr_3n.d.ts → index-u5ozu0G7.d.ts} +2 -2
- package/dist/index.d.ts +79 -76
- package/dist/index.js +111 -100
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/index.js +1 -1
- package/dist/power-search-DrDfcoL1.d.ts +68 -0
- package/dist/registry-B1ObuP--.d.ts +45 -0
- package/dist/registry-C7OZb0PJ.js +135 -0
- package/dist/{types-JktRxujg.d.ts → types-Cp4liug-.d.ts} +66 -3
- package/dist/{index-B8MbfMwV.d.ts → types-DDAAT1Xd.d.ts} +36 -82
- package/dist/types-DIYwbkpe.d.ts +33 -0
- package/dist/{types-DZoEm_DG.d.ts → types-pnljWjEE.d.ts} +23 -6
- package/dist/{useResizable-CeESZS1v.d.ts → useResizable-CUoNPmUw.d.ts} +1 -1
- package/package.json +10 -1
- package/styles/avatar.css +14 -0
- package/styles/badge.css +8 -0
- package/styles/breadcrumbs.css +6 -1
- package/styles/button.css +13 -0
- package/styles/calendar.css +16 -0
- package/styles/card.css +2 -0
- package/styles/chat.css +474 -3
- package/styles/dropdown-menu.css +11 -0
- package/styles/icon.css +58 -8
- package/styles/link.css +5 -0
- package/styles/number-input.css +22 -0
- package/styles/pagination.css +45 -1
- package/styles/power-search.css +303 -0
- package/styles/progress-bar.css +4 -0
- package/styles/selector.css +58 -0
- package/styles/tab-list.css +15 -0
- package/styles/table.css +304 -1
- package/styles/text-area.css +17 -0
- package/styles/text-input.css +5 -0
- package/styles/toast.css +7 -0
- package/styles/toolbar.css +11 -0
- package/styles.css +1 -0
- package/dist/Avatar-5s3HSrtN.js +0 -136
- package/dist/Badge-Ba0EwsTj.js +0 -19
- package/dist/Calendar-BG7wEsro.js +0 -277
- package/dist/Chat-DjNxw5gv.js +0 -1051
- package/dist/DateInput-DE2TN1Rq.js +0 -250
- package/dist/Icon-Dfr4k6-S.js +0 -86
- package/dist/Link-CprjOuTI.js +0 -92
- package/dist/NumberInput-CTYiQxHq.js +0 -147
- package/dist/Selector-Da-2BO3q.js +0 -325
- package/dist/Table-D-LhAy_J.js +0 -967
- package/dist/index-DJo-BmXZ.d.ts +0 -431
- package/dist/index-DtjAdYEc.d.ts +0 -68
- package/dist/{CheckboxList-EsIEXjK_.js → CheckboxList-BbCPiend.js} +1 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { t as _sfc_main$5 } from "./Button-DrqeomlE.js";
|
|
2
|
+
import { t as useMediaQuery } from "./useMediaQuery-GMmgp28-.js";
|
|
2
3
|
import { t as useDismiss } from "./useDismiss-CAiHU6QD.js";
|
|
3
4
|
import { t as useTypeahead } from "./useTypeahead-PAK8lMYz.js";
|
|
4
|
-
import { t as _sfc_main$6 } from "./Icon-Dfr4k6-S.js";
|
|
5
|
-
import { t as _sfc_main$7 } from "./Divider-BtwnL18I.js";
|
|
6
|
-
import { t as _sfc_main$8 } from "./Item-C1z6gXn8.js";
|
|
7
5
|
import { t as usePositionedLayer } from "./usePositionedLayer-C1NBOsVT.js";
|
|
6
|
+
import { t as _sfc_main$6 } from "./BottomSheet-Dg95HB1s.js";
|
|
7
|
+
import { t as _sfc_main$7 } from "./Icon-CJKjdJy-.js";
|
|
8
|
+
import { t as _sfc_main$8 } from "./Divider-BtwnL18I.js";
|
|
9
|
+
import { t as _sfc_main$9 } from "./Item-C1z6gXn8.js";
|
|
8
10
|
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, h, inject, mergeModels, mergeProps, nextTick, normalizeProps, onBeforeUnmount, onMounted, openBlock, provide, ref, renderSlot, shallowRef, toDisplayString, unref, useAttrs, useId, useModel, useSlots, vShow, watch, withCtx, withDirectives } from "vue";
|
|
9
11
|
import "../styles/dropdown-menu.css";
|
|
10
12
|
//#region src/DropdownMenu/context.ts
|
|
@@ -57,7 +59,7 @@ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
|
|
|
57
59
|
__name: "DropdownMenuDivider",
|
|
58
60
|
setup(__props) {
|
|
59
61
|
return (_ctx, _cache) => {
|
|
60
|
-
return openBlock(), createBlock(_sfc_main$
|
|
62
|
+
return openBlock(), createBlock(_sfc_main$8, { class: "astryx-dropdown-menu-divider" });
|
|
61
63
|
};
|
|
62
64
|
}
|
|
63
65
|
});
|
|
@@ -116,7 +118,7 @@ const _hoisted_2$1 = {
|
|
|
116
118
|
key: 0,
|
|
117
119
|
class: "astryx-item__start"
|
|
118
120
|
};
|
|
119
|
-
const _hoisted_3 = { class: "astryx-item__content" };
|
|
121
|
+
const _hoisted_3$1 = { class: "astryx-item__content" };
|
|
120
122
|
const _hoisted_4 = {
|
|
121
123
|
key: 0,
|
|
122
124
|
class: "astryx-item__label"
|
|
@@ -220,14 +222,14 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
220
222
|
onClick: handleClick,
|
|
221
223
|
onPointermove: handlePointerMove
|
|
222
224
|
}), [
|
|
223
|
-
hasStart.value ? (openBlock(), createElementBlock("span", _hoisted_2$1, [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(_sfc_main$
|
|
225
|
+
hasStart.value ? (openBlock(), createElementBlock("span", _hoisted_2$1, [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(_sfc_main$7, {
|
|
224
226
|
color: iconColor.value,
|
|
225
227
|
icon: __props.icon,
|
|
226
228
|
size: "sm"
|
|
227
229
|
}, null, 8, ["color", "icon"])])])) : createCommentVNode("v-if", true),
|
|
228
|
-
createElementVNode("span", _hoisted_3, [hasLabel.value ? (openBlock(), createElementBlock("span", _hoisted_4, [renderSlot(_ctx.$slots, "label", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])])) : createCommentVNode("v-if", true), hasDescription.value ? (openBlock(), createElementBlock("span", _hoisted_5, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(__props.description), 1)])])) : createCommentVNode("v-if", true)]),
|
|
230
|
+
createElementVNode("span", _hoisted_3$1, [hasLabel.value ? (openBlock(), createElementBlock("span", _hoisted_4, [renderSlot(_ctx.$slots, "label", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])])) : createCommentVNode("v-if", true), hasDescription.value ? (openBlock(), createElementBlock("span", _hoisted_5, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(__props.description), 1)])])) : createCommentVNode("v-if", true)]),
|
|
229
231
|
hasEnd.value ? (openBlock(), createElementBlock("span", _hoisted_6, [renderSlot(_ctx.$slots, "endContent")])) : createCommentVNode("v-if", true)
|
|
230
|
-
], 16, _hoisted_1$1)) : (openBlock(), createBlock(_sfc_main$
|
|
232
|
+
], 16, _hoisted_1$1)) : (openBlock(), createBlock(_sfc_main$9, mergeProps({ key: 1 }, unref(attrs), {
|
|
231
233
|
class: "astryx-dropdown-menu-item",
|
|
232
234
|
role: "menuitem",
|
|
233
235
|
"data-menu-size": menuSize.value,
|
|
@@ -243,7 +245,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
243
245
|
}), createSlots({ _: 2 }, [
|
|
244
246
|
hasStart.value ? {
|
|
245
247
|
name: "startContent",
|
|
246
|
-
fn: withCtx(() => [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(_sfc_main$
|
|
248
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(_sfc_main$7, {
|
|
247
249
|
color: iconColor.value,
|
|
248
250
|
icon: __props.icon,
|
|
249
251
|
size: "sm"
|
|
@@ -451,6 +453,11 @@ function useMenuFocus(options) {
|
|
|
451
453
|
//#region src/DropdownMenu/DropdownMenu.vue
|
|
452
454
|
const _hoisted_1 = ["data-open"];
|
|
453
455
|
const _hoisted_2 = [
|
|
456
|
+
"id",
|
|
457
|
+
"aria-labelledby",
|
|
458
|
+
"aria-label"
|
|
459
|
+
];
|
|
460
|
+
const _hoisted_3 = [
|
|
454
461
|
"id",
|
|
455
462
|
"aria-labelledby",
|
|
456
463
|
"aria-label",
|
|
@@ -459,6 +466,7 @@ const _hoisted_2 = [
|
|
|
459
466
|
const GAP = 4;
|
|
460
467
|
const DEFAULT_MAX_WIDTH = 320;
|
|
461
468
|
const DEFAULT_MAX_HEIGHT = "300px";
|
|
469
|
+
const COMPACT_TOUCH_QUERY = "(max-width: 639px) and (pointer: coarse) and (hover: none)";
|
|
462
470
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
463
471
|
name: "AstryxDropdownMenu",
|
|
464
472
|
inheritAttrs: false,
|
|
@@ -470,6 +478,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
470
478
|
menuWidth: {},
|
|
471
479
|
menuMaxHeight: {},
|
|
472
480
|
placement: { default: "below" },
|
|
481
|
+
presentation: { default: "popover" },
|
|
473
482
|
alignment: { default: "start" },
|
|
474
483
|
hasChevron: {
|
|
475
484
|
type: Boolean,
|
|
@@ -506,7 +515,16 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
506
515
|
const focusLastOnOpen = shallowRef(false);
|
|
507
516
|
let openModality = "keyboard";
|
|
508
517
|
let armedTriggerClickGuard = false;
|
|
518
|
+
const isCompactTouch = useMediaQuery(COMPACT_TOUCH_QUERY);
|
|
519
|
+
const isSheet = computed(() => props.presentation === "bottom-sheet" || props.presentation === "adaptive" && isCompactTouch.value);
|
|
520
|
+
const sheetOpen = computed({
|
|
521
|
+
get: () => isSheet.value && isOpen.value,
|
|
522
|
+
set: (open) => {
|
|
523
|
+
if (!open) closeMenu();
|
|
524
|
+
}
|
|
525
|
+
});
|
|
509
526
|
const buttonProps = computed(() => props.button ?? {});
|
|
527
|
+
const sheetLabel = computed(() => typeof buttonProps.value.label === "string" ? buttonProps.value.label : "Menu");
|
|
510
528
|
const menuSize = computed(() => buttonProps.value.size ?? "md");
|
|
511
529
|
const isIconOnly = computed(() => buttonProps.value.isIconOnly === true);
|
|
512
530
|
const hasChevron = computed(() => props.hasChevron && !isIconOnly.value);
|
|
@@ -548,9 +566,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
548
566
|
gap: GAP
|
|
549
567
|
});
|
|
550
568
|
watch(isOpen, (nowOpen) => {
|
|
551
|
-
layerIsOpen.value = nowOpen;
|
|
569
|
+
layerIsOpen.value = nowOpen && !isSheet.value;
|
|
552
570
|
});
|
|
553
571
|
const surfaceStyle = computed(() => {
|
|
572
|
+
if (isSheet.value) return {};
|
|
554
573
|
const style = {
|
|
555
574
|
"top": `${position.value.top}px`,
|
|
556
575
|
"left": `${position.value.left}px`,
|
|
@@ -580,7 +599,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
580
599
|
useDismiss({
|
|
581
600
|
container: surfaceRef,
|
|
582
601
|
trigger: anchorRef,
|
|
583
|
-
isEnabled: computed(() => isOpen.value),
|
|
602
|
+
isEnabled: computed(() => isOpen.value && !isSheet.value),
|
|
584
603
|
onDismiss: closeMenu
|
|
585
604
|
});
|
|
586
605
|
function emitOpenChange(next) {
|
|
@@ -608,7 +627,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
608
627
|
return anchor.querySelector("button, a[href], [role=\"button\"], [tabindex]");
|
|
609
628
|
}
|
|
610
629
|
watch(isOpen, async (nowOpen) => {
|
|
611
|
-
layerIsOpen.value = nowOpen;
|
|
630
|
+
layerIsOpen.value = nowOpen && !isSheet.value;
|
|
612
631
|
if (nowOpen) {
|
|
613
632
|
anchorWidth.value = anchorRef.value?.getBoundingClientRect().width ?? 0;
|
|
614
633
|
await nextTick();
|
|
@@ -686,6 +705,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
686
705
|
}));
|
|
687
706
|
provide(dropdownMenuContextKey, {
|
|
688
707
|
closeMenu,
|
|
708
|
+
isOpen,
|
|
689
709
|
menuSize
|
|
690
710
|
});
|
|
691
711
|
onMounted(() => {
|
|
@@ -712,7 +732,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
712
732
|
onKeydown: onTriggerKeydown
|
|
713
733
|
}), createSlots({ _: 2 }, [hasChevron.value ? {
|
|
714
734
|
name: "end",
|
|
715
|
-
fn: withCtx(() => [createVNode(_sfc_main$
|
|
735
|
+
fn: withCtx(() => [createVNode(_sfc_main$7, {
|
|
716
736
|
color: "inherit",
|
|
717
737
|
icon: "chevronDown",
|
|
718
738
|
size: "sm"
|
|
@@ -722,7 +742,34 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
722
742
|
"aria-controls",
|
|
723
743
|
"aria-expanded",
|
|
724
744
|
"tooltip"
|
|
725
|
-
]))], 8, _hoisted_1), (openBlock(), createBlock(
|
|
745
|
+
]))], 8, _hoisted_1), isSheet.value ? (openBlock(), createBlock(_sfc_main$6, {
|
|
746
|
+
key: 0,
|
|
747
|
+
"is-open": sheetOpen.value,
|
|
748
|
+
"onUpdate:isOpen": _cache[0] || (_cache[0] = ($event) => sheetOpen.value = $event),
|
|
749
|
+
height: "hug",
|
|
750
|
+
label: sheetLabel.value,
|
|
751
|
+
padding: 2
|
|
752
|
+
}, {
|
|
753
|
+
default: withCtx(() => [createElementVNode("div", mergeProps({
|
|
754
|
+
id: surfaceId.value,
|
|
755
|
+
ref_key: "surfaceRef",
|
|
756
|
+
ref: surfaceRef
|
|
757
|
+
}, forwardedAttrs.value, {
|
|
758
|
+
"aria-labelledby": menuAriaLabelledBy.value,
|
|
759
|
+
"aria-label": menuAriaLabel.value,
|
|
760
|
+
class: ["astryx-dropdown-menu is-sheet", unref(attrs).class],
|
|
761
|
+
role: "menu",
|
|
762
|
+
tabindex: "-1",
|
|
763
|
+
onKeydown: onSurfaceKeydown
|
|
764
|
+
}), [__props.items != null ? (openBlock(), createBlock(unref(DropdownMenuItems), {
|
|
765
|
+
key: 0,
|
|
766
|
+
items: __props.items
|
|
767
|
+
}, null, 8, ["items"])) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)], 16, _hoisted_2)]),
|
|
768
|
+
_: 3
|
|
769
|
+
}, 8, ["is-open", "label"])) : (openBlock(), createBlock(Teleport, {
|
|
770
|
+
key: 1,
|
|
771
|
+
to: "body"
|
|
772
|
+
}, [createVNode(Transition, {
|
|
726
773
|
name: "astryx-dropdown-menu",
|
|
727
774
|
persisted: ""
|
|
728
775
|
}, {
|
|
@@ -742,11 +789,11 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
742
789
|
}), [__props.items != null ? (openBlock(), createBlock(unref(DropdownMenuItems), {
|
|
743
790
|
key: 0,
|
|
744
791
|
items: __props.items
|
|
745
|
-
}, null, 8, ["items"])) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)], 16,
|
|
792
|
+
}, null, 8, ["items"])) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)], 16, _hoisted_3), [[vShow, isOpen.value]])]),
|
|
746
793
|
_: 3
|
|
747
794
|
})]))], 64);
|
|
748
795
|
};
|
|
749
796
|
}
|
|
750
797
|
});
|
|
751
798
|
//#endregion
|
|
752
|
-
export {
|
|
799
|
+
export { _sfc_main$4 as a, useDropdownMenuContext as c, _sfc_main$2 as i, useMenuFocus as n, MENU_ITEM_ROLES as o, _sfc_main$1 as r, activateMenuItem as s, _sfc_main as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Bn as _default, Gn as FileInputStatus, Hn as FileInputMode, Kn as FileInputValue, Un as FileInputProps, Vn as FileInputEmits, Wn as FileInputSize } from "../index-
|
|
1
|
+
import { Bn as _default, Gn as FileInputStatus, Hn as FileInputMode, Kn as FileInputValue, Un as FileInputProps, Vn as FileInputEmits, Wn as FileInputSize } from "../index-DNRBbwp_.js";
|
|
2
2
|
export { _default as FileInput, type FileInputEmits, type FileInputMode, type FileInputProps, type FileInputSize, type FileInputStatus, type FileInputValue };
|
package/dist/FileInput/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _sfc_main } from "../FileInput-
|
|
1
|
+
import { t as _sfc_main } from "../FileInput-DLO6V12n.js";
|
|
2
2
|
export { _sfc_main as FileInput };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as _sfc_main$1 } from "./VisuallyHidden-C7NN3VEP.js";
|
|
2
2
|
import { t as useAnnounce } from "./announce-Cnio10Wk.js";
|
|
3
3
|
import { n as selectFiles, t as formatFileSize } from "./useFileSelection-BPtaegqK.js";
|
|
4
|
-
import { a as useAstryxMessages } from "./context-
|
|
4
|
+
import { a as useAstryxMessages } from "./context-CiKncNSH.js";
|
|
5
5
|
import { t as _sfc_main$2 } from "./FieldIcon--NTgW5IU.js";
|
|
6
6
|
import { t as _sfc_main$3 } from "./IconButton-BNQuz9W_.js";
|
|
7
|
-
import { t as _sfc_main$4 } from "./Icon-
|
|
7
|
+
import { t as _sfc_main$4 } from "./Icon-CJKjdJy-.js";
|
|
8
8
|
import { t as _sfc_main$5 } from "./Spinner-9cYUCnDy.js";
|
|
9
9
|
import { t as _sfc_main$6 } from "./Field-8zRxzDHE.js";
|
|
10
10
|
import { computed, createBlock, createCommentVNode, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, openBlock, shallowRef, toDisplayString, unref, useId, useModel, useTemplateRef, withCtx } from "vue";
|
package/dist/Icon/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { a as IconSize, i as IconProps, n as IconColor, o as IconSlots, r as IconName } from "../types-
|
|
2
|
-
import { a as isIconGlyph, i as iconGlyphSlug, n as ICON_GLYPHS, r as IconGlyphName, t as _default } from "../index-
|
|
3
|
-
|
|
1
|
+
import { a as IconSize, i as IconProps, n as IconColor, o as IconSlots, r as IconName } from "../types-pnljWjEE.js";
|
|
2
|
+
import { a as isIconGlyph, i as iconGlyphSlug, n as ICON_GLYPHS, r as IconGlyphName, t as _default } from "../index-u5ozu0G7.js";
|
|
3
|
+
import { i as addIcon, n as IconifyIcon, r as addCollection, t as IconifyCollection } from "../registry-B1ObuP--.js";
|
|
4
|
+
export { ICON_GLYPHS, _default as Icon, type IconColor, type IconGlyphName, type IconName, type IconProps, type IconSize, type IconSlots, type IconifyCollection, type IconifyIcon, addCollection, addIcon, iconGlyphSlug, isIconGlyph };
|
package/dist/Icon/index.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { i as isIconGlyph, n as ICON_GLYPHS, r as iconGlyphSlug, t as _sfc_main } from "../Icon-
|
|
2
|
-
|
|
1
|
+
import { i as isIconGlyph, n as ICON_GLYPHS, r as iconGlyphSlug, t as _sfc_main } from "../Icon-CJKjdJy-.js";
|
|
2
|
+
import { n as addCollection, r as addIcon } from "../registry-C7OZb0PJ.js";
|
|
3
|
+
export { ICON_GLYPHS, _sfc_main as Icon, addCollection, addIcon, iconGlyphSlug, isIconGlyph };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { t as IconifyCollection } from "../registry-B1ObuP--.js";
|
|
2
|
+
//#region src/Icon/plugin.d.ts
|
|
3
|
+
export interface AstryxIconsOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Collection prefixes to read, such as `['carbon']`.
|
|
6
|
+
*
|
|
7
|
+
* When omitted, every `@iconify-json/*` dependency of the project is used.
|
|
8
|
+
*/
|
|
9
|
+
collections?: readonly string[];
|
|
10
|
+
/**
|
|
11
|
+
* Read a collection by prefix. The default reads
|
|
12
|
+
* `@iconify-json/<prefix>/icons.json` from the project.
|
|
13
|
+
*/
|
|
14
|
+
loadCollection?: (prefix: string, root: string) => IconifyCollection | undefined;
|
|
15
|
+
}
|
|
16
|
+
interface AstryxIconsPlugin {
|
|
17
|
+
name: 'astryx-icons';
|
|
18
|
+
enforce: 'pre';
|
|
19
|
+
configResolved: (config: {
|
|
20
|
+
root: string;
|
|
21
|
+
}) => void;
|
|
22
|
+
resolveId: (id: string) => string | undefined;
|
|
23
|
+
load: (id: string) => string | undefined;
|
|
24
|
+
transform: (code: string, id: string) => {
|
|
25
|
+
code: string;
|
|
26
|
+
map: null;
|
|
27
|
+
} | undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Vite plugin that bundles only the icons a project names in source.
|
|
31
|
+
*
|
|
32
|
+
* A static `name="carbon:settings"` becomes an import of that one icon. The
|
|
33
|
+
* collection JSON stays on disk; the client bundle receives the used bodies.
|
|
34
|
+
* Names built at runtime are invisible here — register those with
|
|
35
|
+
* `addCollection`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function astryxIcons(options?: AstryxIconsOptions): AstryxIconsPlugin;
|
|
38
|
+
/** Static icon names written as `collection:icon`, or as a `name` binding. */
|
|
39
|
+
export declare function extractIconCandidates(code: string): string[];
|
|
40
|
+
/**
|
|
41
|
+
* VitePress sets the Vite root to `docs/`, which has no package.json.
|
|
42
|
+
* Walk up to the package that actually depends on `@iconify-json/*`.
|
|
43
|
+
*/
|
|
44
|
+
export declare function findPackageRoot(start: string): string;
|
|
45
|
+
//#endregion
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { a as parseIconName, o as resolveCollectionIcon, t as ASTRYX_ICON_QUEUE } from "../registry-C7OZb0PJ.js";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import process from "node:process";
|
|
6
|
+
//#region src/Icon/plugin.ts
|
|
7
|
+
const VIRTUAL = "virtual:astryx-icon/";
|
|
8
|
+
const ICON_PART = "[a-z0-9]+(?:[-_][a-z0-9]+)*";
|
|
9
|
+
/**
|
|
10
|
+
* Vite plugin that bundles only the icons a project names in source.
|
|
11
|
+
*
|
|
12
|
+
* A static `name="carbon:settings"` becomes an import of that one icon. The
|
|
13
|
+
* collection JSON stays on disk; the client bundle receives the used bodies.
|
|
14
|
+
* Names built at runtime are invisible here — register those with
|
|
15
|
+
* `addCollection`.
|
|
16
|
+
*/
|
|
17
|
+
function astryxIcons(options = {}) {
|
|
18
|
+
const cache = /* @__PURE__ */ new Map();
|
|
19
|
+
let root = process.cwd();
|
|
20
|
+
let prefixes;
|
|
21
|
+
const warned = /* @__PURE__ */ new Set();
|
|
22
|
+
function load(prefix) {
|
|
23
|
+
const key = prefix.toLowerCase();
|
|
24
|
+
if (cache.has(key)) return cache.get(key);
|
|
25
|
+
const loaded = (options.loadCollection ?? readInstalledCollection)(key, root);
|
|
26
|
+
cache.set(key, loaded);
|
|
27
|
+
return loaded;
|
|
28
|
+
}
|
|
29
|
+
function availablePrefixes() {
|
|
30
|
+
prefixes ??= (options.collections ?? discoverPrefixes(root)).map((prefix) => prefix.toLowerCase());
|
|
31
|
+
return prefixes;
|
|
32
|
+
}
|
|
33
|
+
function resolveSpecifier(raw) {
|
|
34
|
+
const parsed = parseIconName(raw, availablePrefixes());
|
|
35
|
+
if (parsed == null || !availablePrefixes().includes(parsed.prefix)) return void 0;
|
|
36
|
+
const collection = load(parsed.prefix);
|
|
37
|
+
if (collection == null) {
|
|
38
|
+
warnMissing(`${parsed.prefix}:${parsed.name}`, `Install @iconify-json/${parsed.prefix}.`);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (resolveCollectionIcon(collection, parsed.name) == null) {
|
|
42
|
+
warnMissing(`${parsed.prefix}:${parsed.name}`, "The collection has no icon by that name.");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
return parsed;
|
|
46
|
+
}
|
|
47
|
+
function warnMissing(name, detail) {
|
|
48
|
+
if (warned.has(name)) return;
|
|
49
|
+
warned.add(name);
|
|
50
|
+
console.warn(`[astryx-vue] Icon "${name}" was not bundled. ${detail}`);
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
name: "astryx-icons",
|
|
54
|
+
enforce: "pre",
|
|
55
|
+
configResolved(config) {
|
|
56
|
+
root = findPackageRoot(config.root);
|
|
57
|
+
cache.clear();
|
|
58
|
+
prefixes = void 0;
|
|
59
|
+
},
|
|
60
|
+
resolveId(id) {
|
|
61
|
+
if (id.startsWith(VIRTUAL)) return `\0${id}`;
|
|
62
|
+
},
|
|
63
|
+
load(id) {
|
|
64
|
+
if (!id.startsWith(`\0${VIRTUAL}`)) return void 0;
|
|
65
|
+
const spec = id.slice(`\0${VIRTUAL}`.length);
|
|
66
|
+
const slash = spec.indexOf("/");
|
|
67
|
+
if (slash <= 0) return "export {}";
|
|
68
|
+
const prefix = spec.slice(0, slash);
|
|
69
|
+
const name = spec.slice(slash + 1);
|
|
70
|
+
const data = resolveCollectionIcon(load(prefix), name);
|
|
71
|
+
if (data == null) return "export {}";
|
|
72
|
+
const payload = iconPayload(data);
|
|
73
|
+
return `const queue = (globalThis[${JSON.stringify(ASTRYX_ICON_QUEUE)}] ??= [])\nqueue.push([${JSON.stringify(`${prefix}:${name}`)}, ${JSON.stringify(payload)}])\n`;
|
|
74
|
+
},
|
|
75
|
+
transform(code, id) {
|
|
76
|
+
if (!shouldScan(id)) return void 0;
|
|
77
|
+
const specs = /* @__PURE__ */ new Map();
|
|
78
|
+
for (const raw of extractIconCandidates(code)) {
|
|
79
|
+
const resolved = resolveSpecifier(raw);
|
|
80
|
+
if (resolved == null) continue;
|
|
81
|
+
specs.set(`${resolved.prefix}/${resolved.name}`, resolved);
|
|
82
|
+
}
|
|
83
|
+
if (specs.size === 0) return void 0;
|
|
84
|
+
const block = [...specs.values()].map((spec) => {
|
|
85
|
+
return `import '${VIRTUAL}${spec.prefix}/${spec.name}'`;
|
|
86
|
+
}).join("\n");
|
|
87
|
+
const next = (id.split("?", 1)[0] ?? id).endsWith(".vue") ? injectVue(code, block) : injectModule(code, block);
|
|
88
|
+
if (next === code) return void 0;
|
|
89
|
+
return {
|
|
90
|
+
code: next,
|
|
91
|
+
map: null
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function iconPayload(data) {
|
|
97
|
+
const payload = { body: data.body };
|
|
98
|
+
if (data.width != null) payload.width = data.width;
|
|
99
|
+
if (data.height != null) payload.height = data.height;
|
|
100
|
+
if (data.left != null) payload.left = data.left;
|
|
101
|
+
if (data.top != null) payload.top = data.top;
|
|
102
|
+
if (data.rotate != null) payload.rotate = data.rotate;
|
|
103
|
+
if (data.hFlip != null) payload.hFlip = data.hFlip;
|
|
104
|
+
if (data.vFlip != null) payload.vFlip = data.vFlip;
|
|
105
|
+
return payload;
|
|
106
|
+
}
|
|
107
|
+
function shouldScan(id) {
|
|
108
|
+
if (id.includes("\0") || id.includes("node_modules") || id.includes(VIRTUAL)) return false;
|
|
109
|
+
const [filename, query] = id.split("?", 2);
|
|
110
|
+
if (query?.includes("raw") || query?.includes("type=")) return false;
|
|
111
|
+
return /\.(?:vue|[cm]?[jt]sx?)$/.test(filename ?? "");
|
|
112
|
+
}
|
|
113
|
+
function unwrapLiteral(value) {
|
|
114
|
+
const trimmed = value.trim();
|
|
115
|
+
return (/^(["'`])([\s\S]*)\1$/.exec(trimmed)?.[2] ?? trimmed).trim();
|
|
116
|
+
}
|
|
117
|
+
/** Static icon names written as `collection:icon`, or as a `name` binding. */
|
|
118
|
+
function extractIconCandidates(code) {
|
|
119
|
+
const found = /* @__PURE__ */ new Set();
|
|
120
|
+
const colonLiteral = new RegExp(`(["'\`])(${ICON_PART}:${ICON_PART})\\1`, "gi");
|
|
121
|
+
const nameBinding = /(?:^|[\s<(]):?name\s*=\s*(["'])([\s\S]*?)\1/g;
|
|
122
|
+
const nameProperty = /(?:^|[{,\s])name\s*:\s*(["'`])([\s\S]*?)\1/g;
|
|
123
|
+
for (const match of code.matchAll(colonLiteral)) if (match[2]) found.add(match[2]);
|
|
124
|
+
for (const pattern of [nameBinding, nameProperty]) for (const match of code.matchAll(pattern)) if (match[2]) found.add(unwrapLiteral(match[2]));
|
|
125
|
+
return [...found];
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* VitePress sets the Vite root to `docs/`, which has no package.json.
|
|
129
|
+
* Walk up to the package that actually depends on `@iconify-json/*`.
|
|
130
|
+
*/
|
|
131
|
+
function findPackageRoot(start) {
|
|
132
|
+
let dir = start;
|
|
133
|
+
while (true) try {
|
|
134
|
+
readFileSync(join(dir, "package.json"));
|
|
135
|
+
return dir;
|
|
136
|
+
} catch {
|
|
137
|
+
const parent = dirname(dir);
|
|
138
|
+
if (parent === dir) return start;
|
|
139
|
+
dir = parent;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
function discoverPrefixes(root) {
|
|
143
|
+
try {
|
|
144
|
+
const pkg = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
|
|
145
|
+
return [
|
|
146
|
+
...Object.keys(pkg.dependencies ?? {}),
|
|
147
|
+
...Object.keys(pkg.devDependencies ?? {}),
|
|
148
|
+
...Object.keys(pkg.optionalDependencies ?? {})
|
|
149
|
+
].filter((name) => name.startsWith("@iconify-json/")).map((name) => name.slice(14));
|
|
150
|
+
} catch {
|
|
151
|
+
return [];
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
function readInstalledCollection(prefix, root) {
|
|
155
|
+
try {
|
|
156
|
+
const jsonPath = createRequire(join(root, "package.json")).resolve(`@iconify-json/${prefix}/icons.json`);
|
|
157
|
+
return JSON.parse(readFileSync(jsonPath, "utf8"));
|
|
158
|
+
} catch {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function injectVue(code, block) {
|
|
163
|
+
if (code.includes(block)) return code;
|
|
164
|
+
const tags = [...code.matchAll(/<script\b[^>]*>/gi)];
|
|
165
|
+
const target = tags.find((tag) => tag[0].includes("setup")) ?? tags[0];
|
|
166
|
+
if (target?.index != null) {
|
|
167
|
+
const at = target.index + target[0].length;
|
|
168
|
+
return `${code.slice(0, at)}\n${block}\n${code.slice(at)}`;
|
|
169
|
+
}
|
|
170
|
+
return `<script setup>\n${block}\n<\/script>\n${code}`;
|
|
171
|
+
}
|
|
172
|
+
function injectModule(code, block) {
|
|
173
|
+
if (code.includes(block)) return code;
|
|
174
|
+
return `${block}\n${code}`;
|
|
175
|
+
}
|
|
176
|
+
//#endregion
|
|
177
|
+
export { astryxIcons, extractIconCandidates, findPackageRoot };
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { i as getIcon, s as warnMissingIcon } from "./registry-C7OZb0PJ.js";
|
|
2
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, inject, mergeProps, normalizeClass, openBlock, renderSlot, resolveDynamicComponent, toValue, useId } from "vue";
|
|
3
|
+
import "../styles/icon.css";
|
|
4
|
+
//#region src/Icon/context.ts
|
|
5
|
+
/**
|
|
6
|
+
* The size an owning component supplies to the icons in its slots.
|
|
7
|
+
*
|
|
8
|
+
* The value is stored as given, so a caller can pass a ref or a computed and
|
|
9
|
+
* keep the default in step with its own props.
|
|
10
|
+
*/
|
|
11
|
+
const ICON_DEFAULT_SIZE_KEY = Symbol("astryx-icon-default-size");
|
|
12
|
+
/**
|
|
13
|
+
* The size inherited from the nearest owner, or `undefined` when there is none.
|
|
14
|
+
*/
|
|
15
|
+
function useIconDefaultSize() {
|
|
16
|
+
const inherited = inject(ICON_DEFAULT_SIZE_KEY, void 0);
|
|
17
|
+
return computed(() => inherited == null ? void 0 : toValue(inherited));
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/Icon/glyphs.ts
|
|
21
|
+
/**
|
|
22
|
+
* The artwork kept for the components' own chrome. Applications bring their own
|
|
23
|
+
* icons; this list only has to cover what astryx-vue draws itself.
|
|
24
|
+
*/
|
|
25
|
+
const ICON_GLYPHS = [
|
|
26
|
+
"chevronDown",
|
|
27
|
+
"chevronLeft",
|
|
28
|
+
"chevronRight",
|
|
29
|
+
"check",
|
|
30
|
+
"moreHorizontal",
|
|
31
|
+
"copy",
|
|
32
|
+
"calendar",
|
|
33
|
+
"clock",
|
|
34
|
+
"upload",
|
|
35
|
+
"arrowUp",
|
|
36
|
+
"arrowDown",
|
|
37
|
+
"close",
|
|
38
|
+
"funnel",
|
|
39
|
+
"image",
|
|
40
|
+
"search",
|
|
41
|
+
"stop",
|
|
42
|
+
"microphone",
|
|
43
|
+
"warning",
|
|
44
|
+
"error"
|
|
45
|
+
];
|
|
46
|
+
function isIconGlyph(value) {
|
|
47
|
+
return ICON_GLYPHS.includes(value);
|
|
48
|
+
}
|
|
49
|
+
/** The CSS-safe form of a name, used as the `astryx-icon--<slug>` class. */
|
|
50
|
+
function iconGlyphSlug(name) {
|
|
51
|
+
return name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/:/g, "-").toLowerCase();
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/Icon/svg.ts
|
|
55
|
+
/**
|
|
56
|
+
* Turn icon data into a viewBox and a body.
|
|
57
|
+
*
|
|
58
|
+
* Flip and rotation follow Iconify: flip first, then rotate, and a 90 degree
|
|
59
|
+
* turn swaps the canvas. The body is wrapped in a transformed group only when
|
|
60
|
+
* a transform is present, so a plain glyph stays as the collection authored it.
|
|
61
|
+
*/
|
|
62
|
+
function iconToSVG(icon) {
|
|
63
|
+
const box = {
|
|
64
|
+
left: icon.left ?? 0,
|
|
65
|
+
top: icon.top ?? 0,
|
|
66
|
+
width: icon.width ?? 16,
|
|
67
|
+
height: icon.height ?? 16
|
|
68
|
+
};
|
|
69
|
+
let body = icon.body;
|
|
70
|
+
const transformations = [];
|
|
71
|
+
const hFlip = icon.hFlip === true;
|
|
72
|
+
const vFlip = icon.vFlip === true;
|
|
73
|
+
let rotation = icon.rotate ?? 0;
|
|
74
|
+
if (hFlip) {
|
|
75
|
+
if (vFlip) rotation += 2;
|
|
76
|
+
else {
|
|
77
|
+
transformations.push(`translate(${box.width + box.left} ${0 - box.top})`);
|
|
78
|
+
transformations.push("scale(-1 1)");
|
|
79
|
+
box.top = 0;
|
|
80
|
+
box.left = 0;
|
|
81
|
+
}
|
|
82
|
+
} else if (vFlip) {
|
|
83
|
+
transformations.push(`translate(${0 - box.left} ${box.height + box.top})`);
|
|
84
|
+
transformations.push("scale(1 -1)");
|
|
85
|
+
box.top = 0;
|
|
86
|
+
box.left = 0;
|
|
87
|
+
}
|
|
88
|
+
if (rotation < 0) rotation -= Math.floor(rotation / 4) * 4;
|
|
89
|
+
rotation %= 4;
|
|
90
|
+
switch (rotation) {
|
|
91
|
+
case 1: {
|
|
92
|
+
const origin = box.height / 2 + box.top;
|
|
93
|
+
transformations.unshift(`rotate(90 ${origin} ${origin})`);
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
case 2:
|
|
97
|
+
transformations.unshift(`rotate(180 ${box.width / 2 + box.left} ${box.height / 2 + box.top})`);
|
|
98
|
+
break;
|
|
99
|
+
case 3: {
|
|
100
|
+
const origin = box.width / 2 + box.left;
|
|
101
|
+
transformations.unshift(`rotate(-90 ${origin} ${origin})`);
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (rotation % 2 === 1) {
|
|
106
|
+
if (box.left !== box.top) {
|
|
107
|
+
const left = box.left;
|
|
108
|
+
box.left = box.top;
|
|
109
|
+
box.top = left;
|
|
110
|
+
}
|
|
111
|
+
if (box.width !== box.height) {
|
|
112
|
+
const width = box.width;
|
|
113
|
+
box.width = box.height;
|
|
114
|
+
box.height = width;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (transformations.length > 0) body = `<g transform="${transformations.join(" ")}">${body}</g>`;
|
|
118
|
+
return {
|
|
119
|
+
viewBox: `${box.left} ${box.top} ${box.width} ${box.height}`,
|
|
120
|
+
body
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function prefixIds(body, idPrefix) {
|
|
124
|
+
if (idPrefix === "" || !body.includes("id=")) return body;
|
|
125
|
+
return body.replace(/\bid=(["'])([^"']+)\1/g, (_, quote, id) => `id=${quote}${idPrefix}${id}${quote}`).replace(/(\b(?:href|xlink:href)=)(["'])#([^"']+)\2/g, (_, attr, quote, id) => `${attr}${quote}#${idPrefix}${id}${quote}`).replace(/url\(#([^)]+)\)/g, (_, id) => `url(#${idPrefix}${id})`);
|
|
126
|
+
}
|
|
127
|
+
/** A complete SVG element for one icon. The caller supplies a unique id prefix. */
|
|
128
|
+
function renderIconMarkup(icon, idPrefix) {
|
|
129
|
+
const built = iconToSVG(icon);
|
|
130
|
+
const body = prefixIds(built.body, idPrefix);
|
|
131
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="${built.viewBox}" width="100%" height="100%" aria-hidden="true" focusable="false">${body}</svg>`;
|
|
132
|
+
}
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/Icon/Icon.vue
|
|
135
|
+
const _hoisted_1 = ["data-color", "data-size"];
|
|
136
|
+
const _hoisted_2 = ["innerHTML"];
|
|
137
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
138
|
+
name: "AstryxIcon",
|
|
139
|
+
__name: "Icon",
|
|
140
|
+
props: {
|
|
141
|
+
name: {},
|
|
142
|
+
icon: {},
|
|
143
|
+
color: { default: "inherit" },
|
|
144
|
+
size: {},
|
|
145
|
+
label: {}
|
|
146
|
+
},
|
|
147
|
+
setup(__props) {
|
|
148
|
+
const props = __props;
|
|
149
|
+
const inheritedSize = useIconDefaultSize();
|
|
150
|
+
const idPrefix = `i${useId().replace(/\W/g, "")}-`;
|
|
151
|
+
const hasName = computed(() => props.name != null && props.name !== "");
|
|
152
|
+
const resolvedSize = computed(() => {
|
|
153
|
+
if (props.size != null) return props.size;
|
|
154
|
+
if (inheritedSize.value != null) return inheritedSize.value;
|
|
155
|
+
if (hasName.value) return void 0;
|
|
156
|
+
return "md";
|
|
157
|
+
});
|
|
158
|
+
const iconMarkup = computed(() => {
|
|
159
|
+
if (!hasName.value || props.name == null) return void 0;
|
|
160
|
+
const data = getIcon(props.name);
|
|
161
|
+
if (data == null) {
|
|
162
|
+
warnMissingIcon(props.name);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
return renderIconMarkup(data, idPrefix);
|
|
166
|
+
});
|
|
167
|
+
const glyphSlug = computed(() => typeof props.icon === "string" && isIconGlyph(props.icon) ? iconGlyphSlug(props.icon) : void 0);
|
|
168
|
+
const providedClass = computed(() => typeof props.icon === "string" && !isIconGlyph(props.icon) ? props.icon : void 0);
|
|
169
|
+
const iconComponent = computed(() => props.icon != null && typeof props.icon !== "string" ? props.icon : void 0);
|
|
170
|
+
const a11yAttrs = computed(() => {
|
|
171
|
+
const label = props.label;
|
|
172
|
+
return label != null && label !== "" ? {
|
|
173
|
+
"role": "img",
|
|
174
|
+
"aria-label": label
|
|
175
|
+
} : { "aria-hidden": "true" };
|
|
176
|
+
});
|
|
177
|
+
return (_ctx, _cache) => {
|
|
178
|
+
return openBlock(), createElementBlock("span", mergeProps(a11yAttrs.value, {
|
|
179
|
+
class: "astryx-icon",
|
|
180
|
+
"data-color": __props.color,
|
|
181
|
+
"data-size": resolvedSize.value
|
|
182
|
+
}), [
|
|
183
|
+
createCommentVNode(" Iconify bodies are SVG path data from a collection, not caller HTML. "),
|
|
184
|
+
createCommentVNode(" eslint-disable-next-line vue/no-v-html "),
|
|
185
|
+
hasName.value && iconMarkup.value ? (openBlock(), createElementBlock("span", {
|
|
186
|
+
key: 0,
|
|
187
|
+
class: "astryx-icon__svg",
|
|
188
|
+
innerHTML: iconMarkup.value
|
|
189
|
+
}, null, 8, _hoisted_2)) : !hasName.value && glyphSlug.value ? (openBlock(), createElementBlock("span", {
|
|
190
|
+
key: 1,
|
|
191
|
+
class: normalizeClass(["astryx-icon__glyph", `astryx-icon--${glyphSlug.value}`])
|
|
192
|
+
}, null, 2)) : !hasName.value && providedClass.value ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createCommentVNode("\n Utility icon classes (UnoCSS `i-*`) set width and height to 100% outside\n any layer, which would override this box's size if the class sat on it.\n The box owns the size; the class only paints the inside.\n "), createElementVNode("span", { class: normalizeClass(["astryx-icon__external", providedClass.value]) }, null, 2)], 2112)) : !hasName.value && iconComponent.value ? (openBlock(), createBlock(resolveDynamicComponent(iconComponent.value), { key: 3 })) : !hasName.value ? renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 4) : createCommentVNode("v-if", true)
|
|
193
|
+
], 16, _hoisted_1);
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
//#endregion
|
|
198
|
+
export { isIconGlyph as i, ICON_GLYPHS as n, iconGlyphSlug as r, _sfc_main as t };
|
package/dist/Lightbox/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as _sfc_main, t as useLightbox } from "../Lightbox-
|
|
1
|
+
import { n as _sfc_main, t as useLightbox } from "../Lightbox-CdFCS_EA.js";
|
|
2
2
|
export { _sfc_main as Lightbox, useLightbox };
|