@jakubmazanec/ui 0.1.0 → 0.1.1-next.80f405d
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/build/components/Button.d.ts +6 -6
- package/build/components/Card.d.ts +2 -2
- package/build/components/Checkbox.d.ts +7 -7
- package/build/components/CheckboxField.d.ts +2 -2
- package/build/components/Combobox.d.ts +18 -18
- package/build/components/Combobox.js +6 -6
- package/build/components/Combobox.js.map +2 -2
- package/build/components/ComboboxOption.d.ts +7 -7
- package/build/components/Container.d.ts +7 -7
- package/build/components/Description.d.ts +2 -2
- package/build/components/Dialog.d.ts +5 -5
- package/build/components/DialogPanel.d.ts +2 -2
- package/build/components/DialogTitle.d.ts +2 -2
- package/build/components/Error.d.ts +2 -2
- package/build/components/Field.d.ts +2 -2
- package/build/components/Fieldset.d.ts +4 -4
- package/build/components/Form.d.ts +2 -2
- package/build/components/Icon.d.ts +5 -5
- package/build/components/Input.d.ts +9 -9
- package/build/components/Label.d.ts +2 -2
- package/build/components/Legend.d.ts +2 -2
- package/build/components/Listbox.d.ts +23 -23
- package/build/components/Listbox.js +4 -4
- package/build/components/Listbox.js.map +2 -2
- package/build/components/ListboxOption.d.ts +7 -7
- package/build/components/Menu.d.ts +2 -2
- package/build/components/MenuButton.d.ts +4 -4
- package/build/components/MenuHeading.d.ts +2 -2
- package/build/components/MenuItem.d.ts +4 -4
- package/build/components/MenuItems.d.ts +2 -2
- package/build/components/MenuSection.d.ts +2 -2
- package/build/components/MenuSeparator.d.ts +2 -2
- package/build/components/Popover.d.ts +2 -2
- package/build/components/PopoverBackdrop.d.ts +2 -2
- package/build/components/PopoverButton.d.ts +4 -4
- package/build/components/PopoverGroup.d.ts +2 -2
- package/build/components/PopoverPanel.d.ts +2 -2
- package/build/components/Radio.d.ts +7 -7
- package/build/components/Radio.js +1 -1
- package/build/components/Radio.js.map +2 -2
- package/build/components/RadioField.d.ts +2 -2
- package/build/components/RadioGroup.d.ts +4 -4
- package/build/components/Spinner.d.ts +7 -7
- package/build/components/Table.d.ts +2 -2
- package/build/components/TableBody.d.ts +2 -2
- package/build/components/TableCaption.d.ts +2 -2
- package/build/components/TableCell.d.ts +2 -2
- package/build/components/TableFoot.d.ts +2 -2
- package/build/components/TableHead.d.ts +2 -2
- package/build/components/TableHeader.d.ts +2 -2
- package/build/components/TableRow.d.ts +2 -2
- package/build/components/Text.d.ts +4 -4
- package/build/components/Textarea.d.ts +8 -8
- package/build/components/data-table/DataTable.js +13 -13
- package/build/components/data-table/DataTable.js.map +2 -2
- package/build/components/data-table/internals/DataTableHeader.js +23 -23
- package/build/components/data-table/internals/DataTableHeader.js.map +2 -2
- package/build/components/data-table/internals/DataTableHeaderFilter.js +14 -14
- package/build/components/data-table/internals/DataTableHeaderFilter.js.map +2 -2
- package/build/components/data-table/internals/DataTablePagination.js +10 -10
- package/build/components/data-table/internals/DataTablePagination.js.map +2 -2
- package/build/components/data-table/internals/DataTableSearch.js +2 -2
- package/build/components/data-table/internals/DataTableSearch.js.map +2 -2
- package/build/components/data-table/internals/addFilter.js.map +1 -1
- package/build/development/createTailwindConfig.d.ts +6 -6
- package/build/development/createTailwindConfig.js.map +1 -1
- package/build/development/internals/createDisplayColor.js +1 -1
- package/build/development/internals/createDisplayColor.js.map +2 -2
- package/build/development/internals/hexToHsl.js +3 -3
- package/build/development/internals/hexToHsl.js.map +2 -2
- package/build/development/internals/isHex.js +3 -3
- package/build/development/internals/isHex.js.map +2 -2
- package/build/development/internals/round.js +1 -1
- package/build/development/internals/round.js.map +2 -2
- package/build/development/internals.d.ts +2 -2
- package/build/development/internals.js +0 -2
- package/build/development/internals.js.map +2 -2
- package/build/theme/Theme.d.ts +8 -8
- package/build/theme/internals/ComponentThemeCompoundVariants.d.ts +4 -4
- package/build/theme/internals/UseComponentTheme.d.ts +6 -6
- package/build/theme/internals/createUseComponentThemeReturn.d.ts +1 -1
- package/build/theme/internals/createUseComponentThemeReturn.js.map +1 -1
- package/build/theme/internals/themeContext.d.ts +20 -20
- package/build/theme/internals/useTheme.d.ts +20 -20
- package/build/theme/internals.d.ts +12 -12
- package/build/theme/internals.js +0 -12
- package/build/theme/internals.js.map +2 -2
- package/build/theme.d.ts +1 -1
- package/build/theme.js +0 -1
- package/build/theme.js.map +2 -2
- package/build/utilities.d.ts +1 -1
- package/build/utilities.js +0 -1
- package/build/utilities.js.map +2 -2
- package/package.json +4 -4
- package/source/components/Combobox.tsx +16 -18
- package/source/components/Listbox.tsx +19 -21
- package/source/components/Radio.tsx +2 -2
- package/source/components/data-table/DataTable.tsx +12 -14
- package/source/components/data-table/internals/DataTableHeader.tsx +25 -25
- package/source/components/data-table/internals/DataTableHeaderFilter.tsx +20 -22
- package/source/components/data-table/internals/DataTablePagination.tsx +10 -10
- package/source/components/data-table/internals/DataTableSearch.tsx +4 -4
- package/source/components/data-table/internals/addFilter.ts +3 -3
- package/source/development/createTailwindConfig.ts +2 -2
- package/source/development/internals/createDisplayColor.ts +1 -1
- package/source/development/internals/hexToHsl.ts +3 -3
- package/source/development/internals/isHex.ts +3 -4
- package/source/development/internals/round.ts +1 -1
- package/source/development/internals.ts +2 -2
- package/source/theme/Theme.ts +5 -5
- package/source/theme/internals/ComponentThemeCompoundVariants.ts +4 -4
- package/source/theme/internals/UseComponentTheme.ts +7 -7
- package/source/theme/internals/createUseComponentThemeReturn.ts +1 -1
- package/source/theme/internals.ts +12 -12
- package/source/theme.ts +1 -1
- package/source/utilities.ts +1 -1
|
@@ -75,10 +75,10 @@ export const Listbox = forwardRef(
|
|
|
75
75
|
throw new Error("Combobox accepts only either `items` prop, or children!");
|
|
76
76
|
}
|
|
77
77
|
let filteredItems = query ? items?.filter(
|
|
78
|
-
(item) => item.label.toLowerCase().
|
|
78
|
+
(item) => item.label.toLowerCase().replaceAll(/\s+/g, "").includes(query.toLowerCase().replaceAll(/\s+/g, ""))
|
|
79
79
|
) : items;
|
|
80
80
|
let filteredChildren = query ? Children.toArray(children).filter((child) => {
|
|
81
|
-
if (typeof child === "object" && "props" in child && typeof child.props === "object" && typeof child.props.children === "string" && child.props.children.toLowerCase().
|
|
81
|
+
if (typeof child === "object" && "props" in child && typeof child.props === "object" && typeof child.props.children === "string" && child.props.children.toLowerCase().replaceAll(/\s+/g, "").includes(query.toLowerCase().replaceAll(/\s+/g, ""))) {
|
|
82
82
|
return true;
|
|
83
83
|
}
|
|
84
84
|
return false;
|
|
@@ -101,8 +101,8 @@ export const Listbox = forwardRef(
|
|
|
101
101
|
HeadlessListboxButton,
|
|
102
102
|
{
|
|
103
103
|
className: theme.root("relative", className),
|
|
104
|
-
"data-multiple": multiple ? true : null,
|
|
105
104
|
"data-component": "listbox",
|
|
105
|
+
"data-multiple": multiple ? true : null,
|
|
106
106
|
children: ({ value: selectedValue }) => {
|
|
107
107
|
if (!items && !multiple) {
|
|
108
108
|
let selectedItem2;
|
|
@@ -196,8 +196,8 @@ export const Listbox = forwardRef(
|
|
|
196
196
|
/* @__PURE__ */ jsxs(
|
|
197
197
|
HeadlessListboxOptions,
|
|
198
198
|
{
|
|
199
|
-
className: theme.options(),
|
|
200
199
|
anchor: "bottom start",
|
|
200
|
+
className: theme.options(),
|
|
201
201
|
onKeyDown: handleTab,
|
|
202
202
|
children: [
|
|
203
203
|
showFilter ? /* @__PURE__ */ jsx("div", { className: theme.filter(), children: /* @__PURE__ */ jsx(Input, { ref: inputRef, showClearButton: true, value: query, onInput: handleQueryChange }) }) : null,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../source/components/Listbox.tsx"],
|
|
4
|
-
"sourcesContent": ["// TODO: fix somehow\n/* eslint-disable complexity -- TODO */\nimport {\n Listbox as HeadlessListbox,\n ListboxButton as HeadlessListboxButton,\n ListboxOptions as HeadlessListboxOptions,\n type ListboxProps as HeadlessListboxProps,\n} from '@headlessui/react';\nimport {\n type ChangeEvent,\n Children,\n type ComponentPropsWithoutRef,\n type ElementType,\n Fragment,\n type KeyboardEvent,\n type PropsWithChildren,\n type ReactNode,\n type Ref,\n useCallback,\n useRef,\n useState,\n} from 'react';\n\nimport {\n type ComponentProps,\n type ComponentTheme,\n createComponentTheme,\n} from '../theme/internals.js';\nimport {Icon} from './Icon.js';\nimport {Input} from './Input.js';\nimport {forwardRef, useFormId} from './internals.js';\nimport {ListboxOption} from './ListboxOption.js';\nimport {useField} from './useField.js';\nimport {useFieldName} from './useFieldName.js';\n\nexport const useListboxTheme = createComponentTheme('Listbox', {\n variants: {disabled: [true, false], invalid: [true, false]},\n elements: ['root', 'label', 'icon', 'options', 'filter'],\n});\n\nconst LISTBOX_ELEMENT = Fragment;\n\nexport type ListboxItem<V> = {\n value: V;\n label: string;\n};\n\nexport type ListboxProps<\n T extends ElementType,\n V extends boolean | number | string,\n> = PropsWithChildren<\n ComponentProps<typeof useListboxTheme> &\n ComponentPropsWithoutRef<T> &\n (\n | {\n as?: T | undefined;\n value?: V | undefined;\n defaultValue?: V | undefined;\n multiple?: false | undefined;\n hideSelected?: never; // must be here so the type of props is correct\n items?: Array<ListboxItem<V>> | undefined;\n placeholder?: string;\n name?: string | undefined;\n className?: string | undefined;\n showFilter?: boolean | undefined;\n onChange?: (selectedValue: V) => void;\n }\n | {\n as?: T | undefined;\n value?: V[] | undefined;\n defaultValue?: V[] | undefined;\n multiple: true;\n hideSelected?:\n | {\n limit: number;\n message?: string | undefined;\n }\n | undefined;\n items?: Array<ListboxItem<V>> | undefined;\n placeholder?: string;\n name?: string | undefined;\n className?: string | undefined;\n showFilter?: boolean | undefined;\n onChange?: (selectedValue: V[]) => void;\n }\n )\n>;\n\nexport const Listbox = forwardRef(\n <T extends ElementType = typeof LISTBOX_ELEMENT, V extends boolean | number | string = string>(\n {\n disabled = false,\n invalid = false,\n as = LISTBOX_ELEMENT as unknown as T,\n value,\n defaultValue,\n multiple,\n hideSelected,\n items,\n placeholder,\n name,\n className,\n showFilter,\n onChange,\n children,\n ...rest\n }: ListboxProps<T, V>,\n ref: Ref<HTMLElement>,\n ) => {\n let theme = useListboxTheme({disabled, invalid});\n let formId = useFormId();\n let field = useField();\n let fieldName = useFieldName();\n let [query, setQuery] = useState('');\n let inputRef = useRef<HTMLElement>(null);\n\n let handleChange = useCallback(\n (selectedValue: V) => {\n onChange?.(selectedValue as V & V[]);\n },\n [onChange],\n );\n\n // hacky solution so the user is able to focus inout used for filtering\n let handleTab = useCallback(\n (event: KeyboardEvent) => {\n if (!showFilter) {\n return;\n }\n\n if (event.key === 'Tab' && document.activeElement !== inputRef.current) {\n event.preventDefault();\n inputRef.current?.focus();\n }\n },\n [showFilter],\n );\n\n let handleQueryChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {\n setQuery(event.target.value);\n }, []);\n\n if (items && children) {\n throw new Error('Combobox accepts only either `items` prop, or children!');\n }\n\n let filteredItems =\n query ?\n items?.filter((item) =>\n item.label\n .toLowerCase()\n .replace(/\\s+/g, '')\n .includes(query.toLowerCase().replace(/\\s+/g, '')),\n )\n : items;\n let filteredChildren =\n query ?\n Children.toArray(children).filter((child) => {\n if (\n typeof child === 'object' &&\n 'props' in child &&\n typeof child.props === 'object' &&\n typeof (child.props as {children?: unknown[] | string}).children === 'string' &&\n (child.props as {children: string}).children\n .toLowerCase()\n .replace(/\\s+/g, '')\n .includes(query.toLowerCase().replace(/\\s+/g, ''))\n ) {\n return true;\n }\n\n return false;\n })\n : children;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- needed\n let props: HeadlessListboxProps<any, any> = {\n as,\n ref,\n name: field?.name ?? fieldName ?? name,\n value: value ?? null,\n defaultValue,\n multiple,\n disabled,\n invalid,\n form: formId,\n onChange: handleChange,\n ...rest,\n };\n\n return (\n <HeadlessListbox {...props}>\n <HeadlessListboxButton\n className={theme.root('relative', className)}\n data-multiple={multiple ? true : null}\n data-component=\"listbox\"\n >\n {({value: selectedValue}) => {\n if (!items && !multiple) {\n let selectedItem: ReactNode;\n\n Children.forEach(filteredChildren, (child) => {\n if (!child) {\n return;\n }\n\n if (\n typeof child === 'object' &&\n 'props' in child &&\n typeof child.props === 'object' &&\n (child.props as Record<string, unknown>).value === selectedValue\n ) {\n selectedItem = (child.props as Record<string, unknown>).children as ReactNode;\n }\n });\n\n return (\n <>\n <span className={theme.label('overflow-hidden text-ellipsis whitespace-nowrap')}>\n {selectedItem ?? placeholder ?? null}\n </span>\n <span className={theme.icon('absolute')}>\n <Icon name=\"ChevronUpDown\" />\n </span>\n </>\n );\n } else if (!items && multiple) {\n let itemsHidden = false;\n let selectedItems: ReactNode[] = [];\n\n Children.forEach(filteredChildren, (child) => {\n if (!child) {\n return;\n }\n\n if (\n typeof child === 'object' &&\n 'props' in child &&\n typeof child.props === 'object' &&\n (selectedValue as unknown[]).includes(\n (child.props as Record<string, unknown>).value,\n )\n ) {\n selectedItems.push(\n (child.props as Record<string, unknown>).children as ReactNode,\n );\n }\n });\n\n if (hideSelected && selectedItems.length > hideSelected.limit) {\n selectedItems = selectedItems.slice(0, hideSelected.limit);\n itemsHidden = true;\n }\n\n return (\n <>\n {selectedItems.length ?\n selectedItems.map((selectedItem, index) => (\n <span\n // eslint-disable-next-line react/no-array-index-key -- needed\n key={index}\n className={theme.label('overflow-hidden text-ellipsis whitespace-nowrap')}\n >\n {selectedItem}\n </span>\n ))\n : (placeholder ?? null)}\n {itemsHidden ?\n <span\n data-ellipsis\n className={theme.label('overflow-hidden text-ellipsis whitespace-nowrap')}\n >\n {hideSelected?.message ?? '\u2026'}\n </span>\n : null}\n <span className={theme.icon('absolute')}>\n <Icon name=\"ChevronUpDown\" />\n </span>\n </>\n );\n } else if (items && multiple) {\n let itemsHidden = false;\n let selectedItems =\n filteredItems?.filter((item) =>\n (selectedValue as unknown[] | undefined)?.includes(item.value),\n ) ?? [];\n\n if (hideSelected && selectedItems.length > hideSelected.limit) {\n selectedItems = selectedItems.slice(0, hideSelected.limit);\n itemsHidden = true;\n }\n\n return (\n <>\n {selectedItems.length ?\n selectedItems.map((selectedItem, index) => (\n <span\n // eslint-disable-next-line react/no-array-index-key -- needed\n key={index}\n className={theme.label('overflow-hidden text-ellipsis whitespace-nowrap')}\n >\n {selectedItem.label}\n </span>\n ))\n : (placeholder ?? null)}\n {itemsHidden ?\n <span\n data-ellipsis\n className={theme.label('overflow-hidden text-ellipsis whitespace-nowrap')}\n >\n {hideSelected?.message ?? '\u2026'}\n </span>\n : null}\n <span className={theme.icon('absolute')}>\n <Icon name=\"ChevronUpDown\" />\n </span>\n </>\n );\n }\n\n let selectedItem = filteredItems?.find((item) => item.value === selectedValue);\n\n return (\n <>\n <span className={theme.label('overflow-hidden text-ellipsis whitespace-nowrap')}>\n {selectedItem?.label ?? placeholder ?? null}\n </span>\n <span className={theme.icon('absolute')}>\n <Icon name=\"ChevronUpDown\" />\n </span>\n </>\n );\n }}\n </HeadlessListboxButton>\n <HeadlessListboxOptions\n className={theme.options()}\n anchor=\"bottom start\"\n onKeyDown={handleTab}\n >\n {showFilter ?\n <div className={theme.filter()}>\n <Input ref={inputRef} showClearButton value={query} onInput={handleQueryChange} />\n </div>\n : null}\n {items ?\n filteredItems?.map((item) => (\n <ListboxOption key={item.label} value={item.value}>\n {item.label}\n </ListboxOption>\n ))\n : filteredChildren}\n </HeadlessListboxOptions>\n </HeadlessListbox>\n );\n },\n);\n\nexport const listboxTheme: ComponentTheme<typeof useListboxTheme> = {\n classNames: {\n root: 'flex w-full min-w-32 items-center rounded-2 border-2 border-neutral-100 hover:border-neutral-200 bg-white px-2.5 h-9 pr-9 gap-x-2 transition-colors shadow-inner font-sans text-sm',\n label: 'flex gap-x-2',\n icon: 'text-neutral-500 size-5 top-1.5 right-1.5 cursor-pointer',\n options:\n 'flex flex-col gap-y-1 shadow p-1 z-30 rounded-2 border-2 border-neutral-100 hover:border-neutral-200 bg-white text-left w-[var(--button-width)] [--anchor-gap:theme(spacing.1)] [--anchor-padding:theme(spacing.2)] [scrollbar-width:thin] empty:invisible transition-colors',\n filter: '[&>[data-component=input]]:rounded',\n },\n variants: {\n disabled: {\n true: {\n root: 'border-neutral-100 text-neutral-200 cursor-not-allowed',\n label: '',\n icon: 'text-neutral-200',\n options: 'border-neutral-100',\n filter: '',\n },\n false: {\n root: '',\n label: '',\n icon: '',\n options: '',\n filter: '',\n },\n },\n invalid: {\n true: {\n root: '',\n label: '',\n icon: '',\n options: '',\n filter: '',\n },\n false: {\n root: '',\n label: '',\n icon: '',\n options: '',\n filter: '',\n },\n },\n },\n};\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["import {\n Listbox as HeadlessListbox,\n ListboxButton as HeadlessListboxButton,\n ListboxOptions as HeadlessListboxOptions,\n type ListboxProps as HeadlessListboxProps,\n} from '@headlessui/react';\nimport {\n type ChangeEvent,\n Children,\n type ComponentPropsWithoutRef,\n type ElementType,\n Fragment,\n type KeyboardEvent,\n type PropsWithChildren,\n type ReactNode,\n type Ref,\n useCallback,\n useRef,\n useState,\n} from 'react';\n\nimport {\n type ComponentProps,\n type ComponentTheme,\n createComponentTheme,\n} from '../theme/internals.js';\nimport {Icon} from './Icon.js';\nimport {Input} from './Input.js';\nimport {forwardRef, useFormId} from './internals.js';\nimport {ListboxOption} from './ListboxOption.js';\nimport {useField} from './useField.js';\nimport {useFieldName} from './useFieldName.js';\n\nexport const useListboxTheme = createComponentTheme('Listbox', {\n variants: {disabled: [true, false], invalid: [true, false]},\n elements: ['root', 'label', 'icon', 'options', 'filter'],\n});\n\nconst LISTBOX_ELEMENT = Fragment;\n\nexport type ListboxItem<V> = {\n value: V;\n label: string;\n};\n\nexport type ListboxProps<\n T extends ElementType,\n V extends boolean | number | string,\n> = PropsWithChildren<\n ComponentProps<typeof useListboxTheme> &\n ComponentPropsWithoutRef<T> &\n (\n | {\n as?: T | undefined;\n value?: V[] | undefined;\n defaultValue?: V[] | undefined;\n multiple: true;\n hideSelected?:\n | {\n limit: number;\n message?: string | undefined;\n }\n | undefined;\n items?: Array<ListboxItem<V>> | undefined;\n placeholder?: string;\n name?: string | undefined;\n className?: string | undefined;\n showFilter?: boolean | undefined;\n onChange?: (selectedValue: V[]) => void;\n }\n | {\n as?: T | undefined;\n value?: V | undefined;\n defaultValue?: V | undefined;\n multiple?: false | undefined;\n hideSelected?: never; // must be here so the type of props is correct\n items?: Array<ListboxItem<V>> | undefined;\n placeholder?: string;\n name?: string | undefined;\n className?: string | undefined;\n showFilter?: boolean | undefined;\n onChange?: (selectedValue: V) => void;\n }\n )\n>;\n\nexport const Listbox = forwardRef(\n <T extends ElementType = typeof LISTBOX_ELEMENT, V extends boolean | number | string = string>(\n {\n disabled = false,\n invalid = false,\n as = LISTBOX_ELEMENT as unknown as T,\n value,\n defaultValue,\n multiple,\n hideSelected,\n items,\n placeholder,\n name,\n className,\n showFilter,\n onChange,\n children,\n ...rest\n }: ListboxProps<T, V>,\n ref: Ref<HTMLElement>,\n ) => {\n let theme = useListboxTheme({disabled, invalid});\n let formId = useFormId();\n let field = useField();\n let fieldName = useFieldName();\n let [query, setQuery] = useState('');\n let inputRef = useRef<HTMLElement>(null);\n\n let handleChange = useCallback(\n (selectedValue: V) => {\n onChange?.(selectedValue as V & V[]);\n },\n [onChange],\n );\n\n // hacky solution so the user is able to focus inout used for filtering\n let handleTab = useCallback(\n (event: KeyboardEvent) => {\n if (!showFilter) {\n return;\n }\n\n if (event.key === 'Tab' && document.activeElement !== inputRef.current) {\n event.preventDefault();\n inputRef.current?.focus();\n }\n },\n [showFilter],\n );\n\n let handleQueryChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {\n setQuery(event.target.value);\n }, []);\n\n if (items && children) {\n throw new Error('Combobox accepts only either `items` prop, or children!');\n }\n\n let filteredItems =\n query ?\n items?.filter((item) =>\n item.label\n .toLowerCase()\n .replaceAll(/\\s+/g, '')\n .includes(query.toLowerCase().replaceAll(/\\s+/g, '')),\n )\n : items;\n let filteredChildren =\n query ?\n Children.toArray(children).filter((child) => {\n if (\n typeof child === 'object' &&\n 'props' in child &&\n typeof child.props === 'object' &&\n typeof (child.props as {children?: unknown[] | string}).children === 'string' &&\n (child.props as {children: string}).children\n .toLowerCase()\n .replaceAll(/\\s+/g, '')\n .includes(query.toLowerCase().replaceAll(/\\s+/g, ''))\n ) {\n return true;\n }\n\n return false;\n })\n : children;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- needed\n let props: HeadlessListboxProps<any, any> = {\n as,\n ref,\n name: field?.name ?? fieldName ?? name,\n value: value ?? null,\n defaultValue,\n multiple,\n disabled,\n invalid,\n form: formId,\n onChange: handleChange,\n ...rest,\n };\n\n return (\n <HeadlessListbox {...props}>\n <HeadlessListboxButton\n className={theme.root('relative', className)}\n data-component=\"listbox\"\n data-multiple={multiple ? true : null}\n >\n {({value: selectedValue}) => {\n if (!items && !multiple) {\n let selectedItem: ReactNode;\n\n Children.forEach(filteredChildren, (child) => {\n if (!child) {\n return;\n }\n\n if (\n typeof child === 'object' &&\n 'props' in child &&\n typeof child.props === 'object' &&\n (child.props as Record<string, unknown>).value === selectedValue\n ) {\n selectedItem = (child.props as Record<string, unknown>).children as ReactNode;\n }\n });\n\n return (\n <>\n <span className={theme.label('overflow-hidden text-ellipsis whitespace-nowrap')}>\n {selectedItem ?? placeholder ?? null}\n </span>\n <span className={theme.icon('absolute')}>\n <Icon name=\"ChevronUpDown\" />\n </span>\n </>\n );\n } else if (!items && multiple) {\n let itemsHidden = false;\n let selectedItems: ReactNode[] = [];\n\n Children.forEach(filteredChildren, (child) => {\n if (!child) {\n return;\n }\n\n if (\n typeof child === 'object' &&\n 'props' in child &&\n typeof child.props === 'object' &&\n (selectedValue as unknown[]).includes(\n (child.props as Record<string, unknown>).value,\n )\n ) {\n selectedItems.push(\n (child.props as Record<string, unknown>).children as ReactNode,\n );\n }\n });\n\n if (hideSelected && selectedItems.length > hideSelected.limit) {\n selectedItems = selectedItems.slice(0, hideSelected.limit);\n itemsHidden = true;\n }\n\n return (\n <>\n {selectedItems.length ?\n selectedItems.map((selectedItem, index) => (\n <span\n // eslint-disable-next-line react/no-array-index-key -- needed\n key={index}\n className={theme.label('overflow-hidden text-ellipsis whitespace-nowrap')}\n >\n {selectedItem}\n </span>\n ))\n : (placeholder ?? null)}\n {itemsHidden ?\n <span\n data-ellipsis\n className={theme.label('overflow-hidden text-ellipsis whitespace-nowrap')}\n >\n {hideSelected?.message ?? '\u2026'}\n </span>\n : null}\n <span className={theme.icon('absolute')}>\n <Icon name=\"ChevronUpDown\" />\n </span>\n </>\n );\n } else if (items && multiple) {\n let itemsHidden = false;\n let selectedItems =\n filteredItems?.filter((item) =>\n (selectedValue as unknown[] | undefined)?.includes(item.value),\n ) ?? [];\n\n if (hideSelected && selectedItems.length > hideSelected.limit) {\n selectedItems = selectedItems.slice(0, hideSelected.limit);\n itemsHidden = true;\n }\n\n return (\n <>\n {selectedItems.length ?\n selectedItems.map((selectedItem, index) => (\n <span\n // eslint-disable-next-line react/no-array-index-key -- needed\n key={index}\n className={theme.label('overflow-hidden text-ellipsis whitespace-nowrap')}\n >\n {selectedItem.label}\n </span>\n ))\n : (placeholder ?? null)}\n {itemsHidden ?\n <span\n data-ellipsis\n className={theme.label('overflow-hidden text-ellipsis whitespace-nowrap')}\n >\n {hideSelected?.message ?? '\u2026'}\n </span>\n : null}\n <span className={theme.icon('absolute')}>\n <Icon name=\"ChevronUpDown\" />\n </span>\n </>\n );\n }\n\n let selectedItem = filteredItems?.find((item) => item.value === selectedValue);\n\n return (\n <>\n <span className={theme.label('overflow-hidden text-ellipsis whitespace-nowrap')}>\n {selectedItem?.label ?? placeholder ?? null}\n </span>\n <span className={theme.icon('absolute')}>\n <Icon name=\"ChevronUpDown\" />\n </span>\n </>\n );\n }}\n </HeadlessListboxButton>\n <HeadlessListboxOptions\n anchor=\"bottom start\"\n className={theme.options()}\n onKeyDown={handleTab}\n >\n {showFilter ?\n <div className={theme.filter()}>\n <Input ref={inputRef} showClearButton value={query} onInput={handleQueryChange} />\n </div>\n : null}\n {items ?\n filteredItems?.map((item) => (\n <ListboxOption key={item.label} value={item.value}>\n {item.label}\n </ListboxOption>\n ))\n : filteredChildren}\n </HeadlessListboxOptions>\n </HeadlessListbox>\n );\n },\n);\n\nexport const listboxTheme: ComponentTheme<typeof useListboxTheme> = {\n classNames: {\n root: 'flex w-full min-w-32 items-center rounded-2 border-2 border-neutral-100 hover:border-neutral-200 bg-white px-2.5 h-9 pr-9 gap-x-2 transition-colors shadow-inner font-sans text-sm',\n label: 'flex gap-x-2',\n icon: 'text-neutral-500 size-5 top-1.5 right-1.5 cursor-pointer',\n options:\n 'flex flex-col gap-y-1 shadow p-1 z-30 rounded-2 border-2 border-neutral-100 hover:border-neutral-200 bg-white text-left w-[var(--button-width)] [--anchor-gap:theme(spacing.1)] [--anchor-padding:theme(spacing.2)] [scrollbar-width:thin] empty:invisible transition-colors',\n filter: '[&>[data-component=input]]:rounded',\n },\n variants: {\n disabled: {\n true: {\n root: 'border-neutral-100 text-neutral-200 cursor-not-allowed',\n label: '',\n icon: 'text-neutral-200',\n options: 'border-neutral-100',\n filter: '',\n },\n false: {\n root: '',\n label: '',\n icon: '',\n options: '',\n filter: '',\n },\n },\n invalid: {\n true: {\n root: '',\n label: '',\n icon: '',\n options: '',\n filter: '',\n },\n false: {\n root: '',\n label: '',\n icon: '',\n options: '',\n filter: '',\n },\n },\n },\n};\n"],
|
|
5
|
+
"mappings": ";AAuNgB,mBACE,KADF;AAvNhB;AAAA,EACE,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,OAEb;AACP;AAAA,EAEE;AAAA,EAGA,YAAAA;AAAA,EAKA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EAGE;AAAA,OACK;AACP,SAAQ,YAAW;AACnB,SAAQ,aAAY;AACpB,SAAQ,YAAY,iBAAgB;AACpC,SAAQ,qBAAoB;AAC5B,SAAQ,gBAAe;AACvB,SAAQ,oBAAmB;AAEpB,aAAM,kBAAkB,qBAAqB,WAAW;AAAA,EAC7D,UAAU,EAAC,UAAU,CAAC,MAAM,KAA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AA,IACP,MAAM;AAAA,IACN,SACE;AAAA,IACF,QAAQ;AAAA,EACV;AAAA,EACA,UAAU;AAAA,IACR,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,MAAM;AAAA,QACN,OAAO;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,QACT,QAAQ;AAAA,MACV;AAAA,MACA,OAAO;AAAA,QACL,MAAM;AAAA,QACN,OAAO;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,QACT,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP,MAAM;AAAA,QACJ,MAAM;AAAA,QACN,OAAO;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,QACT,QAAQ;AAAA,MACV;AAAA,MACA,OAAO;AAAA,QACL,MAAM;AAAA,QACN,OAAO;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,QACT,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["Fragment", "selectedItem"]
|
|
7
7
|
}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const useListboxOptionTheme:
|
|
4
|
-
readonly disabled: boolean;
|
|
5
|
-
}) => {
|
|
6
|
-
icon: (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string;
|
|
7
|
-
root: (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string;
|
|
8
|
-
}) & {
|
|
3
|
+
export declare const useListboxOptionTheme: {
|
|
9
4
|
componentThemeName: "ListboxOption";
|
|
10
5
|
themeDefinition: {
|
|
11
6
|
readonly variants: {
|
|
@@ -13,7 +8,12 @@ export declare const useListboxOptionTheme: ((themeProps: {
|
|
|
13
8
|
};
|
|
14
9
|
readonly elements: ["root", "icon"];
|
|
15
10
|
};
|
|
16
|
-
}
|
|
11
|
+
} & ((themeProps: {
|
|
12
|
+
readonly disabled: boolean;
|
|
13
|
+
}) => {
|
|
14
|
+
icon: (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string;
|
|
15
|
+
root: (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string;
|
|
16
|
+
});
|
|
17
17
|
export type ListboxOptionProps<T extends ElementType, V extends boolean | number | string> = PropsWithChildren<ComponentProps<typeof useListboxOptionTheme> & ComponentPropsWithoutRef<T> & {
|
|
18
18
|
as?: T | undefined;
|
|
19
19
|
value: V;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const useMenuTheme:
|
|
3
|
+
export declare const useMenuTheme: {
|
|
4
4
|
componentThemeName: "Menu";
|
|
5
5
|
themeDefinition: undefined;
|
|
6
|
-
};
|
|
6
|
+
} & (() => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
7
7
|
export type MenuProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof useMenuTheme> & ComponentPropsWithoutRef<T> & {
|
|
8
8
|
as?: T | undefined;
|
|
9
9
|
className?: string;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const useMenuButtonTheme:
|
|
4
|
-
readonly disabled: boolean;
|
|
5
|
-
}) => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string) & {
|
|
3
|
+
export declare const useMenuButtonTheme: {
|
|
6
4
|
componentThemeName: "MenuButton";
|
|
7
5
|
themeDefinition: {
|
|
8
6
|
readonly variants: {
|
|
9
7
|
readonly disabled: [true, false];
|
|
10
8
|
};
|
|
11
9
|
};
|
|
12
|
-
}
|
|
10
|
+
} & ((themeProps: {
|
|
11
|
+
readonly disabled: boolean;
|
|
12
|
+
}) => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
13
13
|
export type MenuButtonProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof useMenuButtonTheme> & ComponentPropsWithoutRef<T> & {
|
|
14
14
|
as?: T | undefined;
|
|
15
15
|
className?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const useMenuHeadingTheme:
|
|
3
|
+
export declare const useMenuHeadingTheme: {
|
|
4
4
|
componentThemeName: "MenuHeading";
|
|
5
5
|
themeDefinition: undefined;
|
|
6
|
-
};
|
|
6
|
+
} & (() => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
7
7
|
export type MenuHeadingProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof useMenuHeadingTheme> & ComponentPropsWithoutRef<T> & {
|
|
8
8
|
as?: T | undefined;
|
|
9
9
|
className?: string;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const useMenuItemTheme:
|
|
4
|
-
readonly disabled: boolean;
|
|
5
|
-
}) => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string) & {
|
|
3
|
+
export declare const useMenuItemTheme: {
|
|
6
4
|
componentThemeName: "MenuItem";
|
|
7
5
|
themeDefinition: {
|
|
8
6
|
readonly variants: {
|
|
9
7
|
readonly disabled: [true, false];
|
|
10
8
|
};
|
|
11
9
|
};
|
|
12
|
-
}
|
|
10
|
+
} & ((themeProps: {
|
|
11
|
+
readonly disabled: boolean;
|
|
12
|
+
}) => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
13
13
|
export type MenuItemProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof useMenuItemTheme> & ComponentPropsWithoutRef<T> & {
|
|
14
14
|
as?: T | undefined;
|
|
15
15
|
className?: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type MenuItemsProps as HeadlessMenuItemsProps } from '@headlessui/react';
|
|
2
2
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
3
3
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
4
|
-
export declare const useMenuItemsTheme:
|
|
4
|
+
export declare const useMenuItemsTheme: {
|
|
5
5
|
componentThemeName: "MenuItems";
|
|
6
6
|
themeDefinition: undefined;
|
|
7
|
-
};
|
|
7
|
+
} & (() => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
8
8
|
export type MenuItemsProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof useMenuItemsTheme> & ComponentPropsWithoutRef<T> & {
|
|
9
9
|
as?: T | undefined;
|
|
10
10
|
anchor?: HeadlessMenuItemsProps['anchor'] | undefined;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const useMenuSectionTheme:
|
|
3
|
+
export declare const useMenuSectionTheme: {
|
|
4
4
|
componentThemeName: "MenuSection";
|
|
5
5
|
themeDefinition: undefined;
|
|
6
|
-
};
|
|
6
|
+
} & (() => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
7
7
|
export type MenuSectionProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof useMenuSectionTheme> & ComponentPropsWithoutRef<T> & {
|
|
8
8
|
as?: T | undefined;
|
|
9
9
|
className?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const useMenuSeparatorTheme:
|
|
3
|
+
export declare const useMenuSeparatorTheme: {
|
|
4
4
|
componentThemeName: "MenuSeparator";
|
|
5
5
|
themeDefinition: undefined;
|
|
6
|
-
};
|
|
6
|
+
} & (() => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
7
7
|
export type MenuSeparatorProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof useMenuSeparatorTheme> & ComponentPropsWithoutRef<T> & {
|
|
8
8
|
as?: T | undefined;
|
|
9
9
|
className?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const usePopoverTheme:
|
|
3
|
+
export declare const usePopoverTheme: {
|
|
4
4
|
componentThemeName: "Popover";
|
|
5
5
|
themeDefinition: undefined;
|
|
6
|
-
};
|
|
6
|
+
} & (() => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
7
7
|
export type PopoverProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof usePopoverTheme> & ComponentPropsWithoutRef<T> & {
|
|
8
8
|
as?: T | undefined;
|
|
9
9
|
className?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const usePopoverBackdropTheme:
|
|
3
|
+
export declare const usePopoverBackdropTheme: {
|
|
4
4
|
componentThemeName: "PopoverBackdrop";
|
|
5
5
|
themeDefinition: undefined;
|
|
6
|
-
};
|
|
6
|
+
} & (() => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
7
7
|
export type PopoverBackdropProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof usePopoverBackdropTheme> & ComponentPropsWithoutRef<T> & {
|
|
8
8
|
as?: T | undefined;
|
|
9
9
|
className?: string;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const usePopoverButtonTheme:
|
|
4
|
-
readonly disabled: boolean;
|
|
5
|
-
}) => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string) & {
|
|
3
|
+
export declare const usePopoverButtonTheme: {
|
|
6
4
|
componentThemeName: "PopoverButton";
|
|
7
5
|
themeDefinition: {
|
|
8
6
|
readonly variants: {
|
|
9
7
|
readonly disabled: [true, false];
|
|
10
8
|
};
|
|
11
9
|
};
|
|
12
|
-
}
|
|
10
|
+
} & ((themeProps: {
|
|
11
|
+
readonly disabled: boolean;
|
|
12
|
+
}) => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
13
13
|
export type PopoverButtonProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof usePopoverButtonTheme> & ComponentPropsWithoutRef<T> & {
|
|
14
14
|
as?: T | undefined;
|
|
15
15
|
autoFocus?: boolean | undefined;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const usePopoverGroupTheme:
|
|
3
|
+
export declare const usePopoverGroupTheme: {
|
|
4
4
|
componentThemeName: "PopoverGroup";
|
|
5
5
|
themeDefinition: undefined;
|
|
6
|
-
};
|
|
6
|
+
} & (() => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
7
7
|
export type PopoverGroupProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof usePopoverGroupTheme> & ComponentPropsWithoutRef<T> & {
|
|
8
8
|
as?: T | undefined;
|
|
9
9
|
className?: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type PopoverPanelProps as HeadlessPopoverPanelProps } from '@headlessui/react';
|
|
2
2
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
3
3
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
4
|
-
export declare const usePopoverPanelTheme:
|
|
4
|
+
export declare const usePopoverPanelTheme: {
|
|
5
5
|
componentThemeName: "PopoverPanel";
|
|
6
6
|
themeDefinition: undefined;
|
|
7
|
-
};
|
|
7
|
+
} & (() => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
8
8
|
export type PopoverPanelProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof usePopoverPanelTheme> & ComponentPropsWithoutRef<T> & {
|
|
9
9
|
as?: T | undefined;
|
|
10
10
|
static?: boolean | undefined;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const useRadioTheme:
|
|
4
|
-
readonly disabled: boolean;
|
|
5
|
-
}) => {
|
|
6
|
-
icon: (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string;
|
|
7
|
-
root: (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string;
|
|
8
|
-
}) & {
|
|
3
|
+
export declare const useRadioTheme: {
|
|
9
4
|
componentThemeName: "Radio";
|
|
10
5
|
themeDefinition: {
|
|
11
6
|
readonly variants: {
|
|
@@ -13,7 +8,12 @@ export declare const useRadioTheme: ((themeProps: {
|
|
|
13
8
|
};
|
|
14
9
|
readonly elements: ["root", "icon"];
|
|
15
10
|
};
|
|
16
|
-
}
|
|
11
|
+
} & ((themeProps: {
|
|
12
|
+
readonly disabled: boolean;
|
|
13
|
+
}) => {
|
|
14
|
+
icon: (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string;
|
|
15
|
+
root: (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string;
|
|
16
|
+
});
|
|
17
17
|
export type RadioProps<T extends ElementType, V extends boolean | number | string> = ComponentProps<typeof useRadioTheme> & ComponentPropsWithoutRef<T> & {
|
|
18
18
|
as?: T | undefined;
|
|
19
19
|
value: V;
|
|
@@ -33,7 +33,7 @@ export const Radio = forwardRef(
|
|
|
33
33
|
"data-component": "radio",
|
|
34
34
|
...rest
|
|
35
35
|
};
|
|
36
|
-
return /* @__PURE__ */ jsx(HeadlessRadio, { ...props, children: /* @__PURE__ */ jsx("span", { className: theme.icon(), children: /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg",
|
|
36
|
+
return /* @__PURE__ */ jsx(HeadlessRadio, { ...props, children: /* @__PURE__ */ jsx("span", { className: theme.icon(), children: /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", xmlSpace: "preserve", children: /* @__PURE__ */ jsx("circle", { cx: "10", cy: "10", fill: "currentColor", r: "4" }) }) }) }) });
|
|
37
37
|
}
|
|
38
38
|
);
|
|
39
39
|
export const radioTheme = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../source/components/Radio.tsx"],
|
|
4
|
-
"sourcesContent": ["import {Radio as HeadlessRadio, type RadioProps as HeadlessRadioProps} from '@headlessui/react';\nimport {type ComponentPropsWithoutRef, type ElementType, type Ref} from 'react';\n\nimport {\n type ComponentProps,\n type ComponentTheme,\n createComponentTheme,\n} from '../theme/internals.js';\nimport {Icon} from './Icon.js';\nimport {forwardRef} from './internals.js';\n\nexport const useRadioTheme = createComponentTheme('Radio', {\n variants: {\n disabled: [true, false],\n },\n elements: ['root', 'icon'],\n});\n\nconst RADIO_ELEMENT = 'span';\n\nexport type RadioProps<T extends ElementType, V extends boolean | number | string> = ComponentProps<\n typeof useRadioTheme\n> &\n ComponentPropsWithoutRef<T> & {\n as?: T | undefined;\n value: V;\n autoFocus?: boolean | undefined;\n className?: string;\n };\n\nexport const Radio = forwardRef(\n <T extends ElementType = typeof RADIO_ELEMENT, V extends boolean | number | string = string>(\n {\n disabled = false,\n as = RADIO_ELEMENT as T,\n value,\n autoFocus,\n className,\n ...rest\n }: RadioProps<T, V>,\n ref: Ref<HTMLElement>,\n ) => {\n let theme = useRadioTheme({disabled});\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- needed\n let props: HeadlessRadioProps<any, V> = {\n as,\n ref,\n value,\n disabled,\n autoFocus,\n className: theme.root('relative', className),\n 'data-component': 'radio',\n ...rest,\n };\n\n return (\n <HeadlessRadio {...props}>\n <span className={theme.icon()}>\n <Icon>\n <svg xmlns=\"http://www.w3.org/2000/svg\"
|
|
5
|
-
"mappings": ";AA6Dc;AA7Dd,SAAQ,SAAS,qBAA2D;AAG5E;AAAA,EAGE;AAAA,OACK;AACP,SAAQ,YAAW;AACnB,SAAQ,kBAAiB;AAElB,aAAM,gBAAgB,qBAAqB,SAAS;AAAA,EACzD,UAAU;AAAA,IACR,UAAU,CAAC,MAAM,KAAK;AAAA,EACxB;AAAA,EACA,UAAU,CAAC,QAAQ,MAAM;AAC3B,CAAC;AAED,MAAM,gBAAgB;AAYf,aAAM,QAAQ;AAAA,EACnB,CACE;AAAA,IACE,WAAW;AAAA,IACX,KAAK;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AACH,QAAI,QAAQ,cAAc,EAAC,SAAQ,CAAC;AAGpC,QAAI,QAAoC;AAAA,MACtC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW,MAAM,KAAK,YAAY,SAAS;AAAA,MAC3C,kBAAkB;AAAA,MAClB,GAAG;AAAA,IACL;AAEA,WACE,oBAAC,iBAAe,GAAG,OACjB,8BAAC,UAAK,WAAW,MAAM,KAAK,GAC1B,8BAAC,QACC,8BAAC,SAAI,OAAM,8BAA6B,
|
|
4
|
+
"sourcesContent": ["import {Radio as HeadlessRadio, type RadioProps as HeadlessRadioProps} from '@headlessui/react';\nimport {type ComponentPropsWithoutRef, type ElementType, type Ref} from 'react';\n\nimport {\n type ComponentProps,\n type ComponentTheme,\n createComponentTheme,\n} from '../theme/internals.js';\nimport {Icon} from './Icon.js';\nimport {forwardRef} from './internals.js';\n\nexport const useRadioTheme = createComponentTheme('Radio', {\n variants: {\n disabled: [true, false],\n },\n elements: ['root', 'icon'],\n});\n\nconst RADIO_ELEMENT = 'span';\n\nexport type RadioProps<T extends ElementType, V extends boolean | number | string> = ComponentProps<\n typeof useRadioTheme\n> &\n ComponentPropsWithoutRef<T> & {\n as?: T | undefined;\n value: V;\n autoFocus?: boolean | undefined;\n className?: string;\n };\n\nexport const Radio = forwardRef(\n <T extends ElementType = typeof RADIO_ELEMENT, V extends boolean | number | string = string>(\n {\n disabled = false,\n as = RADIO_ELEMENT as T,\n value,\n autoFocus,\n className,\n ...rest\n }: RadioProps<T, V>,\n ref: Ref<HTMLElement>,\n ) => {\n let theme = useRadioTheme({disabled});\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- needed\n let props: HeadlessRadioProps<any, V> = {\n as,\n ref,\n value,\n disabled,\n autoFocus,\n className: theme.root('relative', className),\n 'data-component': 'radio',\n ...rest,\n };\n\n return (\n <HeadlessRadio {...props}>\n <span className={theme.icon()}>\n <Icon>\n <svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" xmlSpace=\"preserve\">\n <circle cx=\"10\" cy=\"10\" fill=\"currentColor\" r=\"4\" />\n </svg>\n </Icon>\n </span>\n </HeadlessRadio>\n );\n },\n);\n\nexport const radioTheme: ComponentTheme<typeof useRadioTheme> = {\n classNames: {\n root: 'group/radio inline-block size-5',\n icon: 'flex justify-content justify-item size-5 *:rounded-full *:bg-white *:border-2 *:border-neutral-100 *:hover:border-neutral-200 *:shadow-inner *:transition-colors *:text-transparent *:hover:text-neutral-100 group-data-[checked]/radio:*:bg-neutral-950 group-data-[checked]/radio:*:border-neutral-950 group-data-[checked]/radio:*:text-white',\n },\n variants: {\n disabled: {\n true: {\n root: 'border-neutral-100 text-neutral-200 cursor-not-allowed',\n icon: 'opacity-0',\n },\n false: {\n root: '',\n icon: '',\n },\n },\n },\n};\n"],
|
|
5
|
+
"mappings": ";AA6Dc;AA7Dd,SAAQ,SAAS,qBAA2D;AAG5E;AAAA,EAGE;AAAA,OACK;AACP,SAAQ,YAAW;AACnB,SAAQ,kBAAiB;AAElB,aAAM,gBAAgB,qBAAqB,SAAS;AAAA,EACzD,UAAU;AAAA,IACR,UAAU,CAAC,MAAM,KAAK;AAAA,EACxB;AAAA,EACA,UAAU,CAAC,QAAQ,MAAM;AAC3B,CAAC;AAED,MAAM,gBAAgB;AAYf,aAAM,QAAQ;AAAA,EACnB,CACE;AAAA,IACE,WAAW;AAAA,IACX,KAAK;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AACH,QAAI,QAAQ,cAAc,EAAC,SAAQ,CAAC;AAGpC,QAAI,QAAoC;AAAA,MACtC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW,MAAM,KAAK,YAAY,SAAS;AAAA,MAC3C,kBAAkB;AAAA,MAClB,GAAG;AAAA,IACL;AAEA,WACE,oBAAC,iBAAe,GAAG,OACjB,8BAAC,UAAK,WAAW,MAAM,KAAK,GAC1B,8BAAC,QACC,8BAAC,SAAI,SAAQ,aAAY,OAAM,8BAA6B,UAAS,YACnE,8BAAC,YAAO,IAAG,MAAK,IAAG,MAAK,MAAK,gBAAe,GAAE,KAAI,GACpD,GACF,GACF,GACF;AAAA,EAEJ;AACF;AAEO,aAAM,aAAmD;AAAA,EAC9D,YAAY;AAAA,IACV,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA,UAAU;AAAA,IACR,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA,OAAO;AAAA,QACL,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type PropsWithChildren } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const useRadioFieldTheme:
|
|
3
|
+
export declare const useRadioFieldTheme: {
|
|
4
4
|
componentThemeName: "RadioField";
|
|
5
5
|
themeDefinition: undefined;
|
|
6
|
-
};
|
|
6
|
+
} & (() => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
7
7
|
export type RadioFieldProps = PropsWithChildren<ComponentProps<typeof useRadioFieldTheme> & {
|
|
8
8
|
className?: string;
|
|
9
9
|
}>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { type FieldMetadata, type FieldName } from '@conform-to/react';
|
|
2
2
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
3
3
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
4
|
-
export declare const useRadioGroupTheme:
|
|
5
|
-
readonly disabled: boolean;
|
|
6
|
-
}) => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string) & {
|
|
4
|
+
export declare const useRadioGroupTheme: {
|
|
7
5
|
componentThemeName: "RadioGroup";
|
|
8
6
|
themeDefinition: {
|
|
9
7
|
readonly variants: {
|
|
10
8
|
readonly disabled: [true, false];
|
|
11
9
|
};
|
|
12
10
|
};
|
|
13
|
-
}
|
|
11
|
+
} & ((themeProps: {
|
|
12
|
+
readonly disabled: boolean;
|
|
13
|
+
}) => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
14
14
|
export type RadioGroupProps<T extends ElementType, V extends boolean | number | string> = PropsWithChildren<ComponentProps<typeof useRadioGroupTheme> & ComponentPropsWithoutRef<T> & ({
|
|
15
15
|
as?: T | undefined;
|
|
16
16
|
value?: V | undefined;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
2
|
-
export declare const useSpinnerTheme:
|
|
3
|
-
readonly size: "small" | "medium" | "large" | "surface";
|
|
4
|
-
}) => {
|
|
5
|
-
icon: (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string;
|
|
6
|
-
root: (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string;
|
|
7
|
-
}) & {
|
|
2
|
+
export declare const useSpinnerTheme: {
|
|
8
3
|
componentThemeName: "Spinner";
|
|
9
4
|
themeDefinition: {
|
|
10
5
|
readonly variants: {
|
|
@@ -12,7 +7,12 @@ export declare const useSpinnerTheme: ((themeProps: {
|
|
|
12
7
|
};
|
|
13
8
|
readonly elements: ["root", "icon"];
|
|
14
9
|
};
|
|
15
|
-
}
|
|
10
|
+
} & ((themeProps: {
|
|
11
|
+
readonly size: "small" | "medium" | "large" | "surface";
|
|
12
|
+
}) => {
|
|
13
|
+
icon: (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string;
|
|
14
|
+
root: (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string;
|
|
15
|
+
});
|
|
16
16
|
export type SpinnerProps = ComponentProps<typeof useSpinnerTheme> & {
|
|
17
17
|
className?: string;
|
|
18
18
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const useTableTheme:
|
|
3
|
+
export declare const useTableTheme: {
|
|
4
4
|
componentThemeName: "Table";
|
|
5
5
|
themeDefinition: undefined;
|
|
6
|
-
};
|
|
6
|
+
} & (() => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
7
7
|
export type TableProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof useTableTheme> & ComponentPropsWithoutRef<T> & {
|
|
8
8
|
as?: T | undefined;
|
|
9
9
|
className?: string | undefined;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const useTableBodyTheme:
|
|
3
|
+
export declare const useTableBodyTheme: {
|
|
4
4
|
componentThemeName: "TableBody";
|
|
5
5
|
themeDefinition: undefined;
|
|
6
|
-
};
|
|
6
|
+
} & (() => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
7
7
|
export type TableBodyProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof useTableBodyTheme> & ComponentPropsWithoutRef<T> & {
|
|
8
8
|
as?: T | undefined;
|
|
9
9
|
className?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const useTableCaptionTheme:
|
|
3
|
+
export declare const useTableCaptionTheme: {
|
|
4
4
|
componentThemeName: "TableCaption";
|
|
5
5
|
themeDefinition: undefined;
|
|
6
|
-
};
|
|
6
|
+
} & (() => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
7
7
|
export type TableCaptionProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof useTableCaptionTheme> & ComponentPropsWithoutRef<T> & {
|
|
8
8
|
as?: T | undefined;
|
|
9
9
|
className?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const useTableCellTheme:
|
|
3
|
+
export declare const useTableCellTheme: {
|
|
4
4
|
componentThemeName: "TableCell";
|
|
5
5
|
themeDefinition: undefined;
|
|
6
|
-
};
|
|
6
|
+
} & (() => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
7
7
|
export type TableCellProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof useTableCellTheme> & ComponentPropsWithoutRef<T> & {
|
|
8
8
|
as?: T | undefined;
|
|
9
9
|
className?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const useTableFootTheme:
|
|
3
|
+
export declare const useTableFootTheme: {
|
|
4
4
|
componentThemeName: "TableFoot";
|
|
5
5
|
themeDefinition: undefined;
|
|
6
|
-
};
|
|
6
|
+
} & (() => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
7
7
|
export type TableFootProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof useTableFootTheme> & ComponentPropsWithoutRef<T> & {
|
|
8
8
|
as?: T | undefined;
|
|
9
9
|
className?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const useTableHeadTheme:
|
|
3
|
+
export declare const useTableHeadTheme: {
|
|
4
4
|
componentThemeName: "TableHead";
|
|
5
5
|
themeDefinition: undefined;
|
|
6
|
-
};
|
|
6
|
+
} & (() => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
7
7
|
export type TableHeadProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof useTableHeadTheme> & ComponentPropsWithoutRef<T> & {
|
|
8
8
|
as?: T | undefined;
|
|
9
9
|
className?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const useTableHeaderTheme:
|
|
3
|
+
export declare const useTableHeaderTheme: {
|
|
4
4
|
componentThemeName: "TableHeader";
|
|
5
5
|
themeDefinition: undefined;
|
|
6
|
-
};
|
|
6
|
+
} & (() => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
7
7
|
export type TableHeaderProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof useTableHeaderTheme> & ComponentPropsWithoutRef<T> & {
|
|
8
8
|
as?: T | undefined;
|
|
9
9
|
className?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const useTableRowTheme:
|
|
3
|
+
export declare const useTableRowTheme: {
|
|
4
4
|
componentThemeName: "TableRow";
|
|
5
5
|
themeDefinition: undefined;
|
|
6
|
-
};
|
|
6
|
+
} & (() => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
7
7
|
export type TableRowProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof useTableRowTheme> & ComponentPropsWithoutRef<T> & {
|
|
8
8
|
as?: T | undefined;
|
|
9
9
|
className?: string;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
import { type ComponentProps, type ComponentTheme } from '../theme/internals.js';
|
|
3
|
-
export declare const useTextTheme:
|
|
4
|
-
readonly size: "small" | "medium" | "large";
|
|
5
|
-
}) => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string) & {
|
|
3
|
+
export declare const useTextTheme: {
|
|
6
4
|
componentThemeName: "Text";
|
|
7
5
|
themeDefinition: {
|
|
8
6
|
readonly variants: {
|
|
9
7
|
readonly size: ["small", "medium", "large"];
|
|
10
8
|
};
|
|
11
9
|
};
|
|
12
|
-
}
|
|
10
|
+
} & ((themeProps: {
|
|
11
|
+
readonly size: "small" | "medium" | "large";
|
|
12
|
+
}) => (baseClassName?: import("../theme/internals.js").ClassName, overrideClassName?: import("../theme/internals.js").ClassName) => string);
|
|
13
13
|
export type TextProps<T extends ElementType> = PropsWithChildren<ComponentProps<typeof useTextTheme> & ComponentPropsWithoutRef<T> & {
|
|
14
14
|
as?: T | undefined;
|
|
15
15
|
className?: string;
|