@plexui/vue 0.1.11 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,8 +15,10 @@ export const FieldError = defineComponent({
15
15
  },
16
16
  setup(props, { slots, attrs }) {
17
17
  return () => h("div", { class: [s.FieldError, attrs.class], id: props.id, role: "alert" }, [
18
- props.icon ? h(ExclamationMarkCircle, { class: s.Icon }) : null,
19
- h("span", null, slots.default?.()),
18
+ h("div", { class: s.Inner }, [
19
+ props.icon ? h(ExclamationMarkCircle, { class: s.Icon }) : null,
20
+ h("span", null, slots.default?.()),
21
+ ]),
20
22
  ]);
21
23
  },
22
24
  });
@@ -1 +1 @@
1
- {"version":3,"file":"FieldError.js","sourceRoot":"","sources":["../../../../src/components/FieldError/FieldError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,CAAC,MAAM,4DAA4D,CAAA;AAE1E;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC;IACxC,IAAI,EAAE,YAAY;IAClB,YAAY,EAAE,KAAK;IACnB,KAAK,EAAE;QACL,EAAE,EAAE,MAAM;QACV,6DAA6D;QAC7D,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;KACvC;IACD,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;QAC3B,OAAO,GAAG,EAAE,CACV,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;YAC5E,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,qBAAqB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI;YAC/D,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;SACnC,CAAC,CAAA;IACN,CAAC;CACF,CAAC,CAAA","sourcesContent":["import { defineComponent, h } from \"vue\"\nimport { ExclamationMarkCircle } from \"../Icon/index.js\"\nimport s from \"@plexui/styles/components/FieldError/FieldError.module.css\"\n\n/**\n * Port of packages/ui/src/components/FieldError/FieldError.tsx. Like React,\n * only `class` and `id` reach the DOM; other attributes are dropped.\n */\nexport const FieldError = defineComponent({\n name: \"FieldError\",\n inheritAttrs: false,\n props: {\n id: String,\n /** Shows the error icon before the message. @default true */\n icon: { type: Boolean, default: true },\n },\n setup(props, { slots, attrs }) {\n return () =>\n h(\"div\", { class: [s.FieldError, attrs.class], id: props.id, role: \"alert\" }, [\n props.icon ? h(ExclamationMarkCircle, { class: s.Icon }) : null,\n h(\"span\", null, slots.default?.()),\n ])\n },\n})\n\nexport type FieldErrorProps = InstanceType<typeof FieldError>[\"$props\"]\n"]}
1
+ {"version":3,"file":"FieldError.js","sourceRoot":"","sources":["../../../../src/components/FieldError/FieldError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,CAAC,MAAM,4DAA4D,CAAA;AAE1E;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC;IACxC,IAAI,EAAE,YAAY;IAClB,YAAY,EAAE,KAAK;IACnB,KAAK,EAAE;QACL,EAAE,EAAE,MAAM;QACV,6DAA6D;QAC7D,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;KACvC;IACD,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;QAC3B,OAAO,GAAG,EAAE,CACV,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;YAC5E,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE;gBAC3B,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,qBAAqB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI;gBAC/D,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;aACnC,CAAC;SACH,CAAC,CAAA;IACN,CAAC;CACF,CAAC,CAAA","sourcesContent":["import { defineComponent, h } from \"vue\"\nimport { ExclamationMarkCircle } from \"../Icon/index.js\"\nimport s from \"@plexui/styles/components/FieldError/FieldError.module.css\"\n\n/**\n * Port of packages/ui/src/components/FieldError/FieldError.tsx. Like React,\n * only `class` and `id` reach the DOM; other attributes are dropped.\n */\nexport const FieldError = defineComponent({\n name: \"FieldError\",\n inheritAttrs: false,\n props: {\n id: String,\n /** Shows the error icon before the message. @default true */\n icon: { type: Boolean, default: true },\n },\n setup(props, { slots, attrs }) {\n return () =>\n h(\"div\", { class: [s.FieldError, attrs.class], id: props.id, role: \"alert\" }, [\n h(\"div\", { class: s.Inner }, [\n props.icon ? h(ExclamationMarkCircle, { class: s.Icon }) : null,\n h(\"span\", null, slots.default?.()),\n ]),\n ])\n },\n})\n\nexport type FieldErrorProps = InstanceType<typeof FieldError>[\"$props\"]\n"]}
@@ -351,11 +351,13 @@ const RadioGroupItemComponent = defineComponent({
351
351
  event.preventDefault();
352
352
  };
353
353
  return () => {
354
- const { class: className, ...restAttrs } = attrs;
354
+ const { "class": className,
355
+ // These name the radio itself: a `Field` around the item labels it through them
356
+ "id": idAttr, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, ...restAttrs } = attrs;
355
357
  const isChecked = checked.value;
356
358
  const isDisabled = disabled.value;
357
359
  const state = isChecked ? "checked" : "unchecked";
358
- const itemId = `${props.value}-${id}`;
360
+ const itemId = idAttr ?? `${props.value}-${id}`;
359
361
  if (isFormControl.value)
360
362
  defaultChecked ??= isChecked;
361
363
  else
@@ -387,7 +389,9 @@ const RadioGroupItemComponent = defineComponent({
387
389
  "required": props.required ? "" : undefined,
388
390
  "id": itemId,
389
391
  "class": s.RadioItem,
390
- "aria-describedby": descriptionId,
392
+ "aria-label": ariaLabel,
393
+ "aria-labelledby": ariaLabelledBy,
394
+ "aria-describedby": [descriptionId, ariaDescribedBy].filter(Boolean).join(" ") || undefined,
391
395
  // Reka's RovingFocusItem marks the active item; Radix does not
392
396
  "data-active": undefined,
393
397
  "onClick": handleClick,
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../../../src/components/RadioGroup/RadioGroup.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,CAAC,EACD,MAAM,EACN,QAAQ,EACR,eAAe,EACf,SAAS,EACT,OAAO,EACP,GAAG,EACH,UAAU,EACV,KAAK,EACL,KAAK,EACL,OAAO,GAMR,MAAM,KAAK,CAAA;AACZ,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACrE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACxF,OAAO,CAAC,MAAM,4DAA4D,CAAA;AA4B1E,MAAM,oBAAoB,GAAyC,MAAM,CAAC,kBAAkB,CAAC,CAAA;AAE7F,MAAM,oBAAoB,GAAG,GAAG,EAAE;IAChC,MAAM,OAAO,GAAG,MAA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EAAE,CAAC,CAAC;4BACd,OAAO,EAAE,gBAAgB,CAAC,WAAW,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;yBACjF,CAAC;wBACJ,CAAC,CAAC,IAAI;iBACT,CAAC;gBACF,KAAK,CAAC,OAAO,EAAE,EAAE;aAClB,CACF,CAAA;YAED,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI,QAAQ,CAAC,EAAE,GAAG,SAAS,EAAE,EAAE;gBAC1E,aAAa;oBACX,CAAC,CAAC,0FAA0F;wBAC1F,CAAC,CACC,KAAK,EACL;4BACE,OAAO,EAAE,CAAC,CAAC,cAAc;4BACzB,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;4BAC1C,kBAAkB,EAAE,KAAK,CAAC,WAAW;yBACtC,EACD;4BACE,KAAK;4BACL,CAAC,CACC,MAAM,EACN,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC,gBAAgB,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,EAClG,WAAW,CACZ;yBACF,CACF;oBACH,CAAC,CAAC,KAAK;aACV,CAAC,CAAA;QACJ,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAaF,MAAM,CAAC,MAAM,cAAc,GAAG,uBAE7B,CAAA;AAED;;;GAGG;AACH,+EAA+E;AAC/E,2EAA2E;AAC3E,MAAM,CAAC,MAAM,UAAU,GAEnB,MAAM,CAAC,MAAM,CACf,mBAA2F,EAC3F,EAAE,IAAI,EAAE,cAAc,EAAE,CACzB,CAAA","sourcesContent":["import {\n computed,\n defineComponent,\n h,\n inject,\n nextTick,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n shallowRef,\n useId,\n watch,\n withCtx,\n type ComputedRef,\n type HTMLAttributes,\n type InjectionKey,\n type PropType,\n type Ref,\n} from \"vue\"\nimport { Presence, RovingFocusGroup, RovingFocusItem } from \"reka-ui\"\nimport { bubbleInputStyle, useIsFormControl, useSize } from \"../Checkbox/bubbleInput.js\"\nimport s from \"@plexui/styles/components/RadioGroup/RadioGroup.module.css\"\n\n// Vue port of packages/ui/src/components/RadioGroup/RadioGroup.tsx. Props,\n// defaults, rendered DOM and behaviour match React (checked by the parity\n// tests).\n//\n// React builds on Radix RadioGroup. Reka's RadioGroupItem renders different\n// markup (`aria-label` copied from the label, `required` and `name` on the\n// button, a visually hidden input only when a `name` is set), stops every\n// click and checks an arrow-focused radio a tick later. So the Radix group\n// and radio (state, button attributes, hidden form input, arrow-key\n// selection) are rendered here, and keyboard focus comes from Reka's\n// RovingFocusGroup and RovingFocusItem, the same roving tabindex Radix uses.\n\ntype Direction = \"col\" | \"row\"\n\ntype BubbleInputEffect = { input: Ref<HTMLInputElement | null>; run: () => void }\n\ntype RadioGroupContextValue = {\n disabled: ComputedRef<boolean>\n required: ComputedRef<boolean>\n name: ComputedRef<string | undefined>\n value: ComputedRef<string | null>\n setValue: (value: string) => void\n bubbleInputEffects: Set<BubbleInputEffect>\n runBubbleInputEffects: () => void\n}\n\nconst RadioGroupContextKey: InjectionKey<RadioGroupContextValue> = Symbol(\"PlexUIRadioGroup\")\n\nconst useRadioGroupContext = () => {\n const context = inject(RadioGroupContextKey, null)\n\n if (!context) {\n throw new Error(\"RadioGroup components must be wrapped in <RadioGroup />\")\n }\n\n return context\n}\n\ntype ExposedRovingFocusGroup = { getItems: () => { ref: HTMLElement }[] }\n\nconst ARROW_KEYS = [\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\"]\n\n// Radix RovingFocusGroup's focusFirst\nconst focusFirst = (candidates: HTMLElement[]) => {\n const previouslyFocused = document.activeElement\n for (const candidate of candidates) {\n if (candidate === previouslyFocused) return\n candidate.focus({ preventScroll: false })\n if (document.activeElement !== previouslyFocused) return\n }\n}\n\nconst callHandlers = (handlers: unknown, event: Event) => {\n for (const handler of Array.isArray(handlers) ? handlers : [handlers]) {\n if (typeof handler === \"function\") handler(event)\n }\n}\n\n// The caller's listeners the group element composes with Reka's\nconst GROUP_LISTENERS = [\"onMousedown\", \"onMouseup\", \"onFocus\", \"onBlur\", \"onFocusin\", \"onFocusout\"] as const\n\n// Internal: the radiogroup element rendered through Reka's RovingFocusGroup\n// (`asChild`), with Reka's group handlers wired the Radix way:\n// - Radix runs the caller's mousedown handler first and skips its own once\n// the event is default-prevented; Reka merges its own in front.\n// - Radix's group focus and blur handlers are React `onFocus` / `onBlur`,\n// which bubble from the radios: a radio's focus ends a click focus and its\n// blur ends Shift+Tab's \"tabbing back out\" (the group is tabbable again).\n// Reka listens to the group's own native focus and blur only, so its\n// handlers run on `focusin` / `focusout` here.\n// - Reka also ends a click focus on mouseup, which Radix does not.\nconst GroupElement = defineComponent({\n name: \"RadioGroupElement\",\n inheritAttrs: false,\n props: {\n listeners: { type: Object as PropType<Record<string, unknown>>, default: () => ({}) },\n },\n setup(props, { attrs, slots }) {\n return () => {\n const { onMousedown, onMouseup: _onMouseup, onFocus, onBlur, ...restAttrs } = attrs\n const caller = props.listeners\n const handlers: Record<string, (event: Event) => void> = {\n onMousedown: (event) => {\n callHandlers(caller.onMousedown, event)\n if (!event.defaultPrevented) callHandlers(onMousedown, event)\n },\n onFocusin: (event) => {\n callHandlers(caller.onFocusin, event)\n callHandlers(onFocus, event)\n },\n onFocusout: (event) => {\n callHandlers(caller.onFocusout, event)\n callHandlers(onBlur, event)\n },\n }\n for (const key of [\"onMouseup\", \"onFocus\", \"onBlur\"] as const) {\n if (caller[key]) handlers[key] = (event) => callHandlers(caller[key], event)\n }\n return h(\"div\", { ...restAttrs, ...handlers }, slots.default?.())\n }\n },\n})\n\nconst RadioGroupComponent = defineComponent({\n name: \"RadioGroup\",\n inheritAttrs: false,\n props: {\n /** Initial selected value when uncontrolled */\n defaultValue: String,\n /** Controlled selected value. Bind with `v-model:value`; leave unset for an uncontrolled group. */\n value: { type: String, default: undefined },\n /** Name submitted with the owning form */\n name: String,\n /** Determines the layout direction of the radio items. @default \"row\" */\n direction: { type: String as PropType<Direction>, default: \"row\" },\n /** Controls whether the entire radio group is disabled. @default false */\n disabled: { type: Boolean, default: false },\n /** Marks the group as required (`aria-required`). @default false */\n required: { type: Boolean, default: false },\n },\n emits: {\n /** The selected value changed (`v-model:value`) */\n \"update:value\": (_value: string) => true,\n /** Same payload as `update:value`, named after React's `onChange` */\n \"change\": (_value: string) => true,\n },\n setup(props, { attrs, slots, emit }) {\n const groupRef = ref<ExposedRovingFocusGroup | null>(null)\n\n // Radix useControllableState: controlled while `value` is set\n const uncontrolledValue = ref<string | null>(props.defaultValue ?? null)\n const value = computed(() => (props.value !== undefined ? props.value : uncontrolledValue.value))\n\n const reportChange = (nextValue: string) => {\n emit(\"update:value\", nextValue)\n emit(\"change\", nextValue)\n }\n\n const setValue = (nextValue: string) => {\n if (props.value !== undefined) {\n if (nextValue !== props.value) reportChange(nextValue)\n } else {\n uncontrolledValue.value = nextValue\n }\n }\n\n // Radix reports an uncontrolled change from the group's effect, which\n // React runs after the items' effects (the hidden inputs' clicks)\n watch(\n uncontrolledValue,\n (nextValue) => {\n void nextTick(() => {\n if (nextValue !== null) reportChange(nextValue)\n })\n },\n { flush: \"post\" },\n )\n\n // React runs the items' hidden-input effects in tree order; Vue's post\n // watchers run in the order they were triggered, so the first item's\n // watcher runs them all here, in document order (each is a no-op when\n // nothing changed for it)\n const bubbleInputEffects = new Set<BubbleInputEffect>()\n const runBubbleInputEffects = () => {\n const effects = [...bubbleInputEffects].sort((a, b) => {\n const first = a.input.value\n const second = b.input.value\n if (!first || !second) return 0\n return first.compareDocumentPosition(second) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1\n })\n for (const effect of effects) effect.run()\n }\n\n provide(RadioGroupContextKey, {\n disabled: computed(() => props.disabled),\n required: computed(() => props.required),\n name: computed(() => props.name),\n value,\n setValue,\n bubbleInputEffects,\n runBubbleInputEffects,\n })\n\n // Radix: a reset of the group's form sets the value it first rendered\n const initialValue = value.value\n onMounted(() => {\n const element = (groupRef.value as { $el?: unknown } | null)?.$el\n const form = element instanceof Element ? element.closest(\"form\") : null\n if (!form) return\n const reset = () => {\n if (initialValue !== null) setValue(initialValue)\n }\n form.addEventListener(\"reset\", reset)\n onBeforeUnmount(() => form.removeEventListener(\"reset\", reset))\n })\n\n // Radix moves focus into the group onto the checked radio, then the last\n // focused one, then the first. Reka looks for a `data-active` attribute\n // that Radix does not render, so its entry focus is replaced here.\n const handleEntryFocus = (event: Event) => {\n event.preventDefault()\n const items = (groupRef.value?.getItems() ?? [])\n .map((item) => item.ref)\n .filter((item) => !item.hasAttribute(\"data-disabled\"))\n const activeItem = items.find((item) => item.getAttribute(\"data-state\") === \"checked\")\n const currentItem = items.find((item) => item.getAttribute(\"tabindex\") === \"0\")\n focusFirst([activeItem, currentItem, ...items].filter((item): item is HTMLElement => !!item))\n }\n\n return () => {\n const { class: className, dir, ...otherAttrs } = attrs\n const listeners: Record<string, unknown> = {}\n const restAttrs: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(otherAttrs)) {\n if ((GROUP_LISTENERS as readonly string[]).includes(key)) listeners[key] = value\n else restAttrs[key] = value\n }\n\n return h(\n RovingFocusGroup,\n {\n ref: groupRef,\n asChild: true,\n loop: true,\n dir: dir as \"ltr\" | \"rtl\" | undefined,\n onEntryFocus: handleEntryFocus,\n },\n {\n default: () =>\n h(\n GroupElement,\n {\n // `dir`, `tabindex` and `style=\"outline: none\"` come from RovingFocusGroup, like Radix\n \"listeners\": listeners,\n \"role\": \"radiogroup\",\n \"aria-required\": props.required,\n \"data-disabled\": props.disabled ? \"\" : undefined,\n \"class\": [s.RadioGroup, className],\n \"data-direction\": props.direction,\n ...restAttrs,\n },\n { default: () => slots.default?.() },\n ),\n },\n )\n }\n },\n})\n\n// React's value tracker per hidden input: its `checked` on mount, then the\n// one React last saw in a click that reached its root (also when a handler\n// stopped it from bubbling further). The native setter Radix uses bypasses it.\nconst trackedChecked = new WeakMap<HTMLInputElement, boolean>()\n\nconst useCheckedTracker = (input: Ref<HTMLInputElement | null>) =>\n watch(\n input,\n (el) => {\n if (!el || trackedChecked.has(el)) return\n // React creates the input by setting its `checked` property, so later\n // changes of the `checked` attribute never move its checkedness\n el.checked = el.checked\n trackedChecked.set(el, el.checked)\n },\n { flush: \"sync\" },\n )\n\n/**\n * Radix's RadioBubbleInput effect: sets the hidden radio's `checked` through\n * the native setter (unless `checked` is undefined) and dispatches a bubbling\n * `click`, which the input stops when `stop` is set, so form listeners see\n * the user's radio only. React turns that click into the form's `onChange`\n * when the input's `checked` differs from its value tracker, then refreshes\n * the trackers of the other radios with the same name in the same form;\n * Vue's form listeners are native, so a native `change` follows in those\n * cases.\n */\nconst dispatchBubbleClick = (input: HTMLInputElement, checked: boolean | undefined, stop: boolean) => {\n const setChecked = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, \"checked\")?.set\n if (!setChecked) return\n if (checked !== undefined) setChecked.call(input, checked)\n const click = new Event(\"click\", { bubbles: true })\n if (stop) input.addEventListener(\"click\", (event) => event.stopPropagation(), { once: true })\n input.dispatchEvent(click)\n if (trackedChecked.get(input) === input.checked) return\n trackedChecked.set(input, input.checked)\n input.dispatchEvent(new Event(\"change\", { bubbles: true }))\n\n const name = input.getAttribute(\"name\")\n if (name === null) return\n for (const other of Array.from(input.ownerDocument.querySelectorAll<HTMLInputElement>('input[type=\"radio\"]'))) {\n if (other !== input && other.getAttribute(\"name\") === name && other.form === input.form && trackedChecked.has(other)) {\n trackedChecked.set(other, other.checked)\n }\n }\n}\n\nconst RadioGroupItemComponent = defineComponent({\n name: \"RadioGroupItem\",\n inheritAttrs: false,\n props: {\n /** Value of this option */\n value: { type: String, required: true },\n /** Determines if a given radio item is disabled. @default false */\n disabled: { type: Boolean, default: false },\n /** Sets `required` on this item's radio button (the hidden form input follows the group's) */\n required: { type: Boolean, default: undefined },\n /** Stretches the item to fill the available width. @default false */\n block: { type: Boolean, default: false },\n /** The orientation of the radio indicator relative to the label. @default \"left\" */\n orientation: { type: String as PropType<\"left\" | \"right\">, default: \"left\" },\n /** Optional second line below the option's label, linked via `aria-describedby` (or the `description` slot) */\n description: String,\n },\n setup(props, { attrs, slots }) {\n const context = useRadioGroupContext()\n const id = useId()\n const wrapper = ref<HTMLDivElement | null>(null)\n const button = ref<HTMLButtonElement | null>(null)\n const bubbleInput = ref<HTMLInputElement | null>(null)\n\n const disabled = computed(() => context.disabled.value || props.disabled)\n const checked = computed(() => context.value.value === props.value)\n\n // Radix's Radio: the hidden input renders until the button mounts, then only inside a form\n const isFormControl = useIsFormControl(button, () => undefined)\n const controlSize = useSize(() => (isFormControl.value ? button.value : null))\n useCheckedTracker(bubbleInput)\n\n // Radix RadioGroupItem: an arrow key that moves focus onto a radio checks it\n let isArrowKeyPressed = false\n const handleDocumentKeyDown = (event: KeyboardEvent) => {\n if (ARROW_KEYS.includes(event.key)) isArrowKeyPressed = true\n }\n const handleDocumentKeyUp = () => {\n isArrowKeyPressed = false\n }\n\n onMounted(() => {\n button.value = (wrapper.value?.firstElementChild as HTMLButtonElement | null) ?? null\n document.addEventListener(\"keydown\", handleDocumentKeyDown)\n document.addEventListener(\"keyup\", handleDocumentKeyUp)\n })\n\n onBeforeUnmount(() => {\n document.removeEventListener(\"keydown\", handleDocumentKeyDown)\n document.removeEventListener(\"keyup\", handleDocumentKeyUp)\n })\n\n // Radix's RadioBubbleInput effect: the radio the user clicked reports its\n // click (also when the value did not change); a radio whose `checked`\n // changed otherwise reports it with a click that stops at the input\n type UserClick = { hasConsumerStoppedPropagation: boolean }\n const userClick = shallowRef<UserClick | null>(null)\n let prevChecked = checked.value\n let handledUserClick: UserClick | null = null\n const bubbleInputEffect: BubbleInputEffect = {\n input: bubbleInput,\n run: () => {\n const input = bubbleInput.value\n if (!input) return\n const isChecked = checked.value\n const checkedChanged = prevChecked !== isChecked\n prevChecked = isChecked\n const isNewUserClick = userClick.value !== null && userClick.value !== handledUserClick\n handledUserClick = userClick.value\n if (isNewUserClick) dispatchBubbleClick(input, checkedChanged ? isChecked : undefined, false)\n else if (checkedChanged) dispatchBubbleClick(input, isChecked, true)\n },\n }\n context.bubbleInputEffects.add(bubbleInputEffect)\n onBeforeUnmount(() => context.bubbleInputEffects.delete(bubbleInputEffect))\n watch([bubbleInput, checked, userClick], context.runBubbleInputEffects, { flush: \"post\" })\n\n // Radix's RadioBubbleInput renders `defaultChecked` from its first render\n let defaultChecked: boolean | undefined\n\n const handleClick = (event: MouseEvent) => {\n // React does not dispatch mouse handlers on a disabled button\n if (disabled.value) return\n if (!checked.value) {\n // Plex passes no click handler a consumer could stop\n userClick.value = { hasConsumerStoppedPropagation: false }\n context.setValue(props.value)\n }\n // In a form, the button's click stops here; the hidden input's click\n // bubbles instead (Plex passes no click handler a consumer could stop)\n if (isFormControl.value) event.stopPropagation()\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n // According to WAI ARIA, radio groups don't activate items on enter keypress\n if (event.key === \"Enter\") event.preventDefault()\n }\n\n const handleFocus = (event: FocusEvent) => {\n // Roving focus moved here with an arrow key: check this radio by clicking it\n if (isArrowKeyPressed) (event.currentTarget as HTMLButtonElement).click()\n }\n\n // Prevents text selection when double-clicking the label\n const handleLabelMouseDown = (event: MouseEvent) => {\n if (!event.defaultPrevented && event.detail > 1) event.preventDefault()\n }\n\n return () => {\n const { class: className, ...restAttrs } = attrs\n const isChecked = checked.value\n const isDisabled = disabled.value\n const state = isChecked ? \"checked\" : \"unchecked\"\n const itemId = `${props.value}-${id}`\n if (isFormControl.value) defaultChecked ??= isChecked\n else defaultChecked = undefined\n\n // Providing an extra wrapper enables `label` to be inline-flex, avoiding clickable whitespace\n // when radio options are of varied lengths.\n // NOTE: Important that this is `flex` to prevent the `inline-flex` label from extra, unintentional whitespace.\n const description = slots.description ? slots.description() : props.description\n const descriptionId = slots.description || props.description ? `${itemId}-description` : undefined\n const label = h(\n \"label\",\n {\n \"for\": itemId,\n \"class\": [s.RadioLabel, className],\n \"data-disabled\": isDisabled ? \"\" : undefined,\n \"data-block\": props.block ? \"\" : undefined,\n \"data-orientation\": props.orientation,\n \"onMousedown\": handleLabelMouseDown,\n },\n [\n h(\"div\", { class: s.RadioIndicatorWrapper, ref: wrapper }, [\n h(\n RovingFocusItem,\n { asChild: true, focusable: !isDisabled, active: isChecked },\n {\n default: () =>\n h(\n \"button\",\n {\n \"type\": \"button\",\n \"role\": \"radio\",\n \"aria-checked\": isChecked,\n \"data-state\": state,\n \"data-disabled\": isDisabled ? \"\" : undefined,\n \"disabled\": isDisabled,\n \"value\": props.value,\n // radix-ui 1.8: the item's own `required` lands on its button\n \"required\": props.required ? \"\" : undefined,\n \"id\": itemId,\n \"class\": s.RadioItem,\n \"aria-describedby\": descriptionId,\n // Reka's RovingFocusItem marks the active item; Radix does not\n \"data-active\": undefined,\n \"onClick\": handleClick,\n \"onKeydown\": handleKeyDown,\n \"onFocus\": handleFocus,\n },\n [\n h(\n Presence,\n { present: isChecked },\n {\n // Presence calls its slot once during setup; withCtx marks it\n // as a render slot so Vue does not warn about that call\n default: withCtx(() => [\n h(\"span\", {\n \"data-state\": state,\n \"data-disabled\": isDisabled ? \"\" : undefined,\n \"class\": s.RadioIndicator,\n }),\n ]),\n },\n ),\n ],\n ),\n },\n ),\n isFormControl.value\n ? h(\"input\", {\n \"ref\": bubbleInput,\n \"type\": \"radio\",\n \"aria-hidden\": \"true\",\n // React's `defaultChecked`, from the input's first render\n \"^checked\": defaultChecked ? \"\" : undefined,\n \"name\": context.name.value,\n \"^value\": props.value,\n // radix-ui 1.8: the group's `required` reaches every input\n \"required\": context.required.value,\n \"disabled\": isDisabled,\n \"tabindex\": -1,\n \"style\": bubbleInputStyle(controlSize.value, { transform: \"translateX(-100%)\" }),\n })\n : null,\n ]),\n slots.default?.(),\n ],\n )\n\n return h(\"div\", { class: [\"flex\", props.block && \"w-full\"], ...restAttrs }, [\n descriptionId\n ? // The description stays outside the label, so it describes the radio instead of naming it\n h(\n \"div\",\n {\n \"class\": s.RadioItemGroup,\n \"data-block\": props.block ? \"\" : undefined,\n \"data-orientation\": props.orientation,\n },\n [\n label,\n h(\n \"span\",\n { \"id\": descriptionId, \"class\": s.RadioDescription, \"data-disabled\": isDisabled ? \"\" : undefined },\n description,\n ),\n ],\n )\n : label,\n ])\n }\n },\n})\n\ntype RadioGroupOwnProps = InstanceType<typeof RadioGroupComponent>[\"$props\"]\n\n/** RadioGroup props plus the attributes that fall through to the group element, as in React. */\nexport type RadioGroupProps = RadioGroupOwnProps &\n Omit<HTMLAttributes, keyof RadioGroupOwnProps> & { \"aria-label\"?: string }\n\ntype RadioGroupItemOwnProps = InstanceType<typeof RadioGroupItemComponent>[\"$props\"]\n\n/** RadioGroupItem props; `class` lands on the label, other attributes on the wrapper `<div>`. */\nexport type RadioGroupItemProps = RadioGroupItemOwnProps & Omit<HTMLAttributes, keyof RadioGroupItemOwnProps>\n\nexport const RadioGroupItem = RadioGroupItemComponent as typeof RadioGroupItemComponent & {\n new (): { $props: RadioGroupItemProps }\n}\n\n/**\n * Single-choice group of radio items. Flat export `RadioGroupItem` for\n * templates; `RadioGroup.Item` for render functions and SFCs.\n */\n// Typed explicitly so the published declaration refers to the parts instead of\n// expanding them (an expanded component type fails consumers' type checks)\nexport const RadioGroup: typeof RadioGroupComponent & { new (): { $props: RadioGroupProps } } & {\n Item: typeof RadioGroupItem\n} = Object.assign(\n RadioGroupComponent as typeof RadioGroupComponent & { new (): { $props: RadioGroupProps } },\n { Item: RadioGroupItem },\n)\n"]}
1
+ {"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../../../src/components/RadioGroup/RadioGroup.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,CAAC,EACD,MAAM,EACN,QAAQ,EACR,eAAe,EACf,SAAS,EACT,OAAO,EACP,GAAG,EACH,UAAU,EACV,K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,WAAW;yBACtC,EACD;4BACE,KAAK;4BACL,CAAC,CACC,MAAM,EACN,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC,gBAAgB,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,EAClG,WAAW,CACZ;yBACF,CACF;oBACH,CAAC,CAAC,KAAK;aACV,CAAC,CAAA;QACJ,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAaF,MAAM,CAAC,MAAM,cAAc,GAAG,uBAE7B,CAAA;AAED;;;GAGG;AACH,+EAA+E;AAC/E,2EAA2E;AAC3E,MAAM,CAAC,MAAM,UAAU,GAEnB,MAAM,CAAC,MAAM,CACf,mBAA2F,EAC3F,EAAE,IAAI,EAAE,cAAc,EAAE,CACzB,CAAA","sourcesContent":["import {\n computed,\n defineComponent,\n h,\n inject,\n nextTick,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n shallowRef,\n useId,\n watch,\n withCtx,\n type ComputedRef,\n type HTMLAttributes,\n type InjectionKey,\n type PropType,\n type Ref,\n} from \"vue\"\nimport { Presence, RovingFocusGroup, RovingFocusItem } from \"reka-ui\"\nimport { bubbleInputStyle, useIsFormControl, useSize } from \"../Checkbox/bubbleInput.js\"\nimport s from \"@plexui/styles/components/RadioGroup/RadioGroup.module.css\"\n\n// Vue port of packages/ui/src/components/RadioGroup/RadioGroup.tsx. Props,\n// defaults, rendered DOM and behaviour match React (checked by the parity\n// tests).\n//\n// React builds on Radix RadioGroup. Reka's RadioGroupItem renders different\n// markup (`aria-label` copied from the label, `required` and `name` on the\n// button, a visually hidden input only when a `name` is set), stops every\n// click and checks an arrow-focused radio a tick later. So the Radix group\n// and radio (state, button attributes, hidden form input, arrow-key\n// selection) are rendered here, and keyboard focus comes from Reka's\n// RovingFocusGroup and RovingFocusItem, the same roving tabindex Radix uses.\n\ntype Direction = \"col\" | \"row\"\n\ntype BubbleInputEffect = { input: Ref<HTMLInputElement | null>; run: () => void }\n\ntype RadioGroupContextValue = {\n disabled: ComputedRef<boolean>\n required: ComputedRef<boolean>\n name: ComputedRef<string | undefined>\n value: ComputedRef<string | null>\n setValue: (value: string) => void\n bubbleInputEffects: Set<BubbleInputEffect>\n runBubbleInputEffects: () => void\n}\n\nconst RadioGroupContextKey: InjectionKey<RadioGroupContextValue> = Symbol(\"PlexUIRadioGroup\")\n\nconst useRadioGroupContext = () => {\n const context = inject(RadioGroupContextKey, null)\n\n if (!context) {\n throw new Error(\"RadioGroup components must be wrapped in <RadioGroup />\")\n }\n\n return context\n}\n\ntype ExposedRovingFocusGroup = { getItems: () => { ref: HTMLElement }[] }\n\nconst ARROW_KEYS = [\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\"]\n\n// Radix RovingFocusGroup's focusFirst\nconst focusFirst = (candidates: HTMLElement[]) => {\n const previouslyFocused = document.activeElement\n for (const candidate of candidates) {\n if (candidate === previouslyFocused) return\n candidate.focus({ preventScroll: false })\n if (document.activeElement !== previouslyFocused) return\n }\n}\n\nconst callHandlers = (handlers: unknown, event: Event) => {\n for (const handler of Array.isArray(handlers) ? handlers : [handlers]) {\n if (typeof handler === \"function\") handler(event)\n }\n}\n\n// The caller's listeners the group element composes with Reka's\nconst GROUP_LISTENERS = [\"onMousedown\", \"onMouseup\", \"onFocus\", \"onBlur\", \"onFocusin\", \"onFocusout\"] as const\n\n// Internal: the radiogroup element rendered through Reka's RovingFocusGroup\n// (`asChild`), with Reka's group handlers wired the Radix way:\n// - Radix runs the caller's mousedown handler first and skips its own once\n// the event is default-prevented; Reka merges its own in front.\n// - Radix's group focus and blur handlers are React `onFocus` / `onBlur`,\n// which bubble from the radios: a radio's focus ends a click focus and its\n// blur ends Shift+Tab's \"tabbing back out\" (the group is tabbable again).\n// Reka listens to the group's own native focus and blur only, so its\n// handlers run on `focusin` / `focusout` here.\n// - Reka also ends a click focus on mouseup, which Radix does not.\nconst GroupElement = defineComponent({\n name: \"RadioGroupElement\",\n inheritAttrs: false,\n props: {\n listeners: { type: Object as PropType<Record<string, unknown>>, default: () => ({}) },\n },\n setup(props, { attrs, slots }) {\n return () => {\n const { onMousedown, onMouseup: _onMouseup, onFocus, onBlur, ...restAttrs } = attrs\n const caller = props.listeners\n const handlers: Record<string, (event: Event) => void> = {\n onMousedown: (event) => {\n callHandlers(caller.onMousedown, event)\n if (!event.defaultPrevented) callHandlers(onMousedown, event)\n },\n onFocusin: (event) => {\n callHandlers(caller.onFocusin, event)\n callHandlers(onFocus, event)\n },\n onFocusout: (event) => {\n callHandlers(caller.onFocusout, event)\n callHandlers(onBlur, event)\n },\n }\n for (const key of [\"onMouseup\", \"onFocus\", \"onBlur\"] as const) {\n if (caller[key]) handlers[key] = (event) => callHandlers(caller[key], event)\n }\n return h(\"div\", { ...restAttrs, ...handlers }, slots.default?.())\n }\n },\n})\n\nconst RadioGroupComponent = defineComponent({\n name: \"RadioGroup\",\n inheritAttrs: false,\n props: {\n /** Initial selected value when uncontrolled */\n defaultValue: String,\n /** Controlled selected value. Bind with `v-model:value`; leave unset for an uncontrolled group. */\n value: { type: String, default: undefined },\n /** Name submitted with the owning form */\n name: String,\n /** Determines the layout direction of the radio items. @default \"row\" */\n direction: { type: String as PropType<Direction>, default: \"row\" },\n /** Controls whether the entire radio group is disabled. @default false */\n disabled: { type: Boolean, default: false },\n /** Marks the group as required (`aria-required`). @default false */\n required: { type: Boolean, default: false },\n },\n emits: {\n /** The selected value changed (`v-model:value`) */\n \"update:value\": (_value: string) => true,\n /** Same payload as `update:value`, named after React's `onChange` */\n \"change\": (_value: string) => true,\n },\n setup(props, { attrs, slots, emit }) {\n const groupRef = ref<ExposedRovingFocusGroup | null>(null)\n\n // Radix useControllableState: controlled while `value` is set\n const uncontrolledValue = ref<string | null>(props.defaultValue ?? null)\n const value = computed(() => (props.value !== undefined ? props.value : uncontrolledValue.value))\n\n const reportChange = (nextValue: string) => {\n emit(\"update:value\", nextValue)\n emit(\"change\", nextValue)\n }\n\n const setValue = (nextValue: string) => {\n if (props.value !== undefined) {\n if (nextValue !== props.value) reportChange(nextValue)\n } else {\n uncontrolledValue.value = nextValue\n }\n }\n\n // Radix reports an uncontrolled change from the group's effect, which\n // React runs after the items' effects (the hidden inputs' clicks)\n watch(\n uncontrolledValue,\n (nextValue) => {\n void nextTick(() => {\n if (nextValue !== null) reportChange(nextValue)\n })\n },\n { flush: \"post\" },\n )\n\n // React runs the items' hidden-input effects in tree order; Vue's post\n // watchers run in the order they were triggered, so the first item's\n // watcher runs them all here, in document order (each is a no-op when\n // nothing changed for it)\n const bubbleInputEffects = new Set<BubbleInputEffect>()\n const runBubbleInputEffects = () => {\n const effects = [...bubbleInputEffects].sort((a, b) => {\n const first = a.input.value\n const second = b.input.value\n if (!first || !second) return 0\n return first.compareDocumentPosition(second) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1\n })\n for (const effect of effects) effect.run()\n }\n\n provide(RadioGroupContextKey, {\n disabled: computed(() => props.disabled),\n required: computed(() => props.required),\n name: computed(() => props.name),\n value,\n setValue,\n bubbleInputEffects,\n runBubbleInputEffects,\n })\n\n // Radix: a reset of the group's form sets the value it first rendered\n const initialValue = value.value\n onMounted(() => {\n const element = (groupRef.value as { $el?: unknown } | null)?.$el\n const form = element instanceof Element ? element.closest(\"form\") : null\n if (!form) return\n const reset = () => {\n if (initialValue !== null) setValue(initialValue)\n }\n form.addEventListener(\"reset\", reset)\n onBeforeUnmount(() => form.removeEventListener(\"reset\", reset))\n })\n\n // Radix moves focus into the group onto the checked radio, then the last\n // focused one, then the first. Reka looks for a `data-active` attribute\n // that Radix does not render, so its entry focus is replaced here.\n const handleEntryFocus = (event: Event) => {\n event.preventDefault()\n const items = (groupRef.value?.getItems() ?? [])\n .map((item) => item.ref)\n .filter((item) => !item.hasAttribute(\"data-disabled\"))\n const activeItem = items.find((item) => item.getAttribute(\"data-state\") === \"checked\")\n const currentItem = items.find((item) => item.getAttribute(\"tabindex\") === \"0\")\n focusFirst([activeItem, currentItem, ...items].filter((item): item is HTMLElement => !!item))\n }\n\n return () => {\n const { class: className, dir, ...otherAttrs } = attrs\n const listeners: Record<string, unknown> = {}\n const restAttrs: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(otherAttrs)) {\n if ((GROUP_LISTENERS as readonly string[]).includes(key)) listeners[key] = value\n else restAttrs[key] = value\n }\n\n return h(\n RovingFocusGroup,\n {\n ref: groupRef,\n asChild: true,\n loop: true,\n dir: dir as \"ltr\" | \"rtl\" | undefined,\n onEntryFocus: handleEntryFocus,\n },\n {\n default: () =>\n h(\n GroupElement,\n {\n // `dir`, `tabindex` and `style=\"outline: none\"` come from RovingFocusGroup, like Radix\n \"listeners\": listeners,\n \"role\": \"radiogroup\",\n \"aria-required\": props.required,\n \"data-disabled\": props.disabled ? \"\" : undefined,\n \"class\": [s.RadioGroup, className],\n \"data-direction\": props.direction,\n ...restAttrs,\n },\n { default: () => slots.default?.() },\n ),\n },\n )\n }\n },\n})\n\n// React's value tracker per hidden input: its `checked` on mount, then the\n// one React last saw in a click that reached its root (also when a handler\n// stopped it from bubbling further). The native setter Radix uses bypasses it.\nconst trackedChecked = new WeakMap<HTMLInputElement, boolean>()\n\nconst useCheckedTracker = (input: Ref<HTMLInputElement | null>) =>\n watch(\n input,\n (el) => {\n if (!el || trackedChecked.has(el)) return\n // React creates the input by setting its `checked` property, so later\n // changes of the `checked` attribute never move its checkedness\n el.checked = el.checked\n trackedChecked.set(el, el.checked)\n },\n { flush: \"sync\" },\n )\n\n/**\n * Radix's RadioBubbleInput effect: sets the hidden radio's `checked` through\n * the native setter (unless `checked` is undefined) and dispatches a bubbling\n * `click`, which the input stops when `stop` is set, so form listeners see\n * the user's radio only. React turns that click into the form's `onChange`\n * when the input's `checked` differs from its value tracker, then refreshes\n * the trackers of the other radios with the same name in the same form;\n * Vue's form listeners are native, so a native `change` follows in those\n * cases.\n */\nconst dispatchBubbleClick = (input: HTMLInputElement, checked: boolean | undefined, stop: boolean) => {\n const setChecked = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, \"checked\")?.set\n if (!setChecked) return\n if (checked !== undefined) setChecked.call(input, checked)\n const click = new Event(\"click\", { bubbles: true })\n if (stop) input.addEventListener(\"click\", (event) => event.stopPropagation(), { once: true })\n input.dispatchEvent(click)\n if (trackedChecked.get(input) === input.checked) return\n trackedChecked.set(input, input.checked)\n input.dispatchEvent(new Event(\"change\", { bubbles: true }))\n\n const name = input.getAttribute(\"name\")\n if (name === null) return\n for (const other of Array.from(input.ownerDocument.querySelectorAll<HTMLInputElement>('input[type=\"radio\"]'))) {\n if (other !== input && other.getAttribute(\"name\") === name && other.form === input.form && trackedChecked.has(other)) {\n trackedChecked.set(other, other.checked)\n }\n }\n}\n\nconst RadioGroupItemComponent = defineComponent({\n name: \"RadioGroupItem\",\n inheritAttrs: false,\n props: {\n /** Value of this option */\n value: { type: String, required: true },\n /** Determines if a given radio item is disabled. @default false */\n disabled: { type: Boolean, default: false },\n /** Sets `required` on this item's radio button (the hidden form input follows the group's) */\n required: { type: Boolean, default: undefined },\n /** Stretches the item to fill the available width. @default false */\n block: { type: Boolean, default: false },\n /** The orientation of the radio indicator relative to the label. @default \"left\" */\n orientation: { type: String as PropType<\"left\" | \"right\">, default: \"left\" },\n /** Optional second line below the option's label, linked via `aria-describedby` (or the `description` slot) */\n description: String,\n },\n setup(props, { attrs, slots }) {\n const context = useRadioGroupContext()\n const id = useId()\n const wrapper = ref<HTMLDivElement | null>(null)\n const button = ref<HTMLButtonElement | null>(null)\n const bubbleInput = ref<HTMLInputElement | null>(null)\n\n const disabled = computed(() => context.disabled.value || props.disabled)\n const checked = computed(() => context.value.value === props.value)\n\n // Radix's Radio: the hidden input renders until the button mounts, then only inside a form\n const isFormControl = useIsFormControl(button, () => undefined)\n const controlSize = useSize(() => (isFormControl.value ? button.value : null))\n useCheckedTracker(bubbleInput)\n\n // Radix RadioGroupItem: an arrow key that moves focus onto a radio checks it\n let isArrowKeyPressed = false\n const handleDocumentKeyDown = (event: KeyboardEvent) => {\n if (ARROW_KEYS.includes(event.key)) isArrowKeyPressed = true\n }\n const handleDocumentKeyUp = () => {\n isArrowKeyPressed = false\n }\n\n onMounted(() => {\n button.value = (wrapper.value?.firstElementChild as HTMLButtonElement | null) ?? null\n document.addEventListener(\"keydown\", handleDocumentKeyDown)\n document.addEventListener(\"keyup\", handleDocumentKeyUp)\n })\n\n onBeforeUnmount(() => {\n document.removeEventListener(\"keydown\", handleDocumentKeyDown)\n document.removeEventListener(\"keyup\", handleDocumentKeyUp)\n })\n\n // Radix's RadioBubbleInput effect: the radio the user clicked reports its\n // click (also when the value did not change); a radio whose `checked`\n // changed otherwise reports it with a click that stops at the input\n type UserClick = { hasConsumerStoppedPropagation: boolean }\n const userClick = shallowRef<UserClick | null>(null)\n let prevChecked = checked.value\n let handledUserClick: UserClick | null = null\n const bubbleInputEffect: BubbleInputEffect = {\n input: bubbleInput,\n run: () => {\n const input = bubbleInput.value\n if (!input) return\n const isChecked = checked.value\n const checkedChanged = prevChecked !== isChecked\n prevChecked = isChecked\n const isNewUserClick = userClick.value !== null && userClick.value !== handledUserClick\n handledUserClick = userClick.value\n if (isNewUserClick) dispatchBubbleClick(input, checkedChanged ? isChecked : undefined, false)\n else if (checkedChanged) dispatchBubbleClick(input, isChecked, true)\n },\n }\n context.bubbleInputEffects.add(bubbleInputEffect)\n onBeforeUnmount(() => context.bubbleInputEffects.delete(bubbleInputEffect))\n watch([bubbleInput, checked, userClick], context.runBubbleInputEffects, { flush: \"post\" })\n\n // Radix's RadioBubbleInput renders `defaultChecked` from its first render\n let defaultChecked: boolean | undefined\n\n const handleClick = (event: MouseEvent) => {\n // React does not dispatch mouse handlers on a disabled button\n if (disabled.value) return\n if (!checked.value) {\n // Plex passes no click handler a consumer could stop\n userClick.value = { hasConsumerStoppedPropagation: false }\n context.setValue(props.value)\n }\n // In a form, the button's click stops here; the hidden input's click\n // bubbles instead (Plex passes no click handler a consumer could stop)\n if (isFormControl.value) event.stopPropagation()\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n // According to WAI ARIA, radio groups don't activate items on enter keypress\n if (event.key === \"Enter\") event.preventDefault()\n }\n\n const handleFocus = (event: FocusEvent) => {\n // Roving focus moved here with an arrow key: check this radio by clicking it\n if (isArrowKeyPressed) (event.currentTarget as HTMLButtonElement).click()\n }\n\n // Prevents text selection when double-clicking the label\n const handleLabelMouseDown = (event: MouseEvent) => {\n if (!event.defaultPrevented && event.detail > 1) event.preventDefault()\n }\n\n return () => {\n const {\n \"class\": className,\n // These name the radio itself: a `Field` around the item labels it through them\n \"id\": idAttr,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n ...restAttrs\n } = attrs\n const isChecked = checked.value\n const isDisabled = disabled.value\n const state = isChecked ? \"checked\" : \"unchecked\"\n const itemId = (idAttr as string | undefined) ?? `${props.value}-${id}`\n if (isFormControl.value) defaultChecked ??= isChecked\n else defaultChecked = undefined\n\n // Providing an extra wrapper enables `label` to be inline-flex, avoiding clickable whitespace\n // when radio options are of varied lengths.\n // NOTE: Important that this is `flex` to prevent the `inline-flex` label from extra, unintentional whitespace.\n const description = slots.description ? slots.description() : props.description\n const descriptionId = slots.description || props.description ? `${itemId}-description` : undefined\n const label = h(\n \"label\",\n {\n \"for\": itemId,\n \"class\": [s.RadioLabel, className],\n \"data-disabled\": isDisabled ? \"\" : undefined,\n \"data-block\": props.block ? \"\" : undefined,\n \"data-orientation\": props.orientation,\n \"onMousedown\": handleLabelMouseDown,\n },\n [\n h(\"div\", { class: s.RadioIndicatorWrapper, ref: wrapper }, [\n h(\n RovingFocusItem,\n { asChild: true, focusable: !isDisabled, active: isChecked },\n {\n default: () =>\n h(\n \"button\",\n {\n \"type\": \"button\",\n \"role\": \"radio\",\n \"aria-checked\": isChecked,\n \"data-state\": state,\n \"data-disabled\": isDisabled ? \"\" : undefined,\n \"disabled\": isDisabled,\n \"value\": props.value,\n // radix-ui 1.8: the item's own `required` lands on its button\n \"required\": props.required ? \"\" : undefined,\n \"id\": itemId,\n \"class\": s.RadioItem,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": [descriptionId, ariaDescribedBy].filter(Boolean).join(\" \") || undefined,\n // Reka's RovingFocusItem marks the active item; Radix does not\n \"data-active\": undefined,\n \"onClick\": handleClick,\n \"onKeydown\": handleKeyDown,\n \"onFocus\": handleFocus,\n },\n [\n h(\n Presence,\n { present: isChecked },\n {\n // Presence calls its slot once during setup; withCtx marks it\n // as a render slot so Vue does not warn about that call\n default: withCtx(() => [\n h(\"span\", {\n \"data-state\": state,\n \"data-disabled\": isDisabled ? \"\" : undefined,\n \"class\": s.RadioIndicator,\n }),\n ]),\n },\n ),\n ],\n ),\n },\n ),\n isFormControl.value\n ? h(\"input\", {\n \"ref\": bubbleInput,\n \"type\": \"radio\",\n \"aria-hidden\": \"true\",\n // React's `defaultChecked`, from the input's first render\n \"^checked\": defaultChecked ? \"\" : undefined,\n \"name\": context.name.value,\n \"^value\": props.value,\n // radix-ui 1.8: the group's `required` reaches every input\n \"required\": context.required.value,\n \"disabled\": isDisabled,\n \"tabindex\": -1,\n \"style\": bubbleInputStyle(controlSize.value, { transform: \"translateX(-100%)\" }),\n })\n : null,\n ]),\n slots.default?.(),\n ],\n )\n\n return h(\"div\", { class: [\"flex\", props.block && \"w-full\"], ...restAttrs }, [\n descriptionId\n ? // The description stays outside the label, so it describes the radio instead of naming it\n h(\n \"div\",\n {\n \"class\": s.RadioItemGroup,\n \"data-block\": props.block ? \"\" : undefined,\n \"data-orientation\": props.orientation,\n },\n [\n label,\n h(\n \"span\",\n { \"id\": descriptionId, \"class\": s.RadioDescription, \"data-disabled\": isDisabled ? \"\" : undefined },\n description,\n ),\n ],\n )\n : label,\n ])\n }\n },\n})\n\ntype RadioGroupOwnProps = InstanceType<typeof RadioGroupComponent>[\"$props\"]\n\n/** RadioGroup props plus the attributes that fall through to the group element, as in React. */\nexport type RadioGroupProps = RadioGroupOwnProps &\n Omit<HTMLAttributes, keyof RadioGroupOwnProps> & { \"aria-label\"?: string }\n\ntype RadioGroupItemOwnProps = InstanceType<typeof RadioGroupItemComponent>[\"$props\"]\n\n/** RadioGroupItem props; `class` lands on the label, other attributes on the wrapper `<div>`. */\nexport type RadioGroupItemProps = RadioGroupItemOwnProps & Omit<HTMLAttributes, keyof RadioGroupItemOwnProps>\n\nexport const RadioGroupItem = RadioGroupItemComponent as typeof RadioGroupItemComponent & {\n new (): { $props: RadioGroupItemProps }\n}\n\n/**\n * Single-choice group of radio items. Flat export `RadioGroupItem` for\n * templates; `RadioGroup.Item` for render functions and SFCs.\n */\n// Typed explicitly so the published declaration refers to the parts instead of\n// expanding them (an expanded component type fails consumers' type checks)\nexport const RadioGroup: typeof RadioGroupComponent & { new (): { $props: RadioGroupProps } } & {\n Item: typeof RadioGroupItem\n} = Object.assign(\n RadioGroupComponent as typeof RadioGroupComponent & { new (): { $props: RadioGroupProps } },\n { Item: RadioGroupItem },\n)\n"]}
@@ -0,0 +1,90 @@
1
+ import clsx, {} from "clsx";
2
+ import { defineComponent, h, nextTick, } from "vue";
3
+ import { moveItem, sortableKeyDown, sortablePointerDown } from "../../lib/sortable.js";
4
+ import { GripVertical } from "../Icon/index.js";
5
+ import s from "@plexui/styles/components/Sortable/Sortable.module.css";
6
+ // Vue port of packages/ui/src/components/Sortable/Sortable.tsx.
7
+ //
8
+ // - `value` binds with `v-model:value`; `change` fires with it.
9
+ // - React's `Sortable.Handle` is the flat `SortableHandle` here.
10
+ // - Attributes reach the rendered element, as React's rest props do.
11
+ const preventNativeDrag = (event) => event.preventDefault();
12
+ const SortableComponent = defineComponent({
13
+ name: "Sortable",
14
+ inheritAttrs: false,
15
+ props: {
16
+ /** The list, in the order of the children. Bind with `v-model:value`. */
17
+ value: { type: Array, required: true },
18
+ /** `list` for rows one under another, `grid` for items that stand side by side. @default "list" */
19
+ layout: { type: String, default: "list" },
20
+ /** Element to render, such as `TableBody` for table rows. @default "div" */
21
+ as: { type: [String, Object], default: "div" },
22
+ /** Turns dragging off. @default false */
23
+ disabled: { type: Boolean, default: false },
24
+ /** Shows the grips of `SortableHandle`. A hidden grip still takes the keyboard, and the item drags from anywhere but a control. @default true in a table, otherwise false */
25
+ handles: { type: Boolean, default: undefined },
26
+ },
27
+ emits: {
28
+ "update:value": (_value) => true,
29
+ "change": (_value) => true,
30
+ },
31
+ slots: Object,
32
+ setup(props, { attrs, emit, slots }) {
33
+ const commit = async (from, to) => {
34
+ const next = moveItem(props.value, from, to);
35
+ emit("update:value", next);
36
+ emit("change", next);
37
+ await nextTick();
38
+ };
39
+ const onPointerdown = (event) => {
40
+ if (!props.disabled) {
41
+ sortablePointerDown(event, event.currentTarget, props.layout, commit);
42
+ }
43
+ };
44
+ const onKeydown = (event) => {
45
+ if (!props.disabled)
46
+ void sortableKeyDown(event, event.currentTarget, commit);
47
+ };
48
+ return () => {
49
+ const { class: className, ...rest } = attrs;
50
+ const isElement = typeof props.as === "string";
51
+ return h(props.as, {
52
+ ...rest,
53
+ "class": clsx(s.Sortable, className),
54
+ "data-sortable": "",
55
+ "data-layout": props.layout,
56
+ "data-disabled": props.disabled ? "" : undefined,
57
+ "data-handles": props.handles?.toString(),
58
+ onPointerdown,
59
+ onKeydown,
60
+ "onDragstart": preventNativeDrag,
61
+ }, isElement ? slots.default?.() : { default: () => slots.default?.() });
62
+ };
63
+ },
64
+ });
65
+ const SortableHandleComponent = defineComponent({
66
+ name: "SortableHandle",
67
+ inheritAttrs: false,
68
+ props: {
69
+ /** Name of the handle for assistive technology. @default "Reorder" */
70
+ ariaLabel: { type: String, default: "Reorder" },
71
+ },
72
+ slots: Object,
73
+ setup(props, { attrs, slots }) {
74
+ return () => {
75
+ const { class: className, ...rest } = attrs;
76
+ return h("button", {
77
+ ...rest,
78
+ "type": "button",
79
+ "class": clsx(s.Handle, className),
80
+ "data-sortable-handle": "",
81
+ "aria-label": props.ariaLabel,
82
+ }, (slots.default ? slots.default() : [h(GripVertical, { "aria-hidden": true })]));
83
+ };
84
+ },
85
+ });
86
+ /** Reorders its direct children by dragging, from anywhere but a control, or by a `SortableHandle` where grips are shown. */
87
+ export const Sortable = SortableComponent;
88
+ /** The grip of an item. Arrow keys move the item while the handle has focus. */
89
+ export const SortableHandle = SortableHandleComponent;
90
+ //# sourceMappingURL=Sortable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sortable.js","sourceRoot":"","sources":["../../../../src/components/Sortable/Sortable.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAmB,MAAM,MAAM,CAAA;AAC5C,OAAO,EACL,eAAe,EACf,CAAC,EACD,QAAQ,GAMT,MAAM,KAAK,CAAA;AACZ,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,mBAAmB,EAAuB,MAAM,uBAAuB,CAAA;AAC3G,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,CAAC,MAAM,wDAAwD,CAAA;AAEtE,gEAAgE;AAChE,EAAE;AACF,gEAAgE;AAChE,iEAAiE;AACjE,qEAAqE;AAErE,MAAM,iBAAiB,GAAG,CAAC,KAAY,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,CAAA;AAElE,MAAM,iBAAiB,GAAG,eAAe,CAAC;IACxC,IAAI,EAAE,UAAU;IAChB,YAAY,EAAE,KAAK;IACnB,KAAK,EAAE;QACL,yEAAyE;QACzE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAqC,EAAE,QAAQ,EAAE,IAAI,EAAE;QACtE,mGAAmG;QACnG,MAAM,EAAE,EAAE,IAAI,EAAE,MAAkC,EAAE,OAAO,EAAE,MAAM,EAAE;QACrE,4EAA4E;QAC5E,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAiC,EAAE,OAAO,EAAE,KAAK,EAAE;QAC9E,yCAAyC;QACzC,QAAQ,EAAE,EA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,SAAS;aAC9B,EACD,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,CAAuB,CACrG,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAEF,6HAA6H;AAC7H,MAAM,CAAC,MAAM,QAAQ,GAAG,iBAAiB,CAAA;AACzC,gFAAgF;AAChF,MAAM,CAAC,MAAM,cAAc,GAAG,uBAAuB,CAAA","sourcesContent":["import clsx, { type ClassValue } from \"clsx\"\nimport {\n defineComponent,\n h,\n nextTick,\n type Component,\n type PropType,\n type SlotsType,\n type VNodeArrayChildren,\n type VNodeChild,\n} from \"vue\"\nimport { moveItem, sortableKeyDown, sortablePointerDown, type SortableLayout } from \"../../lib/sortable.js\"\nimport { GripVertical } from \"../Icon/index.js\"\nimport s from \"@plexui/styles/components/Sortable/Sortable.module.css\"\n\n// Vue port of packages/ui/src/components/Sortable/Sortable.tsx.\n//\n// - `value` binds with `v-model:value`; `change` fires with it.\n// - React's `Sortable.Handle` is the flat `SortableHandle` here.\n// - Attributes reach the rendered element, as React's rest props do.\n\nconst preventNativeDrag = (event: Event) => event.preventDefault()\n\nconst SortableComponent = defineComponent({\n name: \"Sortable\",\n inheritAttrs: false,\n props: {\n /** The list, in the order of the children. Bind with `v-model:value`. */\n value: { type: Array as PropType<readonly unknown[]>, required: true },\n /** `list` for rows one under another, `grid` for items that stand side by side. @default \"list\" */\n layout: { type: String as PropType<SortableLayout>, default: \"list\" },\n /** Element to render, such as `TableBody` for table rows. @default \"div\" */\n as: { type: [String, Object] as PropType<string | Component>, default: \"div\" },\n /** Turns dragging off. @default false */\n disabled: { type: Boolean, default: false },\n /** Shows the grips of `SortableHandle`. A hidden grip still takes the keyboard, and the item drags from anywhere but a control. @default true in a table, otherwise false */\n handles: { type: Boolean, default: undefined },\n },\n emits: {\n \"update:value\": (_value: unknown[]) => true,\n \"change\": (_value: unknown[]) => true,\n },\n slots: Object as SlotsType<{\n /** The items, one direct child per entry of `value`, keyed by the entry and not by its index */\n default?: () => VNodeChild\n }>,\n setup(props, { attrs, emit, slots }) {\n const commit = async (from: number, to: number) => {\n const next = moveItem(props.value, from, to)\n emit(\"update:value\", next)\n emit(\"change\", next)\n await nextTick()\n }\n\n const onPointerdown = (event: PointerEvent) => {\n if (!props.disabled) {\n sortablePointerDown(event, event.currentTarget as HTMLElement, props.layout, commit)\n }\n }\n\n const onKeydown = (event: KeyboardEvent) => {\n if (!props.disabled) void sortableKeyDown(event, event.currentTarget as HTMLElement, commit)\n }\n\n return () => {\n const { class: className, ...rest } = attrs\n const isElement = typeof props.as === \"string\"\n return h(\n props.as as string,\n {\n ...rest,\n \"class\": clsx(s.Sortable, className as ClassValue),\n \"data-sortable\": \"\",\n \"data-layout\": props.layout,\n \"data-disabled\": props.disabled ? \"\" : undefined,\n \"data-handles\": props.handles?.toString(),\n onPointerdown,\n onKeydown,\n \"onDragstart\": preventNativeDrag,\n },\n isElement ? (slots.default?.() as VNodeArrayChildren) : { default: () => slots.default?.() },\n )\n }\n },\n})\n\nconst SortableHandleComponent = defineComponent({\n name: \"SortableHandle\",\n inheritAttrs: false,\n props: {\n /** Name of the handle for assistive technology. @default \"Reorder\" */\n ariaLabel: { type: String, default: \"Reorder\" },\n },\n slots: Object as SlotsType<{\n /** The grip */\n default?: () => VNodeChild\n }>,\n setup(props, { attrs, slots }) {\n return () => {\n const { class: className, ...rest } = attrs\n return h(\n \"button\",\n {\n ...rest,\n \"type\": \"button\",\n \"class\": clsx(s.Handle, className as ClassValue),\n \"data-sortable-handle\": \"\",\n \"aria-label\": props.ariaLabel,\n },\n (slots.default ? slots.default() : [h(GripVertical, { \"aria-hidden\": true })]) as VNodeArrayChildren,\n )\n }\n },\n})\n\n/** Reorders its direct children by dragging, from anywhere but a control, or by a `SortableHandle` where grips are shown. */\nexport const Sortable = SortableComponent\n/** The grip of an item. Arrow keys move the item while the handle has focus. */\nexport const SortableHandle = SortableHandleComponent\nexport type { SortableLayout }\n"]}
@@ -0,0 +1,2 @@
1
+ export { Sortable, SortableHandle } from "./Sortable.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Sortable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAuB,MAAM,eAAe,CAAA","sourcesContent":["export { Sortable, SortableHandle, type SortableLayout } from \"./Sortable.js\"\n"]}
@@ -272,16 +272,17 @@ const TabsComponent = defineComponent({
272
272
  });
273
273
  });
274
274
  }
275
+ else if (thumb.style.transition) {
276
+ // Normal update (value change, etc.): the thumb leaves with the label's colour
277
+ applyThumbSizing(isVertical, true);
278
+ }
275
279
  else {
276
- // Normal update (value change, etc.)
280
+ // First measure: apply transition after initial calculation is set
277
281
  waitForAnimationFrame(() => {
278
- applyThumbSizing(isVertical, !!thumb.style.transition);
279
- // Apply transition after initial calculation is set
280
- if (!thumb.style.transition) {
281
- waitForAnimationFrame(() => {
282
- thumb.style.transition = transitionProperty;
283
- });
284
- }
282
+ applyThumbSizing(isVertical, false);
283
+ waitForAnimationFrame(() => {
284
+ thumb.style.transition = transitionProperty;
285
+ });
285
286
  });
286
287
  }
287
288
  };