@yamada-ui/react 2.3.0-next-20260515022613 → 2.3.0-next-20260516024901
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/cjs/components/accordion/use-accordion.cjs +4 -5
- package/dist/cjs/components/accordion/use-accordion.cjs.map +1 -1
- package/dist/cjs/components/checkbox/use-checkbox.cjs +17 -18
- package/dist/cjs/components/checkbox/use-checkbox.cjs.map +1 -1
- package/dist/esm/components/accordion/use-accordion.js +4 -5
- package/dist/esm/components/accordion/use-accordion.js.map +1 -1
- package/dist/esm/components/checkbox/use-checkbox.js +17 -18
- package/dist/esm/components/checkbox/use-checkbox.js.map +1 -1
- package/dist/types/components/alert/alert.style.d.ts +1 -1
- package/dist/types/components/autocomplete/autocomplete.style.d.ts +1 -1
- package/dist/types/components/calendar/calendar.style.d.ts +2 -2
- package/dist/types/components/carousel/carousel.style.d.ts +2 -2
- package/dist/types/components/chart/cartesian-chart.style.d.ts +1 -1
- package/dist/types/components/chart/polar-chart.style.d.ts +1 -1
- package/dist/types/components/checkbox-card/checkbox-card.d.ts +3 -3
- package/dist/types/components/checkbox-card/checkbox-card.style.d.ts +1 -1
- package/dist/types/components/color-picker/color-picker.style.d.ts +1 -1
- package/dist/types/components/data-list/data-list.style.d.ts +1 -1
- package/dist/types/components/dropzone/dropzone.d.ts +1 -1
- package/dist/types/components/dropzone/dropzone.style.d.ts +1 -1
- package/dist/types/components/empty-state/empty-state.style.d.ts +2 -2
- package/dist/types/components/field/field.style.d.ts +2 -2
- package/dist/types/components/fieldset/fieldset.style.d.ts +1 -1
- package/dist/types/components/form/form.style.d.ts +1 -1
- package/dist/types/components/number-input/number-input.style.d.ts +1 -1
- package/dist/types/components/radio-card/radio-card.d.ts +3 -3
- package/dist/types/components/radio-card/radio-card.style.d.ts +1 -1
- package/dist/types/components/steps/steps.style.d.ts +1 -1
- package/dist/types/components/timeline/timeline.d.ts +1 -1
- package/dist/types/components/timeline/timeline.style.d.ts +1 -1
- package/dist/types/providers/i18n-provider/i18n-provider.d.ts +1 -1
- package/package.json +1 -1
|
@@ -112,12 +112,11 @@ const useAccordionItem = ({ disabled, index, ...rest }) => {
|
|
|
112
112
|
onFocus,
|
|
113
113
|
onKeyDown
|
|
114
114
|
]);
|
|
115
|
-
const getPanelProps = (0, react.useCallback)((
|
|
115
|
+
const getPanelProps = (0, react.useCallback)((props = {}) => require_props.mergeProps({
|
|
116
116
|
id: panelId,
|
|
117
|
-
"aria-labelledby":
|
|
118
|
-
role: "region"
|
|
119
|
-
|
|
120
|
-
}), [itemId, panelId]);
|
|
117
|
+
"aria-labelledby": itemId,
|
|
118
|
+
role: "region"
|
|
119
|
+
}, props)(), [itemId, panelId]);
|
|
121
120
|
return {
|
|
122
121
|
disabled,
|
|
123
122
|
open,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-accordion.cjs","names":["createDescendants","createContext","useControllableState","mergeProps","mergeRefs"],"sources":["../../../../src/components/accordion/use-accordion.ts"],"sourcesContent":["\"use client\"\n\nimport type { KeyboardEvent } from \"react\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport { useCallback, useEffect, useId, useState } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { createDescendants } from \"../../hooks/use-descendants\"\nimport {\n ariaAttr,\n createContext,\n cx,\n dataAttr,\n handlerAll,\n isArray,\n mergeRefs,\n runKeyAction,\n} from \"../../utils\"\n\nconst {\n DescendantsContext: AccordionDescendantsContext,\n useDescendant: useAccordionDescendant,\n useDescendants: useAccordionDescendants,\n} = createDescendants<HTMLButtonElement>()\n\nexport {\n AccordionDescendantsContext,\n useAccordionDescendant,\n useAccordionDescendants,\n}\n\ninterface AccordionContext extends Omit<\n UseAccordionReturn,\n \"descendants\" | \"getRootProps\"\n> {}\n\nconst [AccordionContext, useAccordionContext] = createContext<AccordionContext>(\n { name: \"AccordionContext\" },\n)\n\nexport { AccordionContext, useAccordionContext }\n\ninterface AccordionItemContext extends Omit<\n UseAccordionItemReturn,\n \"getItemProps\"\n> {}\n\nconst [AccordionItemContext, useAccordionItemContext] =\n createContext<AccordionItemContext>({\n name: \"AccordionItemContext\",\n })\n\nexport { AccordionItemContext, useAccordionItemContext }\n\nexport interface UseAccordionProps extends Omit<HTMLProps, \"onChange\"> {\n /**\n * The initial index(es) of the accordion item to expand.\n */\n defaultIndex?: number | number[]\n /**\n * The index(es) of the accordion item to expand.\n */\n index?: number | number[]\n /**\n * If `true`, multiple accordion items can be expanded at once.\n *\n * @default false\n */\n multiple?: boolean\n /**\n * If `true`, any expanded accordion item can be collapsed again.\n *\n * @default false\n */\n toggle?: boolean\n /**\n * The callback invoked when accordion items are expanded or collapsed.\n */\n onChange?: (index: number | number[]) => void\n}\n\nexport const useAccordion = ({\n defaultIndex: defaultIndexProp,\n index: indexProp,\n multiple,\n toggle,\n onChange,\n ...rest\n}: UseAccordionProps = {}) => {\n if (\n (indexProp || defaultIndexProp) != null &&\n !isArray(indexProp || defaultIndexProp) &&\n multiple\n ) {\n console.warn(\n `Accordion: If 'multiple' is passed, then 'index' or 'defaultIndex' must be an array.`,\n )\n }\n\n if (multiple && toggle) {\n console.warn(\n `Accordion: If 'multiple' is passed, 'toggle' will be ignored. Either remove 'toggle' or 'multiple' depending on whether you want multiple accordions visible or not`,\n )\n }\n\n const descendants = useAccordionDescendants()\n\n const [focusedIndex, setFocusedIndex] = useState<number>(-1)\n\n const [index, setIndex] = useControllableState({\n defaultValue: () =>\n multiple ? (defaultIndexProp ?? []) : (defaultIndexProp ?? -1),\n value: indexProp,\n onChange,\n })\n\n const getRootProps: PropGetter = useCallback(\n (props = {}) => mergeProps(rest, props)(),\n [rest],\n )\n\n useEffect(() => {\n return () => setFocusedIndex(-1)\n }, [])\n\n return {\n descendants,\n focusedIndex,\n index,\n multiple,\n setFocusedIndex,\n setIndex,\n toggle,\n getRootProps,\n }\n}\n\nexport type UseAccordionReturn = ReturnType<typeof useAccordion>\n\nexport interface UseAccordionItemProps extends HTMLProps {\n /**\n * The index of the accordion item.\n */\n index: number\n /**\n * If `true`, the accordion item will be disabled.\n *\n * @default false\n */\n disabled?: boolean\n}\n\nexport const useAccordionItem = ({\n disabled,\n index,\n ...rest\n}: UseAccordionItemProps) => {\n const itemId = useId()\n const panelId = useId()\n const {\n index: selectedIndex,\n multiple,\n setFocusedIndex,\n setIndex,\n toggle,\n } = useAccordionContext()\n const { descendants, register } = useAccordionDescendant({ disabled })\n const open =\n index !== -1\n ? isArray(selectedIndex)\n ? selectedIndex.includes(index)\n : selectedIndex === index\n : false\n\n if (open && disabled)\n console.warn(`Accordion: Cannot open a disabled accordion item`)\n\n const onChange = useCallback(\n (open: boolean) => {\n if (index === -1) return\n\n if (multiple && isArray(selectedIndex)) {\n setIndex(\n open\n ? selectedIndex.concat(index)\n : selectedIndex.filter((i) => i !== index),\n )\n } else if (open) {\n setIndex(index)\n } else if (toggle) {\n setIndex(-1)\n }\n },\n [multiple, toggle, index, selectedIndex, setIndex],\n )\n\n const onFocus = useCallback(() => {\n setFocusedIndex(index)\n }, [setFocusedIndex, index])\n\n const onClick = useCallback(() => {\n onChange(!open)\n setFocusedIndex(index)\n descendants.value(index)?.node.focus()\n }, [index, setFocusedIndex, open, onChange, descendants])\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLButtonElement>) => {\n runKeyAction(ev, {\n ArrowDown: () => {\n const next = descendants.enabledNextValue(index)\n\n next?.node.focus()\n },\n ArrowUp: () => {\n const prev = descendants.enabledPrevValue(index)\n\n prev?.node.focus()\n },\n End: () => {\n const last = descendants.enabledLastValue()\n\n last?.node.focus()\n },\n Home: () => {\n const first = descendants.enabledFirstValue()\n\n first?.node.focus()\n },\n })\n },\n [descendants, index],\n )\n\n const getItemProps: PropGetter = useCallback(\n (props = {}) =>\n mergeProps({ \"data-expanded\": dataAttr(open) }, rest, props)(),\n [open, rest],\n )\n\n const getButtonProps: PropGetter<\"button\"> = useCallback(\n ({ ref, ...props } = {}) => ({\n id: itemId,\n type: \"button\",\n \"aria-controls\": panelId,\n \"aria-disabled\": ariaAttr((!multiple && !toggle && open) || disabled),\n \"aria-expanded\": open,\n tabIndex: 0,\n ...props,\n ref: mergeRefs(register, ref),\n disabled,\n onClick: handlerAll(props.onClick, onClick),\n onFocus: handlerAll(props.onFocus, onFocus),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown),\n }),\n [\n itemId,\n open,\n panelId,\n multiple,\n toggle,\n disabled,\n register,\n onClick,\n onFocus,\n onKeyDown,\n ],\n )\n\n const getPanelProps: PropGetter = useCallback(\n ({ \"aria-labelledby\": ariaLabelledby, ...props } = {}) => ({\n id: panelId,\n \"aria-labelledby\": cx(ariaLabelledby, itemId),\n role: \"region\",\n ...props,\n }),\n [itemId, panelId],\n )\n\n const getIconProps: PropGetter<\"svg\"> = useCallback(\n (props) => ({\n \"aria-disabled\": ariaAttr((!multiple && !toggle && open) || disabled),\n \"aria-expanded\": open,\n \"aria-hidden\": true,\n role: \"presentation\",\n ...props,\n }),\n [multiple, toggle, open, disabled],\n )\n\n return {\n disabled,\n open,\n getButtonProps,\n getIconProps,\n getItemProps,\n getPanelProps,\n }\n}\n\nexport type UseAccordionItemReturn = ReturnType<typeof useAccordionItem>\n"],"mappings":";;;;;;;;;;;AAmBA,MAAM,EACJ,oBAAoB,6BACpB,eAAe,wBACf,gBAAgB,4BACdA,oCAAAA,mBAAsC;AAa1C,MAAM,CAAC,kBAAkB,uBAAuBC,gBAAAA,cAC9C,EAAE,MAAM,oBAAoB,CAC7B;AASD,MAAM,CAAC,sBAAsB,2BAC3BA,gBAAAA,cAAoC,EAClC,MAAM,wBACP,CAAC;AA+BJ,MAAa,gBAAgB,EAC3B,cAAc,kBACd,OAAO,WACP,UACA,QACA,UACA,GAAG,SACkB,EAAE,KAAK;CAC5B,KACG,aAAa,qBAAqB,QACnC,EAAA,GAAA,oBAAA,cAAA,SAAS,aAAa,iBAAiB,IACvC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A;EACA;EACA;EACA;EACA;EACA;EACD,CACF;CAED,MAAM,iBAAA,GAAA,MAAA,cACH,EAAE,mBAAmB,gBAAgB,GAAG,UAAU,EAAE,MAAM;EACzD,IAAI;EACJ,oBAAA,GAAA,oBAAA,cAAA,IAAsB,gBAAgB,OAAO;EAC7C,MAAM;EACN,GAAG;EACJ,GACD,CAAC,QAAQ,QAAQ,CAClB;CAaD,OAAO;EACL;EACA;EACA;EACA,eAAA,GAAA,MAAA,cAdC,WAAW;GACV,kBAAA,GAAA,oBAAA,cAAA,UAA2B,CAAC,YAAY,CAAC,UAAU,QAAS,SAAS;GACrE,iBAAiB;GACjB,eAAe;GACf,MAAM;GACN,GAAG;GACJ,GACD;GAAC;GAAU;GAAQ;GAAM;GAAS,CAOtB;EACZ;EACA;EACD"}
|
|
1
|
+
{"version":3,"file":"use-accordion.cjs","names":["createDescendants","createContext","useControllableState","mergeProps","mergeRefs"],"sources":["../../../../src/components/accordion/use-accordion.ts"],"sourcesContent":["\"use client\"\n\nimport type { KeyboardEvent } from \"react\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport { useCallback, useEffect, useId, useState } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { createDescendants } from \"../../hooks/use-descendants\"\nimport {\n ariaAttr,\n createContext,\n dataAttr,\n handlerAll,\n isArray,\n mergeRefs,\n runKeyAction,\n} from \"../../utils\"\n\nconst {\n DescendantsContext: AccordionDescendantsContext,\n useDescendant: useAccordionDescendant,\n useDescendants: useAccordionDescendants,\n} = createDescendants<HTMLButtonElement>()\n\nexport {\n AccordionDescendantsContext,\n useAccordionDescendant,\n useAccordionDescendants,\n}\n\ninterface AccordionContext extends Omit<\n UseAccordionReturn,\n \"descendants\" | \"getRootProps\"\n> {}\n\nconst [AccordionContext, useAccordionContext] = createContext<AccordionContext>(\n { name: \"AccordionContext\" },\n)\n\nexport { AccordionContext, useAccordionContext }\n\ninterface AccordionItemContext extends Omit<\n UseAccordionItemReturn,\n \"getItemProps\"\n> {}\n\nconst [AccordionItemContext, useAccordionItemContext] =\n createContext<AccordionItemContext>({\n name: \"AccordionItemContext\",\n })\n\nexport { AccordionItemContext, useAccordionItemContext }\n\nexport interface UseAccordionProps extends Omit<HTMLProps, \"onChange\"> {\n /**\n * The initial index(es) of the accordion item to expand.\n */\n defaultIndex?: number | number[]\n /**\n * The index(es) of the accordion item to expand.\n */\n index?: number | number[]\n /**\n * If `true`, multiple accordion items can be expanded at once.\n *\n * @default false\n */\n multiple?: boolean\n /**\n * If `true`, any expanded accordion item can be collapsed again.\n *\n * @default false\n */\n toggle?: boolean\n /**\n * The callback invoked when accordion items are expanded or collapsed.\n */\n onChange?: (index: number | number[]) => void\n}\n\nexport const useAccordion = ({\n defaultIndex: defaultIndexProp,\n index: indexProp,\n multiple,\n toggle,\n onChange,\n ...rest\n}: UseAccordionProps = {}) => {\n if (\n (indexProp || defaultIndexProp) != null &&\n !isArray(indexProp || defaultIndexProp) &&\n multiple\n ) {\n console.warn(\n `Accordion: If 'multiple' is passed, then 'index' or 'defaultIndex' must be an array.`,\n )\n }\n\n if (multiple && toggle) {\n console.warn(\n `Accordion: If 'multiple' is passed, 'toggle' will be ignored. Either remove 'toggle' or 'multiple' depending on whether you want multiple accordions visible or not`,\n )\n }\n\n const descendants = useAccordionDescendants()\n\n const [focusedIndex, setFocusedIndex] = useState<number>(-1)\n\n const [index, setIndex] = useControllableState({\n defaultValue: () =>\n multiple ? (defaultIndexProp ?? []) : (defaultIndexProp ?? -1),\n value: indexProp,\n onChange,\n })\n\n const getRootProps: PropGetter = useCallback(\n (props = {}) => mergeProps(rest, props)(),\n [rest],\n )\n\n useEffect(() => {\n return () => setFocusedIndex(-1)\n }, [])\n\n return {\n descendants,\n focusedIndex,\n index,\n multiple,\n setFocusedIndex,\n setIndex,\n toggle,\n getRootProps,\n }\n}\n\nexport type UseAccordionReturn = ReturnType<typeof useAccordion>\n\nexport interface UseAccordionItemProps extends HTMLProps {\n /**\n * The index of the accordion item.\n */\n index: number\n /**\n * If `true`, the accordion item will be disabled.\n *\n * @default false\n */\n disabled?: boolean\n}\n\nexport const useAccordionItem = ({\n disabled,\n index,\n ...rest\n}: UseAccordionItemProps) => {\n const itemId = useId()\n const panelId = useId()\n const {\n index: selectedIndex,\n multiple,\n setFocusedIndex,\n setIndex,\n toggle,\n } = useAccordionContext()\n const { descendants, register } = useAccordionDescendant({ disabled })\n const open =\n index !== -1\n ? isArray(selectedIndex)\n ? selectedIndex.includes(index)\n : selectedIndex === index\n : false\n\n if (open && disabled)\n console.warn(`Accordion: Cannot open a disabled accordion item`)\n\n const onChange = useCallback(\n (open: boolean) => {\n if (index === -1) return\n\n if (multiple && isArray(selectedIndex)) {\n setIndex(\n open\n ? selectedIndex.concat(index)\n : selectedIndex.filter((i) => i !== index),\n )\n } else if (open) {\n setIndex(index)\n } else if (toggle) {\n setIndex(-1)\n }\n },\n [multiple, toggle, index, selectedIndex, setIndex],\n )\n\n const onFocus = useCallback(() => {\n setFocusedIndex(index)\n }, [setFocusedIndex, index])\n\n const onClick = useCallback(() => {\n onChange(!open)\n setFocusedIndex(index)\n descendants.value(index)?.node.focus()\n }, [index, setFocusedIndex, open, onChange, descendants])\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLButtonElement>) => {\n runKeyAction(ev, {\n ArrowDown: () => {\n const next = descendants.enabledNextValue(index)\n\n next?.node.focus()\n },\n ArrowUp: () => {\n const prev = descendants.enabledPrevValue(index)\n\n prev?.node.focus()\n },\n End: () => {\n const last = descendants.enabledLastValue()\n\n last?.node.focus()\n },\n Home: () => {\n const first = descendants.enabledFirstValue()\n\n first?.node.focus()\n },\n })\n },\n [descendants, index],\n )\n\n const getItemProps: PropGetter = useCallback(\n (props = {}) =>\n mergeProps({ \"data-expanded\": dataAttr(open) }, rest, props)(),\n [open, rest],\n )\n\n const getButtonProps: PropGetter<\"button\"> = useCallback(\n ({ ref, ...props } = {}) => ({\n id: itemId,\n type: \"button\",\n \"aria-controls\": panelId,\n \"aria-disabled\": ariaAttr((!multiple && !toggle && open) || disabled),\n \"aria-expanded\": open,\n tabIndex: 0,\n ...props,\n ref: mergeRefs(register, ref),\n disabled,\n onClick: handlerAll(props.onClick, onClick),\n onFocus: handlerAll(props.onFocus, onFocus),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown),\n }),\n [\n itemId,\n open,\n panelId,\n multiple,\n toggle,\n disabled,\n register,\n onClick,\n onFocus,\n onKeyDown,\n ],\n )\n\n const getPanelProps: PropGetter = useCallback(\n (props = {}) =>\n mergeProps(\n { id: panelId, \"aria-labelledby\": itemId, role: \"region\" },\n props,\n )(),\n [itemId, panelId],\n )\n\n const getIconProps: PropGetter<\"svg\"> = useCallback(\n (props) => ({\n \"aria-disabled\": ariaAttr((!multiple && !toggle && open) || disabled),\n \"aria-expanded\": open,\n \"aria-hidden\": true,\n role: \"presentation\",\n ...props,\n }),\n [multiple, toggle, open, disabled],\n )\n\n return {\n disabled,\n open,\n getButtonProps,\n getIconProps,\n getItemProps,\n getPanelProps,\n }\n}\n\nexport type UseAccordionItemReturn = ReturnType<typeof useAccordionItem>\n"],"mappings":";;;;;;;;;;;AAkBA,MAAM,EACJ,oBAAoB,6BACpB,eAAe,wBACf,gBAAgB,4BACdA,oCAAAA,mBAAsC;AAa1C,MAAM,CAAC,kBAAkB,uBAAuBC,gBAAAA,cAC9C,EAAE,MAAM,oBAAoB,CAC7B;AASD,MAAM,CAAC,sBAAsB,2BAC3BA,gBAAAA,cAAoC,EAClC,MAAM,wBACP,CAAC;AA+BJ,MAAa,gBAAgB,EAC3B,cAAc,kBACd,OAAO,WACP,UACA,QACA,UACA,GAAG,SACkB,EAAE,KAAK;CAC5B,KACG,aAAa,qBAAqB,QACnC,EAAA,GAAA,oBAAA,cAAA,SAAS,aAAa,iBAAiB,IACvC,UAEA,QAAQ,KACN,uFACD;CAGH,IAAI,YAAY,QACd,QAAQ,KACN,sKACD;CAGH,MAAM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,EAAE,KACTD,cAAAA,WACE;EAAE,IAAI;EAAS,mBAAmB;EAAQ,MAAM;EAAU,EAC1D,MACD,EAAE,EACL,CAAC,QAAQ,QAAQ,CAClB;CAaD,OAAO;EACL;EACA;EACA;EACA,eAAA,GAAA,MAAA,cAdC,WAAW;GACV,kBAAA,GAAA,oBAAA,cAAA,UAA2B,CAAC,YAAY,CAAC,UAAU,QAAS,SAAS;GACrE,iBAAiB;GACjB,eAAe;GACf,MAAM;GACN,GAAG;GACJ,GACD;GAAC;GAAU;GAAQ;GAAM;GAAS,CAOtB;EACZ;EACA;EACD"}
|
|
@@ -13,7 +13,7 @@ const useCheckbox = ({ "aria-describedby": ariaDescribedbyProp, ...props } = {})
|
|
|
13
13
|
const group = require_use_checkbox_group.useCheckboxGroupContext();
|
|
14
14
|
const { max, value: groupValue, getInputProps: getGroupInputProps, getLabelProps } = group ?? {};
|
|
15
15
|
const uuid = (0, react.useId)();
|
|
16
|
-
const { props: { id, ref, name, "aria-controls":
|
|
16
|
+
const { props: { id, ref, name, "aria-controls": ariaControls, "aria-labelledby": ariaLabelledby, checked: checkedProp, defaultChecked = false, disabled, indeterminate = false, readOnly, required, tabIndex, value, onChange: onChangeProp, ...rest }, ariaProps: { "aria-describedby": ariaDescribedby, ...ariaProps }, dataProps, eventProps } = require_use_field_props.useFieldProps({
|
|
17
17
|
id: group ? uuid : void 0,
|
|
18
18
|
...props,
|
|
19
19
|
notSupportReadOnly: true
|
|
@@ -39,7 +39,8 @@ const useCheckbox = ({ "aria-describedby": ariaDescribedbyProp, ...props } = {})
|
|
|
39
39
|
setChecked
|
|
40
40
|
]);
|
|
41
41
|
const getRootProps = (0, react.useCallback)((props = {}) => {
|
|
42
|
-
const merged = require_props.mergeProps(
|
|
42
|
+
const merged = require_props.mergeProps({
|
|
43
|
+
...dataProps,
|
|
43
44
|
"data-checked": (0, require_utils_index.utils_exports.dataAttr)(checked),
|
|
44
45
|
"data-indeterminate": (0, require_utils_index.utils_exports.dataAttr)(indeterminate)
|
|
45
46
|
}, rest, props)();
|
|
@@ -51,19 +52,20 @@ const useCheckbox = ({ "aria-describedby": ariaDescribedbyProp, ...props } = {})
|
|
|
51
52
|
rest,
|
|
52
53
|
getLabelProps
|
|
53
54
|
]);
|
|
54
|
-
const getInputProps = (0, react.useCallback)((
|
|
55
|
-
const sharedProps = {
|
|
55
|
+
const getInputProps = (0, react.useCallback)((props = {}) => {
|
|
56
|
+
const sharedProps = require_props.mergeProps({
|
|
56
57
|
...dataProps,
|
|
57
58
|
...ariaProps,
|
|
58
59
|
id,
|
|
60
|
+
ref: require_ref.mergeRefs(ref, indeterminateRef),
|
|
59
61
|
type: "checkbox",
|
|
60
62
|
name,
|
|
61
63
|
style: require_dom.visuallyHiddenAttributes.style,
|
|
62
64
|
"aria-checked": indeterminate ? "mixed" : checked,
|
|
63
|
-
"aria-controls":
|
|
64
|
-
"aria-describedby":
|
|
65
|
+
"aria-controls": ariaControls,
|
|
66
|
+
"aria-describedby": resolvedAriaDescribedby,
|
|
65
67
|
"aria-disabled": (0, require_utils_index.utils_exports.ariaAttr)(!interactive),
|
|
66
|
-
"aria-labelledby":
|
|
68
|
+
"aria-labelledby": ariaLabelledby,
|
|
67
69
|
"data-checked": (0, require_utils_index.utils_exports.dataAttr)(checked),
|
|
68
70
|
"data-indeterminate": (0, require_utils_index.utils_exports.dataAttr)(indeterminate),
|
|
69
71
|
checked,
|
|
@@ -71,13 +73,11 @@ const useCheckbox = ({ "aria-describedby": ariaDescribedbyProp, ...props } = {})
|
|
|
71
73
|
readOnly,
|
|
72
74
|
required,
|
|
73
75
|
tabIndex,
|
|
74
|
-
value
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
onFocus: (0, require_utils_index.utils_exports.handlerAll)(props.onFocus, eventProps.onFocus)
|
|
80
|
-
};
|
|
76
|
+
value
|
|
77
|
+
}, props, {
|
|
78
|
+
...eventProps,
|
|
79
|
+
onChange
|
|
80
|
+
})();
|
|
81
81
|
return getGroupInputProps?.(sharedProps) ?? sharedProps;
|
|
82
82
|
}, [
|
|
83
83
|
dataProps,
|
|
@@ -86,10 +86,10 @@ const useCheckbox = ({ "aria-describedby": ariaDescribedbyProp, ...props } = {})
|
|
|
86
86
|
name,
|
|
87
87
|
indeterminate,
|
|
88
88
|
checked,
|
|
89
|
-
|
|
89
|
+
ariaControls,
|
|
90
90
|
resolvedAriaDescribedby,
|
|
91
91
|
interactive,
|
|
92
|
-
|
|
92
|
+
ariaLabelledby,
|
|
93
93
|
disabled,
|
|
94
94
|
readOnly,
|
|
95
95
|
required,
|
|
@@ -97,8 +97,7 @@ const useCheckbox = ({ "aria-describedby": ariaDescribedbyProp, ...props } = {})
|
|
|
97
97
|
value,
|
|
98
98
|
ref,
|
|
99
99
|
indeterminateRef,
|
|
100
|
-
eventProps
|
|
101
|
-
eventProps.onFocus,
|
|
100
|
+
eventProps,
|
|
102
101
|
onChange,
|
|
103
102
|
getGroupInputProps
|
|
104
103
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-checkbox.cjs","names":["useCheckboxGroupContext","useFieldProps","useControllableEventState","mergeProps","
|
|
1
|
+
{"version":3,"file":"use-checkbox.cjs","names":["useCheckboxGroupContext","useFieldProps","useControllableEventState","mergeProps","mergeRefs","visuallyHiddenAttributes"],"sources":["../../../../src/components/checkbox/use-checkbox.ts"],"sourcesContent":["\"use client\"\n\nimport type { ChangeEvent, ChangeEventHandler, FocusEventHandler } from \"react\"\nimport type { HTMLProps, HTMLRefAttributes, PropGetter } from \"../../core\"\nimport type { FieldProps } from \"../field\"\nimport { useCallback, useId } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useControllableEventState } from \"../../hooks/use-controllable-state\"\nimport {\n ariaAttr,\n dataAttr,\n isNumber,\n isUndefined,\n mergeRefs,\n visuallyHiddenAttributes,\n} from \"../../utils\"\nimport { useFieldProps } from \"../field\"\nimport { useCheckboxGroupContext } from \"./use-checkbox-group\"\n\nexport interface UseCheckboxProps<Y extends string = string>\n extends\n Omit<HTMLProps<\"label\">, \"onBlur\" | \"onChange\" | \"onFocus\" | \"ref\">,\n HTMLRefAttributes<\"input\">,\n FieldProps {\n /**\n * If `true`, the checkbox will be checked.\n */\n checked?: boolean\n /**\n * If `true`, the checkbox will be initially checked.\n *\n * @default false\n */\n defaultChecked?: boolean\n /**\n * id assigned to input.\n */\n id?: string\n /**\n * If `true`, the checkbox will be indeterminate.\n *\n * @default false\n */\n indeterminate?: boolean\n /**\n * The name of the input field in a checkbox.\n */\n name?: string\n /**\n * The value of the checkbox.\n */\n value?: Y\n /**\n * The callback invoked when the checkbox is blurred.\n */\n onBlur?: FocusEventHandler<HTMLInputElement>\n /**\n * The callback invoked when the checked state changes.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>\n /**\n * The callback invoked when the checkbox is focused.\n */\n onFocus?: FocusEventHandler<HTMLInputElement>\n}\n\nexport const useCheckbox = <Y extends string = string>({\n \"aria-describedby\": ariaDescribedbyProp,\n ...props\n}: UseCheckboxProps<Y> = {}) => {\n const group = useCheckboxGroupContext()\n const {\n max,\n value: groupValue,\n getInputProps: getGroupInputProps,\n getLabelProps,\n } = group ?? {}\n const uuid = useId()\n const {\n props: {\n id,\n ref,\n name,\n \"aria-controls\": ariaControls,\n \"aria-labelledby\": ariaLabelledby,\n checked: checkedProp,\n defaultChecked = false,\n disabled,\n indeterminate = false,\n readOnly,\n required,\n tabIndex,\n value,\n onChange: onChangeProp,\n ...rest\n },\n ariaProps: { \"aria-describedby\": ariaDescribedby, ...ariaProps },\n dataProps,\n eventProps,\n } = useFieldProps({\n id: group ? uuid : undefined,\n ...props,\n notSupportReadOnly: true,\n })\n const resolvedAriaDescribedby = group ? ariaDescribedbyProp : ariaDescribedby\n const resolvedChecked =\n !isUndefined(groupValue) && !isUndefined(value)\n ? groupValue.includes(value)\n : checkedProp\n const [checked, setChecked] = useControllableEventState({\n defaultValue: defaultChecked,\n value: resolvedChecked,\n onChange: onChangeProp,\n })\n const trulyDisabled =\n !checked && isNumber(max) && group && group.value.length >= max\n const interactive = !(readOnly || trulyDisabled)\n const indeterminateRef = useCallback(\n (el: HTMLInputElement | null) => {\n if (el) el.indeterminate = indeterminate\n },\n [indeterminate],\n )\n\n const onChange = useCallback(\n (ev: ChangeEvent<HTMLInputElement>) => {\n if (!interactive) return (ev.defaultPrevented = true)\n\n if (indeterminate) ev.target.checked = true\n\n setChecked(ev)\n },\n [interactive, indeterminate, setChecked],\n )\n\n const getRootProps: PropGetter<\"label\"> = useCallback(\n (props = {}) => {\n const merged = mergeProps(\n {\n ...dataProps,\n \"data-checked\": dataAttr(checked),\n \"data-indeterminate\": dataAttr(indeterminate),\n },\n rest,\n props,\n )()\n\n return getLabelProps?.(merged) ?? merged\n },\n [dataProps, checked, indeterminate, rest, getLabelProps],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}) => {\n const sharedProps = mergeProps(\n {\n ...dataProps,\n ...ariaProps,\n id,\n ref: mergeRefs(ref, indeterminateRef),\n type: \"checkbox\",\n name,\n style: visuallyHiddenAttributes.style,\n \"aria-checked\": indeterminate ? (\"mixed\" as const) : checked,\n \"aria-controls\": ariaControls,\n \"aria-describedby\": resolvedAriaDescribedby,\n \"aria-disabled\": ariaAttr(!interactive),\n \"aria-labelledby\": ariaLabelledby,\n \"data-checked\": dataAttr(checked),\n \"data-indeterminate\": dataAttr(indeterminate),\n checked,\n disabled,\n readOnly,\n required,\n tabIndex,\n value,\n },\n props,\n { ...eventProps, onChange },\n )()\n\n return getGroupInputProps?.(sharedProps) ?? sharedProps\n },\n [\n dataProps,\n ariaProps,\n id,\n name,\n indeterminate,\n checked,\n ariaControls,\n resolvedAriaDescribedby,\n interactive,\n ariaLabelledby,\n disabled,\n readOnly,\n required,\n tabIndex,\n value,\n ref,\n indeterminateRef,\n eventProps,\n onChange,\n getGroupInputProps,\n ],\n )\n\n const getIndicatorProps: PropGetter = useCallback(\n (props = {}) => ({\n ...dataProps,\n \"aria-hidden\": \"true\",\n \"data-checked\": dataAttr(checked),\n \"data-indeterminate\": dataAttr(indeterminate),\n ...props,\n }),\n [dataProps, checked, indeterminate],\n )\n\n return {\n checked,\n indeterminate,\n getIndicatorProps,\n getInputProps,\n getRootProps,\n onChange,\n }\n}\n\nexport type UseCheckboxReturn = ReturnType<typeof useCheckbox>\n"],"mappings":";;;;;;;;;;;AAkEA,MAAa,eAA0C,EACrD,oBAAoB,qBACpB,GAAG,UACoB,EAAE,KAAK;CAC9B,MAAM,QAAQA,2BAAAA,yBAAyB;CACvC,MAAM,EACJ,KACA,OAAO,YACP,eAAe,oBACf,kBACE,SAAS,EAAE;CACf,MAAM,QAAA,GAAA,MAAA,QAAc;CACpB,MAAM,EACJ,OAAO,EACL,IACA,KACA,MACA,iBAAiB,cACjB,mBAAmB,gBACnB,SAAS,aACT,iBAAiB,OACjB,UACA,gBAAgB,OAChB,UACA,UACA,UACA,OACA,UAAU,cACV,GAAG,QAEL,WAAW,EAAE,oBAAoB,iBAAiB,GAAG,aACrD,WACA,eACEC,wBAAAA,cAAc;EAChB,IAAI,QAAQ,OAAO,KAAA;EACnB,GAAG;EACH,oBAAoB;EACrB,CAAC;CACF,MAAM,0BAA0B,QAAQ,sBAAsB;CAK9D,MAAM,CAAC,SAAS,cAAcC,2CAAAA,0BAA0B;EACtD,cAAc;EACd,OALA,EAAA,GAAA,oBAAA,cAAA,aAAa,WAAW,IAAI,EAAA,GAAA,oBAAA,cAAA,aAAa,MAAM,GAC3C,WAAW,SAAS,MAAM,GAC1B;EAIJ,UAAU;EACX,CAAC;CACF,MAAM,gBACJ,CAAC,YAAA,GAAA,oBAAA,cAAA,UAAoB,IAAI,IAAI,SAAS,MAAM,MAAM,UAAU;CAC9D,MAAM,cAAc,EAAE,YAAY;CAClC,MAAM,oBAAA,GAAA,MAAA,cACH,OAAgC;EAC/B,IAAI,IAAI,GAAG,gBAAgB;IAE7B,CAAC,cAAc,CAChB;CAED,MAAM,Y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AyB,QAAQ;GACjC,uBAAA,GAAA,oBAAA,cAAA,UAA+B,cAAc;GAC7C,GAAG;GACJ,GACD;GAAC;GAAW;GAAS;GAAc,CAMlB;EACjB;EACA;EACA;EACD"}
|
|
@@ -111,12 +111,11 @@ const useAccordionItem = ({ disabled, index, ...rest }) => {
|
|
|
111
111
|
onFocus,
|
|
112
112
|
onKeyDown
|
|
113
113
|
]);
|
|
114
|
-
const getPanelProps = useCallback((
|
|
114
|
+
const getPanelProps = useCallback((props = {}) => mergeProps({
|
|
115
115
|
id: panelId,
|
|
116
|
-
"aria-labelledby":
|
|
117
|
-
role: "region"
|
|
118
|
-
|
|
119
|
-
}), [itemId, panelId]);
|
|
116
|
+
"aria-labelledby": itemId,
|
|
117
|
+
role: "region"
|
|
118
|
+
}, props)(), [itemId, panelId]);
|
|
120
119
|
return {
|
|
121
120
|
disabled,
|
|
122
121
|
open,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-accordion.js","names":["createContext"],"sources":["../../../../src/components/accordion/use-accordion.ts"],"sourcesContent":["\"use client\"\n\nimport type { KeyboardEvent } from \"react\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport { useCallback, useEffect, useId, useState } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { createDescendants } from \"../../hooks/use-descendants\"\nimport {\n ariaAttr,\n createContext,\n cx,\n dataAttr,\n handlerAll,\n isArray,\n mergeRefs,\n runKeyAction,\n} from \"../../utils\"\n\nconst {\n DescendantsContext: AccordionDescendantsContext,\n useDescendant: useAccordionDescendant,\n useDescendants: useAccordionDescendants,\n} = createDescendants<HTMLButtonElement>()\n\nexport {\n AccordionDescendantsContext,\n useAccordionDescendant,\n useAccordionDescendants,\n}\n\ninterface AccordionContext extends Omit<\n UseAccordionReturn,\n \"descendants\" | \"getRootProps\"\n> {}\n\nconst [AccordionContext, useAccordionContext] = createContext<AccordionContext>(\n { name: \"AccordionContext\" },\n)\n\nexport { AccordionContext, useAccordionContext }\n\ninterface AccordionItemContext extends Omit<\n UseAccordionItemReturn,\n \"getItemProps\"\n> {}\n\nconst [AccordionItemContext, useAccordionItemContext] =\n createContext<AccordionItemContext>({\n name: \"AccordionItemContext\",\n })\n\nexport { AccordionItemContext, useAccordionItemContext }\n\nexport interface UseAccordionProps extends Omit<HTMLProps, \"onChange\"> {\n /**\n * The initial index(es) of the accordion item to expand.\n */\n defaultIndex?: number | number[]\n /**\n * The index(es) of the accordion item to expand.\n */\n index?: number | number[]\n /**\n * If `true`, multiple accordion items can be expanded at once.\n *\n * @default false\n */\n multiple?: boolean\n /**\n * If `true`, any expanded accordion item can be collapsed again.\n *\n * @default false\n */\n toggle?: boolean\n /**\n * The callback invoked when accordion items are expanded or collapsed.\n */\n onChange?: (index: number | number[]) => void\n}\n\nexport const useAccordion = ({\n defaultIndex: defaultIndexProp,\n index: indexProp,\n multiple,\n toggle,\n onChange,\n ...rest\n}: UseAccordionProps = {}) => {\n if (\n (indexProp || defaultIndexProp) != null &&\n !isArray(indexProp || defaultIndexProp) &&\n multiple\n ) {\n console.warn(\n `Accordion: If 'multiple' is passed, then 'index' or 'defaultIndex' must be an array.`,\n )\n }\n\n if (multiple && toggle) {\n console.warn(\n `Accordion: If 'multiple' is passed, 'toggle' will be ignored. Either remove 'toggle' or 'multiple' depending on whether you want multiple accordions visible or not`,\n )\n }\n\n const descendants = useAccordionDescendants()\n\n const [focusedIndex, setFocusedIndex] = useState<number>(-1)\n\n const [index, setIndex] = useControllableState({\n defaultValue: () =>\n multiple ? (defaultIndexProp ?? []) : (defaultIndexProp ?? -1),\n value: indexProp,\n onChange,\n })\n\n const getRootProps: PropGetter = useCallback(\n (props = {}) => mergeProps(rest, props)(),\n [rest],\n )\n\n useEffect(() => {\n return () => setFocusedIndex(-1)\n }, [])\n\n return {\n descendants,\n focusedIndex,\n index,\n multiple,\n setFocusedIndex,\n setIndex,\n toggle,\n getRootProps,\n }\n}\n\nexport type UseAccordionReturn = ReturnType<typeof useAccordion>\n\nexport interface UseAccordionItemProps extends HTMLProps {\n /**\n * The index of the accordion item.\n */\n index: number\n /**\n * If `true`, the accordion item will be disabled.\n *\n * @default false\n */\n disabled?: boolean\n}\n\nexport const useAccordionItem = ({\n disabled,\n index,\n ...rest\n}: UseAccordionItemProps) => {\n const itemId = useId()\n const panelId = useId()\n const {\n index: selectedIndex,\n multiple,\n setFocusedIndex,\n setIndex,\n toggle,\n } = useAccordionContext()\n const { descendants, register } = useAccordionDescendant({ disabled })\n const open =\n index !== -1\n ? isArray(selectedIndex)\n ? selectedIndex.includes(index)\n : selectedIndex === index\n : false\n\n if (open && disabled)\n console.warn(`Accordion: Cannot open a disabled accordion item`)\n\n const onChange = useCallback(\n (open: boolean) => {\n if (index === -1) return\n\n if (multiple && isArray(selectedIndex)) {\n setIndex(\n open\n ? selectedIndex.concat(index)\n : selectedIndex.filter((i) => i !== index),\n )\n } else if (open) {\n setIndex(index)\n } else if (toggle) {\n setIndex(-1)\n }\n },\n [multiple, toggle, index, selectedIndex, setIndex],\n )\n\n const onFocus = useCallback(() => {\n setFocusedIndex(index)\n }, [setFocusedIndex, index])\n\n const onClick = useCallback(() => {\n onChange(!open)\n setFocusedIndex(index)\n descendants.value(index)?.node.focus()\n }, [index, setFocusedIndex, open, onChange, descendants])\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLButtonElement>) => {\n runKeyAction(ev, {\n ArrowDown: () => {\n const next = descendants.enabledNextValue(index)\n\n next?.node.focus()\n },\n ArrowUp: () => {\n const prev = descendants.enabledPrevValue(index)\n\n prev?.node.focus()\n },\n End: () => {\n const last = descendants.enabledLastValue()\n\n last?.node.focus()\n },\n Home: () => {\n const first = descendants.enabledFirstValue()\n\n first?.node.focus()\n },\n })\n },\n [descendants, index],\n )\n\n const getItemProps: PropGetter = useCallback(\n (props = {}) =>\n mergeProps({ \"data-expanded\": dataAttr(open) }, rest, props)(),\n [open, rest],\n )\n\n const getButtonProps: PropGetter<\"button\"> = useCallback(\n ({ ref, ...props } = {}) => ({\n id: itemId,\n type: \"button\",\n \"aria-controls\": panelId,\n \"aria-disabled\": ariaAttr((!multiple && !toggle && open) || disabled),\n \"aria-expanded\": open,\n tabIndex: 0,\n ...props,\n ref: mergeRefs(register, ref),\n disabled,\n onClick: handlerAll(props.onClick, onClick),\n onFocus: handlerAll(props.onFocus, onFocus),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown),\n }),\n [\n itemId,\n open,\n panelId,\n multiple,\n toggle,\n disabled,\n register,\n onClick,\n onFocus,\n onKeyDown,\n ],\n )\n\n const getPanelProps: PropGetter = useCallback(\n ({ \"aria-labelledby\": ariaLabelledby, ...props } = {}) => ({\n id: panelId,\n \"aria-labelledby\": cx(ariaLabelledby, itemId),\n role: \"region\",\n ...props,\n }),\n [itemId, panelId],\n )\n\n const getIconProps: PropGetter<\"svg\"> = useCallback(\n (props) => ({\n \"aria-disabled\": ariaAttr((!multiple && !toggle && open) || disabled),\n \"aria-expanded\": open,\n \"aria-hidden\": true,\n role: \"presentation\",\n ...props,\n }),\n [multiple, toggle, open, disabled],\n )\n\n return {\n disabled,\n open,\n getButtonProps,\n getIconProps,\n getItemProps,\n getPanelProps,\n }\n}\n\nexport type UseAccordionItemReturn = ReturnType<typeof useAccordionItem>\n"],"mappings":";;;;;;;;;;AAmBA,MAAM,EACJ,oBAAoB,6BACpB,eAAe,wBACf,gBAAgB,4BACd,mBAAsC;AAa1C,MAAM,CAAC,kBAAkB,uBAAuBA,gBAC9C,EAAE,MAAM,oBAAoB,CAC7B;AASD,MAAM,CAAC,sBAAsB,2BAC3BA,gBAAoC,EAClC,MAAM,wBACP,CAAC;AA+BJ,MAAa,gBAAgB,EAC3B,cAAc,kBACd,OAAO,WACP,UACA,QACA,UACA,GAAG,SACkB,EAAE,KAAK;CAC5B,KACG,aAAa,qBAAqB,QACnC,EAAA,GAAA,cAAA,SAAS,aAAa,iBAAiB,IACvC,UAEA,QAAQ,K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AO;EACL;EACA;EACA;EACA,cAfsC,aACrC,WAAW;GACV,kBAAA,GAAA,cAAA,UAA2B,CAAC,YAAY,CAAC,UAAU,QAAS,SAAS;GACrE,iBAAiB;GACjB,eAAe;GACf,MAAM;GACN,GAAG;GACJ,GACD;GAAC;GAAU;GAAQ;GAAM;GAAS,CAOtB;EACZ;EACA;EACD"}
|
|
1
|
+
{"version":3,"file":"use-accordion.js","names":["createContext"],"sources":["../../../../src/components/accordion/use-accordion.ts"],"sourcesContent":["\"use client\"\n\nimport type { KeyboardEvent } from \"react\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport { useCallback, useEffect, useId, useState } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { createDescendants } from \"../../hooks/use-descendants\"\nimport {\n ariaAttr,\n createContext,\n dataAttr,\n handlerAll,\n isArray,\n mergeRefs,\n runKeyAction,\n} from \"../../utils\"\n\nconst {\n DescendantsContext: AccordionDescendantsContext,\n useDescendant: useAccordionDescendant,\n useDescendants: useAccordionDescendants,\n} = createDescendants<HTMLButtonElement>()\n\nexport {\n AccordionDescendantsContext,\n useAccordionDescendant,\n useAccordionDescendants,\n}\n\ninterface AccordionContext extends Omit<\n UseAccordionReturn,\n \"descendants\" | \"getRootProps\"\n> {}\n\nconst [AccordionContext, useAccordionContext] = createContext<AccordionContext>(\n { name: \"AccordionContext\" },\n)\n\nexport { AccordionContext, useAccordionContext }\n\ninterface AccordionItemContext extends Omit<\n UseAccordionItemReturn,\n \"getItemProps\"\n> {}\n\nconst [AccordionItemContext, useAccordionItemContext] =\n createContext<AccordionItemContext>({\n name: \"AccordionItemContext\",\n })\n\nexport { AccordionItemContext, useAccordionItemContext }\n\nexport interface UseAccordionProps extends Omit<HTMLProps, \"onChange\"> {\n /**\n * The initial index(es) of the accordion item to expand.\n */\n defaultIndex?: number | number[]\n /**\n * The index(es) of the accordion item to expand.\n */\n index?: number | number[]\n /**\n * If `true`, multiple accordion items can be expanded at once.\n *\n * @default false\n */\n multiple?: boolean\n /**\n * If `true`, any expanded accordion item can be collapsed again.\n *\n * @default false\n */\n toggle?: boolean\n /**\n * The callback invoked when accordion items are expanded or collapsed.\n */\n onChange?: (index: number | number[]) => void\n}\n\nexport const useAccordion = ({\n defaultIndex: defaultIndexProp,\n index: indexProp,\n multiple,\n toggle,\n onChange,\n ...rest\n}: UseAccordionProps = {}) => {\n if (\n (indexProp || defaultIndexProp) != null &&\n !isArray(indexProp || defaultIndexProp) &&\n multiple\n ) {\n console.warn(\n `Accordion: If 'multiple' is passed, then 'index' or 'defaultIndex' must be an array.`,\n )\n }\n\n if (multiple && toggle) {\n console.warn(\n `Accordion: If 'multiple' is passed, 'toggle' will be ignored. Either remove 'toggle' or 'multiple' depending on whether you want multiple accordions visible or not`,\n )\n }\n\n const descendants = useAccordionDescendants()\n\n const [focusedIndex, setFocusedIndex] = useState<number>(-1)\n\n const [index, setIndex] = useControllableState({\n defaultValue: () =>\n multiple ? (defaultIndexProp ?? []) : (defaultIndexProp ?? -1),\n value: indexProp,\n onChange,\n })\n\n const getRootProps: PropGetter = useCallback(\n (props = {}) => mergeProps(rest, props)(),\n [rest],\n )\n\n useEffect(() => {\n return () => setFocusedIndex(-1)\n }, [])\n\n return {\n descendants,\n focusedIndex,\n index,\n multiple,\n setFocusedIndex,\n setIndex,\n toggle,\n getRootProps,\n }\n}\n\nexport type UseAccordionReturn = ReturnType<typeof useAccordion>\n\nexport interface UseAccordionItemProps extends HTMLProps {\n /**\n * The index of the accordion item.\n */\n index: number\n /**\n * If `true`, the accordion item will be disabled.\n *\n * @default false\n */\n disabled?: boolean\n}\n\nexport const useAccordionItem = ({\n disabled,\n index,\n ...rest\n}: UseAccordionItemProps) => {\n const itemId = useId()\n const panelId = useId()\n const {\n index: selectedIndex,\n multiple,\n setFocusedIndex,\n setIndex,\n toggle,\n } = useAccordionContext()\n const { descendants, register } = useAccordionDescendant({ disabled })\n const open =\n index !== -1\n ? isArray(selectedIndex)\n ? selectedIndex.includes(index)\n : selectedIndex === index\n : false\n\n if (open && disabled)\n console.warn(`Accordion: Cannot open a disabled accordion item`)\n\n const onChange = useCallback(\n (open: boolean) => {\n if (index === -1) return\n\n if (multiple && isArray(selectedIndex)) {\n setIndex(\n open\n ? selectedIndex.concat(index)\n : selectedIndex.filter((i) => i !== index),\n )\n } else if (open) {\n setIndex(index)\n } else if (toggle) {\n setIndex(-1)\n }\n },\n [multiple, toggle, index, selectedIndex, setIndex],\n )\n\n const onFocus = useCallback(() => {\n setFocusedIndex(index)\n }, [setFocusedIndex, index])\n\n const onClick = useCallback(() => {\n onChange(!open)\n setFocusedIndex(index)\n descendants.value(index)?.node.focus()\n }, [index, setFocusedIndex, open, onChange, descendants])\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLButtonElement>) => {\n runKeyAction(ev, {\n ArrowDown: () => {\n const next = descendants.enabledNextValue(index)\n\n next?.node.focus()\n },\n ArrowUp: () => {\n const prev = descendants.enabledPrevValue(index)\n\n prev?.node.focus()\n },\n End: () => {\n const last = descendants.enabledLastValue()\n\n last?.node.focus()\n },\n Home: () => {\n const first = descendants.enabledFirstValue()\n\n first?.node.focus()\n },\n })\n },\n [descendants, index],\n )\n\n const getItemProps: PropGetter = useCallback(\n (props = {}) =>\n mergeProps({ \"data-expanded\": dataAttr(open) }, rest, props)(),\n [open, rest],\n )\n\n const getButtonProps: PropGetter<\"button\"> = useCallback(\n ({ ref, ...props } = {}) => ({\n id: itemId,\n type: \"button\",\n \"aria-controls\": panelId,\n \"aria-disabled\": ariaAttr((!multiple && !toggle && open) || disabled),\n \"aria-expanded\": open,\n tabIndex: 0,\n ...props,\n ref: mergeRefs(register, ref),\n disabled,\n onClick: handlerAll(props.onClick, onClick),\n onFocus: handlerAll(props.onFocus, onFocus),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown),\n }),\n [\n itemId,\n open,\n panelId,\n multiple,\n toggle,\n disabled,\n register,\n onClick,\n onFocus,\n onKeyDown,\n ],\n )\n\n const getPanelProps: PropGetter = useCallback(\n (props = {}) =>\n mergeProps(\n { id: panelId, \"aria-labelledby\": itemId, role: \"region\" },\n props,\n )(),\n [itemId, panelId],\n )\n\n const getIconProps: PropGetter<\"svg\"> = useCallback(\n (props) => ({\n \"aria-disabled\": ariaAttr((!multiple && !toggle && open) || disabled),\n \"aria-expanded\": open,\n \"aria-hidden\": true,\n role: \"presentation\",\n ...props,\n }),\n [multiple, toggle, open, disabled],\n )\n\n return {\n disabled,\n open,\n getButtonProps,\n getIconProps,\n getItemProps,\n getPanelProps,\n }\n}\n\nexport type UseAccordionItemReturn = ReturnType<typeof useAccordionItem>\n"],"mappings":";;;;;;;;;;AAkBA,MAAM,EACJ,oBAAoB,6BACpB,eAAe,wBACf,gBAAgB,4BACd,mBAAsC;AAa1C,MAAM,CAAC,kBAAkB,uBAAuBA,gBAC9C,EAAE,MAAM,oBAAoB,CAC7B;AASD,MAAM,CAAC,sBAAsB,2BAC3BA,gBAAoC,EAClC,MAAM,wBACP,CAAC;AA+BJ,MAAa,gBAAgB,EAC3B,cAAc,kBACd,OAAO,WACP,UACA,QACA,UACA,GAAG,SACkB,EAAE,KAAK;CAC5B,KACG,aAAa,qBAAqB,QACnC,EAAA,GAAA,cAAA,SAAS,aAAa,iBAAiB,IACvC,UAEA,QAAQ,KACN,uFACD;CAGH,IAAI,YAAY,QACd,QAAQ,KACN,sKACD;CAGH,MAAM,cAAc,yBAAyB;CAE7C,MAAM,CAAC,cAAc,mBAAmB,SAAiB,GAAG;CAE5D,MAAM,CAAC,OAAO,YAAY,qBAAqB;EAC7C,oBACE,WAAY,oBAAoB,EAAE,GAAK,oBAAoB;EAC7D,OAAO;EACP;EACD,CAAC;CAEF,MAAM,eAA2B,aAC9B,QAAQ,EAAE,KAAK,WAAW,MAAM,MAAM,EAAE,EACzC,CAAC,KAAK,CACP;CAED,gBAAgB;EACd,aAAa,gBAAgB,GAAG;IAC/B,EAAE,CAAC;CAEN,O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AC,aAAa,MAAM,CACrB;CAED,MAAM,eAA2B,aAC9B,QAAQ,EAAE,KACT,WAAW,EAAE,kBAAA,GAAA,cAAA,UAA0B,KAAK,EAAE,EAAE,MAAM,MAAM,EAAE,EAChE,CAAC,MAAM,KAAK,CACb;CAED,MAAM,iBAAuC,aAC1C,EAAE,KAAK,GAAG,UAAU,EAAE,MAAM;EAC3B,IAAI;EACJ,MAAM;EACN,iBAAiB;EACjB,kBAAA,GAAA,cAAA,UAA2B,CAAC,YAAY,CAAC,UAAU,QAAS,SAAS;EACrE,iBAAiB;EACjB,UAAU;EACV,GAAG;EACH,KAAK,UAAU,UAAU,IAAI;EAC7B;EACA,UAAA,GAAA,cAAA,YAAoB,MAAM,SAAS,QAAQ;EAC3C,UAAA,GAAA,cAAA,YAAoB,MAAM,SAAS,QAAQ;EAC3C,YAAA,GAAA,cAAA,YAAsB,MAAM,WAAW,UAAU;EAClD,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;CAED,MAAM,gBAA4B,aAC/B,QAAQ,EAAE,KACT,WACE;EAAE,IAAI;EAAS,mBAAmB;EAAQ,MAAM;EAAU,EAC1D,MACD,EAAE,EACL,CAAC,QAAQ,QAAQ,CAClB;CAaD,OAAO;EACL;EACA;EACA;EACA,cAfsC,aACrC,WAAW;GACV,kBAAA,GAAA,cAAA,UAA2B,CAAC,YAAY,CAAC,UAAU,QAAS,SAAS;GACrE,iBAAiB;GACjB,eAAe;GACf,MAAM;GACN,GAAG;GACJ,GACD;GAAC;GAAU;GAAQ;GAAM;GAAS,CAOtB;EACZ;EACA;EACD"}
|
|
@@ -12,7 +12,7 @@ const useCheckbox = ({ "aria-describedby": ariaDescribedbyProp, ...props } = {})
|
|
|
12
12
|
const group = useCheckboxGroupContext();
|
|
13
13
|
const { max, value: groupValue, getInputProps: getGroupInputProps, getLabelProps } = group ?? {};
|
|
14
14
|
const uuid = useId();
|
|
15
|
-
const { props: { id, ref, name, "aria-controls":
|
|
15
|
+
const { props: { id, ref, name, "aria-controls": ariaControls, "aria-labelledby": ariaLabelledby, checked: checkedProp, defaultChecked = false, disabled, indeterminate = false, readOnly, required, tabIndex, value, onChange: onChangeProp, ...rest }, ariaProps: { "aria-describedby": ariaDescribedby, ...ariaProps }, dataProps, eventProps } = useFieldProps({
|
|
16
16
|
id: group ? uuid : void 0,
|
|
17
17
|
...props,
|
|
18
18
|
notSupportReadOnly: true
|
|
@@ -38,7 +38,8 @@ const useCheckbox = ({ "aria-describedby": ariaDescribedbyProp, ...props } = {})
|
|
|
38
38
|
setChecked
|
|
39
39
|
]);
|
|
40
40
|
const getRootProps = useCallback((props = {}) => {
|
|
41
|
-
const merged = mergeProps(
|
|
41
|
+
const merged = mergeProps({
|
|
42
|
+
...dataProps,
|
|
42
43
|
"data-checked": (0, utils_exports.dataAttr)(checked),
|
|
43
44
|
"data-indeterminate": (0, utils_exports.dataAttr)(indeterminate)
|
|
44
45
|
}, rest, props)();
|
|
@@ -50,19 +51,20 @@ const useCheckbox = ({ "aria-describedby": ariaDescribedbyProp, ...props } = {})
|
|
|
50
51
|
rest,
|
|
51
52
|
getLabelProps
|
|
52
53
|
]);
|
|
53
|
-
const getInputProps = useCallback((
|
|
54
|
-
const sharedProps = {
|
|
54
|
+
const getInputProps = useCallback((props = {}) => {
|
|
55
|
+
const sharedProps = mergeProps({
|
|
55
56
|
...dataProps,
|
|
56
57
|
...ariaProps,
|
|
57
58
|
id,
|
|
59
|
+
ref: mergeRefs(ref, indeterminateRef),
|
|
58
60
|
type: "checkbox",
|
|
59
61
|
name,
|
|
60
62
|
style: visuallyHiddenAttributes.style,
|
|
61
63
|
"aria-checked": indeterminate ? "mixed" : checked,
|
|
62
|
-
"aria-controls":
|
|
63
|
-
"aria-describedby":
|
|
64
|
+
"aria-controls": ariaControls,
|
|
65
|
+
"aria-describedby": resolvedAriaDescribedby,
|
|
64
66
|
"aria-disabled": (0, utils_exports.ariaAttr)(!interactive),
|
|
65
|
-
"aria-labelledby":
|
|
67
|
+
"aria-labelledby": ariaLabelledby,
|
|
66
68
|
"data-checked": (0, utils_exports.dataAttr)(checked),
|
|
67
69
|
"data-indeterminate": (0, utils_exports.dataAttr)(indeterminate),
|
|
68
70
|
checked,
|
|
@@ -70,13 +72,11 @@ const useCheckbox = ({ "aria-describedby": ariaDescribedbyProp, ...props } = {})
|
|
|
70
72
|
readOnly,
|
|
71
73
|
required,
|
|
72
74
|
tabIndex,
|
|
73
|
-
value
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
onFocus: (0, utils_exports.handlerAll)(props.onFocus, eventProps.onFocus)
|
|
79
|
-
};
|
|
75
|
+
value
|
|
76
|
+
}, props, {
|
|
77
|
+
...eventProps,
|
|
78
|
+
onChange
|
|
79
|
+
})();
|
|
80
80
|
return getGroupInputProps?.(sharedProps) ?? sharedProps;
|
|
81
81
|
}, [
|
|
82
82
|
dataProps,
|
|
@@ -85,10 +85,10 @@ const useCheckbox = ({ "aria-describedby": ariaDescribedbyProp, ...props } = {})
|
|
|
85
85
|
name,
|
|
86
86
|
indeterminate,
|
|
87
87
|
checked,
|
|
88
|
-
|
|
88
|
+
ariaControls,
|
|
89
89
|
resolvedAriaDescribedby,
|
|
90
90
|
interactive,
|
|
91
|
-
|
|
91
|
+
ariaLabelledby,
|
|
92
92
|
disabled,
|
|
93
93
|
readOnly,
|
|
94
94
|
required,
|
|
@@ -96,8 +96,7 @@ const useCheckbox = ({ "aria-describedby": ariaDescribedbyProp, ...props } = {})
|
|
|
96
96
|
value,
|
|
97
97
|
ref,
|
|
98
98
|
indeterminateRef,
|
|
99
|
-
eventProps
|
|
100
|
-
eventProps.onFocus,
|
|
99
|
+
eventProps,
|
|
101
100
|
onChange,
|
|
102
101
|
getGroupInputProps
|
|
103
102
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-checkbox.js","names":[],"sources":["../../../../src/components/checkbox/use-checkbox.ts"],"sourcesContent":["\"use client\"\n\nimport type { ChangeEvent, ChangeEventHandler, FocusEventHandler } from \"react\"\nimport type { HTMLProps, HTMLRefAttributes, PropGetter } from \"../../core\"\nimport type { FieldProps } from \"../field\"\nimport { useCallback, useId } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useControllableEventState } from \"../../hooks/use-controllable-state\"\nimport {\n ariaAttr,\n
|
|
1
|
+
{"version":3,"file":"use-checkbox.js","names":[],"sources":["../../../../src/components/checkbox/use-checkbox.ts"],"sourcesContent":["\"use client\"\n\nimport type { ChangeEvent, ChangeEventHandler, FocusEventHandler } from \"react\"\nimport type { HTMLProps, HTMLRefAttributes, PropGetter } from \"../../core\"\nimport type { FieldProps } from \"../field\"\nimport { useCallback, useId } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useControllableEventState } from \"../../hooks/use-controllable-state\"\nimport {\n ariaAttr,\n dataAttr,\n isNumber,\n isUndefined,\n mergeRefs,\n visuallyHiddenAttributes,\n} from \"../../utils\"\nimport { useFieldProps } from \"../field\"\nimport { useCheckboxGroupContext } from \"./use-checkbox-group\"\n\nexport interface UseCheckboxProps<Y extends string = string>\n extends\n Omit<HTMLProps<\"label\">, \"onBlur\" | \"onChange\" | \"onFocus\" | \"ref\">,\n HTMLRefAttributes<\"input\">,\n FieldProps {\n /**\n * If `true`, the checkbox will be checked.\n */\n checked?: boolean\n /**\n * If `true`, the checkbox will be initially checked.\n *\n * @default false\n */\n defaultChecked?: boolean\n /**\n * id assigned to input.\n */\n id?: string\n /**\n * If `true`, the checkbox will be indeterminate.\n *\n * @default false\n */\n indeterminate?: boolean\n /**\n * The name of the input field in a checkbox.\n */\n name?: string\n /**\n * The value of the checkbox.\n */\n value?: Y\n /**\n * The callback invoked when the checkbox is blurred.\n */\n onBlur?: FocusEventHandler<HTMLInputElement>\n /**\n * The callback invoked when the checked state changes.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>\n /**\n * The callback invoked when the checkbox is focused.\n */\n onFocus?: FocusEventHandler<HTMLInputElement>\n}\n\nexport const useCheckbox = <Y extends string = string>({\n \"aria-describedby\": ariaDescribedbyProp,\n ...props\n}: UseCheckboxProps<Y> = {}) => {\n const group = useCheckboxGroupContext()\n const {\n max,\n value: groupValue,\n getInputProps: getGroupInputProps,\n getLabelProps,\n } = group ?? {}\n const uuid = useId()\n const {\n props: {\n id,\n ref,\n name,\n \"aria-controls\": ariaControls,\n \"aria-labelledby\": ariaLabelledby,\n checked: checkedProp,\n defaultChecked = false,\n disabled,\n indeterminate = false,\n readOnly,\n required,\n tabIndex,\n value,\n onChange: onChangeProp,\n ...rest\n },\n ariaProps: { \"aria-describedby\": ariaDescribedby, ...ariaProps },\n dataProps,\n eventProps,\n } = useFieldProps({\n id: group ? uuid : undefined,\n ...props,\n notSupportReadOnly: true,\n })\n const resolvedAriaDescribedby = group ? ariaDescribedbyProp : ariaDescribedby\n const resolvedChecked =\n !isUndefined(groupValue) && !isUndefined(value)\n ? groupValue.includes(value)\n : checkedProp\n const [checked, setChecked] = useControllableEventState({\n defaultValue: defaultChecked,\n value: resolvedChecked,\n onChange: onChangeProp,\n })\n const trulyDisabled =\n !checked && isNumber(max) && group && group.value.length >= max\n const interactive = !(readOnly || trulyDisabled)\n const indeterminateRef = useCallback(\n (el: HTMLInputElement | null) => {\n if (el) el.indeterminate = indeterminate\n },\n [indeterminate],\n )\n\n const onChange = useCallback(\n (ev: ChangeEvent<HTMLInputElement>) => {\n if (!interactive) return (ev.defaultPrevented = true)\n\n if (indeterminate) ev.target.checked = true\n\n setChecked(ev)\n },\n [interactive, indeterminate, setChecked],\n )\n\n const getRootProps: PropGetter<\"label\"> = useCallback(\n (props = {}) => {\n const merged = mergeProps(\n {\n ...dataProps,\n \"data-checked\": dataAttr(checked),\n \"data-indeterminate\": dataAttr(indeterminate),\n },\n rest,\n props,\n )()\n\n return getLabelProps?.(merged) ?? merged\n },\n [dataProps, checked, indeterminate, rest, getLabelProps],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}) => {\n const sharedProps = mergeProps(\n {\n ...dataProps,\n ...ariaProps,\n id,\n ref: mergeRefs(ref, indeterminateRef),\n type: \"checkbox\",\n name,\n style: visuallyHiddenAttributes.style,\n \"aria-checked\": indeterminate ? (\"mixed\" as const) : checked,\n \"aria-controls\": ariaControls,\n \"aria-describedby\": resolvedAriaDescribedby,\n \"aria-disabled\": ariaAttr(!interactive),\n \"aria-labelledby\": ariaLabelledby,\n \"data-checked\": dataAttr(checked),\n \"data-indeterminate\": dataAttr(indeterminate),\n checked,\n disabled,\n readOnly,\n required,\n tabIndex,\n value,\n },\n props,\n { ...eventProps, onChange },\n )()\n\n return getGroupInputProps?.(sharedProps) ?? sharedProps\n },\n [\n dataProps,\n ariaProps,\n id,\n name,\n indeterminate,\n checked,\n ariaControls,\n resolvedAriaDescribedby,\n interactive,\n ariaLabelledby,\n disabled,\n readOnly,\n required,\n tabIndex,\n value,\n ref,\n indeterminateRef,\n eventProps,\n onChange,\n getGroupInputProps,\n ],\n )\n\n const getIndicatorProps: PropGetter = useCallback(\n (props = {}) => ({\n ...dataProps,\n \"aria-hidden\": \"true\",\n \"data-checked\": dataAttr(checked),\n \"data-indeterminate\": dataAttr(indeterminate),\n ...props,\n }),\n [dataProps, checked, indeterminate],\n )\n\n return {\n checked,\n indeterminate,\n getIndicatorProps,\n getInputProps,\n getRootProps,\n onChange,\n }\n}\n\nexport type UseCheckboxReturn = ReturnType<typeof useCheckbox>\n"],"mappings":";;;;;;;;;;AAkEA,MAAa,eAA0C,EACrD,oBAAoB,qBACpB,GAAG,UACoB,EAAE,KAAK;CAC9B,MAAM,QAAQ,yBAAyB;CACvC,MAAM,EACJ,KACA,OAAO,YACP,eAAe,oBACf,kBACE,SAAS,EAAE;CACf,MAAM,OAAO,OAAO;CACpB,MAAM,EACJ,OAAO,EACL,IACA,KACA,MACA,iBAAiB,cACjB,mBAAmB,gBACnB,SAAS,aACT,iBAAiB,OACjB,UACA,gBAAgB,OAChB,UACA,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,oBAAoB;GACpB,kBAAA,GAAA,cAAA,UAA0B,CAAC,YAAY;GACvC,mBAAmB;GACnB,iBAAA,GAAA,cAAA,UAAyB,QAAQ;GACjC,uBAAA,GAAA,cAAA,UAA+B,cAAc;GAC7C;GACA;GACA;GACA;GACA;GACA;GACD,EACD,OACA;GAAE,GAAG;GAAY;GAAU,CAC5B,EAAE;EAEH,OAAO,qBAAqB,YAAY,IAAI;IAE9C;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;CAaD,OAAO;EACL;EACA;EACA,mBAdoC,aACnC,QAAQ,EAAE,MAAM;GACf,GAAG;GACH,eAAe;GACf,iBAAA,GAAA,cAAA,UAAyB,QAAQ;GACjC,uBAAA,GAAA,cAAA,UAA+B,cAAc;GAC7C,GAAG;GACJ,GACD;GAAC;GAAW;GAAS;GAAc,CAMlB;EACjB;EACA;EACA;EACD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/alert/alert.style.d.ts
|
|
4
|
-
declare const alertStyle: ComponentSlotStyle<"title" | "loading" | "icon" | "
|
|
4
|
+
declare const alertStyle: ComponentSlotStyle<"title" | "loading" | "icon" | "description" | "root", CSSPropObject<CSSSlotObject<"title" | "loading" | "icon" | "description" | "root">>, CSSModifierObject<CSSSlotObject<"title" | "loading" | "icon" | "description" | "root">>, {
|
|
5
5
|
island: {
|
|
6
6
|
description: {
|
|
7
7
|
color: "fg.muted";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/autocomplete/autocomplete.style.d.ts
|
|
4
|
-
declare const autocompleteStyle: ComponentSlotStyle<"input" | "label" | "option" | "content" | "group" | "separator" | "icon" | "indicator" | "root" | "field" | "
|
|
4
|
+
declare const autocompleteStyle: ComponentSlotStyle<"input" | "label" | "option" | "content" | "group" | "separator" | "icon" | "indicator" | "root" | "field" | "empty" | "valueText", CSSPropObject<CSSSlotObject<"input" | "label" | "option" | "content" | "group" | "separator" | "icon" | "indicator" | "root" | "field" | "empty" | "valueText">>, {
|
|
5
5
|
xs: {
|
|
6
6
|
empty: {
|
|
7
7
|
gap: "1.5";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/calendar/calendar.style.d.ts
|
|
4
|
-
declare const calendarStyle: ComponentSlotStyle<"button" | "select" | "cell" | "navigation" | "row" | "separator" | "next" | "root" | "
|
|
4
|
+
declare const calendarStyle: ComponentSlotStyle<"button" | "select" | "cell" | "navigation" | "row" | "separator" | "next" | "root" | "month" | "week" | "weekday" | "day" | "control" | "months" | "years" | "weeks" | "prev", {
|
|
5
5
|
/**
|
|
6
6
|
* If `true`, the calendar will be fixed rows.
|
|
7
7
|
*
|
|
@@ -73,7 +73,7 @@ declare const calendarStyle: ComponentSlotStyle<"button" | "select" | "cell" | "
|
|
|
73
73
|
"--font-size": "fontSizes.xl";
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
|
-
}, CSSModifierObject<CSSSlotObject<"button" | "select" | "cell" | "navigation" | "row" | "separator" | "next" | "root" | "
|
|
76
|
+
}, CSSModifierObject<CSSSlotObject<"button" | "select" | "cell" | "navigation" | "row" | "separator" | "next" | "root" | "month" | "week" | "weekday" | "day" | "control" | "months" | "years" | "weeks" | "prev">>>;
|
|
77
77
|
type CalendarStyle = typeof calendarStyle;
|
|
78
78
|
//#endregion
|
|
79
79
|
export { CalendarStyle, calendarStyle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/carousel/carousel.style.d.ts
|
|
4
|
-
declare const carouselStyle: ComponentSlotStyle<"list" | "next" | "indicator" | "item" | "root" | "trigger" | "
|
|
4
|
+
declare const carouselStyle: ComponentSlotStyle<"list" | "next" | "indicator" | "item" | "root" | "trigger" | "indicators" | "prev", CSSPropObject<CSSSlotObject<"list" | "next" | "indicator" | "item" | "root" | "trigger" | "indicators" | "prev">>, {
|
|
5
5
|
sm: {
|
|
6
6
|
root: {
|
|
7
7
|
h: "sm";
|
|
@@ -17,7 +17,7 @@ declare const carouselStyle: ComponentSlotStyle<"list" | "next" | "indicator" |
|
|
|
17
17
|
h: "lg";
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
}, CSSModifierObject<CSSSlotObject<"list" | "next" | "indicator" | "item" | "root" | "trigger" | "
|
|
20
|
+
}, CSSModifierObject<CSSSlotObject<"list" | "next" | "indicator" | "item" | "root" | "trigger" | "indicators" | "prev">>>;
|
|
21
21
|
type CarouselStyle = typeof carouselStyle;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { CarouselStyle, carouselStyle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/chart/cartesian-chart.style.d.ts
|
|
4
|
-
declare const cartesianChartStyle: ComponentSlotStyle<"area" | "line" | "grid" | "bar" | "dot" | "root" | "
|
|
4
|
+
declare const cartesianChartStyle: ComponentSlotStyle<"area" | "line" | "grid" | "bar" | "dot" | "root" | "activeDot" | "labelList" | "referenceLine" | "referenceLineLabel" | "xAxis" | "xAxisLabel" | "xAxisTick" | "xAxisTickLine" | "yAxis" | "yAxisLabel" | "yAxisTick" | "yAxisTickLine", CSSPropObject<CSSSlotObject<"area" | "line" | "grid" | "bar" | "dot" | "root" | "activeDot" | "labelList" | "referenceLine" | "referenceLineLabel" | "xAxis" | "xAxisLabel" | "xAxisTick" | "xAxisTickLine" | "yAxis" | "yAxisLabel" | "yAxisTick" | "yAxisTickLine">>, CSSModifierObject<CSSSlotObject<"area" | "line" | "grid" | "bar" | "dot" | "root" | "activeDot" | "labelList" | "referenceLine" | "referenceLineLabel" | "xAxis" | "xAxisLabel" | "xAxisTick" | "xAxisTickLine" | "yAxis" | "yAxisLabel" | "yAxisTick" | "yAxisTickLine">>, CSSModifierObject<CSSSlotObject<"area" | "line" | "grid" | "bar" | "dot" | "root" | "activeDot" | "labelList" | "referenceLine" | "referenceLineLabel" | "xAxis" | "xAxisLabel" | "xAxisTick" | "xAxisTickLine" | "yAxis" | "yAxisLabel" | "yAxisTick" | "yAxisTickLine">>>;
|
|
5
5
|
type CartesianChartStyle = typeof cartesianChartStyle;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { CartesianChartStyle, cartesianChartStyle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/chart/polar-chart.style.d.ts
|
|
4
|
-
declare const polarChartStyle: ComponentSlotStyle<"label" | "grid" | "dot" | "root" | "
|
|
4
|
+
declare const polarChartStyle: ComponentSlotStyle<"label" | "grid" | "dot" | "root" | "activeDot" | "angleAxis" | "angleAxisLabel" | "angleAxisLine" | "angleAxisTick" | "angleAxisTickLine" | "labelLine" | "labelList" | "pie" | "radar" | "radial" | "radialBackground" | "radiusAxis" | "radiusAxisLabel" | "radiusAxisLine" | "radiusAxisTick" | "radiusAxisTickLine" | "sector", CSSPropObject<CSSSlotObject<"label" | "grid" | "dot" | "root" | "activeDot" | "angleAxis" | "angleAxisLabel" | "angleAxisLine" | "angleAxisTick" | "angleAxisTickLine" | "labelLine" | "labelList" | "pie" | "radar" | "radial" | "radialBackground" | "radiusAxis" | "radiusAxisLabel" | "radiusAxisLine" | "radiusAxisTick" | "radiusAxisTickLine" | "sector">>, CSSModifierObject<CSSSlotObject<"label" | "grid" | "dot" | "root" | "activeDot" | "angleAxis" | "angleAxisLabel" | "angleAxisLine" | "angleAxisTick" | "angleAxisTickLine" | "labelLine" | "labelList" | "pie" | "radar" | "radial" | "radialBackground" | "radiusAxis" | "radiusAxisLabel" | "radiusAxisLine" | "radiusAxisTick" | "radiusAxisTickLine" | "sector">>, CSSModifierObject<CSSSlotObject<"label" | "grid" | "dot" | "root" | "activeDot" | "angleAxis" | "angleAxisLabel" | "angleAxisLine" | "angleAxisTick" | "angleAxisTickLine" | "labelLine" | "labelList" | "pie" | "radar" | "radial" | "radialBackground" | "radiusAxis" | "radiusAxisLabel" | "radiusAxisLine" | "radiusAxisTick" | "radiusAxisTickLine" | "sector">>>;
|
|
5
5
|
type PolarChartStyle = typeof polarChartStyle;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { PolarChartStyle, polarChartStyle };
|
|
@@ -63,7 +63,7 @@ interface CheckboxCardRootProps<Y extends string = string> extends Merge<HTMLSty
|
|
|
63
63
|
*/
|
|
64
64
|
rootProps?: HTMLStyledProps<"label">;
|
|
65
65
|
}
|
|
66
|
-
declare const component: <H extends "fragment" | As = "div", R extends _$_yamada_ui_utils0.Dict = _$_yamada_ui_utils0.Dict<any>>(el: H | _$react.FC<R>, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "
|
|
66
|
+
declare const component: <H extends "fragment" | As = "div", R extends _$_yamada_ui_utils0.Dict = _$_yamada_ui_utils0.Dict<any>>(el: H | _$react.FC<R>, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "description" | "indicator" | "root" | "addon", {
|
|
67
67
|
justify: {
|
|
68
68
|
end: {
|
|
69
69
|
addon: {
|
|
@@ -213,7 +213,7 @@ declare const component: <H extends "fragment" | As = "div", R extends _$_yamada
|
|
|
213
213
|
name,
|
|
214
214
|
className,
|
|
215
215
|
...options
|
|
216
|
-
}?: ComponentOptions) => (initialProps?: InitialProps<R>, ...superProps: SuperProps<R>[]) => H extends "fragment" ? _$react.FunctionComponent<R> : Component<Exclude<H, "fragment">, R>, CheckboxCardPropsContext: _$react.Context<Partial<CheckboxCardRootProps<string>> | undefined>, useCheckboxCardPropsContext: () => Partial<CheckboxCardRootProps<string>> | undefined, useRootComponentProps: <Y extends _$_yamada_ui_utils0.Dict = {}, R extends keyof Y = keyof Y>(props: Y, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "
|
|
216
|
+
}?: ComponentOptions) => (initialProps?: InitialProps<R>, ...superProps: SuperProps<R>[]) => H extends "fragment" ? _$react.FunctionComponent<R> : Component<Exclude<H, "fragment">, R>, CheckboxCardPropsContext: _$react.Context<Partial<CheckboxCardRootProps<string>> | undefined>, useCheckboxCardPropsContext: () => Partial<CheckboxCardRootProps<string>> | undefined, useRootComponentProps: <Y extends _$_yamada_ui_utils0.Dict = {}, R extends keyof Y = keyof Y>(props: Y, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "description" | "indicator" | "root" | "addon", {
|
|
217
217
|
justify: {
|
|
218
218
|
end: {
|
|
219
219
|
addon: {
|
|
@@ -363,7 +363,7 @@ declare const component: <H extends "fragment" | As = "div", R extends _$_yamada
|
|
|
363
363
|
className,
|
|
364
364
|
withContext,
|
|
365
365
|
transferProps
|
|
366
|
-
}?: UseComponentPropsOptions<R>) => [CSSSlotObject, Merge<WithoutThemeProps<Y, ComponentSlotStyle<"group" | "
|
|
366
|
+
}?: UseComponentPropsOptions<R>) => [CSSSlotObject, Merge<WithoutThemeProps<Y, ComponentSlotStyle<"group" | "description" | "indicator" | "root" | "addon", {
|
|
367
367
|
justify: {
|
|
368
368
|
end: {
|
|
369
369
|
addon: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
//#region src/components/checkbox-card/checkbox-card.style.d.ts
|
|
3
|
-
declare const checkboxCardStyle: ComponentSlotStyle<"group" | "
|
|
3
|
+
declare const checkboxCardStyle: ComponentSlotStyle<"group" | "description" | "indicator" | "root" | "addon", {
|
|
4
4
|
/**
|
|
5
5
|
* The justify indicator of the component
|
|
6
6
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/color-picker/color-picker.style.d.ts
|
|
4
|
-
declare const colorPickerStyle: ComponentSlotStyle<"input" | "content" | "icon" | "root" | "
|
|
4
|
+
declare const colorPickerStyle: ComponentSlotStyle<"input" | "content" | "icon" | "root" | "colorSwatch" | "field" | "eyeDropper", CSSPropObject<CSSSlotObject<"input" | "content" | "icon" | "root" | "colorSwatch" | "field" | "eyeDropper">>, {
|
|
5
5
|
xs: {
|
|
6
6
|
field: {
|
|
7
7
|
fontSize: "1em";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
//#region src/components/data-list/data-list.style.d.ts
|
|
3
|
-
declare const dataListStyle: ComponentSlotStyle<"term" | "
|
|
3
|
+
declare const dataListStyle: ComponentSlotStyle<"term" | "description" | "item" | "root", {
|
|
4
4
|
/**
|
|
5
5
|
* The orientation of the data list.
|
|
6
6
|
*
|
|
@@ -41,7 +41,7 @@ declare const DropzoneRoot: Component<({
|
|
|
41
41
|
loadingProps,
|
|
42
42
|
overlayProps,
|
|
43
43
|
...rest
|
|
44
|
-
}: WithoutThemeProps<DropzoneRootProps, ComponentSlotStyle<"title" | "overlay" | "loading" | "icon" | "
|
|
44
|
+
}: WithoutThemeProps<DropzoneRootProps, ComponentSlotStyle<"title" | "overlay" | "loading" | "icon" | "description" | "root", CSSPropObject<CSSSlotObject<"title" | "overlay" | "loading" | "icon" | "description" | "root">>, {
|
|
45
45
|
xs: {
|
|
46
46
|
root: {
|
|
47
47
|
minH: "xs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/dropzone/dropzone.style.d.ts
|
|
4
|
-
declare const dropzoneStyle: ComponentSlotStyle<"title" | "overlay" | "loading" | "icon" | "
|
|
4
|
+
declare const dropzoneStyle: ComponentSlotStyle<"title" | "overlay" | "loading" | "icon" | "description" | "root", CSSPropObject<CSSSlotObject<"title" | "overlay" | "loading" | "icon" | "description" | "root">>, {
|
|
5
5
|
xs: {
|
|
6
6
|
root: {
|
|
7
7
|
minH: "xs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/empty-state/empty-state.style.d.ts
|
|
4
|
-
declare const emptyState: ComponentSlotStyle<"title" | "content" | "
|
|
4
|
+
declare const emptyState: ComponentSlotStyle<"title" | "content" | "description" | "indicator" | "root", CSSPropObject<CSSSlotObject<"title" | "content" | "description" | "indicator" | "root">>, {
|
|
5
5
|
sm: {
|
|
6
6
|
content: {
|
|
7
7
|
gap: "xs";
|
|
@@ -47,7 +47,7 @@ declare const emptyState: ComponentSlotStyle<"title" | "content" | "indicator" |
|
|
|
47
47
|
fontSize: "xl";
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
-
}, CSSModifierObject<CSSSlotObject<"title" | "content" | "
|
|
50
|
+
}, CSSModifierObject<CSSSlotObject<"title" | "content" | "description" | "indicator" | "root">>>;
|
|
51
51
|
type EmptyState = typeof emptyState;
|
|
52
52
|
//#endregion
|
|
53
53
|
export { EmptyState, emptyState };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/field/field.style.d.ts
|
|
4
|
-
declare const fieldStyle: ComponentSlotStyle<"label" | "root" | "
|
|
4
|
+
declare const fieldStyle: ComponentSlotStyle<"label" | "root" | "helperMessage" | "errorMessage" | "requiredIndicator", {
|
|
5
5
|
/**
|
|
6
6
|
* The orientation of the field.
|
|
7
7
|
*/
|
|
@@ -35,7 +35,7 @@ declare const fieldStyle: ComponentSlotStyle<"label" | "root" | "errorMessage" |
|
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
|
-
}, CSSModifierObject<CSSSlotObject<"label" | "root" | "
|
|
38
|
+
}, CSSModifierObject<CSSSlotObject<"label" | "root" | "helperMessage" | "errorMessage" | "requiredIndicator">>, CSSModifierObject<CSSSlotObject<"label" | "root" | "helperMessage" | "errorMessage" | "requiredIndicator">>>;
|
|
39
39
|
type FieldStyle = typeof fieldStyle;
|
|
40
40
|
//#endregion
|
|
41
41
|
export { FieldStyle, fieldStyle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/fieldset/fieldset.style.d.ts
|
|
4
|
-
declare const fieldsetStyle: ComponentSlotStyle<"header" | "legend" | "content" | "root" | "
|
|
4
|
+
declare const fieldsetStyle: ComponentSlotStyle<"header" | "legend" | "content" | "root" | "helperMessage" | "errorMessage", CSSPropObject<CSSSlotObject<"header" | "legend" | "content" | "root" | "helperMessage" | "errorMessage">>, {
|
|
5
5
|
sm: {
|
|
6
6
|
content: {
|
|
7
7
|
gap: "3";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/form/form.style.d.ts
|
|
4
|
-
declare const formStyle: ComponentSlotStyle<"body" | "footer" | "header" | "title" | "group" | "
|
|
4
|
+
declare const formStyle: ComponentSlotStyle<"body" | "footer" | "header" | "title" | "group" | "description" | "root" | "submitButton", CSSPropObject<CSSSlotObject<"body" | "footer" | "header" | "title" | "group" | "description" | "root" | "submitButton">>, {
|
|
5
5
|
sm: {
|
|
6
6
|
body: {
|
|
7
7
|
gap: "5";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/number-input/number-input.style.d.ts
|
|
4
|
-
declare const numberInputStyle: ComponentSlotStyle<"button" | "root" | "field" | "
|
|
4
|
+
declare const numberInputStyle: ComponentSlotStyle<"button" | "root" | "field" | "control" | "decrement" | "increment", CSSPropObject<CSSSlotObject<"button" | "root" | "field" | "control" | "decrement" | "increment">>, {
|
|
5
5
|
xs: {
|
|
6
6
|
control: {
|
|
7
7
|
boxSize: "calc({--height} - {spaces.2})";
|
|
@@ -55,7 +55,7 @@ interface RadioCardRootProps<Y extends string = string> extends Merge<HTMLStyled
|
|
|
55
55
|
*/
|
|
56
56
|
rootProps?: HTMLStyledProps<"label">;
|
|
57
57
|
}
|
|
58
|
-
declare const component: <H extends "fragment" | As = "div", R extends _$_yamada_ui_utils0.Dict = _$_yamada_ui_utils0.Dict<any>>(el: H | _$react.FC<R>, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "
|
|
58
|
+
declare const component: <H extends "fragment" | As = "div", R extends _$_yamada_ui_utils0.Dict = _$_yamada_ui_utils0.Dict<any>>(el: H | _$react.FC<R>, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "description" | "indicator" | "root" | "addon", {
|
|
59
59
|
justify: {
|
|
60
60
|
end: {
|
|
61
61
|
addon: {
|
|
@@ -232,7 +232,7 @@ declare const component: <H extends "fragment" | As = "div", R extends _$_yamada
|
|
|
232
232
|
name,
|
|
233
233
|
className,
|
|
234
234
|
...options
|
|
235
|
-
}?: ComponentOptions) => (initialProps?: InitialProps<R>, ...superProps: SuperProps<R>[]) => H extends "fragment" ? _$react.FunctionComponent<R> : Component<Exclude<H, "fragment">, R>, RadioCardPropsContext: _$react.Context<Partial<RadioCardRootProps<string>> | undefined>, useRadioCardPropsContext: () => Partial<RadioCardRootProps<string>> | undefined, useRootComponentProps: <Y extends _$_yamada_ui_utils0.Dict = {}, R extends keyof Y = keyof Y>(props: Y, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "
|
|
235
|
+
}?: ComponentOptions) => (initialProps?: InitialProps<R>, ...superProps: SuperProps<R>[]) => H extends "fragment" ? _$react.FunctionComponent<R> : Component<Exclude<H, "fragment">, R>, RadioCardPropsContext: _$react.Context<Partial<RadioCardRootProps<string>> | undefined>, useRadioCardPropsContext: () => Partial<RadioCardRootProps<string>> | undefined, useRootComponentProps: <Y extends _$_yamada_ui_utils0.Dict = {}, R extends keyof Y = keyof Y>(props: Y, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "description" | "indicator" | "root" | "addon", {
|
|
236
236
|
justify: {
|
|
237
237
|
end: {
|
|
238
238
|
addon: {
|
|
@@ -409,7 +409,7 @@ declare const component: <H extends "fragment" | As = "div", R extends _$_yamada
|
|
|
409
409
|
className,
|
|
410
410
|
withContext,
|
|
411
411
|
transferProps
|
|
412
|
-
}?: UseComponentPropsOptions<R>) => [CSSSlotObject, Merge<WithoutThemeProps<Y, ComponentSlotStyle<"group" | "
|
|
412
|
+
}?: UseComponentPropsOptions<R>) => [CSSSlotObject, Merge<WithoutThemeProps<Y, ComponentSlotStyle<"group" | "description" | "indicator" | "root" | "addon", {
|
|
413
413
|
justify: {
|
|
414
414
|
end: {
|
|
415
415
|
addon: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
//#region src/components/radio-card/radio-card.style.d.ts
|
|
3
|
-
declare const radioCardStyle: ComponentSlotStyle<"group" | "
|
|
3
|
+
declare const radioCardStyle: ComponentSlotStyle<"group" | "description" | "indicator" | "root" | "addon", {
|
|
4
4
|
/**
|
|
5
5
|
* The justify indicator of the component
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
//#region src/components/steps/steps.style.d.ts
|
|
3
|
-
declare const stepsStyle: ComponentSlotStyle<"title" | "list" | "separator" | "
|
|
3
|
+
declare const stepsStyle: ComponentSlotStyle<"title" | "list" | "separator" | "description" | "indicator" | "item" | "root", {
|
|
4
4
|
/**
|
|
5
5
|
* The orientation of the steps.
|
|
6
6
|
*
|
|
@@ -69,7 +69,7 @@ declare const TimelineRoot: Component<({
|
|
|
69
69
|
index,
|
|
70
70
|
items,
|
|
71
71
|
...rest
|
|
72
|
-
}: WithoutThemeProps<TimelineRootProps, ComponentSlotStyle<"title" | "content" | "
|
|
72
|
+
}: WithoutThemeProps<TimelineRootProps, ComponentSlotStyle<"title" | "content" | "connector" | "description" | "indicator" | "item" | "root", {
|
|
73
73
|
align: {
|
|
74
74
|
center: {
|
|
75
75
|
content: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
//#region src/components/timeline/timeline.style.d.ts
|
|
3
|
-
declare const timelineStyle: ComponentSlotStyle<"title" | "content" | "
|
|
3
|
+
declare const timelineStyle: ComponentSlotStyle<"title" | "content" | "connector" | "description" | "indicator" | "item" | "root", {
|
|
4
4
|
/**
|
|
5
5
|
* The alignment of the timeline.
|
|
6
6
|
*
|
|
@@ -134,7 +134,7 @@ declare const I18nContext: _$react.Context<I18nContext<{
|
|
|
134
134
|
readonly toggle: {
|
|
135
135
|
readonly "Toggle button": "Toggle button";
|
|
136
136
|
};
|
|
137
|
-
}, "progress.Loading..." | "progress.{value} percent" | "select.Clear value" | "table.Clear sorting" | "table.Page size" | "table.Select all rows" | "table.Select row" | "table.Sort ascending" | "table.Sort descending" | "toggle.Toggle button" | "slider.Slider thumb" | "modal.Close modal" | "modal.Open modal" | "closeButton.Close" | "tag.Close tag" | "stat.Decreased by" | "stat.Increased by" | "sidebar.Close sidebar" | "sidebar.Open sidebar" | "
|
|
137
|
+
}, "progress.Loading..." | "progress.{value} percent" | "select.Clear value" | "table.Clear sorting" | "table.Page size" | "table.Select all rows" | "table.Select row" | "table.Sort ascending" | "table.Sort descending" | "toggle.Toggle button" | "slider.Slider thumb" | "modal.Close modal" | "modal.Open modal" | "closeButton.Close" | "tag.Close tag" | "stat.Decreased by" | "stat.Increased by" | "sidebar.Close sidebar" | "sidebar.Open sidebar" | "calendar.Choose the month" | "calendar.Choose the year" | "calendar.Go to the next month" | "calendar.Go to the previous month" | "calendar.Today" | "actionBar.Close action bar" | "actionBar.Open action bar" | "autocomplete.Clear value" | "autocomplete.No results found" | "avatar.Avatar Icon" | "breadcrumb.Breadcrumb" | "breadcrumb.Ellipsis" | "carousel.Go to next slide" | "carousel.Go to previous slide" | "carousel.Go to {page} slide" | "carousel.Slides" | "carousel.{page} of {total}" | "colorPicker.Pick a color" | "colorSelector.Pick a color" | "colorSwatch.Color swatch group" | "datePicker.Clear value" | "hueSlider.Blue" | "hueSlider.Cyan" | "hueSlider.Green" | "hueSlider.Magenta" | "hueSlider.Red" | "hueSlider.Yellow" | "numberInput.Decrease" | "numberInput.Increase" | "pagination.Go to first page" | "pagination.Go to last page" | "pagination.Go to next page" | "pagination.Go to page {value}" | "pagination.Go to previous page" | "pagination.Pagination" | "pagination.{value} / {total}" | "pagination.{value} of {total}" | "passwordInput.Password strength meter" | "passwordInput.Toggle password visibility" | "saturationSlider.Saturation and brightness thumb" | "saturationSlider.Saturation {saturation}%, Brightness {brightness}%">>;
|
|
138
138
|
interface I18nProviderProps {
|
|
139
139
|
children?: ReactNode;
|
|
140
140
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamada-ui/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.3.0-next-
|
|
4
|
+
"version": "2.3.0-next-20260516024901",
|
|
5
5
|
"description": "React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"yamada",
|