@wow-two-beta/fe 0.0.36 → 0.0.38

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.
Files changed (42) hide show
  1. package/dist/auth/AuthSession.d.ts +25 -1
  2. package/dist/auth/AuthSession.js.map +1 -1
  3. package/dist/auth/BffSession.d.ts +55 -0
  4. package/dist/auth/BffSession.js +73 -0
  5. package/dist/auth/BffSession.js.map +1 -0
  6. package/dist/auth/BffSessionSync.d.ts +57 -0
  7. package/dist/auth/BffSessionSync.js +160 -0
  8. package/dist/auth/BffSessionSync.js.map +1 -0
  9. package/dist/auth/BffStrategy.d.ts +53 -0
  10. package/dist/auth/BffStrategy.js +95 -0
  11. package/dist/auth/BffStrategy.js.map +1 -0
  12. package/dist/auth/RedirectStrategy.js +3 -6
  13. package/dist/auth/RedirectStrategy.js.map +1 -1
  14. package/dist/auth/ReturnUrlExtensions.d.ts +7 -0
  15. package/dist/auth/ReturnUrlExtensions.js +15 -0
  16. package/dist/auth/ReturnUrlExtensions.js.map +1 -0
  17. package/dist/auth/UseBffAuth.d.ts +31 -0
  18. package/dist/auth/UseBffAuth.js +39 -0
  19. package/dist/auth/UseBffAuth.js.map +1 -0
  20. package/dist/auth/index.d.ts +5 -1
  21. package/dist/auth/index.js +11 -1
  22. package/dist/auth/index.js.map +1 -1
  23. package/dist/auth/providers/AuthProvider.vue.js +74 -5
  24. package/dist/auth/providers/AuthProvider.vue.js.map +1 -1
  25. package/dist/foundation/http/Antiforgery.d.ts +5 -0
  26. package/dist/foundation/http/Antiforgery.js.map +1 -1
  27. package/dist/foundation/http/CreateApiClient.js +1 -1
  28. package/dist/foundation/http/CreateApiClient.js.map +1 -1
  29. package/dist/index.js +2 -1
  30. package/dist/presentation/actions/refreshButton/RefreshButton.vue.js.map +1 -1
  31. package/dist/presentation/forms/phoneInput/PhoneInput.vue.d.ts +2 -0
  32. package/dist/presentation/forms/phoneInput/PhoneInput.vue.js +39 -14
  33. package/dist/presentation/forms/phoneInput/PhoneInput.vue.js.map +1 -1
  34. package/dist/presentation/overlays/alertModal/AlertModalContent.vue.js +1 -0
  35. package/dist/presentation/overlays/alertModal/AlertModalContent.vue.js.map +1 -1
  36. package/dist/presentation/overlays/index.js +2 -1
  37. package/dist/presentation/overlays/modal/ModalContent.vue.d.ts +17 -0
  38. package/dist/presentation/overlays/modal/ModalContent.vue.js +23 -2
  39. package/dist/presentation/overlays/modal/ModalContent.vue.js.map +1 -1
  40. package/dist/presentation/overlays/modal/ModalContent2.vue.js +2 -1
  41. package/dist/presentation/overlays/modal/index.d.ts +1 -1
  42. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -146,7 +146,7 @@ import { default as default142, DescriptionGroupDensity, DescriptionGroupLayout
146
146
  import { default as default143, default as default144, ModalRole } from "./presentation/overlays/modal/Modal.vue.js";
147
147
  import { default as default145, default as default146, default as default147 } from "./presentation/overlays/OverlayBody.vue.js";
148
148
  import { default as default148, default as default149, default as default150 } from "./presentation/overlays/OverlayCloseButton.vue.js";
149
- import { default as default151, default as default152, ModalPhoneLayout, ModalSize } from "./presentation/overlays/modal/ModalContent.vue.js";
149
+ import { default as default151, default as default152, ModalHeight, ModalPhoneLayout, ModalSize } from "./presentation/overlays/modal/ModalContent.vue.js";
150
150
  import { default as default153, default as default154, default as default155 } from "./presentation/overlays/OverlayFooter.vue.js";
151
151
  import { default as default156, default as default157, default as default158 } from "./presentation/overlays/OverlayHeader.vue.js";
152
152
  import { default as default159, default as default160 } from "./presentation/overlays/modal/ModalTrigger.vue.js";
@@ -868,6 +868,7 @@ export {
868
868
  default54 as ModalDescription,
869
869
  default155 as ModalFooter,
870
870
  default158 as ModalHeader,
871
+ ModalHeight,
871
872
  ModalPhoneLayout,
872
873
  ModalRole,
873
874
  ModalSize,
@@ -1 +1 @@
1
- {"version":3,"file":"RefreshButton.vue.js","sources":["../../../../src/presentation/actions/refreshButton/RefreshButton.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { ButtonProps } from '../button';\n\n/** @internal The `ButtonProps` this preset decides itself. */\ntype OwnedButtonProp = keyof Pick<ButtonProps, 'isLoading' | 'shape' | 'leadingSlot'>;\n\n/** Defines the forwarded `ButtonProps`, minus the ones the refresh preset sets. */\ntype RefreshButtonAttributes = Omit<ButtonProps, OwnedButtonProp>;\n\n/** Defines props for the one refresh control a region shows. */\nexport interface RefreshButtonProps extends /* @vue-ignore */ RefreshButtonAttributes {\n /** True from the click until the refresh settles — `useRefresh`'s `refreshing`; the icon spins and clicks wait. */\n readonly isRefreshing?: boolean;\n\n /** The visible label, or the accessible name of an icon-only button. Default `\"Refresh\"`, localized. */\n readonly label?: string;\n\n /** Renders the icon alone, square at its size, named by `label`. */\n readonly isIconOnly?: boolean;\n\n /** The visual surface style. Default `outline`; `ghost` inside a panel header. */\n readonly variant?: ButtonProps['variant'];\n\n /** The size step. Default `sm`; `md` beside page-level controls. */\n readonly size?: ButtonProps['size'];\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\nimport { RefreshCw } from 'lucide-vue-next';\nimport { useLocaleDefaults } from '../../../foundation/i18n';\nimport { Icon } from '../../../foundation/icons';\nimport Button from '../button/Button.vue';\n\n/**\n * Renders the refresh control a region reruns its reads with — a `Button` preset that swaps the refresh icon for the\n * spinner while `isRefreshing`, keeps its label and width, and swallows repeat clicks until the refresh settles. Pair\n * it with `useRefresh` from `@wow-two-beta/fe/query`, which also drives the region's placeholders.\n */\ndefineOptions({ name: 'RefreshButton', inheritAttrs: false });\n\nconst componentProps = withDefaults(defineProps<RefreshButtonProps>(), {\n isRefreshing: false,\n label: undefined,\n isIconOnly: false,\n variant: 'outline',\n size: 'sm',\n});\nconst props = useLocaleDefaults(componentProps, 'RefreshButton', { label: 'Refresh' });\n\nconst attrs = useAttrs();\n\n/** The icon-only form names itself through `aria-label`, and `title` shows the name on hover. */\nconst naming = computed(() =>\n props.isIconOnly ? { 'aria-label': props.label, title: props.label } : ({} as Record<string, string>),\n);\n</script>\n\n<template>\n <Button\n tone=\"neutral\"\n :variant=\"props.variant\"\n :size=\"props.size\"\n :shape=\"props.isIconOnly ? 'square' : 'default'\"\n :is-loading=\"props.isRefreshing\"\n v-bind=\"{ ...naming, ...attrs }\"\n >\n <template #leading><Icon :icon=\"RefreshCw\" :size=\"14\" /></template>\n <template v-if=\"!props.isIconOnly\">{{ props.label }}</template>\n </Button>\n</template>\n"],"names":["_openBlock","_createBlock","Button","_mergeProps","_unref","_createVNode","Icon","_createElementBlock","_Fragment","_createTextVNode","_toDisplayString"],"mappings":";;;;;;;;;;;;;;;;AA0CA,UAAM,iBAAiB;AAOvB,UAAM,QAAQ,kBAAkB,gBAAgB,iBAAiB,EAAE,OAAO,WAAW;AAErF,UAAM,QAAQ,SAAA;AAGd,UAAM,SAAS;AAAA,MAAS,MACtB,MAAM,aAAa,EAAE,cAAc,MAAM,OAAO,OAAO,MAAM,UAAW,CAAA;AAAA,IAAC;;AAKzE,aAAAA,UAAA,GAAAC,YAUSC,aAVTC,WAUS;AAAA,QATP,MAAK;AAAA,QACJ,SAASC,MAAA,KAAA,EAAM;AAAA,QACf,MAAMA,MAAA,KAAA,EAAM;AAAA,QACZ,OAAOA,MAAA,KAAA,EAAM,aAAU,WAAA;AAAA,QACvB,cAAYA,MAAA,KAAA,EAAM;AAAA,MAAA,GACN,EAAA,GAAA,OAAA,UAAWA,MAAA,KAAA,EAAA,CAAK,GAAA;AAAA,QAElB,iBAAQ,MAAqC;AAAA,UAArCC,YAAqCD,MAAAE,WAAA,GAAA;AAAA,YAA9B,MAAMF,MAAA,SAAA;AAAA,YAAY,MAAM;AAAA,UAAA;;yBATuC,MAGjF;AAAA,UAOS,CAAAA,MAAA,KAAA,EAAM,2BAAvBG,mBAA+DC,UAAA,EAAA,KAAA,KAAA;AAAA,YAAzBC,gBAAAC,gBAAAN,MAAA,KAAA,EAAM,KAAK,GAAA,CAAA;AAAA,UAAA;;;;;;;"}
1
+ {"version":3,"file":"RefreshButton.vue.js","sources":["../../../../src/presentation/actions/refreshButton/RefreshButton.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { ButtonProps } from '../button';\n\n/** @internal The `ButtonProps` this preset decides itself. */\ntype OwnedButtonProp = keyof Pick<ButtonProps, 'isLoading' | 'shape' | 'leadingSlot'>;\n\n/** Defines the forwarded `ButtonProps`, minus the ones the refresh preset sets. */\ntype RefreshButtonAttributes = Omit<ButtonProps, OwnedButtonProp>;\n\n/** Defines props for the one refresh control a region shows. */\nexport interface RefreshButtonProps extends /* @vue-ignore */ RefreshButtonAttributes {\n /** True from the click until the refresh settles — `useRefresh`'s `refreshing`; the icon spins and clicks wait. */\n readonly isRefreshing?: boolean;\n\n /** The visible label, or the accessible name of an icon-only button. Default `\"Refresh\"`, localized. */\n readonly label?: string;\n\n /** Renders the icon alone, square at its size, named by `label`. */\n readonly isIconOnly?: boolean;\n\n /** The visual surface style. Default `outline`; `ghost` inside a panel header. */\n readonly variant?: ButtonProps['variant'];\n\n /** The size step. Default `sm`; `md` beside page-level controls. */\n readonly size?: ButtonProps['size'];\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\nimport { RefreshCw } from 'lucide-vue-next';\nimport { useLocaleDefaults } from '../../../foundation/i18n';\nimport { Icon } from '../../../foundation/icons';\nimport Button from '../button/Button.vue';\n\n/**\n * Renders the refresh control a region reruns its reads with — a `Button` preset that swaps the refresh icon for the\n * spinner while `isRefreshing`, keeps its label and width, and swallows repeat clicks until the refresh settles. Pair\n * it with `useRefresh` from `@wow-two-beta/fe/query`, which also drives the region's placeholders.\n */\ndefineOptions({ name: 'RefreshButton', inheritAttrs: false });\n\nconst componentProps = withDefaults(defineProps<RefreshButtonProps>(), {\n isRefreshing: false,\n label: undefined,\n isIconOnly: false,\n variant: 'outline',\n size: 'sm',\n});\nconst props = useLocaleDefaults(componentProps, 'RefreshButton', { label: 'Refresh' });\n\nconst attrs = useAttrs();\n\n/** The icon-only form names itself through `aria-label`, and `title` shows the name on hover. */\nconst naming = computed(() =>\n props.isIconOnly ? { 'aria-label': props.label, title: props.label } : ({} as Record<string, string>),\n);\n</script>\n\n<template>\n <Button\n tone=\"neutral\"\n :variant=\"props.variant\"\n :size=\"props.size\"\n :shape=\"props.isIconOnly ? 'square' : 'default'\"\n :is-loading=\"props.isRefreshing\"\n v-bind=\"{ ...naming, ...attrs }\"\n >\n <template #leading><Icon :icon=\"RefreshCw\" :size=\"14\" /></template>\n <template v-if=\"!props.isIconOnly\">{{ props.label }}</template>\n </Button>\n</template>\n"],"names":["_openBlock","_createBlock","Button","_mergeProps","_unref","_createVNode","Icon","_createElementBlock","_Fragment","_createTextVNode","_toDisplayString"],"mappings":";;;;;;;;;;;;;;;;AA0CA,UAAM,iBAAiB;AAOvB,UAAM,QAAQ,kBAAkB,gBAAgB,iBAAiB,EAAE,OAAO,WAAW;AAErF,UAAM,QAAQ,SAAA;AAGd,UAAM,SAAS;AAAA,MAAS,MACtB,MAAM,aAAa,EAAE,cAAc,MAAM,OAAO,OAAO,MAAM,UAAW,CAAA;AAAA,IAAC;;AAKzE,aAAAA,UAAA,GAAAC,YAUSC,aAVTC,WAUS;AAAA,QATP,MAAK;AAAA,QACJ,SAASC,MAAA,KAAA,EAAM;AAAA,QACf,MAAMA,MAAA,KAAA,EAAM;AAAA,QACZ,OAAOA,MAAA,KAAA,EAAM,aAAU,WAAA;AAAA,QACvB,cAAYA,MAAA,KAAA,EAAM;AAAA,MAAA,GACN,EAAA,GAAA,OAAA,UAAWA,MAAA,KAAA,EAAA,CAAK,GAAA;AAAA,QAElB,iBAAQ,MAAqC;AAAA,UAArCC,YAAqCD,MAAAE,WAAA,GAAA;AAAA,YAA9B,MAAMF,MAAA,SAAA;AAAA,YAAY,MAAM;AAAA,UAAA;;yBAClD,MAA+D;AAAA,UAA9C,CAAAA,MAAA,KAAA,EAAM,2BAAvBG,mBAA+DC,UAAA,EAAA,KAAA,KAAA;AAAA,YAAzBC,gBAAAC,gBAAAN,MAAA,KAAA,EAAM,KAAK,GAAA,CAAA;AAAA,UAAA;;;;;;;"}
@@ -14,6 +14,8 @@ export interface PhoneInputProps extends /* @vue-ignore */ NativeInputAttributes
14
14
  readonly defaultValue?: string;
15
15
  /** The ISO code selected before the value carries a recognisable dial prefix. Default `US`. */
16
16
  readonly defaultCountry?: string;
17
+ /** The ISO codes the reader may pick, in display order; unknown codes are ignored. Default every known country. */
18
+ readonly countries?: ReadonlyArray<string>;
17
19
  /** The disabled state. Falls back to the surrounding form control's `isDisabled`. */
18
20
  readonly isDisabled?: boolean;
19
21
  /** The read-only state. Falls back to the surrounding form control's `isReadOnly`. */
@@ -1,4 +1,4 @@
1
- import { defineComponent, useAttrs, computed, ref, useTemplateRef, openBlock, createElementBlock, mergeProps, unref, createElementVNode, normalizeClass, Fragment, renderList, toDisplayString, createCommentVNode } from "vue";
1
+ import { defineComponent, useAttrs, computed, ref, useTemplateRef, openBlock, createElementBlock, mergeProps, unref, normalizeClass, toDisplayString, Fragment, renderList, createElementVNode, createCommentVNode } from "vue";
2
2
  import { useLocale } from "../../../foundation/i18n/providers/LocaleContext.js";
3
3
  import { useNativeFormReset } from "../UseNativeFormReset.js";
4
4
  import { cn } from "../../../foundation/styles/Cn.js";
@@ -36,6 +36,11 @@ const PhoneCountries = [
36
36
  { iso: "TR", name: "Türkiye", dial: "+90", flag: "🇹🇷" },
37
37
  { iso: "RU", name: "Russia", dial: "+7", flag: "🇷🇺" },
38
38
  { iso: "UA", name: "Ukraine", dial: "+380", flag: "🇺🇦" },
39
+ { iso: "UZ", name: "Uzbekistan", dial: "+998", flag: "🇺🇿" },
40
+ { iso: "KZ", name: "Kazakhstan", dial: "+7", flag: "🇰🇿" },
41
+ { iso: "KG", name: "Kyrgyzstan", dial: "+996", flag: "🇰🇬" },
42
+ { iso: "TJ", name: "Tajikistan", dial: "+992", flag: "🇹🇯" },
43
+ { iso: "TM", name: "Turkmenistan", dial: "+993", flag: "🇹🇲" },
39
44
  { iso: "IL", name: "Israel", dial: "+972", flag: "🇮🇱" },
40
45
  { iso: "AE", name: "UAE", dial: "+971", flag: "🇦🇪" },
41
46
  { iso: "SA", name: "Saudi Arabia", dial: "+966", flag: "🇸🇦" },
@@ -64,9 +69,14 @@ const PhoneCountries = [
64
69
  { iso: "CO", name: "Colombia", dial: "+57", flag: "🇨🇴" },
65
70
  { iso: "MX", name: "Mexico", dial: "+52", flag: "🇲🇽" }
66
71
  ];
67
- function splitE164(value, defaultIso) {
72
+ function resolveCountries(isos) {
73
+ if (!isos) return PhoneCountries;
74
+ const known = [...new Set(isos)].map((iso) => PhoneCountries.find((c) => c.iso === iso)).filter((c) => c !== void 0);
75
+ return known.length > 0 ? known : PhoneCountries;
76
+ }
77
+ function splitE164(value, countries, defaultIso) {
68
78
  if (!value) return { iso: defaultIso, national: "" };
69
- const sorted = [...PhoneCountries].sort((a, b) => b.dial.length - a.dial.length);
79
+ const sorted = [...countries].sort((a, b) => b.dial.length - a.dial.length);
70
80
  for (const c of sorted) {
71
81
  if (value.startsWith(c.dial)) {
72
82
  return { iso: c.iso, national: value.slice(c.dial.length).replace(/\D/g, "") };
@@ -81,6 +91,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
81
91
  modelValue: { default: void 0 },
82
92
  defaultValue: {},
83
93
  defaultCountry: { default: "US" },
94
+ countries: {},
84
95
  isDisabled: { type: Boolean, default: void 0 },
85
96
  isReadOnly: { type: Boolean, default: void 0 },
86
97
  isInvalid: { type: Boolean, default: void 0 },
@@ -104,26 +115,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
104
115
  const disabled = computed(() => props.isDisabled ?? ctx?.isDisabled);
105
116
  const readOnly = computed(() => props.isReadOnly ?? ctx?.isReadOnly);
106
117
  const invalid = computed(() => props.isInvalid ?? ctx?.isInvalid);
107
- const selectedIso = ref(props.defaultCountry);
118
+ const allowed = computed(() => resolveCountries(props.countries));
119
+ const fallbackIso = computed(
120
+ () => allowed.value.find((c) => c.iso === props.defaultCountry)?.iso ?? allowed.value[0].iso
121
+ );
122
+ const selectedIso = ref(fallbackIso.value);
108
123
  const split = computed(() => {
109
- const selected = PhoneCountries.find((c) => c.iso === selectedIso.value);
124
+ const selected = allowed.value.find((c) => c.iso === selectedIso.value);
110
125
  if (selected && (!e164.value || e164.value.startsWith(selected.dial))) {
111
126
  return {
112
127
  iso: selected.iso,
113
128
  national: e164.value.slice(selected.dial.length).replace(/\D/g, "")
114
129
  };
115
130
  }
116
- return splitE164(e164.value, props.defaultCountry);
131
+ return splitE164(e164.value, allowed.value, fallbackIso.value);
117
132
  });
118
133
  const iso = computed(() => split.value.iso);
119
134
  const national = computed(() => split.value.national);
120
- const country = computed(() => PhoneCountries.find((c) => c.iso === iso.value) ?? PhoneCountries[0]);
135
+ const country = computed(() => allowed.value.find((c) => c.iso === iso.value) ?? allowed.value[0]);
121
136
  function e164For(dial, digits) {
122
137
  return digits ? `${dial}${digits}` : "";
123
138
  }
124
139
  function setCountry(event) {
125
140
  const nextIso = event.target.value;
126
- const next = PhoneCountries.find((c) => c.iso === nextIso) ?? country.value;
141
+ const next = allowed.value.find((c) => c.iso === nextIso) ?? country.value;
127
142
  selectedIso.value = next.iso;
128
143
  const nextValue = e164For(next.dial, national.value);
129
144
  if (nextValue !== e164.value) controlled.setValue(nextValue);
@@ -152,6 +167,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
152
167
  readOnly.value && "cursor-default bg-muted text-muted-foreground"
153
168
  )
154
169
  );
170
+ const prefixClass = computed(
171
+ () => cn(
172
+ "flex h-10 items-center border-r border-input bg-card px-2 text-sm",
173
+ readOnly.value && "bg-muted text-muted-foreground"
174
+ )
175
+ );
155
176
  const inputClass = cn(
156
177
  inputBaseVariants({ size: InputSize.Md }),
157
178
  "rounded-none border-0 focus-visible:ring-0 readonly:focus-visible:ring-0"
@@ -167,7 +188,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
167
188
  "data-readonly": readOnly.value || void 0,
168
189
  class: rootClass.value
169
190
  }, passthroughAttrs.value), [
170
- createElementVNode("select", {
191
+ allowed.value.length === 1 ? (openBlock(), createElementBlock("span", {
192
+ key: 0,
193
+ class: normalizeClass(prefixClass.value)
194
+ }, toDisplayString(country.value.flag) + " " + toDisplayString(country.value.dial), 3)) : (openBlock(), createElementBlock("select", {
195
+ key: 1,
171
196
  "aria-label": unref(locale).t("PhoneInput.country", void 0, "Country"),
172
197
  value: iso.value,
173
198
  disabled: disabled.value || readOnly.value,
@@ -175,13 +200,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
175
200
  style: { minWidth: "90px" },
176
201
  onChange: setCountry
177
202
  }, [
178
- (openBlock(), createElementBlock(Fragment, null, renderList(PhoneCountries, (c) => {
179
- return createElementVNode("option", {
203
+ (openBlock(true), createElementBlock(Fragment, null, renderList(allowed.value, (c) => {
204
+ return openBlock(), createElementBlock("option", {
180
205
  key: c.iso,
181
206
  value: c.iso
182
207
  }, toDisplayString(c.flag) + " " + toDisplayString(c.dial), 9, _hoisted_3);
183
- }), 64))
184
- ], 42, _hoisted_2),
208
+ }), 128))
209
+ ], 42, _hoisted_2)),
185
210
  createElementVNode("input", {
186
211
  type: "tel",
187
212
  inputmode: "tel",
@@ -198,7 +223,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
198
223
  onInput: setNational
199
224
  }, null, 42, _hoisted_4),
200
225
  __props.name ? (openBlock(), createElementBlock("input", {
201
- key: 0,
226
+ key: 2,
202
227
  type: "hidden",
203
228
  disabled: disabled.value,
204
229
  form: typeof _ctx.$attrs.form === "string" ? _ctx.$attrs.form : void 0,
@@ -1 +1 @@
1
- {"version":3,"file":"PhoneInput.vue.js","sources":["../../../../src/presentation/forms/phoneInput/PhoneInput.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { NativeInputAttributes } from '../NativeControlAttributes';\n/** Represents one selectable dialling country. */\nexport interface PhoneCountry {\n iso: string;\n name: string;\n dial: string; // includes leading +\n flag: string; // emoji\n}\n\nexport const PhoneCountries: ReadonlyArray<PhoneCountry> = [\n { iso: 'US', name: 'United States', dial: '+1', flag: '🇺🇸' },\n { iso: 'CA', name: 'Canada', dial: '+1', flag: '🇨🇦' },\n { iso: 'GB', name: 'United Kingdom', dial: '+44', flag: '🇬🇧' },\n { iso: 'AU', name: 'Australia', dial: '+61', flag: '🇦🇺' },\n { iso: 'DE', name: 'Germany', dial: '+49', flag: '🇩🇪' },\n { iso: 'FR', name: 'France', dial: '+33', flag: '🇫🇷' },\n { iso: 'ES', name: 'Spain', dial: '+34', flag: '🇪🇸' },\n { iso: 'IT', name: 'Italy', dial: '+39', flag: '🇮🇹' },\n { iso: 'NL', name: 'Netherlands', dial: '+31', flag: '🇳🇱' },\n { iso: 'BE', name: 'Belgium', dial: '+32', flag: '🇧🇪' },\n { iso: 'CH', name: 'Switzerland', dial: '+41', flag: '🇨🇭' },\n { iso: 'AT', name: 'Austria', dial: '+43', flag: '🇦🇹' },\n { iso: 'SE', name: 'Sweden', dial: '+46', flag: '🇸🇪' },\n { iso: 'NO', name: 'Norway', dial: '+47', flag: '🇳🇴' },\n { iso: 'DK', name: 'Denmark', dial: '+45', flag: '🇩🇰' },\n { iso: 'FI', name: 'Finland', dial: '+358', flag: '🇫🇮' },\n { iso: 'IE', name: 'Ireland', dial: '+353', flag: '🇮🇪' },\n { iso: 'PT', name: 'Portugal', dial: '+351', flag: '🇵🇹' },\n { iso: 'PL', name: 'Poland', dial: '+48', flag: '🇵🇱' },\n { iso: 'CZ', name: 'Czechia', dial: '+420', flag: '🇨🇿' },\n { iso: 'GR', name: 'Greece', dial: '+30', flag: '🇬🇷' },\n { iso: 'TR', name: 'Türkiye', dial: '+90', flag: '🇹🇷' },\n { iso: 'RU', name: 'Russia', dial: '+7', flag: '🇷🇺' },\n { iso: 'UA', name: 'Ukraine', dial: '+380', flag: '🇺🇦' },\n { iso: 'IL', name: 'Israel', dial: '+972', flag: '🇮🇱' },\n { iso: 'AE', name: 'UAE', dial: '+971', flag: '🇦🇪' },\n { iso: 'SA', name: 'Saudi Arabia', dial: '+966', flag: '🇸🇦' },\n { iso: 'EG', name: 'Egypt', dial: '+20', flag: '🇪🇬' },\n { iso: 'ZA', name: 'South Africa', dial: '+27', flag: '🇿🇦' },\n { iso: 'NG', name: 'Nigeria', dial: '+234', flag: '🇳🇬' },\n { iso: 'KE', name: 'Kenya', dial: '+254', flag: '🇰🇪' },\n { iso: 'IN', name: 'India', dial: '+91', flag: '🇮🇳' },\n { iso: 'PK', name: 'Pakistan', dial: '+92', flag: '🇵🇰' },\n { iso: 'BD', name: 'Bangladesh', dial: '+880', flag: '🇧🇩' },\n { iso: 'SG', name: 'Singapore', dial: '+65', flag: '🇸🇬' },\n { iso: 'MY', name: 'Malaysia', dial: '+60', flag: '🇲🇾' },\n { iso: 'TH', name: 'Thailand', dial: '+66', flag: '🇹🇭' },\n { iso: 'VN', name: 'Vietnam', dial: '+84', flag: '🇻🇳' },\n { iso: 'PH', name: 'Philippines', dial: '+63', flag: '🇵🇭' },\n { iso: 'ID', name: 'Indonesia', dial: '+62', flag: '🇮🇩' },\n { iso: 'JP', name: 'Japan', dial: '+81', flag: '🇯🇵' },\n { iso: 'KR', name: 'South Korea', dial: '+82', flag: '🇰🇷' },\n { iso: 'CN', name: 'China', dial: '+86', flag: '🇨🇳' },\n { iso: 'HK', name: 'Hong Kong', dial: '+852', flag: '🇭🇰' },\n { iso: 'TW', name: 'Taiwan', dial: '+886', flag: '🇹🇼' },\n { iso: 'NZ', name: 'New Zealand', dial: '+64', flag: '🇳🇿' },\n { iso: 'BR', name: 'Brazil', dial: '+55', flag: '🇧🇷' },\n { iso: 'AR', name: 'Argentina', dial: '+54', flag: '🇦🇷' },\n { iso: 'CL', name: 'Chile', dial: '+56', flag: '🇨🇱' },\n { iso: 'CO', name: 'Colombia', dial: '+57', flag: '🇨🇴' },\n { iso: 'MX', name: 'Mexico', dial: '+52', flag: '🇲🇽' },\n];\n\nexport interface PhoneInputProps extends /* @vue-ignore */ NativeInputAttributes {\n /** The E.164 value, controlled. The `v-model` binding target. */\n readonly modelValue?: string;\n\n /** The initial E.164 value when uncontrolled. */\n readonly defaultValue?: string;\n\n /** The ISO code selected before the value carries a recognisable dial prefix. Default `US`. */\n readonly defaultCountry?: string;\n\n /** The disabled state. Falls back to the surrounding form control's `isDisabled`. */\n readonly isDisabled?: boolean;\n\n /** The read-only state. Falls back to the surrounding form control's `isReadOnly`. */\n readonly isReadOnly?: boolean;\n\n /** The invalid surface override. Falls back to the surrounding form control's `isInvalid`. */\n readonly isInvalid?: boolean;\n\n /** The national-number placeholder. */\n readonly placeholder?: string;\n\n /** The hidden input name; the hidden input emits the full E.164 value. */\n readonly name?: string;\n}\n\nfunction splitE164(value: string, defaultIso: string): { iso: string; national: string } {\n if (!value) return { iso: defaultIso, national: '' };\n // Match the longest dial code prefix.\n const sorted = [...PhoneCountries].sort((a, b) => b.dial.length - a.dial.length);\n for (const c of sorted) {\n if (value.startsWith(c.dial)) {\n return { iso: c.iso, national: value.slice(c.dial.length).replace(/\\D/g, '') };\n }\n }\n return { iso: defaultIso, national: value.replace(/\\D/g, '') };\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { useLocale } from '../../../foundation/i18n';\nimport { useTemplateRef } from 'vue';\nimport { useNativeFormReset } from '../UseNativeFormReset';\nimport { computed, ref, useAttrs } from 'vue';\nimport type { ClassValue } from 'clsx';\nimport { cn } from '../../../foundation/styles';\nimport { useControlled } from '../../../foundation/state';\nimport { useFormControl } from '../../../foundation/primitives';\nimport { inputBaseVariants, InputSize } from '../InputStyles';\n\n/**\n * Renders a country dial-code select beside a national-number field, emitting one E.164 string.\n *\n * First-generation country list; full `libphonenumber` validation and formatting stays deferred.\n */\n/* `inheritAttrs: false` so `class` folds into the root's own `cn()` call — plain fallthrough\n appends outside it and loses tailwind-merge conflict resolution. */\ndefineOptions({ name: 'PhoneInput', inheritAttrs: false });\n\nconst props = withDefaults(defineProps<PhoneInputProps>(), {\n defaultCountry: 'US',\n placeholder: '(555) 555-5555',\n /* Explicit `undefined` defaults: `useControlled` keys on `=== undefined`, and Vue casts an\n absent `boolean` prop to `false` — which would shadow the form control context. */\n modelValue: undefined,\n isDisabled: undefined,\n isReadOnly: undefined,\n isInvalid: undefined,\n});\n\nconst emit = defineEmits<{\n /** Fires when the reader edits the number or switches country — the `v-model` half. */\n 'update:modelValue': [e164: string];\n}>();\n\nconst attrs = useAttrs();\n\nconst controlled = useControlled<string>({\n controlled: () => props.modelValue,\n default: () => props.defaultValue ?? '',\n onChange: (next) => {\n emit('update:modelValue', next);\n },\n});\n\nconst e164 = controlled.value;\n\n/* FormControlContext adoption — explicit props stay as overrides. The national-number\n input is the composite's primary control (carries the context id + describedby);\n a user `id` attr stays on the root div. */\nconst ctx = useFormControl();\nconst disabled = computed(() => props.isDisabled ?? ctx?.isDisabled);\nconst readOnly = computed(() => props.isReadOnly ?? ctx?.isReadOnly);\nconst invalid = computed(() => props.isInvalid ?? ctx?.isInvalid);\n\n/* Selected ISO is state — shared dial codes (+1 US/CA) make it unrecoverable from the value\n alone. Re-derive only when the value's dial prefix becomes incompatible with the selection. */\nconst selectedIso = ref(props.defaultCountry);\n\nconst split = computed(() => {\n const selected = PhoneCountries.find((c) => c.iso === selectedIso.value);\n if (selected && (!e164.value || e164.value.startsWith(selected.dial))) {\n return {\n iso: selected.iso,\n national: e164.value.slice(selected.dial.length).replace(/\\D/g, ''),\n };\n }\n return splitE164(e164.value, props.defaultCountry);\n});\n\nconst iso = computed(() => split.value.iso);\nconst national = computed(() => split.value.national);\nconst country = computed(() => PhoneCountries.find((c) => c.iso === iso.value) ?? PhoneCountries[0]!);\n\n/* A dial code alone is not a phone number: with no national digits the value is empty, so a blank field submits\n nothing and fails `required` — the selected country survives in `selectedIso`. */\nfunction e164For(dial: string, digits: string): string {\n return digits ? `${dial}${digits}` : '';\n}\n\nfunction setCountry(event: Event): void {\n const nextIso = (event.target as HTMLSelectElement).value;\n const next = PhoneCountries.find((c) => c.iso === nextIso) ?? country.value;\n selectedIso.value = next.iso;\n const nextValue = e164For(next.dial, national.value);\n if (nextValue !== e164.value) controlled.setValue(nextValue);\n}\n\nfunction setNational(event: Event): void {\n const digits = (event.target as HTMLInputElement).value.replace(/\\D/g, '');\n /* Deriving the country before the write keeps a shared dial code (+1 US / CA) on the reader's pick. */\n selectedIso.value = country.value.iso;\n controlled.setValue(e164For(country.value.dial, digits));\n}\n\nconst OwnedAttributes: ReadonlySet<string> = new Set(['class']);\nconst passthroughAttrs = computed(() =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key))),\n);\n\nconst rootClass = computed(() =>\n cn(\n 'inline-flex items-stretch overflow-hidden rounded-md border bg-background',\n invalid.value ? 'border-destructive' : 'border-input',\n disabled.value && 'opacity-60',\n readOnly.value && 'bg-muted text-muted-foreground',\n attrs.class as ClassValue,\n ),\n);\n\n/* The country select is a native `<select>`, which has no `readonly`: a read-only phone input disables it, so it\n takes the frame's muted surface and the default cursor rather than the pointer. */\nconst selectClass = computed(() =>\n cn(\n 'h-10 cursor-pointer border-r border-input bg-card pl-2 pr-1 text-sm outline-hidden focus-visible:ring-2 focus-visible:ring-ring',\n readOnly.value && 'cursor-default bg-muted text-muted-foreground',\n ),\n);\n\nconst inputClass = cn(\n inputBaseVariants({ size: InputSize.Md }),\n 'rounded-none border-0 focus-visible:ring-0 readonly:focus-visible:ring-0',\n);\n\nconst formResetAnchor = useTemplateRef<HTMLInputElement>('formResetAnchor');\nconst formResetRevision = useNativeFormReset(formResetAnchor, () => {\n controlled.reset();\n});\n\nconst locale = useLocale();\n</script>\n\n<template>\n <div :key=\"formResetRevision\" :data-readonly=\"readOnly || undefined\" :class=\"rootClass\" v-bind=\"passthroughAttrs\">\n <select\n :aria-label=\"locale.t('PhoneInput.country', undefined, 'Country')\"\n :value=\"iso\"\n :disabled=\"disabled || readOnly\"\n :class=\"selectClass\"\n :style=\"{ minWidth: '90px' }\"\n @change=\"setCountry\"\n >\n <option v-for=\"c in PhoneCountries\" :key=\"c.iso\" :value=\"c.iso\">{{ c.flag }} {{ c.dial }}</option>\n </select>\n <input\n type=\"tel\"\n inputmode=\"tel\"\n autocomplete=\"tel-national\"\n :id=\"ctx?.id\"\n :value=\"national\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :readonly=\"readOnly\"\n :aria-invalid=\"invalid || undefined\"\n :aria-describedby=\"ctx?.describedBy\"\n :aria-required=\"ctx?.isRequired || undefined\"\n :class=\"inputClass\"\n @input=\"setNational\"\n />\n <input\n v-if=\"name\"\n type=\"hidden\"\n :disabled=\"disabled\"\n :form=\"typeof $attrs.form === 'string' ? $attrs.form : undefined\"\n :name=\"name\"\n :value=\"e164\"\n />\n <input\n ref=\"formResetAnchor\"\n type=\"hidden\"\n :form=\"typeof $attrs.form === 'string' ? $attrs.form : undefined\"\n aria-hidden=\"true\"\n />\n </div>\n</template>\n"],"names":["_openBlock","_createElementBlock","_mergeProps","_unref","_createElementVNode","_Fragment","_renderList","_toDisplayString","$attrs"],"mappings":";;;;;;;;;;;;;AAUO,MAAM,iBAA8C;AAAA,EACzD,EAAE,KAAK,MAAM,MAAM,iBAAiB,MAAM,MAAM,MAAM,OAAA;AAAA,EACtD,EAAE,KAAK,MAAM,MAAM,UAAU,MAAM,MAAM,MAAM,OAAA;AAAA,EAC/C,EAAE,KAAK,MAAM,MAAM,kBAAkB,MAAM,OAAO,MAAM,OAAA;AAAA,EACxD,EAAE,KAAK,MAAM,MAAM,aAAa,MAAM,OAAO,MAAM,OAAA;AAAA,EACnD,EAAE,KAAK,MAAM,MAAM,WAAW,MAAM,OAAO,MAAM,OAAA;AAAA,EACjD,EAAE,KAAK,MAAM,MAAM,UAAU,MAAM,OAAO,MAAM,OAAA;AAAA,EAChD,EAAE,KAAK,MAAM,MAAM,SAAS,MAAM,OAAO,MAAM,OAAA;AAAA,EAC/C,EAAE,KAAK,MAAM,MAAM,SAAS,MAAM,OAAO,MAAM,OAAA;AAAA,EAC/C,EAAE,KAAK,MAAM,MAAM,eAAe,MAA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AAAA,cAAM,OAAO,EAAE;AAAA,YAAA,GAAQG,gBAAA,EAAE,IAAI,IAAG,MAACA,gBAAG,EAAE,IAAI,GAAA,GAAA,UAAA;AAAA;;QAExFH,mBAcE,SAAA;AAAA,UAbA,MAAK;AAAA,UACL,WAAU;AAAA,UACV,cAAa;AAAA,UACZ,IAAID,MAAA,GAAA,GAAK;AAAA,UACT,OAAO,SAAA;AAAA,UACP,aAAa,QAAA;AAAA,UACb,UAAU,SAAA;AAAA,UACV,UAAU,SAAA;AAAA,UACV,gBAAc,QAAA,SAAW;AAAA,UACzB,oBAAkBA,MAAA,GAAA,GAAK;AAAA,UACvB,iBAAeA,MAAA,GAAA,GAAK,cAAc;AAAA,UAClC,sBAAOA,MAAA,UAAA,CAAU;AAAA,UACjB,SAAO;AAAA,QAAA;QAGF,QAAA,qBADRF,mBAOE,SAAA;AAAA;UALA,MAAK;AAAA,UACJ,UAAU,SAAA;AAAA,UACV,MAAI,OAASO,YAAO,oBAAoBA,KAAAA,OAAO,OAAO;AAAA,UACtD,MAAM,QAAA;AAAA,UACN,OAAOL,MAAA,IAAA;AAAA,QAAA;QAEVC,mBAKE,SAAA;AAAA,mBAJI;AAAA,UAAJ,KAAI;AAAA,UACJ,MAAK;AAAA,UACJ,MAAI,OAASI,YAAO,oBAAoBA,KAAAA,OAAO,OAAO;AAAA,UACvD,eAAY;AAAA,QAAA;;;;;"}
1
+ {"version":3,"file":"PhoneInput.vue.js","sources":["../../../../src/presentation/forms/phoneInput/PhoneInput.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { NativeInputAttributes } from '../NativeControlAttributes';\n/** Represents one selectable dialling country. */\nexport interface PhoneCountry {\n iso: string;\n name: string;\n dial: string; // includes leading +\n flag: string; // emoji\n}\n\nexport const PhoneCountries: ReadonlyArray<PhoneCountry> = [\n { iso: 'US', name: 'United States', dial: '+1', flag: '🇺🇸' },\n { iso: 'CA', name: 'Canada', dial: '+1', flag: '🇨🇦' },\n { iso: 'GB', name: 'United Kingdom', dial: '+44', flag: '🇬🇧' },\n { iso: 'AU', name: 'Australia', dial: '+61', flag: '🇦🇺' },\n { iso: 'DE', name: 'Germany', dial: '+49', flag: '🇩🇪' },\n { iso: 'FR', name: 'France', dial: '+33', flag: '🇫🇷' },\n { iso: 'ES', name: 'Spain', dial: '+34', flag: '🇪🇸' },\n { iso: 'IT', name: 'Italy', dial: '+39', flag: '🇮🇹' },\n { iso: 'NL', name: 'Netherlands', dial: '+31', flag: '🇳🇱' },\n { iso: 'BE', name: 'Belgium', dial: '+32', flag: '🇧🇪' },\n { iso: 'CH', name: 'Switzerland', dial: '+41', flag: '🇨🇭' },\n { iso: 'AT', name: 'Austria', dial: '+43', flag: '🇦🇹' },\n { iso: 'SE', name: 'Sweden', dial: '+46', flag: '🇸🇪' },\n { iso: 'NO', name: 'Norway', dial: '+47', flag: '🇳🇴' },\n { iso: 'DK', name: 'Denmark', dial: '+45', flag: '🇩🇰' },\n { iso: 'FI', name: 'Finland', dial: '+358', flag: '🇫🇮' },\n { iso: 'IE', name: 'Ireland', dial: '+353', flag: '🇮🇪' },\n { iso: 'PT', name: 'Portugal', dial: '+351', flag: '🇵🇹' },\n { iso: 'PL', name: 'Poland', dial: '+48', flag: '🇵🇱' },\n { iso: 'CZ', name: 'Czechia', dial: '+420', flag: '🇨🇿' },\n { iso: 'GR', name: 'Greece', dial: '+30', flag: '🇬🇷' },\n { iso: 'TR', name: 'Türkiye', dial: '+90', flag: '🇹🇷' },\n { iso: 'RU', name: 'Russia', dial: '+7', flag: '🇷🇺' },\n { iso: 'UA', name: 'Ukraine', dial: '+380', flag: '🇺🇦' },\n { iso: 'UZ', name: 'Uzbekistan', dial: '+998', flag: '🇺🇿' },\n { iso: 'KZ', name: 'Kazakhstan', dial: '+7', flag: '🇰🇿' },\n { iso: 'KG', name: 'Kyrgyzstan', dial: '+996', flag: '🇰🇬' },\n { iso: 'TJ', name: 'Tajikistan', dial: '+992', flag: '🇹🇯' },\n { iso: 'TM', name: 'Turkmenistan', dial: '+993', flag: '🇹🇲' },\n { iso: 'IL', name: 'Israel', dial: '+972', flag: '🇮🇱' },\n { iso: 'AE', name: 'UAE', dial: '+971', flag: '🇦🇪' },\n { iso: 'SA', name: 'Saudi Arabia', dial: '+966', flag: '🇸🇦' },\n { iso: 'EG', name: 'Egypt', dial: '+20', flag: '🇪🇬' },\n { iso: 'ZA', name: 'South Africa', dial: '+27', flag: '🇿🇦' },\n { iso: 'NG', name: 'Nigeria', dial: '+234', flag: '🇳🇬' },\n { iso: 'KE', name: 'Kenya', dial: '+254', flag: '🇰🇪' },\n { iso: 'IN', name: 'India', dial: '+91', flag: '🇮🇳' },\n { iso: 'PK', name: 'Pakistan', dial: '+92', flag: '🇵🇰' },\n { iso: 'BD', name: 'Bangladesh', dial: '+880', flag: '🇧🇩' },\n { iso: 'SG', name: 'Singapore', dial: '+65', flag: '🇸🇬' },\n { iso: 'MY', name: 'Malaysia', dial: '+60', flag: '🇲🇾' },\n { iso: 'TH', name: 'Thailand', dial: '+66', flag: '🇹🇭' },\n { iso: 'VN', name: 'Vietnam', dial: '+84', flag: '🇻🇳' },\n { iso: 'PH', name: 'Philippines', dial: '+63', flag: '🇵🇭' },\n { iso: 'ID', name: 'Indonesia', dial: '+62', flag: '🇮🇩' },\n { iso: 'JP', name: 'Japan', dial: '+81', flag: '🇯🇵' },\n { iso: 'KR', name: 'South Korea', dial: '+82', flag: '🇰🇷' },\n { iso: 'CN', name: 'China', dial: '+86', flag: '🇨🇳' },\n { iso: 'HK', name: 'Hong Kong', dial: '+852', flag: '🇭🇰' },\n { iso: 'TW', name: 'Taiwan', dial: '+886', flag: '🇹🇼' },\n { iso: 'NZ', name: 'New Zealand', dial: '+64', flag: '🇳🇿' },\n { iso: 'BR', name: 'Brazil', dial: '+55', flag: '🇧🇷' },\n { iso: 'AR', name: 'Argentina', dial: '+54', flag: '🇦🇷' },\n { iso: 'CL', name: 'Chile', dial: '+56', flag: '🇨🇱' },\n { iso: 'CO', name: 'Colombia', dial: '+57', flag: '🇨🇴' },\n { iso: 'MX', name: 'Mexico', dial: '+52', flag: '🇲🇽' },\n];\n\nexport interface PhoneInputProps extends /* @vue-ignore */ NativeInputAttributes {\n /** The E.164 value, controlled. The `v-model` binding target. */\n readonly modelValue?: string;\n\n /** The initial E.164 value when uncontrolled. */\n readonly defaultValue?: string;\n\n /** The ISO code selected before the value carries a recognisable dial prefix. Default `US`. */\n readonly defaultCountry?: string;\n\n /** The ISO codes the reader may pick, in display order; unknown codes are ignored. Default every known country. */\n readonly countries?: ReadonlyArray<string>;\n\n /** The disabled state. Falls back to the surrounding form control's `isDisabled`. */\n readonly isDisabled?: boolean;\n\n /** The read-only state. Falls back to the surrounding form control's `isReadOnly`. */\n readonly isReadOnly?: boolean;\n\n /** The invalid surface override. Falls back to the surrounding form control's `isInvalid`. */\n readonly isInvalid?: boolean;\n\n /** The national-number placeholder. */\n readonly placeholder?: string;\n\n /** The hidden input name; the hidden input emits the full E.164 value. */\n readonly name?: string;\n}\n\n/* A list with no known code reads as absent: a select with no options could not hold a value. */\nfunction resolveCountries(isos: ReadonlyArray<string> | undefined): ReadonlyArray<PhoneCountry> {\n if (!isos) return PhoneCountries;\n const known = [...new Set(isos)]\n .map((iso) => PhoneCountries.find((c) => c.iso === iso))\n .filter((c): c is PhoneCountry => c !== undefined);\n return known.length > 0 ? known : PhoneCountries;\n}\n\nfunction splitE164(\n value: string,\n countries: ReadonlyArray<PhoneCountry>,\n defaultIso: string,\n): { iso: string; national: string } {\n if (!value) return { iso: defaultIso, national: '' };\n // Match the longest dial code prefix; the stable sort leaves a shared code (+7) to the earlier country.\n const sorted = [...countries].sort((a, b) => b.dial.length - a.dial.length);\n for (const c of sorted) {\n if (value.startsWith(c.dial)) {\n return { iso: c.iso, national: value.slice(c.dial.length).replace(/\\D/g, '') };\n }\n }\n return { iso: defaultIso, national: value.replace(/\\D/g, '') };\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { useLocale } from '../../../foundation/i18n';\nimport { useTemplateRef } from 'vue';\nimport { useNativeFormReset } from '../UseNativeFormReset';\nimport { computed, ref, useAttrs } from 'vue';\nimport type { ClassValue } from 'clsx';\nimport { cn } from '../../../foundation/styles';\nimport { useControlled } from '../../../foundation/state';\nimport { useFormControl } from '../../../foundation/primitives';\nimport { inputBaseVariants, InputSize } from '../InputStyles';\n\n/**\n * Renders a country dial-code select beside a national-number field, emitting one E.164 string.\n *\n * First-generation country list; full `libphonenumber` validation and formatting stays deferred.\n */\n/* `inheritAttrs: false` so `class` folds into the root's own `cn()` call — plain fallthrough\n appends outside it and loses tailwind-merge conflict resolution. */\ndefineOptions({ name: 'PhoneInput', inheritAttrs: false });\n\nconst props = withDefaults(defineProps<PhoneInputProps>(), {\n defaultCountry: 'US',\n placeholder: '(555) 555-5555',\n /* Explicit `undefined` defaults: `useControlled` keys on `=== undefined`, and Vue casts an\n absent `boolean` prop to `false` — which would shadow the form control context. */\n modelValue: undefined,\n isDisabled: undefined,\n isReadOnly: undefined,\n isInvalid: undefined,\n});\n\nconst emit = defineEmits<{\n /** Fires when the reader edits the number or switches country — the `v-model` half. */\n 'update:modelValue': [e164: string];\n}>();\n\nconst attrs = useAttrs();\n\nconst controlled = useControlled<string>({\n controlled: () => props.modelValue,\n default: () => props.defaultValue ?? '',\n onChange: (next) => {\n emit('update:modelValue', next);\n },\n});\n\nconst e164 = controlled.value;\n\n/* FormControlContext adoption — explicit props stay as overrides. The national-number\n input is the composite's primary control (carries the context id + describedby);\n a user `id` attr stays on the root div. */\nconst ctx = useFormControl();\nconst disabled = computed(() => props.isDisabled ?? ctx?.isDisabled);\nconst readOnly = computed(() => props.isReadOnly ?? ctx?.isReadOnly);\nconst invalid = computed(() => props.isInvalid ?? ctx?.isInvalid);\n\nconst allowed = computed(() => resolveCountries(props.countries));\n/* The fallback must be selectable: a `defaultCountry` outside the list gives way to the first allowed country. */\nconst fallbackIso = computed(\n () => allowed.value.find((c) => c.iso === props.defaultCountry)?.iso ?? allowed.value[0]!.iso,\n);\n\n/* Selected ISO is state — shared dial codes (+1 US/CA) make it unrecoverable from the value\n alone. Re-derive only when the value's dial prefix becomes incompatible with the selection. */\nconst selectedIso = ref(fallbackIso.value);\n\n/* A value whose dial prefix is outside the list matches no allowed country: its digits stay, under the fallback. */\nconst split = computed(() => {\n const selected = allowed.value.find((c) => c.iso === selectedIso.value);\n if (selected && (!e164.value || e164.value.startsWith(selected.dial))) {\n return {\n iso: selected.iso,\n national: e164.value.slice(selected.dial.length).replace(/\\D/g, ''),\n };\n }\n return splitE164(e164.value, allowed.value, fallbackIso.value);\n});\n\nconst iso = computed(() => split.value.iso);\nconst national = computed(() => split.value.national);\nconst country = computed(() => allowed.value.find((c) => c.iso === iso.value) ?? allowed.value[0]!);\n\n/* A dial code alone is not a phone number: with no national digits the value is empty, so a blank field submits\n nothing and fails `required` — the selected country survives in `selectedIso`. */\nfunction e164For(dial: string, digits: string): string {\n return digits ? `${dial}${digits}` : '';\n}\n\nfunction setCountry(event: Event): void {\n const nextIso = (event.target as HTMLSelectElement).value;\n const next = allowed.value.find((c) => c.iso === nextIso) ?? country.value;\n selectedIso.value = next.iso;\n const nextValue = e164For(next.dial, national.value);\n if (nextValue !== e164.value) controlled.setValue(nextValue);\n}\n\nfunction setNational(event: Event): void {\n const digits = (event.target as HTMLInputElement).value.replace(/\\D/g, '');\n /* Deriving the country before the write keeps a shared dial code (+1 US / CA) on the reader's pick. */\n selectedIso.value = country.value.iso;\n controlled.setValue(e164For(country.value.dial, digits));\n}\n\nconst OwnedAttributes: ReadonlySet<string> = new Set(['class']);\nconst passthroughAttrs = computed(() =>\n Object.fromEntries(Object.entries(attrs).filter(([key]) => !OwnedAttributes.has(key))),\n);\n\nconst rootClass = computed(() =>\n cn(\n 'inline-flex items-stretch overflow-hidden rounded-md border bg-background',\n invalid.value ? 'border-destructive' : 'border-input',\n disabled.value && 'opacity-60',\n readOnly.value && 'bg-muted text-muted-foreground',\n attrs.class as ClassValue,\n ),\n);\n\n/* The country select is a native `<select>`, which has no `readonly`: a read-only phone input disables it, so it\n takes the frame's muted surface and the default cursor rather than the pointer. */\nconst selectClass = computed(() =>\n cn(\n 'h-10 cursor-pointer border-r border-input bg-card pl-2 pr-1 text-sm outline-hidden focus-visible:ring-2 focus-visible:ring-ring',\n readOnly.value && 'cursor-default bg-muted text-muted-foreground',\n ),\n);\n\n/* One allowed country leaves nothing to pick: its flag and dial code sit in the select's place as plain text. */\nconst prefixClass = computed(() =>\n cn(\n 'flex h-10 items-center border-r border-input bg-card px-2 text-sm',\n readOnly.value && 'bg-muted text-muted-foreground',\n ),\n);\n\nconst inputClass = cn(\n inputBaseVariants({ size: InputSize.Md }),\n 'rounded-none border-0 focus-visible:ring-0 readonly:focus-visible:ring-0',\n);\n\nconst formResetAnchor = useTemplateRef<HTMLInputElement>('formResetAnchor');\nconst formResetRevision = useNativeFormReset(formResetAnchor, () => {\n controlled.reset();\n});\n\nconst locale = useLocale();\n</script>\n\n<template>\n <div :key=\"formResetRevision\" :data-readonly=\"readOnly || undefined\" :class=\"rootClass\" v-bind=\"passthroughAttrs\">\n <span v-if=\"allowed.length === 1\" :class=\"prefixClass\">{{ country.flag }} {{ country.dial }}</span>\n <select\n v-else\n :aria-label=\"locale.t('PhoneInput.country', undefined, 'Country')\"\n :value=\"iso\"\n :disabled=\"disabled || readOnly\"\n :class=\"selectClass\"\n :style=\"{ minWidth: '90px' }\"\n @change=\"setCountry\"\n >\n <option v-for=\"c in allowed\" :key=\"c.iso\" :value=\"c.iso\">{{ c.flag }} {{ c.dial }}</option>\n </select>\n <input\n type=\"tel\"\n inputmode=\"tel\"\n autocomplete=\"tel-national\"\n :id=\"ctx?.id\"\n :value=\"national\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :readonly=\"readOnly\"\n :aria-invalid=\"invalid || undefined\"\n :aria-describedby=\"ctx?.describedBy\"\n :aria-required=\"ctx?.isRequired || undefined\"\n :class=\"inputClass\"\n @input=\"setNational\"\n />\n <input\n v-if=\"name\"\n type=\"hidden\"\n :disabled=\"disabled\"\n :form=\"typeof $attrs.form === 'string' ? $attrs.form : undefined\"\n :name=\"name\"\n :value=\"e164\"\n />\n <input\n ref=\"formResetAnchor\"\n type=\"hidden\"\n :form=\"typeof $attrs.form === 'string' ? $attrs.form : undefined\"\n aria-hidden=\"true\"\n />\n </div>\n</template>\n"],"names":["_openBlock","_createElementBlock","_mergeProps","_unref","_toDisplayString","_Fragment","_renderList","_createElementVNode","$attrs"],"mappings":";;;;;;;;;;;;;AAUO,MAAM,iBAA8C;AAAA,EACzD,EAAE,KAAK,MAAM,MAAM,iBAAiB,MAAM,MAAM,MAAM,OAAA;AAAA,EACtD,EAAE,KAAK,MAAM,MAAM,UAAU,MAAM,MAAM,MAAM,OAAA;AAAA,EAC/C,EAAE,KAAK,MAAM,MAAM,kBAAkB,MAAM,OAAO,MAAM,OAAA;AAAA,EACxD,EAAE,KAAK,MAAM,MAAM,aAAa,MAAM,OAAO,MAAM,OAAA;AAAA,EACnD,EAAE,KAAK,MAAM,MAAM,WAAW,MAAM,OAAO,MAAM,OAAA;AAAA,EACjD,EAAE,KAAK,MAAM,MAAM,UAAU,MAAM,OAAO,MAAM,OAAA;AAAA,EAChD,EAAE,KAAK,MAAM,MAAM,SAAS,MAAM,OAAO,MAAM,OAAA;AAAA,EAC/C,EAAE,KAAK,MAAM,MAAM,SAAS,MAAM,OAAO,MAAM,OAAA;AAAA,EAC/C,EAAE,KAAK,MAAM,MAAM,eAAe,MAAM,OAAO,MAAM,OAAA;AAAA,EACrD,EAAE,KAAK,MAAM,MAAM,WAAW,MAAM,OAAO,MAAM,OAAA;AAAA,EACjD,EAAE,KAAK,MAAM,MAAM,eAAe,MAAM,OAAO,MAAM,OAAA;AAAA,EACrD,EAAE,KAAK,MAAM,MAAM,WAAW,MAAM,OAAO,MAAM,OAAA;AAAA,EACjD,EAAE,KAAK,MAAM,MAAM,UAAU,MAAM,OAAO,MAAM,OAAA;AAAA,EAChD,EAAE,KAAK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BAAeA,MAAA,GAAA,GAAK,cAAc;AAAA,UAClC,sBAAOA,MAAA,UAAA,CAAU;AAAA,UACjB,SAAO;AAAA,QAAA;QAGF,QAAA,qBADRF,mBAOE,SAAA;AAAA;UALA,MAAK;AAAA,UACJ,UAAU,SAAA;AAAA,UACV,MAAI,OAASO,YAAO,oBAAoBA,KAAAA,OAAO,OAAO;AAAA,UACtD,MAAM,QAAA;AAAA,UACN,OAAOL,MAAA,IAAA;AAAA,QAAA;QAEVI,mBAKE,SAAA;AAAA,mBAJI;AAAA,UAAJ,KAAI;AAAA,UACJ,MAAK;AAAA,UACJ,MAAI,OAASC,YAAO,oBAAoBA,KAAAA,OAAO,OAAO;AAAA,UACvD,eAAY;AAAA,QAAA;;;;;"}
@@ -9,6 +9,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
9
9
  hideBackdrop: { type: Boolean, default: void 0 },
10
10
  isBlurred: { type: Boolean, default: void 0 },
11
11
  size: {},
12
+ height: {},
12
13
  variant: {},
13
14
  tone: {},
14
15
  radius: {},
@@ -1 +1 @@
1
- {"version":3,"file":"AlertModalContent.vue.js","sources":["../../../../src/presentation/overlays/alertModal/AlertModalContent.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { ModalContentProps } from '../modal';\n\n/** The prop surface of `AlertModalContent` — `ModalContent`'s, with `phoneLayout` defaulting to `sheet`. */\nexport type AlertModalContentProps = ModalContentProps;\n</script>\n\n<script setup lang=\"ts\">\nimport { resolveElement } from '../../../foundation/dom';\nimport { computed, useAttrs, useTemplateRef, type ComponentPublicInstance } from 'vue';\nimport ModalContent, { ModalPhoneLayout } from '../modal/ModalContent.vue';\n\n/**\n * Renders the alert dialog's panel — `ModalContent`, opening as a bottom sheet on phones; the alert semantics live\n * on the root.\n */\ndefineOptions({ name: 'AlertModalContent', inheritAttrs: false });\n\n/** The panel content — chrome subcomponents and the dialog body. React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\n/* Absent booleans stay `undefined`: a cast `false` would forward `showBackdrop: false` and drop the scrim. */\nconst props = withDefaults(defineProps<AlertModalContentProps>(), {\n showBackdrop: undefined,\n hideBackdrop: undefined,\n isBlurred: undefined,\n phoneLayout: ModalPhoneLayout.Sheet,\n showHandle: undefined,\n});\n\nconst attrs = useAttrs();\nconst inner = useTemplateRef<ComponentPublicInstance & { el?: unknown }>('inner');\n\n/** Declared props first, attrs (including `class`) after, so a caller's attribute wins — React's spread order. */\nconst forwarded = computed(() => ({ ...props, ...attrs }));\n\nconst el = computed(() => resolveElement(inner.value));\n\ndefineExpose({ el });\n</script>\n\n<template>\n <ModalContent ref=\"inner\" v-bind=\"forwarded\"><slot /></ModalContent>\n</template>\n"],"names":["_openBlock","_createBlock","ModalContent","_mergeProps","_renderSlot"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsBA,UAAM,QAAQ;AAQd,UAAM,QAAQ,SAAA;AACd,UAAM,QAAQ,eAA2D,OAAO;AAGhF,UAAM,YAAY,SAAS,OAAO,EAAE,GAAG,OAAO,GAAG,QAAQ;AAEzD,UAAM,KAAK,SAAS,MAAM,eAAe,MAAM,KAAK,CAAC;AAErD,aAAa,EAAE,IAAI;;AAIjB,aAAAA,UAAA,GAAAC,YAAoEC,aAApEC,WAAoE;AAAA,iBAAlD;AAAA,QAAJ,KAAI;AAAA,MAAA,GAAgB,UAAA,KAAS,GAAA;AAAA,yBAAE,MAAQ;AAAA,UAARC,WAAQ,KAAA,QAAA,SAAA;AAAA,QAAA;;;;;;"}
1
+ {"version":3,"file":"AlertModalContent.vue.js","sources":["../../../../src/presentation/overlays/alertModal/AlertModalContent.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { ModalContentProps } from '../modal';\n\n/** The prop surface of `AlertModalContent` — `ModalContent`'s, with `phoneLayout` defaulting to `sheet`. */\nexport type AlertModalContentProps = ModalContentProps;\n</script>\n\n<script setup lang=\"ts\">\nimport { resolveElement } from '../../../foundation/dom';\nimport { computed, useAttrs, useTemplateRef, type ComponentPublicInstance } from 'vue';\nimport ModalContent, { ModalPhoneLayout } from '../modal/ModalContent.vue';\n\n/**\n * Renders the alert dialog's panel — `ModalContent`, opening as a bottom sheet on phones; the alert semantics live\n * on the root.\n */\ndefineOptions({ name: 'AlertModalContent', inheritAttrs: false });\n\n/** The panel content — chrome subcomponents and the dialog body. React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\n/* Absent booleans stay `undefined`: a cast `false` would forward `showBackdrop: false` and drop the scrim. */\nconst props = withDefaults(defineProps<AlertModalContentProps>(), {\n showBackdrop: undefined,\n hideBackdrop: undefined,\n isBlurred: undefined,\n phoneLayout: ModalPhoneLayout.Sheet,\n showHandle: undefined,\n});\n\nconst attrs = useAttrs();\nconst inner = useTemplateRef<ComponentPublicInstance & { el?: unknown }>('inner');\n\n/** Declared props first, attrs (including `class`) after, so a caller's attribute wins — React's spread order. */\nconst forwarded = computed(() => ({ ...props, ...attrs }));\n\nconst el = computed(() => resolveElement(inner.value));\n\ndefineExpose({ el });\n</script>\n\n<template>\n <ModalContent ref=\"inner\" v-bind=\"forwarded\"><slot /></ModalContent>\n</template>\n"],"names":["_openBlock","_createBlock","ModalContent","_mergeProps","_renderSlot"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,UAAM,QAAQ;AAQd,UAAM,QAAQ,SAAA;AACd,UAAM,QAAQ,eAA2D,OAAO;AAGhF,UAAM,YAAY,SAAS,OAAO,EAAE,GAAG,OAAO,GAAG,QAAQ;AAEzD,UAAM,KAAK,SAAS,MAAM,eAAe,MAAM,KAAK,CAAC;AAErD,aAAa,EAAE,IAAI;;AAIjB,aAAAA,UAAA,GAAAC,YAAoEC,aAApEC,WAAoE;AAAA,iBAAlD;AAAA,QAAJ,KAAI;AAAA,MAAA,GAAgB,UAAA,KAAS,GAAA;AAAA,yBAAE,MAAQ;AAAA,UAARC,WAAQ,KAAA,QAAA,SAAA;AAAA,QAAA;;;;;;"}
@@ -22,7 +22,7 @@ import { default as default32 } from "./confirmPopover/ConfirmPopover.vue.js";
22
22
  import { default as default33, default as default34, ModalRole } from "./modal/Modal.vue.js";
23
23
  import { default as default35, default as default36, default as default37 } from "./OverlayBody.vue.js";
24
24
  import { default as default38, default as default39, default as default40 } from "./OverlayCloseButton.vue.js";
25
- import { default as default41, default as default42, ModalPhoneLayout, ModalSize } from "./modal/ModalContent.vue.js";
25
+ import { default as default41, default as default42, ModalHeight, ModalPhoneLayout, ModalSize } from "./modal/ModalContent.vue.js";
26
26
  import { default as default43, default as default44, default as default45 } from "./OverlayFooter.vue.js";
27
27
  import { default as default46, default as default47, default as default48 } from "./OverlayHeader.vue.js";
28
28
  import { default as default49, default as default50 } from "./modal/ModalTrigger.vue.js";
@@ -98,6 +98,7 @@ export {
98
98
  default19 as ModalDescription,
99
99
  default45 as ModalFooter,
100
100
  default48 as ModalHeader,
101
+ ModalHeight,
101
102
  ModalPhoneLayout,
102
103
  ModalRole,
103
104
  ModalSize,
@@ -13,6 +13,17 @@ export declare const ModalSize: {
13
13
  readonly Full: "full";
14
14
  };
15
15
  export type ModalSize = (typeof ModalSize)[keyof typeof ModalSize];
16
+ /** Defines how tall a `ModalContent` panel is; either way it never outgrows the window. */
17
+ export declare const ModalHeight: {
18
+ /** Refers to a panel that fits its content — a confirm, an alert, a short prompt settled when it opens. */
19
+ readonly Auto: "auto";
20
+ /**
21
+ * Refers to a panel held at the height paired with its `size` step, whatever its content: a streamed progress, a
22
+ * list that loads, a multi-step flow. The body scrolls; the frame never moves.
23
+ */
24
+ readonly Fixed: "fixed";
25
+ };
26
+ export type ModalHeight = (typeof ModalHeight)[keyof typeof ModalHeight];
16
27
  /** Defines how a `ModalContent` panel lays out below the `sm` breakpoint; from `sm` up it is the centred card. */
17
28
  export declare const ModalPhoneLayout: {
18
29
  /** Refers to a panel that fills the screen — header on top, a scrolling body, the footer pinned to the bottom. */
@@ -41,6 +52,11 @@ export interface ModalContentProps {
41
52
  readonly isBlurred?: boolean;
42
53
  /** The panel's max-width step; a `max-w-*` class still overrides it. Default `md`. */
43
54
  readonly size?: ModalSize;
55
+ /**
56
+ * Whether the panel fits its content or holds the height paired with `size`: `sm` 24rem · `md` 32rem · `lg` 40rem ·
57
+ * `xl` 48rem · `full` the window. Either way it caps at the window and its body scrolls. Default `auto`.
58
+ */
59
+ readonly height?: ModalHeight;
44
60
  /** The visual recipe. Default `elevated`. */
45
61
  readonly variant?: SurfaceVariant;
46
62
  /** The color tone the recipe is tinted with. */
@@ -63,6 +79,7 @@ declare const _default: __VLS_WithSlots<import('vue').DefineComponent<ModalConte
63
79
  el: Readonly<import('vue').ShallowRef<HTMLDivElement | null>>;
64
80
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ModalContentProps> & Readonly<{}>, {
65
81
  readonly size: ModalSize;
82
+ readonly height: ModalHeight;
66
83
  readonly phoneLayout: ModalPhoneLayout;
67
84
  readonly showBackdrop: boolean;
68
85
  readonly hideBackdrop: boolean;
@@ -10,7 +10,7 @@ import { Presence } from "../../../foundation/primitives/presence/Presence.js";
10
10
  import _sfc_main$4 from "../../../foundation/primitives/focusScope/FocusScope.vue.js";
11
11
  import _sfc_main$5 from "../../../foundation/primitives/dismissableLayer/DismissableLayer.vue.js";
12
12
  const _hoisted_1 = ["data-phone-layout"];
13
- const _hoisted_2 = ["role", "aria-labelledby", "aria-describedby", "data-phone-layout"];
13
+ const _hoisted_2 = ["role", "aria-labelledby", "aria-describedby", "data-phone-layout", "data-height"];
14
14
  const _hoisted_3 = {
15
15
  key: 1,
16
16
  "aria-hidden": "true",
@@ -33,6 +33,15 @@ const ModalSize = {
33
33
  /** Refers to a panel that spans the window, inside its gutter. */
34
34
  Full: "full"
35
35
  };
36
+ const ModalHeight = {
37
+ /** Refers to a panel that fits its content — a confirm, an alert, a short prompt settled when it opens. */
38
+ Auto: "auto",
39
+ /**
40
+ * Refers to a panel held at the height paired with its `size` step, whatever its content: a streamed progress, a
41
+ * list that loads, a multi-step flow. The body scrolls; the frame never moves.
42
+ */
43
+ Fixed: "fixed"
44
+ };
36
45
  const ModalPhoneLayout = {
37
46
  /** Refers to a panel that fills the screen — header on top, a scrolling body, the footer pinned to the bottom. */
38
47
  Fullscreen: "fullscreen",
@@ -48,6 +57,13 @@ const ModalSizeClass = {
48
57
  xl: "max-w-4xl",
49
58
  full: "max-w-none"
50
59
  };
60
+ const ModalFixedHeightClass = {
61
+ sm: "h-[min(24rem,calc(100dvh-2rem))]",
62
+ md: "h-[min(32rem,calc(100dvh-2rem))]",
63
+ lg: "h-[min(40rem,calc(100dvh-2rem))]",
64
+ xl: "h-[min(48rem,calc(100dvh-2rem))]",
65
+ full: "h-[calc(100dvh-2rem)]"
66
+ };
51
67
  const LayerPhoneClass = {
52
68
  fullscreen: "max-sm:place-items-stretch max-sm:p-0",
53
69
  sheet: "max-sm:items-end max-sm:justify-items-stretch max-sm:p-0",
@@ -94,6 +110,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
94
110
  hideBackdrop: { type: Boolean, default: void 0 },
95
111
  isBlurred: { type: Boolean },
96
112
  size: { default: "md" },
113
+ height: { default: ModalHeight.Auto },
97
114
  variant: {},
98
115
  tone: {},
99
116
  radius: {},
@@ -140,6 +157,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
140
157
  /* The panel never outgrows the window: it caps at the viewport and its body scrolls under a fixed header and
141
158
  footer. A panel without a body part scrolls whole. */
142
159
  "flex max-h-[calc(100dvh-2rem)] flex-col overflow-y-auto overscroll-contain",
160
+ /* A fixed panel keeps its height while its content streams in or changes step; the body takes the free height. */
161
+ props.height === ModalHeight.Fixed && ModalFixedHeightClass[props.size],
143
162
  PanelMotionClass[props.phoneLayout],
144
163
  surfaceVariants({
145
164
  variant: props.variant ?? "elevated",
@@ -240,7 +259,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
240
259
  "aria-modal": "true",
241
260
  "aria-labelledby": unref(context).titleId,
242
261
  "aria-describedby": unref(context).descriptionId,
243
- "data-phone-layout": props.phoneLayout
262
+ "data-phone-layout": props.phoneLayout,
263
+ "data-height": props.height
244
264
  }, rest.value, {
245
265
  class: classes.value,
246
266
  style: dragStyle.value
@@ -281,6 +301,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
281
301
  }
282
302
  });
283
303
  export {
304
+ ModalHeight,
284
305
  ModalPhoneLayout,
285
306
  ModalSize,
286
307
  _sfc_main as default
@@ -1 +1 @@
1
- {"version":3,"file":"ModalContent.vue.js","sources":["../../../../src/presentation/overlays/modal/ModalContent.vue"],"sourcesContent":["<script lang=\"ts\">\nimport {\n cn,\n type SurfaceElevation,\n type SurfacePadding,\n type SurfaceRadius,\n type SurfaceTone,\n type SurfaceVariant,\n} from '../../../foundation/styles';\n\n/** Defines the max-width step of a `ModalContent` panel. */\nexport const ModalSize = {\n /** Refers to a narrow panel (24rem) — confirmations and short prompts. */\n Sm: 'sm',\n /** Refers to the default panel (32rem). */\n Md: 'md',\n /** Refers to a wide panel (42rem) — forms with paired fields. */\n Lg: 'lg',\n /** Refers to an extra-wide panel (56rem) — tables and multi-column forms. */\n Xl: 'xl',\n /** Refers to a panel that spans the window, inside its gutter. */\n Full: 'full',\n} as const;\n\nexport type ModalSize = (typeof ModalSize)[keyof typeof ModalSize];\n\n/** Defines how a `ModalContent` panel lays out below the `sm` breakpoint; from `sm` up it is the centred card. */\nexport const ModalPhoneLayout = {\n /** Refers to a panel that fills the screen — header on top, a scrolling body, the footer pinned to the bottom. */\n Fullscreen: 'fullscreen',\n /** Refers to a sheet docked to the bottom edge, rounded on top, that slides up. */\n Sheet: 'sheet',\n /** Refers to the centred card, as on wider screens. */\n Card: 'card',\n} as const;\n\nexport type ModalPhoneLayout = (typeof ModalPhoneLayout)[keyof typeof ModalPhoneLayout];\n\nconst ModalSizeClass: Record<ModalSize, string> = {\n sm: 'max-w-sm',\n md: 'max-w-lg',\n lg: 'max-w-2xl',\n xl: 'max-w-4xl',\n full: 'max-w-none',\n};\n\n/* The layer, frame and panel classes per phone layout. Each is prefixed `max-sm:`, so wider screens keep the card. */\nconst LayerPhoneClass: Record<ModalPhoneLayout, string> = {\n fullscreen: 'max-sm:place-items-stretch max-sm:p-0',\n sheet: 'max-sm:items-end max-sm:justify-items-stretch max-sm:p-0',\n card: '',\n};\n\nconst FramePhoneClass: Record<ModalPhoneLayout, string> = {\n fullscreen: 'max-sm:justify-items-stretch',\n sheet: 'max-sm:justify-items-stretch',\n card: '',\n};\n\n/* A wrapping `<form>` joins the fullscreen column, so its `ModalBody` takes the free height and the footer pins. */\nconst PanelPhoneClass: Record<ModalPhoneLayout, string> = {\n fullscreen: cn(\n 'max-sm:h-dvh max-sm:max-h-dvh max-sm:w-full max-sm:max-w-none max-sm:rounded-none',\n 'max-sm:[--ui-overlay-inset-top:env(safe-area-inset-top)]',\n 'max-sm:[&>form]:flex max-sm:[&>form]:min-h-0 max-sm:[&>form]:flex-1 max-sm:[&>form]:flex-col',\n ),\n sheet: 'max-sm:w-full max-sm:max-w-none max-sm:rounded-t-2xl max-sm:rounded-b-none',\n card: '',\n};\n\n/* Phones rise from the bottom edge; the card keeps its pop wherever it shows. */\nconst PanelMotionClass: Record<ModalPhoneLayout, string> = {\n fullscreen: cn(\n 'sm:motion-safe:group-data-[state=open]:animate-(--animate-pop-in)',\n 'sm:motion-safe:group-data-[state=closed]:animate-(--animate-pop-out)',\n 'max-sm:motion-safe:group-data-[state=open]:animate-(--animate-sheet-in)',\n 'max-sm:motion-safe:group-data-[state=closed]:animate-(--animate-sheet-out)',\n ),\n sheet: cn(\n 'sm:motion-safe:group-data-[state=open]:animate-(--animate-pop-in)',\n 'sm:motion-safe:group-data-[state=closed]:animate-(--animate-pop-out)',\n 'max-sm:motion-safe:group-data-[state=open]:animate-(--animate-sheet-in)',\n 'max-sm:motion-safe:group-data-[state=closed]:animate-(--animate-sheet-out)',\n ),\n card: cn(\n 'motion-safe:group-data-[state=open]:animate-(--animate-pop-in)',\n 'motion-safe:group-data-[state=closed]:animate-(--animate-pop-out)',\n ),\n};\n\n/** The drag past which a released sheet handle dismisses: this many pixels, or a third of the sheet if shorter. */\nconst HandleDismissDistance = 96;\n\n/**\n * Represents the prop surface of `ModalContent`.\n *\n * React declared the surface axes by `extends SurfaceLayoutVariants`; they are\n * spelled out here because the SFC compiler's type resolver cannot follow a\n * `VariantProps<typeof …>` base and fails the build on it. The aliases below\n * are the canonical ones from `foundation/styles`, already locked against the\n * `surfaceVariants` config there, so the two cannot drift.\n */\nexport interface ModalContentProps {\n /** Shows the default backdrop behind the panel. Default `true`. */\n readonly showBackdrop?: boolean;\n /** @deprecated Use `showBackdrop` (inverted); this alias is removed next release. */\n readonly hideBackdrop?: boolean;\n\n /** The backdrop-blur toggle. */\n readonly isBlurred?: boolean;\n\n /** The panel's max-width step; a `max-w-*` class still overrides it. Default `md`. */\n readonly size?: ModalSize;\n\n /** The visual recipe. Default `elevated`. */\n readonly variant?: SurfaceVariant;\n\n /** The color tone the recipe is tinted with. */\n readonly tone?: SurfaceTone;\n\n /** The corner rounding. Default `lg`. */\n readonly radius?: SurfaceRadius;\n\n /** The inner spacing step. Default `xl`. */\n readonly padding?: SurfacePadding;\n\n /** The shadow depth. */\n readonly elevation?: SurfaceElevation;\n\n /** The layout below the `sm` breakpoint; wider screens always get the centred card. Default `fullscreen`. */\n readonly phoneLayout?: ModalPhoneLayout;\n\n /**\n * Shows a grab handle on a phone `sheet`. Dragging it down dismisses the dialog where outside clicks may, and\n * springs back where they may not. Default `false`.\n */\n readonly showHandle?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, shallowRef, useAttrs, useTemplateRef, watch } from 'vue';\nimport { surfaceVariants } from '../../../foundation/styles';\nimport { DismissableLayer, FocusScope, Portal, Presence, ScrollLockProvider } from '../../../foundation/primitives';\nimport BackdropOverlay from '../backdropOverlay/BackdropOverlay.vue';\nimport { overlayChromeContextKey } from '../OverlayChrome';\nimport { useModalContext } from './Modal.vue';\n\n/** Renders the portalled dialog surface — scrim, focus trap, scroll lock, and the a11y panel. */\ndefineOptions({ name: 'ModalContent', inheritAttrs: false });\n\n/** The panel content — chrome subcomponents and the dialog body. React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\nconst props = withDefaults(defineProps<ModalContentProps>(), {\n size: 'md',\n showBackdrop: undefined,\n hideBackdrop: undefined,\n phoneLayout: ModalPhoneLayout.Fullscreen,\n showHandle: false,\n});\n\n/** `showBackdrop` first, then the inverted deprecated `hideBackdrop`. */\nconst hasBackdrop = computed(() => props.showBackdrop ?? !(props.hideBackdrop ?? false));\n\nconst attrs = useAttrs();\nconst context = useModalContext();\nconst el = useTemplateRef<HTMLDivElement>('el');\n\n/* Refs lifted to setup consts so the template auto-unwraps them (a plain injected object does not). */\nconst isOpen = context.open;\nconst role = context.role;\nconst dismissOnEscape = context.dismissOnEscape;\n\nfunction close(): void {\n context.setOpen(false);\n}\n\nprovide(overlayChromeContextKey, {\n titleId: context.titleId,\n descriptionId: context.descriptionId,\n close,\n});\n\n/* Safe-area spacers keep content clear of the notch and the home indicator; they collapse from `sm` up. */\nconst hasBottomInset = computed(() => props.phoneLayout !== ModalPhoneLayout.Card);\nconst hasTopInset = computed(() => props.phoneLayout === ModalPhoneLayout.Fullscreen);\nconst hasHandle = computed(() => props.showHandle && props.phoneLayout === ModalPhoneLayout.Sheet);\n\nconst layerClasses = computed(() =>\n cn(\n 'ui-modal-layer group fixed inset-0 z-modal grid place-items-center overflow-y-auto p-4',\n 'motion-safe:data-[state=open]:animate-(--animate-fade-in)',\n 'motion-safe:data-[state=closed]:animate-(--animate-fade-out)',\n LayerPhoneClass[props.phoneLayout],\n ),\n);\n\nconst frameClasses = computed(() =>\n cn('ui-modal-frame grid w-full justify-items-center', FramePhoneClass[props.phoneLayout]),\n);\n\nconst classes = computed(() =>\n cn(\n 'ui-modal-content relative w-full',\n ModalSizeClass[props.size],\n /* The panel never outgrows the window: it caps at the viewport and its body scrolls under a fixed header and\n footer. A panel without a body part scrolls whole. */\n 'flex max-h-[calc(100dvh-2rem)] flex-col overflow-y-auto overscroll-contain',\n PanelMotionClass[props.phoneLayout],\n surfaceVariants({\n variant: props.variant ?? 'elevated',\n tone: props.tone,\n radius: props.radius ?? 'lg',\n padding: props.padding ?? 'xl',\n elevation: props.elevation,\n }),\n attrs.class as string | undefined,\n /* Last, so a caller's width, height or radius serves the card and the phone layout still fills the screen. */\n PanelPhoneClass[props.phoneLayout],\n ),\n);\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\n/* The sheet handle drag. The offset rides on the panel's transform; a release past the distance closes the dialog,\n and the exit keyframe leaves from that offset. Anything shorter springs back. */\nconst dragOffset = shallowRef(0);\nconst isDragging = shallowRef(false);\nlet dragPointer: { readonly id: number; readonly startY: number } | null = null;\n\nwatch(isOpen, (open) => {\n if (open) dragOffset.value = 0;\n});\n\nconst dragStyle = computed(() =>\n hasHandle.value\n ? {\n transform: dragOffset.value > 0 ? `translateY(${dragOffset.value}px)` : undefined,\n transition: isDragging.value ? 'none' : 'transform var(--duration-base) var(--ease-out)',\n }\n : undefined,\n);\n\nfunction handlePointerDown(event: PointerEvent): void {\n if (event.button !== 0) return;\n dragPointer = { id: event.pointerId, startY: event.clientY };\n isDragging.value = true;\n try {\n (event.currentTarget as HTMLElement).setPointerCapture(event.pointerId);\n } catch {\n /* A synthetic or already-released pointer has nothing to capture; the drag still tracks moves on the handle. */\n }\n}\n\nfunction handlePointerMove(event: PointerEvent): void {\n if (dragPointer?.id !== event.pointerId) return;\n dragOffset.value = Math.max(0, event.clientY - dragPointer.startY);\n}\n\nfunction handlePointerEnd(event: PointerEvent): void {\n if (dragPointer?.id !== event.pointerId) return;\n dragPointer = null;\n isDragging.value = false;\n const height = el.value?.offsetHeight ?? 0;\n const distance = Math.min(HandleDismissDistance, height / 3);\n if (event.type === 'pointerup' && dragOffset.value > distance && context.dismissOnOutsideClick.value) {\n context.setOpen(false);\n return;\n }\n dragOffset.value = 0;\n}\n\n/** Outside-click dismissal — `.self` is React's `e.target !== e.currentTarget` guard. */\nfunction handleOutsideClick(): void {\n if (context.dismissOnOutsideClick.value) context.setOpen(false);\n}\n\nfunction handleEscape(): void {\n context.setOpen(false);\n}\n\ndefineExpose({ el });\n</script>\n\n<template>\n <Portal>\n <!-- Lock follows open state, not mount — Content can mount closed. -->\n <ScrollLockProvider :is-enabled=\"isOpen\">\n <!-- The scrim runs on `BackdropOverlay`'s own `Presence` (its `isOpen` prop) so the\n fade-out plays before it unmounts. React wrapped it in a second, outer\n `Presence`, whose injected `data-state` the inner one then overwrote —\n passing the state straight in is the same intent without the masking. -->\n <BackdropOverlay v-if=\"hasBackdrop\" is-inline :is-open=\"isOpen\" :is-blurred=\"props.isBlurred\" />\n <!-- Outside-click dismissal lives on the centering wrapper (it covers the\n backdrop): a click on the padding (`.self`) = outside. The wrapper is the\n Presence-animated node — `Presence` injects `data-state` + `ref` onto it and\n watches *its own* animations (no subtree walk), so the wrapper carries a\n (transparent) fade and the visible pop lands on the panel via\n `group-data-[state=*]`. Both share the same token timing, so the wrapper fade\n gates unmount correctly. -->\n <Presence :is-present=\"isOpen\">\n <div :class=\"layerClasses\" :data-phone-layout=\"props.phoneLayout\" @click.self=\"handleOutsideClick\">\n <!-- The layer is the grid item, so it spans the window's width: a shrink-wrapped layer would hold the\n panel's `w-full` to its content width. It centers the panel in turn. -->\n <FocusScope as-child is-trapped can-loop is-modal>\n <DismissableLayer\n :class=\"frameClasses\"\n :is-escape-disabled=\"!dismissOnEscape\"\n is-outside-click-disabled\n :on-escape=\"handleEscape\"\n >\n <div\n ref=\"el\"\n :role=\"role\"\n aria-modal=\"true\"\n :aria-labelledby=\"context.titleId\"\n :aria-describedby=\"context.descriptionId\"\n :data-phone-layout=\"props.phoneLayout\"\n v-bind=\"rest\"\n :class=\"classes\"\n :style=\"dragStyle\"\n >\n <div\n v-if=\"hasHandle\"\n data-modal-handle\n aria-hidden=\"true\"\n class=\"absolute inset-x-0 top-0 z-raised flex h-6 cursor-grab touch-none justify-center pt-2 sm:hidden\"\n @pointerdown=\"handlePointerDown\"\n @pointermove=\"handlePointerMove\"\n @pointerup=\"handlePointerEnd\"\n @pointercancel=\"handlePointerEnd\"\n >\n <span class=\"h-1 w-10 rounded-full bg-border-strong forced-colors:bg-[CanvasText]\" />\n </div>\n <span\n v-if=\"hasTopInset\"\n aria-hidden=\"true\"\n class=\"block h-[env(safe-area-inset-top)] shrink-0 sm:hidden\"\n />\n <slot />\n <span\n v-if=\"hasBottomInset\"\n aria-hidden=\"true\"\n class=\"block h-[env(safe-area-inset-bottom)] shrink-0 sm:hidden\"\n />\n </div>\n </DismissableLayer>\n </FocusScope>\n </div>\n </Presence>\n </ScrollLockProvider>\n </Portal>\n</template>\n"],"names":["_createBlock","_unref","Portal","_createVNode","ScrollLockProvider","BackdropOverlay","_createElementVNode","FocusScope","DismissableLayer","_mergeProps","_createElementBlock","_openBlock","_renderSlot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAWO,MAAM,YAAY;AAAA;AAAA,EAEvB,IAAI;AAAA;AAAA,EAEJ,IAAI;AAAA;AAAA,EAEJ,IAAI;AAAA;AAAA,EAEJ,IAAI;AAAA;AAAA,EAEJ,MAAM;AACR;AAKO,MAAM,mBAAmB;AAAA;AAAA,EAE9B,YAAY;AAAA;AAAA,EAEZ,OAAO;AAAA;AAAA,EAEP,MAAM;AACR;AAIA,MAAM,iBAA4C;AAAA,EAChD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;AAGA,MAAM,kBAAoD;AAAA,EACxD,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,MAAM;AACR;AAEA,MAAM,kBAAoD;AAAA,EACxD,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,MAAM;AACR;AAGA,MAAM,kBAAoD;AAAA,EACxD,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EA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NK,mBAkCM,OAlCNG,WAkCM;AAAA,uCAjCA;AAAA,8BAAJ,KAAI;AAAA,8BACH,MAAMR,MAAA,IAAA;AAAA,8BACP,cAAW;AAAA,8BACV,mBAAiBA,MAAA,OAAA,EAAQ;AAAA,8BACzB,oBAAkBA,MAAA,OAAA,EAAQ;AAAA,8BAC1B,qBAAmB,MAAM;AAAA,4BAAA,GAClB,KAAA,OAAI;AAAA,8BACX,OAAO,QAAA;AAAA,8BACP,OAAO,UAAA;AAAA,4BAAA;8BAGA,UAAA,sBADRS,mBAWM,OAAA;AAAA;gCATJ,qBAAA;AAAA,gCACA,eAAY;AAAA,gCACZ,OAAM;AAAA,gCACL,eAAa;AAAA,gCACb,eAAa;AAAA,gCACb,aAAW;AAAA,gCACX,iBAAe;AAAA,8BAAA;gCAEhBJ,mBAAqF,QAAA,EAA/E,OAAM,uEAAA,GAAsE,MAAA,EAAA;AAAA,8BAAA;8BAG5E,YAAA,SADRK,UAAA,GAAAD,mBAIE,QAJF,UAIE;8BACFE,WAAQ,KAAA,QAAA,SAAA;AAAA,8BAEA,eAAA,SADRD,UAAA,GAAAD,mBAIE,QAJF,UAIE;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ModalContent.vue.js","sources":["../../../../src/presentation/overlays/modal/ModalContent.vue"],"sourcesContent":["<script lang=\"ts\">\nimport {\n cn,\n type SurfaceElevation,\n type SurfacePadding,\n type SurfaceRadius,\n type SurfaceTone,\n type SurfaceVariant,\n} from '../../../foundation/styles';\n\n/** Defines the max-width step of a `ModalContent` panel. */\nexport const ModalSize = {\n /** Refers to a narrow panel (24rem) — confirmations and short prompts. */\n Sm: 'sm',\n /** Refers to the default panel (32rem). */\n Md: 'md',\n /** Refers to a wide panel (42rem) — forms with paired fields. */\n Lg: 'lg',\n /** Refers to an extra-wide panel (56rem) — tables and multi-column forms. */\n Xl: 'xl',\n /** Refers to a panel that spans the window, inside its gutter. */\n Full: 'full',\n} as const;\n\nexport type ModalSize = (typeof ModalSize)[keyof typeof ModalSize];\n\n/** Defines how tall a `ModalContent` panel is; either way it never outgrows the window. */\nexport const ModalHeight = {\n /** Refers to a panel that fits its content — a confirm, an alert, a short prompt settled when it opens. */\n Auto: 'auto',\n /**\n * Refers to a panel held at the height paired with its `size` step, whatever its content: a streamed progress, a\n * list that loads, a multi-step flow. The body scrolls; the frame never moves.\n */\n Fixed: 'fixed',\n} as const;\n\nexport type ModalHeight = (typeof ModalHeight)[keyof typeof ModalHeight];\n\n/** Defines how a `ModalContent` panel lays out below the `sm` breakpoint; from `sm` up it is the centred card. */\nexport const ModalPhoneLayout = {\n /** Refers to a panel that fills the screen — header on top, a scrolling body, the footer pinned to the bottom. */\n Fullscreen: 'fullscreen',\n /** Refers to a sheet docked to the bottom edge, rounded on top, that slides up. */\n Sheet: 'sheet',\n /** Refers to the centred card, as on wider screens. */\n Card: 'card',\n} as const;\n\nexport type ModalPhoneLayout = (typeof ModalPhoneLayout)[keyof typeof ModalPhoneLayout];\n\nconst ModalSizeClass: Record<ModalSize, string> = {\n sm: 'max-w-sm',\n md: 'max-w-lg',\n lg: 'max-w-2xl',\n xl: 'max-w-4xl',\n full: 'max-w-none',\n};\n\n/* The fixed height paired with each width step, capped at the window like the panel itself. */\nconst ModalFixedHeightClass: Record<ModalSize, string> = {\n sm: 'h-[min(24rem,calc(100dvh-2rem))]',\n md: 'h-[min(32rem,calc(100dvh-2rem))]',\n lg: 'h-[min(40rem,calc(100dvh-2rem))]',\n xl: 'h-[min(48rem,calc(100dvh-2rem))]',\n full: 'h-[calc(100dvh-2rem)]',\n};\n\n/* The layer, frame and panel classes per phone layout. Each is prefixed `max-sm:`, so wider screens keep the card. */\nconst LayerPhoneClass: Record<ModalPhoneLayout, string> = {\n fullscreen: 'max-sm:place-items-stretch max-sm:p-0',\n sheet: 'max-sm:items-end max-sm:justify-items-stretch max-sm:p-0',\n card: '',\n};\n\nconst FramePhoneClass: Record<ModalPhoneLayout, string> = {\n fullscreen: 'max-sm:justify-items-stretch',\n sheet: 'max-sm:justify-items-stretch',\n card: '',\n};\n\n/* A wrapping `<form>` joins the fullscreen column, so its `ModalBody` takes the free height and the footer pins. */\nconst PanelPhoneClass: Record<ModalPhoneLayout, string> = {\n fullscreen: cn(\n 'max-sm:h-dvh max-sm:max-h-dvh max-sm:w-full max-sm:max-w-none max-sm:rounded-none',\n 'max-sm:[--ui-overlay-inset-top:env(safe-area-inset-top)]',\n 'max-sm:[&>form]:flex max-sm:[&>form]:min-h-0 max-sm:[&>form]:flex-1 max-sm:[&>form]:flex-col',\n ),\n sheet: 'max-sm:w-full max-sm:max-w-none max-sm:rounded-t-2xl max-sm:rounded-b-none',\n card: '',\n};\n\n/* Phones rise from the bottom edge; the card keeps its pop wherever it shows. */\nconst PanelMotionClass: Record<ModalPhoneLayout, string> = {\n fullscreen: cn(\n 'sm:motion-safe:group-data-[state=open]:animate-(--animate-pop-in)',\n 'sm:motion-safe:group-data-[state=closed]:animate-(--animate-pop-out)',\n 'max-sm:motion-safe:group-data-[state=open]:animate-(--animate-sheet-in)',\n 'max-sm:motion-safe:group-data-[state=closed]:animate-(--animate-sheet-out)',\n ),\n sheet: cn(\n 'sm:motion-safe:group-data-[state=open]:animate-(--animate-pop-in)',\n 'sm:motion-safe:group-data-[state=closed]:animate-(--animate-pop-out)',\n 'max-sm:motion-safe:group-data-[state=open]:animate-(--animate-sheet-in)',\n 'max-sm:motion-safe:group-data-[state=closed]:animate-(--animate-sheet-out)',\n ),\n card: cn(\n 'motion-safe:group-data-[state=open]:animate-(--animate-pop-in)',\n 'motion-safe:group-data-[state=closed]:animate-(--animate-pop-out)',\n ),\n};\n\n/** The drag past which a released sheet handle dismisses: this many pixels, or a third of the sheet if shorter. */\nconst HandleDismissDistance = 96;\n\n/**\n * Represents the prop surface of `ModalContent`.\n *\n * React declared the surface axes by `extends SurfaceLayoutVariants`; they are\n * spelled out here because the SFC compiler's type resolver cannot follow a\n * `VariantProps<typeof …>` base and fails the build on it. The aliases below\n * are the canonical ones from `foundation/styles`, already locked against the\n * `surfaceVariants` config there, so the two cannot drift.\n */\nexport interface ModalContentProps {\n /** Shows the default backdrop behind the panel. Default `true`. */\n readonly showBackdrop?: boolean;\n /** @deprecated Use `showBackdrop` (inverted); this alias is removed next release. */\n readonly hideBackdrop?: boolean;\n\n /** The backdrop-blur toggle. */\n readonly isBlurred?: boolean;\n\n /** The panel's max-width step; a `max-w-*` class still overrides it. Default `md`. */\n readonly size?: ModalSize;\n\n /**\n * Whether the panel fits its content or holds the height paired with `size`: `sm` 24rem · `md` 32rem · `lg` 40rem ·\n * `xl` 48rem · `full` the window. Either way it caps at the window and its body scrolls. Default `auto`.\n */\n readonly height?: ModalHeight;\n\n /** The visual recipe. Default `elevated`. */\n readonly variant?: SurfaceVariant;\n\n /** The color tone the recipe is tinted with. */\n readonly tone?: SurfaceTone;\n\n /** The corner rounding. Default `lg`. */\n readonly radius?: SurfaceRadius;\n\n /** The inner spacing step. Default `xl`. */\n readonly padding?: SurfacePadding;\n\n /** The shadow depth. */\n readonly elevation?: SurfaceElevation;\n\n /** The layout below the `sm` breakpoint; wider screens always get the centred card. Default `fullscreen`. */\n readonly phoneLayout?: ModalPhoneLayout;\n\n /**\n * Shows a grab handle on a phone `sheet`. Dragging it down dismisses the dialog where outside clicks may, and\n * springs back where they may not. Default `false`.\n */\n readonly showHandle?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, provide, shallowRef, useAttrs, useTemplateRef, watch } from 'vue';\nimport { surfaceVariants } from '../../../foundation/styles';\nimport { DismissableLayer, FocusScope, Portal, Presence, ScrollLockProvider } from '../../../foundation/primitives';\nimport BackdropOverlay from '../backdropOverlay/BackdropOverlay.vue';\nimport { overlayChromeContextKey } from '../OverlayChrome';\nimport { useModalContext } from './Modal.vue';\n\n/** Renders the portalled dialog surface — scrim, focus trap, scroll lock, and the a11y panel. */\ndefineOptions({ name: 'ModalContent', inheritAttrs: false });\n\n/** The panel content — chrome subcomponents and the dialog body. React's `children`. */\ndefineSlots<{ default(): unknown }>();\n\nconst props = withDefaults(defineProps<ModalContentProps>(), {\n size: 'md',\n height: ModalHeight.Auto,\n showBackdrop: undefined,\n hideBackdrop: undefined,\n phoneLayout: ModalPhoneLayout.Fullscreen,\n showHandle: false,\n});\n\n/** `showBackdrop` first, then the inverted deprecated `hideBackdrop`. */\nconst hasBackdrop = computed(() => props.showBackdrop ?? !(props.hideBackdrop ?? false));\n\nconst attrs = useAttrs();\nconst context = useModalContext();\nconst el = useTemplateRef<HTMLDivElement>('el');\n\n/* Refs lifted to setup consts so the template auto-unwraps them (a plain injected object does not). */\nconst isOpen = context.open;\nconst role = context.role;\nconst dismissOnEscape = context.dismissOnEscape;\n\nfunction close(): void {\n context.setOpen(false);\n}\n\nprovide(overlayChromeContextKey, {\n titleId: context.titleId,\n descriptionId: context.descriptionId,\n close,\n});\n\n/* Safe-area spacers keep content clear of the notch and the home indicator; they collapse from `sm` up. */\nconst hasBottomInset = computed(() => props.phoneLayout !== ModalPhoneLayout.Card);\nconst hasTopInset = computed(() => props.phoneLayout === ModalPhoneLayout.Fullscreen);\nconst hasHandle = computed(() => props.showHandle && props.phoneLayout === ModalPhoneLayout.Sheet);\n\nconst layerClasses = computed(() =>\n cn(\n 'ui-modal-layer group fixed inset-0 z-modal grid place-items-center overflow-y-auto p-4',\n 'motion-safe:data-[state=open]:animate-(--animate-fade-in)',\n 'motion-safe:data-[state=closed]:animate-(--animate-fade-out)',\n LayerPhoneClass[props.phoneLayout],\n ),\n);\n\nconst frameClasses = computed(() =>\n cn('ui-modal-frame grid w-full justify-items-center', FramePhoneClass[props.phoneLayout]),\n);\n\nconst classes = computed(() =>\n cn(\n 'ui-modal-content relative w-full',\n ModalSizeClass[props.size],\n /* The panel never outgrows the window: it caps at the viewport and its body scrolls under a fixed header and\n footer. A panel without a body part scrolls whole. */\n 'flex max-h-[calc(100dvh-2rem)] flex-col overflow-y-auto overscroll-contain',\n /* A fixed panel keeps its height while its content streams in or changes step; the body takes the free height. */\n props.height === ModalHeight.Fixed && ModalFixedHeightClass[props.size],\n PanelMotionClass[props.phoneLayout],\n surfaceVariants({\n variant: props.variant ?? 'elevated',\n tone: props.tone,\n radius: props.radius ?? 'lg',\n padding: props.padding ?? 'xl',\n elevation: props.elevation,\n }),\n attrs.class as string | undefined,\n /* Last, so a caller's width, height or radius serves the card and the phone layout still fills the screen. */\n PanelPhoneClass[props.phoneLayout],\n ),\n);\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\n/* The sheet handle drag. The offset rides on the panel's transform; a release past the distance closes the dialog,\n and the exit keyframe leaves from that offset. Anything shorter springs back. */\nconst dragOffset = shallowRef(0);\nconst isDragging = shallowRef(false);\nlet dragPointer: { readonly id: number; readonly startY: number } | null = null;\n\nwatch(isOpen, (open) => {\n if (open) dragOffset.value = 0;\n});\n\nconst dragStyle = computed(() =>\n hasHandle.value\n ? {\n transform: dragOffset.value > 0 ? `translateY(${dragOffset.value}px)` : undefined,\n transition: isDragging.value ? 'none' : 'transform var(--duration-base) var(--ease-out)',\n }\n : undefined,\n);\n\nfunction handlePointerDown(event: PointerEvent): void {\n if (event.button !== 0) return;\n dragPointer = { id: event.pointerId, startY: event.clientY };\n isDragging.value = true;\n try {\n (event.currentTarget as HTMLElement).setPointerCapture(event.pointerId);\n } catch {\n /* A synthetic or already-released pointer has nothing to capture; the drag still tracks moves on the handle. */\n }\n}\n\nfunction handlePointerMove(event: PointerEvent): void {\n if (dragPointer?.id !== event.pointerId) return;\n dragOffset.value = Math.max(0, event.clientY - dragPointer.startY);\n}\n\nfunction handlePointerEnd(event: PointerEvent): void {\n if (dragPointer?.id !== event.pointerId) return;\n dragPointer = null;\n isDragging.value = false;\n const height = el.value?.offsetHeight ?? 0;\n const distance = Math.min(HandleDismissDistance, height / 3);\n if (event.type === 'pointerup' && dragOffset.value > distance && context.dismissOnOutsideClick.value) {\n context.setOpen(false);\n return;\n }\n dragOffset.value = 0;\n}\n\n/** Outside-click dismissal — `.self` is React's `e.target !== e.currentTarget` guard. */\nfunction handleOutsideClick(): void {\n if (context.dismissOnOutsideClick.value) context.setOpen(false);\n}\n\nfunction handleEscape(): void {\n context.setOpen(false);\n}\n\ndefineExpose({ el });\n</script>\n\n<template>\n <Portal>\n <!-- Lock follows open state, not mount — Content can mount closed. -->\n <ScrollLockProvider :is-enabled=\"isOpen\">\n <!-- The scrim runs on `BackdropOverlay`'s own `Presence` (its `isOpen` prop) so the\n fade-out plays before it unmounts. React wrapped it in a second, outer\n `Presence`, whose injected `data-state` the inner one then overwrote —\n passing the state straight in is the same intent without the masking. -->\n <BackdropOverlay v-if=\"hasBackdrop\" is-inline :is-open=\"isOpen\" :is-blurred=\"props.isBlurred\" />\n <!-- Outside-click dismissal lives on the centering wrapper (it covers the\n backdrop): a click on the padding (`.self`) = outside. The wrapper is the\n Presence-animated node — `Presence` injects `data-state` + `ref` onto it and\n watches *its own* animations (no subtree walk), so the wrapper carries a\n (transparent) fade and the visible pop lands on the panel via\n `group-data-[state=*]`. Both share the same token timing, so the wrapper fade\n gates unmount correctly. -->\n <Presence :is-present=\"isOpen\">\n <div :class=\"layerClasses\" :data-phone-layout=\"props.phoneLayout\" @click.self=\"handleOutsideClick\">\n <!-- The layer is the grid item, so it spans the window's width: a shrink-wrapped layer would hold the\n panel's `w-full` to its content width. It centers the panel in turn. -->\n <FocusScope as-child is-trapped can-loop is-modal>\n <DismissableLayer\n :class=\"frameClasses\"\n :is-escape-disabled=\"!dismissOnEscape\"\n is-outside-click-disabled\n :on-escape=\"handleEscape\"\n >\n <div\n ref=\"el\"\n :role=\"role\"\n aria-modal=\"true\"\n :aria-labelledby=\"context.titleId\"\n :aria-describedby=\"context.descriptionId\"\n :data-phone-layout=\"props.phoneLayout\"\n :data-height=\"props.height\"\n v-bind=\"rest\"\n :class=\"classes\"\n :style=\"dragStyle\"\n >\n <div\n v-if=\"hasHandle\"\n data-modal-handle\n aria-hidden=\"true\"\n class=\"absolute inset-x-0 top-0 z-raised flex h-6 cursor-grab touch-none justify-center pt-2 sm:hidden\"\n @pointerdown=\"handlePointerDown\"\n @pointermove=\"handlePointerMove\"\n @pointerup=\"handlePointerEnd\"\n @pointercancel=\"handlePointerEnd\"\n >\n <span class=\"h-1 w-10 rounded-full bg-border-strong forced-colors:bg-[CanvasText]\" />\n </div>\n <span\n v-if=\"hasTopInset\"\n aria-hidden=\"true\"\n class=\"block h-[env(safe-area-inset-top)] shrink-0 sm:hidden\"\n />\n <slot />\n <span\n v-if=\"hasBottomInset\"\n aria-hidden=\"true\"\n class=\"block h-[env(safe-area-inset-bottom)] shrink-0 sm:hidden\"\n />\n </div>\n </DismissableLayer>\n </FocusScope>\n </div>\n </Presence>\n </ScrollLockProvider>\n </Portal>\n</template>\n"],"names":["_createBlock","_unref","Portal","_createVNode","ScrollLockProvider","BackdropOverlay","_createElementVNode","FocusScope","DismissableLayer","_mergeProps","_createElementBlock","_openBlock","_renderSlot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAWO,MAAM,YAAY;AAAA;AAAA,EAEvB,IAAI;AAAA;AAAA,EAEJ,IAAI;AAAA;AAAA,EAEJ,IAAI;AAAA;AAAA,EAEJ,IAAI;AAAA;AAAA,EAEJ,MAAM;AACR;AAKO,MAAM,cAAc;AAAA;AAAA,EAEzB,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,EAKN,OAAO;AACT;AAKO,MAAM,mBAAmB;AAAA;AAAA,EAE9B,YAAY;AAAA;AAAA,EAEZ,OAAO;AAAA;AAAA,EAEP,MAAM;AACR;AAIA,MAAM,iBAA4C;AAAA,EAChD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;AAGA,MAAM,wBAAmD;AAAA,EACvD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;AAGA,M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AA;AAAA,sBA5CD,YAAA;AAAA,sBAAS,cAAA;AAAA,sBAAW,YAAA;AAAA,sBAAS,YAAA;AAAA,oBAAA;uCACvC,MA0CmB;AAAA,wBA1CnBJ,YA0CmBF,MAAAO,WAAA,GAAA;AAAA,0BAzChB,sBAAO,aAAA,KAAY;AAAA,0BACnB,uBAAqBP,MAAA,eAAA;AAAA,0BACtB,6BAAA;AAAA,0BACC,aAAW;AAAA,wBAAA;2CAEZ,MAmCM;AAAA,4BAnCNK,mBAmCM,OAnCNG,WAmCM;AAAA,uCAlCA;AAAA,8BAAJ,KAAI;AAAA,8BACH,MAAMR,MAAA,IAAA;AAAA,8BACP,cAAW;AAAA,8BACV,mBAAiBA,MAAA,OAAA,EAAQ;AAAA,8BACzB,oBAAkBA,MAAA,OAAA,EAAQ;AAAA,8BAC1B,qBAAmB,MAAM;AAAA,8BACzB,eAAa,MAAM;AAAA,4BAAA,GACZ,KAAA,OAAI;AAAA,8BACX,OAAO,QAAA;AAAA,8BACP,OAAO,UAAA;AAAA,4BAAA;8BAGA,UAAA,sBADRS,mBAWM,OAAA;AAAA;gCATJ,qBAAA;AAAA,gCACA,eAAY;AAAA,gCACZ,OAAM;AAAA,gCACL,eAAa;AAAA,gCACb,eAAa;AAAA,gCACb,aAAW;AAAA,gCACX,iBAAe;AAAA,8BAAA;gCAEhBJ,mBAAqF,QAAA,EAA/E,OAAM,uEAAA,GAAsE,MAAA,EAAA;AAAA,8BAAA;8BAG5E,YAAA,SADRK,UAAA,GAAAD,mBAIE,QAJF,UAIE;8BACFE,WAAQ,KAAA,QAAA,SAAA;AAAA,8BAEA,eAAA,SADRD,UAAA,GAAAD,mBAIE,QAJF,UAIE;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,7 @@
1
1
  import _sfc_main from "./ModalContent.vue.js";
2
- import { ModalPhoneLayout, ModalSize } from "./ModalContent.vue.js";
2
+ import { ModalHeight, ModalPhoneLayout, ModalSize } from "./ModalContent.vue.js";
3
3
  export {
4
+ ModalHeight,
4
5
  ModalPhoneLayout,
5
6
  ModalSize,
6
7
  _sfc_main as default
@@ -1,6 +1,6 @@
1
1
  export { default as Modal, ModalRole, type ModalProps } from './Modal.vue';
2
2
  export { default as ModalTrigger, type ModalTriggerProps } from './ModalTrigger.vue';
3
- export { default as ModalContent, ModalPhoneLayout, ModalSize, type ModalContentProps } from './ModalContent.vue';
3
+ export { default as ModalContent, ModalHeight, ModalPhoneLayout, ModalSize, type ModalContentProps, } from './ModalContent.vue';
4
4
  export { default as ModalHeader } from '../OverlayHeader.vue';
5
5
  export { default as ModalTitle } from '../OverlayTitle.vue';
6
6
  export { default as ModalDescription } from '../OverlayDescription.vue';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wow-two-beta/fe",
3
- "version": "0.0.36",
3
+ "version": "0.0.38",
4
4
  "description": "Beta-forever Vue 3 fe sdk for the wow-two ecosystem — components, application adapters and browser capabilities.",
5
5
  "license": "MIT",
6
6
  "repository": {