@traefik-labs/faency 13.8.0 → 13.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/Accordion.vanilla.cjs +86 -0
- package/dist/components/Accordion/Accordion.vanilla.cjs.map +1 -0
- package/dist/components/Accordion/Accordion.vanilla.css.cjs +59 -0
- package/dist/components/Accordion/Accordion.vanilla.css.cjs.map +1 -0
- package/dist/components/Accordion/Accordion.vanilla.css.js +51 -0
- package/dist/components/Accordion/Accordion.vanilla.css.js.map +1 -0
- package/dist/components/Accordion/Accordion.vanilla.js +79 -0
- package/dist/components/Accordion/Accordion.vanilla.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.vanilla.cjs +49 -0
- package/dist/components/Checkbox/Checkbox.vanilla.cjs.map +1 -0
- package/dist/components/Checkbox/Checkbox.vanilla.css.cjs +21 -0
- package/dist/components/Checkbox/Checkbox.vanilla.css.cjs.map +1 -0
- package/dist/components/Checkbox/Checkbox.vanilla.css.js +18 -0
- package/dist/components/Checkbox/Checkbox.vanilla.css.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.vanilla.js +46 -0
- package/dist/components/Checkbox/Checkbox.vanilla.js.map +1 -0
- package/dist/components/Field/FieldContext.cjs +1 -1
- package/dist/components/Field/FieldContext.cjs.map +1 -1
- package/dist/components/Field/FieldContext.js +1 -1
- package/dist/components/Field/FieldContext.js.map +1 -1
- package/dist/components/Radio/Radio.vanilla.cjs +50 -0
- package/dist/components/Radio/Radio.vanilla.cjs.map +1 -0
- package/dist/components/Radio/Radio.vanilla.css.cjs +19 -0
- package/dist/components/Radio/Radio.vanilla.css.cjs.map +1 -0
- package/dist/components/Radio/Radio.vanilla.css.js +17 -0
- package/dist/components/Radio/Radio.vanilla.css.js.map +1 -0
- package/dist/components/Radio/Radio.vanilla.js +46 -0
- package/dist/components/Radio/Radio.vanilla.js.map +1 -0
- package/dist/components/RadioAccordion/RadioAccordion.vanilla.cjs +44 -0
- package/dist/components/RadioAccordion/RadioAccordion.vanilla.cjs.map +1 -0
- package/dist/components/RadioAccordion/RadioAccordion.vanilla.css.cjs +11 -0
- package/dist/components/RadioAccordion/RadioAccordion.vanilla.css.cjs.map +1 -0
- package/dist/components/RadioAccordion/RadioAccordion.vanilla.css.js +9 -0
- package/dist/components/RadioAccordion/RadioAccordion.vanilla.css.js.map +1 -0
- package/dist/components/RadioAccordion/RadioAccordion.vanilla.js +39 -0
- package/dist/components/RadioAccordion/RadioAccordion.vanilla.js.map +1 -0
- package/dist/faency.css +2654 -1977
- package/dist/index.cjs +15 -0
- package/dist/index.d.cts +188 -1
- package/dist/index.d.ts +188 -1
- package/dist/index.js +5 -1
- package/dist/styles/tokens.css.cjs +114 -90
- package/dist/styles/tokens.css.js +114 -90
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldContext.js","names":[],"sources":["../../../components/Field/FieldContext.ts"],"sourcesContent":["import React from 'react';\n\nimport { warnOnce } from '../../utils/warnOnce';\n\ntype MessageSize = '0' | '1' | '2' | '3';\n\ntype FieldControlState = { id?: string; disabled: boolean; invalid: boolean; labelable: boolean };\n\nexport type FieldContextValue = {\n controlId?: string;\n labelId?: string;\n descriptionId?: string;\n errorId?: string;\n hintId?: string;\n messageSize: MessageSize;\n invalid: boolean;\n disabled: boolean;\n registerControl: (key: string, state: FieldControlState | null) => void;\n};\n\nexport const FieldContext = React.createContext<FieldContextValue | null>(null);\n\nexport const useFieldContext = () => React.useContext(FieldContext);\n\nexport type FieldControlOptions = {\n id?: string;\n invalid?: boolean;\n disabled?: boolean;\n 'aria-describedby'?: string;\n 'aria-invalid'?: React.AriaAttributes['aria-invalid'];\n /** Set to false when the control is not a labelable element, such as a radio group. */\n labelable?: boolean;\n};\n\nexport type FieldLabelVariant = 'invalid' | 'subtle' | 'contrast' | 'default';\n\nexport type FieldLabelProps = {\n variant: FieldLabelVariant;\n htmlFor?: string;\n id: string;\n};\n\nexport type FieldBaseProps = {\n id?: string;\n label?: React.ReactNode | ((props: FieldLabelProps) => React.ReactNode);\n /** Text under the label, for what the field is for. */\n hint?: React.ReactNode;\n description?: React.ReactNode;\n error?: React.ReactNode;\n invalid?: boolean;\n disabled?: boolean;\n announceError?: boolean;\n /** `start` puts the label and the hint in a column before the control, and wraps under it when space is short. */\n labelPosition?: 'top' | 'start' | 'end';\n /** The text size of the hint, the description and the error. A Field inside another Field takes its size. */\n messageSize?: MessageSize;\n /**\n * For a field of more than one control: the field becomes a group named by the label and described by\n * the hint, the description and the error. Give each control its own name, and its own error with an inner Field.\n */\n group?: boolean;\n children?: React.ReactNode;\n};\n\nconst hasContent = (node: React.ReactNode) =>\n node !== undefined && node !== null && node !== false && node !== '';\n\nconst noop = () => {};\n\nconst MULTIPLE_CONTROLS_WARNING =\n 'Field: more than one control is in this Field, and its label points to one of them only. Use group, or one Field per control.';\n\nexport const useFieldRoot = ({\n id,\n label,\n hint,\n description,\n error,\n invalid,\n disabled,\n messageSize,\n group = false,\n}: FieldBaseProps) => {\n const outerContext = useFieldContext();\n const generatedId = React.useId();\n const hasLabel = typeof label === 'function' || hasContent(label);\n const hasHint = hasContent(hint);\n const resolvedMessageSize = messageSize ?? outerContext?.messageSize ?? '0';\n const hasDescription = hasContent(description);\n const hasError = hasContent(error);\n const isInvalid = Boolean(invalid) || hasError;\n const isDisabled = Boolean(disabled) || Boolean(outerContext?.disabled);\n\n const [control, setControl] = React.useState<FieldControlState | null>(null);\n const controlsRef = React.useRef(new Map<string, FieldControlState>());\n const registerControl = React.useCallback((key: string, state: FieldControlState | null) => {\n const controls = controlsRef.current;\n if (state) {\n controls.set(key, state);\n } else {\n controls.delete(key);\n }\n if (controls.size > 1) {\n warnOnce(MULTIPLE_CONTROLS_WARNING);\n }\n const next = controls.values().next().value ?? null;\n setControl((prev) =>\n prev?.id === next?.id &&\n prev?.disabled === next?.disabled &&\n prev?.invalid === next?.invalid &&\n prev?.labelable === next?.labelable\n ? prev\n : next,\n );\n }, []);\n const controlId = control?.id ?? id ?? (hasLabel ? `${generatedId}-control` : undefined);\n // The label points to a control only once one is there, so it never points to a missing id.\n const labelFor = group\n ? undefined\n : control\n ? control.labelable === false\n ? undefined\n : controlId\n : id;\n\n const [hasFocus, setHasFocus] = React.useState(false);\n const onFocus = React.useCallback(() => setHasFocus(true), []);\n const onBlur = React.useCallback(() => setHasFocus(false), []);\n\n const labelVariant: FieldLabelVariant = React.useMemo(() => {\n if (isDisabled || control?.disabled) {\n return 'subtle';\n }\n if (isInvalid || control?.invalid) {\n return 'invalid';\n }\n if (hasFocus) {\n return 'contrast';\n }\n return 'default';\n }, [isDisabled, isInvalid, hasFocus, control?.disabled, control?.invalid]);\n\n const ownContext: FieldContextValue = React.useMemo(\n () => ({\n controlId,\n labelId: hasLabel ? `${generatedId}-label` : undefined,\n descriptionId: hasDescription ? `${generatedId}-description` : undefined,\n errorId: hasError ? `${generatedId}-error` : undefined,\n hintId: hasHint ? `${generatedId}-hint` : undefined,\n messageSize: resolvedMessageSize,\n invalid: isInvalid,\n disabled: isDisabled,\n registerControl,\n }),\n [\n controlId,\n generatedId,\n hasLabel,\n hasDescription,\n hasError,\n hasHint,\n resolvedMessageSize,\n isInvalid,\n isDisabled,\n registerControl,\n ],\n );\n\n // The controls of a group get only its disabled state: the group itself carries the name and the messages.\n const groupContext: FieldContextValue = React.useMemo(\n () => ({\n messageSize: resolvedMessageSize,\n invalid: false,\n disabled: isDisabled,\n registerControl: noop,\n }),\n [resolvedMessageSize, isDisabled],\n );\n\n const groupProps = group\n ? {\n role: 'group',\n 'aria-labelledby': ownContext.labelId,\n 'aria-describedby':\n [ownContext.errorId, ownContext.descriptionId, ownContext.hintId]\n .filter(Boolean)\n .join(' ') || undefined,\n }\n : {};\n\n // A Field with no label, hint, description or error inside another Field keeps the outer one.\n const context = group\n ? groupContext\n : outerContext && !hasLabel && !hasHint && !hasDescription && !hasError\n ? outerContext\n : ownContext;\n\n return {\n context,\n ids: ownContext,\n groupProps,\n messageSize: resolvedMessageSize,\n labelFor,\n labelVariant,\n hasLabel,\n hasHint,\n hasDescription,\n hasError,\n onFocus,\n onBlur,\n };\n};\n\n/**\n * Gives a form control the id, `aria-describedby`, `aria-invalid` and `disabled` of the `Field` around it,\n * and gives its own id, `disabled` and invalid state to that `Field`.\n * Outside a `Field`, it only sets `aria-invalid` from `invalid`.\n */\nexport const useFieldControl = ({\n id,\n invalid,\n disabled,\n 'aria-describedby': describedBy,\n 'aria-invalid': ariaInvalid,\n labelable = true,\n}: FieldControlOptions) => {\n const field = useFieldContext();\n const registrationId = React.useId();\n const ownInvalid = Boolean(invalid || ariaInvalid === true || ariaInvalid === 'true');\n const isInvalid = ownInvalid || Boolean(field?.invalid);\n const registerControl = field?.registerControl;\n\n React.useEffect(() => {\n if (!registerControl) {\n return undefined;\n }\n registerControl(registrationId, {\n id,\n disabled: Boolean(disabled),\n invalid: ownInvalid,\n labelable,\n });\n return () => registerControl(registrationId, null);\n }, [registerControl, registrationId, id, disabled, ownInvalid, labelable]);\n const describedByIds =\n [field?.errorId, field?.descriptionId, field?.hintId, describedBy].filter(Boolean).join(' ') ||\n undefined;\n\n return {\n id: id ?? field?.controlId,\n labelId: field?.labelId,\n invalid: isInvalid,\n disabled: disabled || field?.disabled || undefined,\n 'aria-describedby': describedByIds,\n 'aria-invalid': isInvalid ? true : ariaInvalid,\n };\n};\n\nconst ANNOUNCE_DELAY = 1000;\n\n/**\n * Returns the text of the error, after the text of the label when there is one, once it has not\n * changed for a short time, so that a screen reader reads it after the echo of the typed text.\n */\nexport const useAnnouncedError = (enabled: boolean, errorId?: string, labelId?: string) => {\n const [announcedError, setAnnouncedError] = React.useState<string | null>(null);\n const lastTextRef = React.useRef<string | null | undefined>(undefined);\n const timeoutRef = React.useRef<ReturnType<typeof setTimeout>>();\n\n // Compares the rendered text, so that a new JSX error with the same text does not restart the delay.\n React.useEffect(() => {\n const text =\n (enabled && errorId && document.getElementById(errorId)?.textContent?.trim()) || null;\n if (text === lastTextRef.current) {\n return;\n }\n lastTextRef.current = text;\n clearTimeout(timeoutRef.current);\n timeoutRef.current = setTimeout(\n () => {\n const fieldName = labelId\n ? document.getElementById(labelId)?.textContent?.trim()\n : undefined;\n setAnnouncedError(text !== null && fieldName ? `${fieldName}: ${text}` : text);\n },\n text === null ? 0 : ANNOUNCE_DELAY,\n );\n });\n\n React.useEffect(\n () => () => {\n clearTimeout(timeoutRef.current);\n lastTextRef.current = undefined;\n },\n [],\n );\n\n return announcedError;\n};\n"],"mappings":";;;AAoBA,IAAa,eAAe,MAAM,cAAwC,IAAI;AAE9E,IAAa,wBAAwB,MAAM,WAAW,YAAY;AA0ClE,IAAM,cAAc,SAClB,SAAS,KAAA,KAAa,SAAS,QAAQ,SAAS,SAAS,SAAS;AAEpE,IAAM,aAAa,CAAC;AAEpB,IAAM,4BACJ;AAEF,IAAa,gBAAgB,EAC3B,IACA,OACA,MACA,aACA,OACA,SACA,UACA,aACA,QAAQ,YACY;CACpB,MAAM,eAAe,gBAAgB;CACrC,MAAM,cAAc,MAAM,MAAM;CAChC,MAAM,WAAW,OAAO,UAAU,cAAc,WAAW,KAAK;CAChE,MAAM,UAAU,WAAW,IAAI;CAC/B,MAAM,sBAAsB,eAAe,cAAc,eAAe;CACxE,MAAM,iBAAiB,WAAW,WAAW;CAC7C,MAAM,WAAW,WAAW,KAAK;CACjC,MAAM,YAAY,QAAQ,OAAO,KAAK;CACtC,MAAM,aAAa,QAAQ,QAAQ,KAAK,QAAQ,cAAc,QAAQ;CAEtE,MAAM,CAAC,SAAS,cAAc,MAAM,SAAmC,IAAI;CAC3E,MAAM,cAAc,MAAM,uBAAO,IAAI,IAA+B,CAAC;CACrE,MAAM,kBAAkB,MAAM,aAAa,KAAa,UAAoC;EAC1F,MAAM,WAAW,YAAY;EAC7B,IAAI,OACF,SAAS,IAAI,KAAK,KAAK;OAEvB,SAAS,OAAO,GAAG;EAErB,IAAI,SAAS,OAAO,GAClB,SAAS,yBAAyB;EAEp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KAAA,CAAS;CACrE,MAAM,aAAa,MAAM,OAAsC;CAG/D,MAAM,gBAAgB;EACpB,MAAM,OACH,WAAW,WAAW,SAAS,eAAe,OAAO,CAAC,EAAE,aAAa,KAAK,KAAM;EACnF,IAAI,SAAS,YAAY,SACvB;EAEF,YAAY,UAAU;EACtB,aAAa,WAAW,OAAO;EAC/B,WAAW,UAAU,iBACb;GACJ,MAAM,YAAY,UACd,SAAS,eAAe,OAAO,CAAC,EAAE,aAAa,KAAK,IACpD,KAAA;GACJ,kBAAkB,SAAS,QAAQ,YAAY,GAAG,UAAU,IAAI,SAAS,IAAI;EAC/E,GACA,SAAS,OAAO,IAAI,cACtB;CACF,CAAC;CAED,MAAM,sBACQ;EACV,aAAa,WAAW,OAAO;EAC/B,YAAY,UAAU,KAAA;CACxB,GACA,CAAC,CACH;CAEA,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"FieldContext.js","names":[],"sources":["../../../components/Field/FieldContext.ts"],"sourcesContent":["import React from 'react';\n\nimport { warnOnce } from '../../utils/warnOnce';\n\ntype MessageSize = '0' | '1' | '2' | '3';\n\ntype FieldControlState = { id?: string; disabled: boolean; invalid: boolean; labelable: boolean };\n\nexport type FieldContextValue = {\n controlId?: string;\n labelId?: string;\n descriptionId?: string;\n errorId?: string;\n hintId?: string;\n messageSize: MessageSize;\n invalid: boolean;\n disabled: boolean;\n registerControl: (key: string, state: FieldControlState | null) => void;\n};\n\nexport const FieldContext = React.createContext<FieldContextValue | null>(null);\n\nexport const useFieldContext = () => React.useContext(FieldContext);\n\nexport type FieldControlOptions = {\n id?: string;\n invalid?: boolean;\n disabled?: boolean;\n 'aria-describedby'?: string;\n 'aria-invalid'?: React.AriaAttributes['aria-invalid'];\n /** Set to false when the control is not a labelable element, such as a radio group. */\n labelable?: boolean;\n};\n\nexport type FieldLabelVariant = 'invalid' | 'subtle' | 'contrast' | 'default';\n\nexport type FieldLabelProps = {\n variant: FieldLabelVariant;\n htmlFor?: string;\n id: string;\n};\n\nexport type FieldBaseProps = {\n id?: string;\n label?: React.ReactNode | ((props: FieldLabelProps) => React.ReactNode);\n /** Text under the label, for what the field is for. */\n hint?: React.ReactNode;\n description?: React.ReactNode;\n error?: React.ReactNode;\n invalid?: boolean;\n disabled?: boolean;\n announceError?: boolean;\n /** `start` puts the label and the hint in a column before the control, and wraps under it when space is short. */\n labelPosition?: 'top' | 'start' | 'end';\n /** The text size of the hint, the description and the error. A Field inside another Field takes its size. */\n messageSize?: MessageSize;\n /**\n * For a field of more than one control: the field becomes a group named by the label and described by\n * the hint, the description and the error. Give each control its own name, and its own error with an inner Field.\n */\n group?: boolean;\n children?: React.ReactNode;\n};\n\nconst hasContent = (node: React.ReactNode) =>\n node !== undefined && node !== null && node !== false && node !== '';\n\nconst noop = () => {};\n\nconst MULTIPLE_CONTROLS_WARNING =\n 'Field: more than one control is in this Field, and its label points to one of them only. Use group, or one Field per control.';\n\nexport const useFieldRoot = ({\n id,\n label,\n hint,\n description,\n error,\n invalid,\n disabled,\n messageSize,\n group = false,\n}: FieldBaseProps) => {\n const outerContext = useFieldContext();\n const generatedId = React.useId();\n const hasLabel = typeof label === 'function' || hasContent(label);\n const hasHint = hasContent(hint);\n const resolvedMessageSize = messageSize ?? outerContext?.messageSize ?? '0';\n const hasDescription = hasContent(description);\n const hasError = hasContent(error);\n const isInvalid = Boolean(invalid) || hasError;\n const isDisabled = Boolean(disabled) || Boolean(outerContext?.disabled);\n\n const [control, setControl] = React.useState<FieldControlState | null>(null);\n const controlsRef = React.useRef(new Map<string, FieldControlState>());\n const registerControl = React.useCallback((key: string, state: FieldControlState | null) => {\n const controls = controlsRef.current;\n if (state) {\n controls.set(key, state);\n } else {\n controls.delete(key);\n }\n if (controls.size > 1) {\n warnOnce(MULTIPLE_CONTROLS_WARNING);\n }\n const next = controls.values().next().value ?? null;\n setControl((prev) =>\n prev?.id === next?.id &&\n prev?.disabled === next?.disabled &&\n prev?.invalid === next?.invalid &&\n prev?.labelable === next?.labelable\n ? prev\n : next,\n );\n }, []);\n const controlId = control?.id ?? id ?? (hasLabel ? `${generatedId}-control` : undefined);\n // The label points to a control only once one is there, so it never points to a missing id.\n const labelFor = group\n ? undefined\n : control\n ? control.labelable === false\n ? undefined\n : controlId\n : id;\n\n const [hasFocus, setHasFocus] = React.useState(false);\n const onFocus = React.useCallback(() => setHasFocus(true), []);\n const onBlur = React.useCallback(() => setHasFocus(false), []);\n\n const labelVariant: FieldLabelVariant = React.useMemo(() => {\n if (isDisabled || control?.disabled) {\n return 'subtle';\n }\n if (isInvalid || control?.invalid) {\n return 'invalid';\n }\n if (hasFocus) {\n return 'contrast';\n }\n return 'default';\n }, [isDisabled, isInvalid, hasFocus, control?.disabled, control?.invalid]);\n\n const ownContext: FieldContextValue = React.useMemo(\n () => ({\n controlId,\n labelId: hasLabel ? `${generatedId}-label` : undefined,\n descriptionId: hasDescription ? `${generatedId}-description` : undefined,\n errorId: hasError ? `${generatedId}-error` : undefined,\n hintId: hasHint ? `${generatedId}-hint` : undefined,\n messageSize: resolvedMessageSize,\n invalid: isInvalid,\n disabled: isDisabled,\n registerControl,\n }),\n [\n controlId,\n generatedId,\n hasLabel,\n hasDescription,\n hasError,\n hasHint,\n resolvedMessageSize,\n isInvalid,\n isDisabled,\n registerControl,\n ],\n );\n\n // The controls of a group get only its disabled state: the group itself carries the name and the messages.\n const groupContext: FieldContextValue = React.useMemo(\n () => ({\n messageSize: resolvedMessageSize,\n invalid: false,\n disabled: isDisabled,\n registerControl: noop,\n }),\n [resolvedMessageSize, isDisabled],\n );\n\n const groupProps = group\n ? {\n role: 'group',\n 'aria-labelledby': ownContext.labelId,\n 'aria-describedby':\n [ownContext.errorId, ownContext.descriptionId, ownContext.hintId]\n .filter(Boolean)\n .join(' ') || undefined,\n }\n : {};\n\n // A Field with no label, hint, description or error inside another Field keeps the outer one.\n const context = group\n ? groupContext\n : outerContext && !hasLabel && !hasHint && !hasDescription && !hasError\n ? outerContext\n : ownContext;\n\n return {\n context,\n ids: ownContext,\n groupProps,\n messageSize: resolvedMessageSize,\n labelFor,\n labelVariant,\n hasLabel,\n hasHint,\n hasDescription,\n hasError,\n onFocus,\n onBlur,\n };\n};\n\n/**\n * Gives a form control the id, `aria-describedby`, `aria-invalid` and `disabled` of the `Field` around it,\n * and gives its own id, `disabled` and invalid state to that `Field`.\n * Outside a `Field`, it only sets `aria-invalid` from `invalid`.\n */\nexport const useFieldControl = ({\n id,\n invalid,\n disabled,\n 'aria-describedby': describedBy,\n 'aria-invalid': ariaInvalid,\n labelable = true,\n}: FieldControlOptions) => {\n const field = useFieldContext();\n const registrationId = React.useId();\n const ownInvalid = Boolean(invalid || ariaInvalid === true || ariaInvalid === 'true');\n const isInvalid = ownInvalid || Boolean(field?.invalid);\n const registerControl = field?.registerControl;\n\n React.useEffect(() => {\n if (!registerControl) {\n return undefined;\n }\n registerControl(registrationId, {\n id,\n disabled: Boolean(disabled),\n invalid: ownInvalid,\n labelable,\n });\n return () => registerControl(registrationId, null);\n }, [registerControl, registrationId, id, disabled, ownInvalid, labelable]);\n const describedByIds =\n [field?.errorId, field?.descriptionId, field?.hintId, describedBy].filter(Boolean).join(' ') ||\n undefined;\n\n return {\n id: id ?? field?.controlId,\n labelId: field?.labelId,\n invalid: isInvalid,\n disabled: disabled || field?.disabled || undefined,\n 'aria-describedby': describedByIds,\n 'aria-invalid': isInvalid ? true : ariaInvalid,\n };\n};\n\nconst ANNOUNCE_DELAY = 1000;\n\n/**\n * Returns the text of the error, after the text of the label when there is one, once it has not\n * changed for a short time, so that a screen reader reads it after the echo of the typed text.\n */\nexport const useAnnouncedError = (enabled: boolean, errorId?: string, labelId?: string) => {\n const [announcedError, setAnnouncedError] = React.useState<string | null>(null);\n const lastTextRef = React.useRef<string | null | undefined>(null);\n const timeoutRef = React.useRef<ReturnType<typeof setTimeout>>();\n\n // Compares the rendered text, so that a new JSX error with the same text does not restart the delay.\n React.useEffect(() => {\n const text =\n (enabled && errorId && document.getElementById(errorId)?.textContent?.trim()) || null;\n if (text === lastTextRef.current) {\n return;\n }\n lastTextRef.current = text;\n clearTimeout(timeoutRef.current);\n timeoutRef.current = setTimeout(\n () => {\n const fieldName = labelId\n ? document.getElementById(labelId)?.textContent?.trim()\n : undefined;\n setAnnouncedError(text !== null && fieldName ? `${fieldName}: ${text}` : text);\n },\n text === null ? 0 : ANNOUNCE_DELAY,\n );\n });\n\n React.useEffect(\n () => () => {\n clearTimeout(timeoutRef.current);\n lastTextRef.current = undefined;\n },\n [],\n );\n\n return announcedError;\n};\n"],"mappings":";;;AAoBA,IAAa,eAAe,MAAM,cAAwC,IAAI;AAE9E,IAAa,wBAAwB,MAAM,WAAW,YAAY;AA0ClE,IAAM,cAAc,SAClB,SAAS,KAAA,KAAa,SAAS,QAAQ,SAAS,SAAS,SAAS;AAEpE,IAAM,aAAa,CAAC;AAEpB,IAAM,4BACJ;AAEF,IAAa,gBAAgB,EAC3B,IACA,OACA,MACA,aACA,OACA,SACA,UACA,aACA,QAAQ,YACY;CACpB,MAAM,eAAe,gBAAgB;CACrC,MAAM,cAAc,MAAM,MAAM;CAChC,MAAM,WAAW,OAAO,UAAU,cAAc,WAAW,KAAK;CAChE,MAAM,UAAU,WAAW,IAAI;CAC/B,MAAM,sBAAsB,eAAe,cAAc,eAAe;CACxE,MAAM,iBAAiB,WAAW,WAAW;CAC7C,MAAM,WAAW,WAAW,KAAK;CACjC,MAAM,YAAY,QAAQ,OAAO,KAAK;CACtC,MAAM,aAAa,QAAQ,QAAQ,KAAK,QAAQ,cAAc,QAAQ;CAEtE,MAAM,CAAC,SAAS,cAAc,MAAM,SAAmC,IAAI;CAC3E,MAAM,cAAc,MAAM,uBAAO,IAAI,IAA+B,CAAC;CACrE,MAAM,kBAAkB,MAAM,aAAa,KAAa,UAAoC;EAC1F,MAAM,WAAW,YAAY;EAC7B,IAAI,OACF,SAAS,IAAI,KAAK,KAAK;OAEvB,SAAS,OAAO,GAAG;EAErB,IAAI,SAAS,OAAO,GAClB,SAAS,yBAAyB;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AkC,IAAI;CAChE,MAAM,aAAa,MAAM,OAAsC;CAG/D,MAAM,gBAAgB;EACpB,MAAM,OACH,WAAW,WAAW,SAAS,eAAe,OAAO,CAAC,EAAE,aAAa,KAAK,KAAM;EACnF,IAAI,SAAS,YAAY,SACvB;EAEF,YAAY,UAAU;EACtB,aAAa,WAAW,OAAO;EAC/B,WAAW,UAAU,iBACb;GACJ,MAAM,YAAY,UACd,SAAS,eAAe,OAAO,CAAC,EAAE,aAAa,KAAK,IACpD,KAAA;GACJ,kBAAkB,SAAS,QAAQ,YAAY,GAAG,UAAU,IAAI,SAAS,IAAI;EAC/E,GACA,SAAS,OAAO,IAAI,cACtB;CACF,CAAC;CAED,MAAM,sBACQ;EACV,aAAa,WAAW,OAAO;EAC/B,YAAY,UAAU,KAAA;CACxB,GACA,CAAC,CACH;CAEA,OAAO;AACT"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_cx = require("../../styles/cx.cjs");
|
|
3
|
+
const require_recipeVariants = require("../../styles/recipeVariants.cjs");
|
|
4
|
+
const require_useInlineStyle = require("../../styles/useInlineStyle.cjs");
|
|
5
|
+
const require_FieldContext = require("../Field/FieldContext.cjs");
|
|
6
|
+
const require_Radio_vanilla_css = require("./Radio.vanilla.css.cjs");
|
|
7
|
+
let react = require("react");
|
|
8
|
+
react = require_runtime.__toESM(react, 1);
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
+
let _radix_ui_react_radio_group = require("@radix-ui/react-radio-group");
|
|
11
|
+
_radix_ui_react_radio_group = require_runtime.__toESM(_radix_ui_react_radio_group, 1);
|
|
12
|
+
// components/Radio/Radio.vanilla.tsx
|
|
13
|
+
var radioClass = require_recipeVariants.withVariantKeys(require_Radio_vanilla_css.radioRecipe);
|
|
14
|
+
var RadioGroupVanilla = react.default.forwardRef(({ id, disabled, className, css, style, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-labelledby": ariaLabelledBy, ...props }, forwardedRef) => {
|
|
15
|
+
const control = require_FieldContext.useFieldControl({
|
|
16
|
+
id,
|
|
17
|
+
disabled,
|
|
18
|
+
"aria-describedby": ariaDescribedBy,
|
|
19
|
+
"aria-invalid": ariaInvalid,
|
|
20
|
+
labelable: false
|
|
21
|
+
});
|
|
22
|
+
const mergedStyles = require_useInlineStyle.useInlineStyle(css, style);
|
|
23
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_radio_group.Root, {
|
|
24
|
+
...props,
|
|
25
|
+
id: control.id,
|
|
26
|
+
disabled: control.disabled,
|
|
27
|
+
"aria-labelledby": ariaLabelledBy ?? control.labelId,
|
|
28
|
+
"aria-describedby": control["aria-describedby"],
|
|
29
|
+
"aria-invalid": control["aria-invalid"],
|
|
30
|
+
className: require_cx.cx(require_Radio_vanilla_css.radioGroup, className),
|
|
31
|
+
style: mergedStyles,
|
|
32
|
+
ref: forwardedRef
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
RadioGroupVanilla.displayName = "RadioGroupVanilla";
|
|
36
|
+
var RadioVanilla = react.default.forwardRef(({ size, className, css, style, ...props }, forwardedRef) => {
|
|
37
|
+
const mergedStyles = require_useInlineStyle.useInlineStyle(css, style);
|
|
38
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_radio_group.Item, {
|
|
39
|
+
...props,
|
|
40
|
+
className: require_cx.cx(radioClass({ size }), className),
|
|
41
|
+
style: mergedStyles,
|
|
42
|
+
ref: forwardedRef,
|
|
43
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_radio_group.Indicator, { className: require_Radio_vanilla_css.radioIndicator })
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
RadioVanilla.displayName = "RadioVanilla";
|
|
47
|
+
exports.RadioGroupVanilla = RadioGroupVanilla;
|
|
48
|
+
exports.RadioVanilla = RadioVanilla;
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=Radio.vanilla.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.vanilla.cjs","names":["withVariantKeys","radioRecipe","React","useFieldControl","useInlineStyle","RadioGroupPrimitive","cx","radioGroup","radioIndicator"],"sources":["../../../components/Radio/Radio.vanilla.tsx"],"sourcesContent":["import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport React from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport { RecipeVariantProps, withVariantKeys } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { useFieldControl } from '@/components/Field/FieldContext';\n\nimport { radioGroup, radioIndicator, radioRecipe } from './Radio.vanilla.css';\n\nconst radioClass = withVariantKeys(radioRecipe);\n\ntype RadioRecipeVariants = RecipeVariantProps<typeof radioRecipe>;\n\nexport type RadioGroupVanillaProps = Omit<\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>,\n 'asChild'\n> &\n CSSProps;\n\nexport const RadioGroupVanilla = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\n RadioGroupVanillaProps\n>(\n (\n {\n id,\n disabled,\n className,\n css,\n style,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n 'aria-labelledby': ariaLabelledBy,\n ...props\n },\n forwardedRef,\n ) => {\n const control = useFieldControl({\n id,\n disabled,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n labelable: false,\n });\n\n const mergedStyles = useInlineStyle(css, style);\n\n return (\n <RadioGroupPrimitive.Root\n {...props}\n id={control.id}\n disabled={control.disabled}\n aria-labelledby={ariaLabelledBy ?? control.labelId}\n aria-describedby={control['aria-describedby']}\n aria-invalid={control['aria-invalid']}\n className={cx(radioGroup, className)}\n style={mergedStyles}\n ref={forwardedRef}\n />\n );\n },\n);\n\nRadioGroupVanilla.displayName = 'RadioGroupVanilla';\n\nexport interface RadioVanillaOwnProps extends CSSProps {\n size?: RadioRecipeVariants['size'];\n}\n\nexport type RadioVanillaProps = Omit<\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>,\n 'asChild'\n> &\n RadioVanillaOwnProps;\n\nexport const RadioVanilla = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n RadioVanillaProps\n>(({ size, className, css, style, ...props }, forwardedRef) => {\n const mergedStyles = useInlineStyle(css, style);\n\n return (\n <RadioGroupPrimitive.Item\n {...props}\n className={cx(radioClass({ size }), className)}\n style={mergedStyles}\n ref={forwardedRef}\n >\n <RadioGroupPrimitive.Indicator className={radioIndicator} />\n </RadioGroupPrimitive.Item>\n );\n});\n\nRadioVanilla.displayName = 'RadioVanilla';\n"],"mappings":";;;;;;;;;;;;AAYA,IAAM,aAAaA,uBAAAA,gBAAgBC,0BAAAA,WAAW;AAU9C,IAAa,oBAAoBC,MAAAA,QAAM,YAKnC,EACE,IACA,UACA,WACA,KACA,OACA,oBAAoB,iBACpB,gBAAgB,aAChB,mBAAmB,gBACnB,GAAG,SAEL,iBACG;CACH,MAAM,UAAUC,qBAAAA,gBAAgB;EAC9B;EACA;EACA,oBAAoB;EACpB,gBAAgB;EAChB,WAAW;CACb,CAAC;CAED,MAAM,eAAeC,uBAAAA,eAAe,KAAK,KAAK;CAE9C,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,4BAAoB,MAArB;EACE,GAAI;EACJ,IAAI,QAAQ;EACZ,UAAU,QAAQ;EAClB,mBAAiB,kBAAkB,QAAQ;EAC3C,oBAAkB,QAAQ;EAC1B,gBAAc,QAAQ;EACtB,WAAWC,WAAAA,GAAGC,0BAAAA,YAAY,SAAS;EACnC,OAAO;EACP,KAAK;CACN,CAAA;AAEL,CACF;AAEA,kBAAkB,cAAc;AAYhC,IAAa,eAAeL,MAAAA,QAAM,YAG/B,EAAE,MAAM,WAAW,KAAK,OAAO,GAAG,SAAS,iBAAiB;CAC7D,MAAM,eAAeE,uBAAAA,eAAe,KAAK,KAAK;CAE9C,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,4BAAoB,MAArB;EACE,GAAI;EACJ,WAAWC,WAAAA,GAAG,WAAW,EAAE,KAAK,CAAC,GAAG,SAAS;EAC7C,OAAO;EACP,KAAK;EAEL,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACD,4BAAoB,WAArB,EAA+B,WAAWG,0BAAAA,eAAiB,CAAA;CACnC,CAAA;AAE9B,CAAC;AAED,aAAa,cAAc"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
;/* empty css */
|
|
2
|
+
let _vanilla_extract_recipes_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
3
|
+
// components/Radio/Radio.vanilla.css.ts
|
|
4
|
+
var radioGroup = "_1f23zkp0";
|
|
5
|
+
var radioIndicator = "_1f23zkp1";
|
|
6
|
+
var radioRecipe = (0, _vanilla_extract_recipes_createRuntimeFn.createRuntimeFn)({
|
|
7
|
+
defaultClassName: "_1f23zkp4 _1f23zkp2",
|
|
8
|
+
variantClassNames: { size: {
|
|
9
|
+
"1": "_1f23zkp5",
|
|
10
|
+
"2": "_1f23zkp6 _1f23zkp3"
|
|
11
|
+
} },
|
|
12
|
+
defaultVariants: { size: "1" },
|
|
13
|
+
compoundVariants: []
|
|
14
|
+
});
|
|
15
|
+
exports.radioGroup = radioGroup;
|
|
16
|
+
exports.radioIndicator = radioIndicator;
|
|
17
|
+
exports.radioRecipe = radioRecipe;
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=Radio.vanilla.css.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.vanilla.css.cjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
+
// components/Radio/Radio.vanilla.css.ts
|
|
4
|
+
var radioGroup = "_1f23zkp0";
|
|
5
|
+
var radioIndicator = "_1f23zkp1";
|
|
6
|
+
var radioRecipe = createRuntimeFn({
|
|
7
|
+
defaultClassName: "_1f23zkp4 _1f23zkp2",
|
|
8
|
+
variantClassNames: { size: {
|
|
9
|
+
"1": "_1f23zkp5",
|
|
10
|
+
"2": "_1f23zkp6 _1f23zkp3"
|
|
11
|
+
} },
|
|
12
|
+
defaultVariants: { size: "1" },
|
|
13
|
+
compoundVariants: []
|
|
14
|
+
});
|
|
15
|
+
export { radioGroup, radioIndicator, radioRecipe };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=Radio.vanilla.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.vanilla.css.js","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cx } from "../../styles/cx.js";
|
|
2
|
+
import { withVariantKeys } from "../../styles/recipeVariants.js";
|
|
3
|
+
import { useInlineStyle } from "../../styles/useInlineStyle.js";
|
|
4
|
+
import { useFieldControl } from "../Field/FieldContext.js";
|
|
5
|
+
import { radioGroup, radioIndicator, radioRecipe } from "./Radio.vanilla.css.js";
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
9
|
+
// components/Radio/Radio.vanilla.tsx
|
|
10
|
+
var radioClass = withVariantKeys(radioRecipe);
|
|
11
|
+
var RadioGroupVanilla = React.forwardRef(({ id, disabled, className, css, style, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-labelledby": ariaLabelledBy, ...props }, forwardedRef) => {
|
|
12
|
+
const control = useFieldControl({
|
|
13
|
+
id,
|
|
14
|
+
disabled,
|
|
15
|
+
"aria-describedby": ariaDescribedBy,
|
|
16
|
+
"aria-invalid": ariaInvalid,
|
|
17
|
+
labelable: false
|
|
18
|
+
});
|
|
19
|
+
const mergedStyles = useInlineStyle(css, style);
|
|
20
|
+
return /* @__PURE__ */ jsx(RadioGroupPrimitive.Root, {
|
|
21
|
+
...props,
|
|
22
|
+
id: control.id,
|
|
23
|
+
disabled: control.disabled,
|
|
24
|
+
"aria-labelledby": ariaLabelledBy ?? control.labelId,
|
|
25
|
+
"aria-describedby": control["aria-describedby"],
|
|
26
|
+
"aria-invalid": control["aria-invalid"],
|
|
27
|
+
className: cx(radioGroup, className),
|
|
28
|
+
style: mergedStyles,
|
|
29
|
+
ref: forwardedRef
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
RadioGroupVanilla.displayName = "RadioGroupVanilla";
|
|
33
|
+
var RadioVanilla = React.forwardRef(({ size, className, css, style, ...props }, forwardedRef) => {
|
|
34
|
+
const mergedStyles = useInlineStyle(css, style);
|
|
35
|
+
return /* @__PURE__ */ jsx(RadioGroupPrimitive.Item, {
|
|
36
|
+
...props,
|
|
37
|
+
className: cx(radioClass({ size }), className),
|
|
38
|
+
style: mergedStyles,
|
|
39
|
+
ref: forwardedRef,
|
|
40
|
+
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: radioIndicator })
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
RadioVanilla.displayName = "RadioVanilla";
|
|
44
|
+
export { RadioGroupVanilla, RadioVanilla };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=Radio.vanilla.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.vanilla.js","names":[],"sources":["../../../components/Radio/Radio.vanilla.tsx"],"sourcesContent":["import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport React from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport { RecipeVariantProps, withVariantKeys } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { useFieldControl } from '@/components/Field/FieldContext';\n\nimport { radioGroup, radioIndicator, radioRecipe } from './Radio.vanilla.css';\n\nconst radioClass = withVariantKeys(radioRecipe);\n\ntype RadioRecipeVariants = RecipeVariantProps<typeof radioRecipe>;\n\nexport type RadioGroupVanillaProps = Omit<\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>,\n 'asChild'\n> &\n CSSProps;\n\nexport const RadioGroupVanilla = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\n RadioGroupVanillaProps\n>(\n (\n {\n id,\n disabled,\n className,\n css,\n style,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n 'aria-labelledby': ariaLabelledBy,\n ...props\n },\n forwardedRef,\n ) => {\n const control = useFieldControl({\n id,\n disabled,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n labelable: false,\n });\n\n const mergedStyles = useInlineStyle(css, style);\n\n return (\n <RadioGroupPrimitive.Root\n {...props}\n id={control.id}\n disabled={control.disabled}\n aria-labelledby={ariaLabelledBy ?? control.labelId}\n aria-describedby={control['aria-describedby']}\n aria-invalid={control['aria-invalid']}\n className={cx(radioGroup, className)}\n style={mergedStyles}\n ref={forwardedRef}\n />\n );\n },\n);\n\nRadioGroupVanilla.displayName = 'RadioGroupVanilla';\n\nexport interface RadioVanillaOwnProps extends CSSProps {\n size?: RadioRecipeVariants['size'];\n}\n\nexport type RadioVanillaProps = Omit<\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>,\n 'asChild'\n> &\n RadioVanillaOwnProps;\n\nexport const RadioVanilla = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n RadioVanillaProps\n>(({ size, className, css, style, ...props }, forwardedRef) => {\n const mergedStyles = useInlineStyle(css, style);\n\n return (\n <RadioGroupPrimitive.Item\n {...props}\n className={cx(radioClass({ size }), className)}\n style={mergedStyles}\n ref={forwardedRef}\n >\n <RadioGroupPrimitive.Indicator className={radioIndicator} />\n </RadioGroupPrimitive.Item>\n );\n});\n\nRadioVanilla.displayName = 'RadioVanilla';\n"],"mappings":";;;;;;;;;AAYA,IAAM,aAAa,gBAAgB,WAAW;AAU9C,IAAa,oBAAoB,MAAM,YAKnC,EACE,IACA,UACA,WACA,KACA,OACA,oBAAoB,iBACpB,gBAAgB,aAChB,mBAAmB,gBACnB,GAAG,SAEL,iBACG;CACH,MAAM,UAAU,gBAAgB;EAC9B;EACA;EACA,oBAAoB;EACpB,gBAAgB;EAChB,WAAW;CACb,CAAC;CAED,MAAM,eAAe,eAAe,KAAK,KAAK;CAE9C,OACE,oBAAC,oBAAoB,MAArB;EACE,GAAI;EACJ,IAAI,QAAQ;EACZ,UAAU,QAAQ;EAClB,mBAAiB,kBAAkB,QAAQ;EAC3C,oBAAkB,QAAQ;EAC1B,gBAAc,QAAQ;EACtB,WAAW,GAAG,YAAY,SAAS;EACnC,OAAO;EACP,KAAK;CACN,CAAA;AAEL,CACF;AAEA,kBAAkB,cAAc;AAYhC,IAAa,eAAe,MAAM,YAG/B,EAAE,MAAM,WAAW,KAAK,OAAO,GAAG,SAAS,iBAAiB;CAC7D,MAAM,eAAe,eAAe,KAAK,KAAK;CAE9C,OACE,oBAAC,oBAAoB,MAArB;EACE,GAAI;EACJ,WAAW,GAAG,WAAW,EAAE,KAAK,CAAC,GAAG,SAAS;EAC7C,OAAO;EACP,KAAK;EAEL,UAAA,oBAAC,oBAAoB,WAArB,EAA+B,WAAW,eAAiB,CAAA;CACnC,CAAA;AAE9B,CAAC;AAED,aAAa,cAAc"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_cx = require("../../styles/cx.cjs");
|
|
3
|
+
const require_Accordion_vanilla = require("../Accordion/Accordion.vanilla.cjs");
|
|
4
|
+
const require_Radio_vanilla_css = require("../Radio/Radio.vanilla.css.cjs");
|
|
5
|
+
const require_RadioAccordion_vanilla_css = require("./RadioAccordion.vanilla.css.cjs");
|
|
6
|
+
let react = require("react");
|
|
7
|
+
react = require_runtime.__toESM(react, 1);
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
// components/RadioAccordion/RadioAccordion.vanilla.tsx
|
|
10
|
+
var RadioAccordionRootVanilla = react.default.forwardRef((props, forwardedRef) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Accordion_vanilla.AccordionRootVanilla, {
|
|
11
|
+
...props,
|
|
12
|
+
type: "single",
|
|
13
|
+
collapsible: false,
|
|
14
|
+
ref: forwardedRef
|
|
15
|
+
}));
|
|
16
|
+
RadioAccordionRootVanilla.displayName = "RadioAccordionRootVanilla";
|
|
17
|
+
var RadioAccordionItemVanilla = react.default.forwardRef(({ className, ...props }, forwardedRef) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Accordion_vanilla.AccordionItemVanilla, {
|
|
18
|
+
...props,
|
|
19
|
+
className: require_cx.cx(require_RadioAccordion_vanilla_css.radioAccordionItem, className),
|
|
20
|
+
ref: forwardedRef
|
|
21
|
+
}));
|
|
22
|
+
RadioAccordionItemVanilla.displayName = "RadioAccordionItemVanilla";
|
|
23
|
+
var RadioAccordionTriggerVanilla = react.default.forwardRef(({ children, className, ...props }, forwardedRef) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Accordion_vanilla.AccordionTriggerBaseVanilla, {
|
|
24
|
+
...props,
|
|
25
|
+
className: require_cx.cx(require_RadioAccordion_vanilla_css.radioAccordionTrigger, className),
|
|
26
|
+
ref: forwardedRef,
|
|
27
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
28
|
+
className: require_RadioAccordion_vanilla_css.radioAccordionRadio,
|
|
29
|
+
"aria-hidden": true,
|
|
30
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: require_Radio_vanilla_css.radioIndicator })
|
|
31
|
+
}), children]
|
|
32
|
+
}));
|
|
33
|
+
RadioAccordionTriggerVanilla.displayName = "RadioAccordionTriggerVanilla";
|
|
34
|
+
var RadioAccordionContentVanilla = react.default.forwardRef((props, forwardedRef) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Accordion_vanilla.AccordionContentVanilla, {
|
|
35
|
+
...props,
|
|
36
|
+
ref: forwardedRef
|
|
37
|
+
}));
|
|
38
|
+
RadioAccordionContentVanilla.displayName = "RadioAccordionContentVanilla";
|
|
39
|
+
exports.RadioAccordionContentVanilla = RadioAccordionContentVanilla;
|
|
40
|
+
exports.RadioAccordionItemVanilla = RadioAccordionItemVanilla;
|
|
41
|
+
exports.RadioAccordionRootVanilla = RadioAccordionRootVanilla;
|
|
42
|
+
exports.RadioAccordionTriggerVanilla = RadioAccordionTriggerVanilla;
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=RadioAccordion.vanilla.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioAccordion.vanilla.cjs","names":["React","AccordionRootVanilla","AccordionItemVanilla","cx","radioAccordionItem","AccordionTriggerBaseVanilla","radioAccordionTrigger","radioAccordionRadio","radioIndicator","AccordionContentVanilla"],"sources":["../../../components/RadioAccordion/RadioAccordion.vanilla.tsx"],"sourcesContent":["import * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport React from 'react';\n\nimport { cx } from '@/styles/cx';\n\nimport {\n AccordionContentVanilla,\n AccordionContentVanillaProps,\n AccordionItemVanilla,\n AccordionItemVanillaProps,\n AccordionRootVanilla,\n AccordionTriggerBaseVanilla,\n AccordionTriggerBaseVanillaProps,\n} from '@/components/Accordion/Accordion.vanilla';\nimport { radioIndicator } from '@/components/Radio/Radio.vanilla.css';\n\nimport {\n radioAccordionItem,\n radioAccordionRadio,\n radioAccordionTrigger,\n} from './RadioAccordion.vanilla.css';\n\nexport type RadioAccordionRootVanillaProps = Omit<\n Extract<React.ComponentProps<typeof AccordionRootVanilla>, { type: 'single' }>,\n 'type' | 'collapsible' | 'ref'\n>;\n\nexport const RadioAccordionRootVanilla = React.forwardRef<\n React.ElementRef<typeof AccordionRootVanilla>,\n RadioAccordionRootVanillaProps\n>((props, forwardedRef) => (\n <AccordionRootVanilla {...props} type=\"single\" collapsible={false} ref={forwardedRef} />\n));\n\nRadioAccordionRootVanilla.displayName = 'RadioAccordionRootVanilla';\n\nexport type RadioAccordionItemVanillaProps = AccordionItemVanillaProps;\n\nexport const RadioAccordionItemVanilla = React.forwardRef<\n React.ElementRef<typeof AccordionItemVanilla>,\n RadioAccordionItemVanillaProps\n>(({ className, ...props }, forwardedRef) => (\n <AccordionItemVanilla\n {...props}\n className={cx(radioAccordionItem, className)}\n ref={forwardedRef}\n />\n));\n\nRadioAccordionItemVanilla.displayName = 'RadioAccordionItemVanilla';\n\nexport type RadioAccordionTriggerVanillaProps = AccordionTriggerBaseVanillaProps;\n\nexport const RadioAccordionTriggerVanilla = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Trigger>,\n RadioAccordionTriggerVanillaProps\n>(({ children, className, ...props }, forwardedRef) => (\n <AccordionTriggerBaseVanilla\n {...props}\n className={cx(radioAccordionTrigger, className)}\n ref={forwardedRef}\n >\n <div className={radioAccordionRadio} aria-hidden>\n <div className={radioIndicator} />\n </div>\n {children}\n </AccordionTriggerBaseVanilla>\n));\n\nRadioAccordionTriggerVanilla.displayName = 'RadioAccordionTriggerVanilla';\n\nexport type RadioAccordionContentVanillaProps = AccordionContentVanillaProps;\n\nexport const RadioAccordionContentVanilla = React.forwardRef<\n React.ElementRef<typeof AccordionContentVanilla>,\n RadioAccordionContentVanillaProps\n>((props, forwardedRef) => <AccordionContentVanilla {...props} ref={forwardedRef} />);\n\nRadioAccordionContentVanilla.displayName = 'RadioAccordionContentVanilla';\n"],"mappings":";;;;;;;;;AA2BA,IAAa,4BAA4BA,MAAAA,QAAM,YAG5C,OAAO,iBACR,iBAAA,GAAA,kBAAA,IAAA,CAACC,0BAAAA,sBAAD;CAAsB,GAAI;CAAO,MAAK;CAAS,aAAa;CAAO,KAAK;AAAe,CAAA,CACxF;AAED,0BAA0B,cAAc;AAIxC,IAAa,4BAA4BD,MAAAA,QAAM,YAG5C,EAAE,WAAW,GAAG,SAAS,iBAC1B,iBAAA,GAAA,kBAAA,IAAA,CAACE,0BAAAA,sBAAD;CACE,GAAI;CACJ,WAAWC,WAAAA,GAAGC,mCAAAA,oBAAoB,SAAS;CAC3C,KAAK;AACN,CAAA,CACF;AAED,0BAA0B,cAAc;AAIxC,IAAa,+BAA+BJ,MAAAA,QAAM,YAG/C,EAAE,UAAU,WAAW,GAAG,SAAS,iBACpC,iBAAA,GAAA,kBAAA,KAAA,CAACK,0BAAAA,6BAAD;CACE,GAAI;CACJ,WAAWF,WAAAA,GAAGG,mCAAAA,uBAAuB,SAAS;CAC9C,KAAK;CAHP,UAAA,CAKE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAWC,mCAAAA;EAAqB,eAAA;EACnC,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD,EAAK,WAAWC,0BAAAA,eAAiB,CAAA;CAC9B,CAAA,GACJ,QAC0B;AAC9B,CAAA,CAAA;AAED,6BAA6B,cAAc;AAI3C,IAAa,+BAA+BR,MAAAA,QAAM,YAG/C,OAAO,iBAAiB,iBAAA,GAAA,kBAAA,IAAA,CAACS,0BAAAA,yBAAD;CAAyB,GAAI;CAAO,KAAK;AAAe,CAAA,CAAC;AAEpF,6BAA6B,cAAc"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
;/* empty css */
|
|
2
|
+
;/* empty css */
|
|
3
|
+
// components/RadioAccordion/RadioAccordion.vanilla.css.ts
|
|
4
|
+
var radioAccordionItem = "_1bpuyf90";
|
|
5
|
+
var radioAccordionTrigger = "_1bpuyf91";
|
|
6
|
+
var radioAccordionRadio = "_1bpuyf92";
|
|
7
|
+
exports.radioAccordionItem = radioAccordionItem;
|
|
8
|
+
exports.radioAccordionRadio = radioAccordionRadio;
|
|
9
|
+
exports.radioAccordionTrigger = radioAccordionTrigger;
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=RadioAccordion.vanilla.css.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioAccordion.vanilla.css.cjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
// components/RadioAccordion/RadioAccordion.vanilla.css.ts
|
|
4
|
+
var radioAccordionItem = "_1bpuyf90";
|
|
5
|
+
var radioAccordionTrigger = "_1bpuyf91";
|
|
6
|
+
var radioAccordionRadio = "_1bpuyf92";
|
|
7
|
+
export { radioAccordionItem, radioAccordionRadio, radioAccordionTrigger };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=RadioAccordion.vanilla.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioAccordion.vanilla.css.js","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { cx } from "../../styles/cx.js";
|
|
2
|
+
import { AccordionContentVanilla, AccordionItemVanilla, AccordionRootVanilla, AccordionTriggerBaseVanilla } from "../Accordion/Accordion.vanilla.js";
|
|
3
|
+
import { radioIndicator } from "../Radio/Radio.vanilla.css.js";
|
|
4
|
+
import { radioAccordionItem, radioAccordionRadio, radioAccordionTrigger } from "./RadioAccordion.vanilla.css.js";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
// components/RadioAccordion/RadioAccordion.vanilla.tsx
|
|
8
|
+
var RadioAccordionRootVanilla = React.forwardRef((props, forwardedRef) => /* @__PURE__ */ jsx(AccordionRootVanilla, {
|
|
9
|
+
...props,
|
|
10
|
+
type: "single",
|
|
11
|
+
collapsible: false,
|
|
12
|
+
ref: forwardedRef
|
|
13
|
+
}));
|
|
14
|
+
RadioAccordionRootVanilla.displayName = "RadioAccordionRootVanilla";
|
|
15
|
+
var RadioAccordionItemVanilla = React.forwardRef(({ className, ...props }, forwardedRef) => /* @__PURE__ */ jsx(AccordionItemVanilla, {
|
|
16
|
+
...props,
|
|
17
|
+
className: cx(radioAccordionItem, className),
|
|
18
|
+
ref: forwardedRef
|
|
19
|
+
}));
|
|
20
|
+
RadioAccordionItemVanilla.displayName = "RadioAccordionItemVanilla";
|
|
21
|
+
var RadioAccordionTriggerVanilla = React.forwardRef(({ children, className, ...props }, forwardedRef) => /* @__PURE__ */ jsxs(AccordionTriggerBaseVanilla, {
|
|
22
|
+
...props,
|
|
23
|
+
className: cx(radioAccordionTrigger, className),
|
|
24
|
+
ref: forwardedRef,
|
|
25
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
26
|
+
className: radioAccordionRadio,
|
|
27
|
+
"aria-hidden": true,
|
|
28
|
+
children: /* @__PURE__ */ jsx("div", { className: radioIndicator })
|
|
29
|
+
}), children]
|
|
30
|
+
}));
|
|
31
|
+
RadioAccordionTriggerVanilla.displayName = "RadioAccordionTriggerVanilla";
|
|
32
|
+
var RadioAccordionContentVanilla = React.forwardRef((props, forwardedRef) => /* @__PURE__ */ jsx(AccordionContentVanilla, {
|
|
33
|
+
...props,
|
|
34
|
+
ref: forwardedRef
|
|
35
|
+
}));
|
|
36
|
+
RadioAccordionContentVanilla.displayName = "RadioAccordionContentVanilla";
|
|
37
|
+
export { RadioAccordionContentVanilla, RadioAccordionItemVanilla, RadioAccordionRootVanilla, RadioAccordionTriggerVanilla };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=RadioAccordion.vanilla.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioAccordion.vanilla.js","names":[],"sources":["../../../components/RadioAccordion/RadioAccordion.vanilla.tsx"],"sourcesContent":["import * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport React from 'react';\n\nimport { cx } from '@/styles/cx';\n\nimport {\n AccordionContentVanilla,\n AccordionContentVanillaProps,\n AccordionItemVanilla,\n AccordionItemVanillaProps,\n AccordionRootVanilla,\n AccordionTriggerBaseVanilla,\n AccordionTriggerBaseVanillaProps,\n} from '@/components/Accordion/Accordion.vanilla';\nimport { radioIndicator } from '@/components/Radio/Radio.vanilla.css';\n\nimport {\n radioAccordionItem,\n radioAccordionRadio,\n radioAccordionTrigger,\n} from './RadioAccordion.vanilla.css';\n\nexport type RadioAccordionRootVanillaProps = Omit<\n Extract<React.ComponentProps<typeof AccordionRootVanilla>, { type: 'single' }>,\n 'type' | 'collapsible' | 'ref'\n>;\n\nexport const RadioAccordionRootVanilla = React.forwardRef<\n React.ElementRef<typeof AccordionRootVanilla>,\n RadioAccordionRootVanillaProps\n>((props, forwardedRef) => (\n <AccordionRootVanilla {...props} type=\"single\" collapsible={false} ref={forwardedRef} />\n));\n\nRadioAccordionRootVanilla.displayName = 'RadioAccordionRootVanilla';\n\nexport type RadioAccordionItemVanillaProps = AccordionItemVanillaProps;\n\nexport const RadioAccordionItemVanilla = React.forwardRef<\n React.ElementRef<typeof AccordionItemVanilla>,\n RadioAccordionItemVanillaProps\n>(({ className, ...props }, forwardedRef) => (\n <AccordionItemVanilla\n {...props}\n className={cx(radioAccordionItem, className)}\n ref={forwardedRef}\n />\n));\n\nRadioAccordionItemVanilla.displayName = 'RadioAccordionItemVanilla';\n\nexport type RadioAccordionTriggerVanillaProps = AccordionTriggerBaseVanillaProps;\n\nexport const RadioAccordionTriggerVanilla = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Trigger>,\n RadioAccordionTriggerVanillaProps\n>(({ children, className, ...props }, forwardedRef) => (\n <AccordionTriggerBaseVanilla\n {...props}\n className={cx(radioAccordionTrigger, className)}\n ref={forwardedRef}\n >\n <div className={radioAccordionRadio} aria-hidden>\n <div className={radioIndicator} />\n </div>\n {children}\n </AccordionTriggerBaseVanilla>\n));\n\nRadioAccordionTriggerVanilla.displayName = 'RadioAccordionTriggerVanilla';\n\nexport type RadioAccordionContentVanillaProps = AccordionContentVanillaProps;\n\nexport const RadioAccordionContentVanilla = React.forwardRef<\n React.ElementRef<typeof AccordionContentVanilla>,\n RadioAccordionContentVanillaProps\n>((props, forwardedRef) => <AccordionContentVanilla {...props} ref={forwardedRef} />);\n\nRadioAccordionContentVanilla.displayName = 'RadioAccordionContentVanilla';\n"],"mappings":";;;;;;;AA2BA,IAAa,4BAA4B,MAAM,YAG5C,OAAO,iBACR,oBAAC,sBAAD;CAAsB,GAAI;CAAO,MAAK;CAAS,aAAa;CAAO,KAAK;AAAe,CAAA,CACxF;AAED,0BAA0B,cAAc;AAIxC,IAAa,4BAA4B,MAAM,YAG5C,EAAE,WAAW,GAAG,SAAS,iBAC1B,oBAAC,sBAAD;CACE,GAAI;CACJ,WAAW,GAAG,oBAAoB,SAAS;CAC3C,KAAK;AACN,CAAA,CACF;AAED,0BAA0B,cAAc;AAIxC,IAAa,+BAA+B,MAAM,YAG/C,EAAE,UAAU,WAAW,GAAG,SAAS,iBACpC,qBAAC,6BAAD;CACE,GAAI;CACJ,WAAW,GAAG,uBAAuB,SAAS;CAC9C,KAAK;CAHP,UAAA,CAKE,oBAAC,OAAD;EAAK,WAAW;EAAqB,eAAA;EACnC,UAAA,oBAAC,OAAD,EAAK,WAAW,eAAiB,CAAA;CAC9B,CAAA,GACJ,QAC0B;AAC9B,CAAA,CAAA;AAED,6BAA6B,cAAc;AAI3C,IAAa,+BAA+B,MAAM,YAG/C,OAAO,iBAAiB,oBAAC,yBAAD;CAAyB,GAAI;CAAO,KAAK;AAAe,CAAA,CAAC;AAEpF,6BAA6B,cAAc"}
|