@yamada-ui/react 2.1.2-dev-20260306204545 → 2.1.2-dev-20260307012857
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/table/table.cjs +2 -1
- package/dist/cjs/components/table/table.cjs.map +1 -1
- package/dist/cjs/core/css/at-rule.cjs +5 -2
- package/dist/cjs/core/css/at-rule.cjs.map +1 -1
- package/dist/cjs/core/css/config.cjs +1 -1
- package/dist/cjs/core/css/config.cjs.map +1 -1
- package/dist/cjs/core/system/create-system.cjs.map +1 -1
- package/dist/cjs/core/system/storage-manager.cjs.map +1 -1
- package/dist/esm/components/table/table.js +2 -1
- package/dist/esm/components/table/table.js.map +1 -1
- package/dist/esm/core/css/at-rule.js +5 -2
- package/dist/esm/core/css/at-rule.js.map +1 -1
- package/dist/esm/core/css/config.js +1 -1
- package/dist/esm/core/css/config.js.map +1 -1
- package/dist/esm/core/system/create-system.js.map +1 -1
- package/dist/esm/core/system/storage-manager.js.map +1 -1
- package/dist/types/components/accordion/accordion.d.ts +2 -2
- package/dist/types/components/accordion/accordion.style.d.ts +1 -1
- package/dist/types/components/accordion/use-accordion.d.ts +11 -11
- package/dist/types/components/airy/airy.d.ts +2 -2
- package/dist/types/components/alert/alert.d.ts +2 -2
- package/dist/types/components/alpha-slider/alpha-slider.d.ts +2 -2
- package/dist/types/components/aspect-ratio/aspect-ratio.d.ts +2 -2
- package/dist/types/components/autocomplete/autocomplete.d.ts +2 -2
- package/dist/types/components/autocomplete/use-autocomplete.d.ts +5 -5
- package/dist/types/components/avatar/avatar.d.ts +3 -3
- package/dist/types/components/avatar/use-avatar-group.d.ts +2 -2
- package/dist/types/components/badge/badge.d.ts +2 -2
- package/dist/types/components/bleed/bleed.d.ts +2 -2
- package/dist/types/components/blockquote/blockquote.d.ts +2 -2
- package/dist/types/components/breadcrumb/breadcrumb.d.ts +2 -2
- package/dist/types/components/breadcrumb/breadcrumb.style.d.ts +1 -1
- package/dist/types/components/breadcrumb/use-breadcrumb.d.ts +2 -2
- package/dist/types/components/button/button.d.ts +2 -2
- package/dist/types/components/button/icon-button.d.ts +2 -2
- package/dist/types/components/calendar/calendar.d.ts +2 -2
- package/dist/types/components/calendar/calendar.style.d.ts +2 -2
- package/dist/types/components/calendar/use-calendar.d.ts +8 -8
- package/dist/types/components/card/card.d.ts +2 -2
- package/dist/types/components/carousel/carousel.d.ts +2 -2
- package/dist/types/components/carousel/carousel.style.d.ts +2 -2
- package/dist/types/components/carousel/use-carousel.d.ts +3 -3
- package/dist/types/components/center/center.d.ts +2 -2
- package/dist/types/components/chart/area-chart.d.ts +2 -2
- package/dist/types/components/chart/bar-chart.d.ts +2 -2
- package/dist/types/components/chart/cartesian-chart.style.d.ts +1 -1
- package/dist/types/components/chart/chart.d.ts +5 -5
- package/dist/types/components/chart/chart.style.d.ts +2 -2
- package/dist/types/components/chart/composed-chart.d.ts +2 -2
- package/dist/types/components/chart/donut-chart.d.ts +2 -2
- package/dist/types/components/chart/pie-chart.d.ts +2 -2
- package/dist/types/components/chart/polar-chart.style.d.ts +1 -1
- package/dist/types/components/chart/radar-chart.d.ts +2 -2
- package/dist/types/components/chart/use-chart.d.ts +2 -2
- package/dist/types/components/checkbox/checkbox.d.ts +3 -3
- package/dist/types/components/checkbox/use-checkbox-group.d.ts +2 -2
- package/dist/types/components/checkbox-card/checkbox-card.d.ts +4 -4
- package/dist/types/components/circle-progress/circle-progress.d.ts +2 -2
- package/dist/types/components/close-button/close-button.d.ts +2 -2
- package/dist/types/components/code/code.d.ts +2 -2
- package/dist/types/components/collapse/collapse.d.ts +2 -2
- package/dist/types/components/color-picker/color-picker.d.ts +2 -2
- package/dist/types/components/color-picker/color-picker.style.d.ts +1 -1
- package/dist/types/components/color-picker/use-color-picker.d.ts +2 -2
- package/dist/types/components/color-selector/color-selector.d.ts +2 -2
- package/dist/types/components/color-selector/use-color-selector.d.ts +3 -3
- package/dist/types/components/color-swatch/color-swatch.d.ts +2 -2
- package/dist/types/components/container/container.d.ts +2 -2
- package/dist/types/components/data-list/data-list.d.ts +2 -2
- package/dist/types/components/data-list/data-list.style.d.ts +1 -1
- package/dist/types/components/date-picker/date-picker.d.ts +2 -2
- package/dist/types/components/date-picker/use-date-picker.d.ts +4 -4
- package/dist/types/components/drawer/drawer.d.ts +2 -2
- package/dist/types/components/dropzone/dropzone.d.ts +4 -4
- package/dist/types/components/editable/editable.d.ts +4 -4
- package/dist/types/components/editable/use-editable.d.ts +2 -2
- package/dist/types/components/em/em.d.ts +2 -2
- package/dist/types/components/empty-state/empty-state.d.ts +2 -2
- package/dist/types/components/fade/fade.d.ts +2 -2
- package/dist/types/components/field/field.d.ts +3 -3
- package/dist/types/components/field/field.style.d.ts +2 -2
- package/dist/types/components/field/use-field-props.d.ts +4 -4
- package/dist/types/components/fieldset/fieldset.d.ts +3 -3
- package/dist/types/components/fieldset/fieldset.style.d.ts +1 -1
- package/dist/types/components/file-button/file-button.d.ts +2 -2
- package/dist/types/components/file-button/use-file-button.d.ts +18 -18
- package/dist/types/components/file-input/file-input.d.ts +2 -2
- package/dist/types/components/file-input/use-file-input.d.ts +15 -15
- package/dist/types/components/flex/flex.d.ts +2 -2
- package/dist/types/components/flip/flip.d.ts +4 -4
- package/dist/types/components/flip/flip.style.d.ts +1 -1
- package/dist/types/components/float/float.d.ts +2 -2
- package/dist/types/components/form/form.d.ts +3 -3
- package/dist/types/components/format/format-byte.d.ts +4 -4
- package/dist/types/components/format/format-date-time.d.ts +2 -2
- package/dist/types/components/format/format-number.d.ts +2 -2
- package/dist/types/components/grid/grid-item.d.ts +2 -2
- package/dist/types/components/grid/grid.d.ts +2 -2
- package/dist/types/components/group/group.d.ts +2 -2
- package/dist/types/components/group/use-group.d.ts +2 -2
- package/dist/types/components/heading/heading.d.ts +2 -2
- package/dist/types/components/hue-slider/hue-slider.d.ts +3 -3
- package/dist/types/components/icon/icon.d.ts +5 -5
- package/dist/types/components/image/image.d.ts +2 -2
- package/dist/types/components/indicator/indicator.d.ts +4 -4
- package/dist/types/components/infinite-scroll-area/infinite-scroll-area.d.ts +2 -2
- package/dist/types/components/input/input-addon.d.ts +2 -2
- package/dist/types/components/input/input-element.d.ts +2 -2
- package/dist/types/components/input/input.d.ts +2 -2
- package/dist/types/components/kbd/kbd.d.ts +2 -2
- package/dist/types/components/link/link.d.ts +2 -2
- package/dist/types/components/link-box/link-box.d.ts +2 -2
- package/dist/types/components/list/list.d.ts +2 -2
- package/dist/types/components/list/list.style.d.ts +2 -2
- package/dist/types/components/loading/loading-provider.d.ts +2 -2
- package/dist/types/components/loading/loading.d.ts +3 -3
- package/dist/types/components/mark/mark.d.ts +2 -2
- package/dist/types/components/menu/menu.d.ts +2 -2
- package/dist/types/components/menu/menu.style.d.ts +2 -2
- package/dist/types/components/menu/use-menu.d.ts +11 -11
- package/dist/types/components/modal/modal.d.ts +2 -2
- package/dist/types/components/native-accordion/native-accordion.d.ts +2 -2
- package/dist/types/components/native-accordion/native-accordion.style.d.ts +2 -2
- package/dist/types/components/native-accordion/use-native-accordion.d.ts +2 -2
- package/dist/types/components/native-popover/native-popover.d.ts +2 -2
- package/dist/types/components/native-select/native-select.d.ts +2 -2
- package/dist/types/components/native-table/native-table.d.ts +4 -4
- package/dist/types/components/notice/notice.style.d.ts +1 -1
- package/dist/types/components/number-input/number-input.d.ts +2 -2
- package/dist/types/components/number-input/number-input.style.d.ts +1 -1
- package/dist/types/components/pagination/pagination.d.ts +2 -2
- package/dist/types/components/pagination/pagination.style.d.ts +1 -1
- package/dist/types/components/pagination/use-pagination.d.ts +2 -2
- package/dist/types/components/password-input/password-input.d.ts +2 -2
- package/dist/types/components/password-input/strength-meter.d.ts +2 -2
- package/dist/types/components/password-input/use-password-input.d.ts +2 -2
- package/dist/types/components/pin-input/pin-input.d.ts +2 -2
- package/dist/types/components/pin-input/use-pin-input.d.ts +7 -7
- package/dist/types/components/popover/popover.d.ts +2 -2
- package/dist/types/components/progress/progress.d.ts +4 -4
- package/dist/types/components/progress/use-progress.d.ts +706 -706
- package/dist/types/components/qr-code/qr-code.d.ts +2 -2
- package/dist/types/components/radio/radio.d.ts +4 -4
- package/dist/types/components/radio/use-radio-group.d.ts +2 -2
- package/dist/types/components/radio-card/radio-card.d.ts +4 -4
- package/dist/types/components/rating/rating.style.d.ts +2 -2
- package/dist/types/components/rating/use-rating.d.ts +7 -7
- package/dist/types/components/reorder/reorder.d.ts +2 -2
- package/dist/types/components/reorder/reorder.style.d.ts +1 -1
- package/dist/types/components/reorder/use-reorder.d.ts +3 -3
- package/dist/types/components/resizable/resizable.d.ts +2 -2
- package/dist/types/components/resizable/resizable.style.d.ts +2 -2
- package/dist/types/components/resizable/use-resizable.d.ts +2 -2
- package/dist/types/components/ripple/ripple.d.ts +2 -2
- package/dist/types/components/ripple/use-ripple.d.ts +2 -2
- package/dist/types/components/rotate/rotate.d.ts +2 -2
- package/dist/types/components/saturation-slider/saturation-slider.d.ts +2 -2
- package/dist/types/components/saturation-slider/use-saturation-slider.d.ts +2 -2
- package/dist/types/components/scroll-area/scroll-area.d.ts +2 -2
- package/dist/types/components/segmented-control/segmented-control.d.ts +2 -2
- package/dist/types/components/segmented-control/segmented-control.style.d.ts +2 -2
- package/dist/types/components/segmented-control/use-segmented-control.d.ts +9 -9
- package/dist/types/components/select/select.d.ts +2 -2
- package/dist/types/components/select/use-select.d.ts +4 -4
- package/dist/types/components/separator/separator.d.ts +2 -2
- package/dist/types/components/simple-grid/simple-grid.d.ts +2 -2
- package/dist/types/components/skeleton/skeleton.d.ts +2 -2
- package/dist/types/components/slide/slide.d.ts +2 -2
- package/dist/types/components/slide-fade/slide-fade.d.ts +2 -2
- package/dist/types/components/slider/slider.d.ts +2 -2
- package/dist/types/components/slider/use-slider.d.ts +2 -2
- package/dist/types/components/stack/h-stack.d.ts +2 -2
- package/dist/types/components/stack/stack.d.ts +2 -2
- package/dist/types/components/stack/v-stack.d.ts +2 -2
- package/dist/types/components/stack/z-stack.d.ts +2 -2
- package/dist/types/components/stat/stat.d.ts +2 -2
- package/dist/types/components/stat/stat.style.d.ts +2 -2
- package/dist/types/components/status/status.d.ts +2 -2
- package/dist/types/components/steps/steps.d.ts +2 -2
- package/dist/types/components/steps/steps.style.d.ts +1 -1
- package/dist/types/components/steps/use-steps.d.ts +10 -10
- package/dist/types/components/switch/switch.d.ts +2 -2
- package/dist/types/components/table/table.d.ts +3 -3
- package/dist/types/components/tabs/tabs.d.ts +2 -2
- package/dist/types/components/tabs/use-tabs.d.ts +16 -16
- package/dist/types/components/tag/tag.d.ts +2 -2
- package/dist/types/components/text/text.d.ts +2 -2
- package/dist/types/components/textarea/textarea.d.ts +2 -2
- package/dist/types/components/textarea/use-autosize.d.ts +2 -2
- package/dist/types/components/timeline/timeline.d.ts +5 -5
- package/dist/types/components/timeline/timeline.style.d.ts +2 -2
- package/dist/types/components/toggle/toggle.d.ts +5 -5
- package/dist/types/components/toggle/use-toggle-group.d.ts +2 -2
- package/dist/types/components/toggle/use-toggle.d.ts +2 -2
- package/dist/types/components/tooltip/tooltip.d.ts +2 -2
- package/dist/types/components/visually-hidden/visually-hidden.d.ts +2 -2
- package/dist/types/components/wrap/wrap.d.ts +2 -2
- package/dist/types/core/components/create-component.d.ts +7 -7
- package/dist/types/core/index.d.ts +2 -2
- package/dist/types/core/system/color-mode-provider.d.ts +2 -2
- package/dist/types/core/system/create-system.d.ts +5 -2
- package/dist/types/core/system/index.d.ts +2 -2
- package/dist/types/core/system/storage-manager.d.ts +2 -2
- package/dist/types/core/system/storage-script.d.ts +3 -3
- package/dist/types/core/system/styled.d.ts +2 -2
- package/dist/types/core/system/system-provider.d.ts +2 -2
- package/dist/types/hooks/use-breakpoint/use-breakpoint-state.d.ts +2 -2
- package/dist/types/hooks/use-clipboard/index.d.ts +2 -2
- package/dist/types/hooks/use-combobox/index.d.ts +12 -12
- package/dist/types/hooks/use-counter/index.d.ts +2 -2
- package/dist/types/hooks/use-descendants/index.d.ts +2 -2
- package/dist/types/hooks/use-field-sizing/index.d.ts +2 -2
- package/dist/types/hooks/use-hover/index.d.ts +2 -2
- package/dist/types/hooks/use-popper/index.d.ts +2 -2
- package/dist/types/hooks/use-resize-observer/index.d.ts +3 -3
- package/dist/types/index.d.ts +3 -3
- package/dist/types/providers/i18n-provider/i18n-provider.d.ts +3 -3
- package/dist/types/providers/ui-provider/ui-provider.d.ts +2 -2
- package/dist/types/utils/children.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","names":["header","table","cellMap","el","NativeTable.Root","NativeTable.Thead","NativeTable.Tr","NativeTable.Th","NativeTable.Tbody","NativeTable.Td","NativeTable.Tfoot","SortingIcon: FC<SortingIconProps>","ResizableTrigger: FC<ResizableTriggerProps>","TruncatedText: FC<TruncatedTextProps>"],"sources":["../../../../src/components/table/table.tsx"],"sourcesContent":["\"use client\"\n\nimport type {\n AccessorFn,\n Cell,\n CellContext,\n ColumnDef,\n ColumnDefTemplate,\n ColumnFiltersColumnDef,\n ColumnFiltersState,\n ColumnMeta,\n ColumnPinningColumnDef,\n ColumnSizingColumnDef,\n GlobalFilterColumnDef,\n GroupingColumnDef,\n Header,\n HeaderContext,\n HeaderGroup,\n OnChangeFn,\n SortingState as OriginalSortingState,\n PaginationState,\n Table as ReactTable,\n Row,\n RowData,\n RowSelectionState,\n SortDirection,\n SortingColumnDef,\n TableOptions,\n VisibilityColumnDef,\n} from \"@tanstack/react-table\"\nimport type { FC, FocusEvent, KeyboardEvent, ReactElement } from \"react\"\nimport type { CSSProps, GenericsComponent, HTMLStyledProps } from \"../../core\"\nimport type { ReactNodeOrFunction, TransformProps } from \"../../utils\"\nimport type { CheckboxProps } from \"../checkbox\"\nimport {\n createColumnHelper,\n flexRender,\n getCoreRowModel,\n getFilteredRowModel,\n getPaginationRowModel,\n getSortedRowModel,\n useReactTable,\n} from \"@tanstack/react-table\"\nimport { useMemo, useRef } from \"react\"\nimport { createComponent, focusRingStyle, mergeProps, styled } from \"../../core\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport {\n ariaAttr,\n dataAttr,\n isFunction,\n runIfFn,\n runKeyAction,\n useUpdateEffect,\n} from \"../../utils\"\nimport { Checkbox } from \"../checkbox\"\nimport { ChevronsUpDownIcon, ChevronUpIcon } from \"../icon\"\nimport { NativeTable } from \"../native-table\"\n\ndeclare module \"@tanstack/react-table\" {\n interface ColumnDefExtensions<TData extends RowData, TValue = unknown>\n extends\n VisibilityColumnDef,\n ColumnPinningColumnDef,\n ColumnFiltersColumnDef<TData>,\n GlobalFilterColumnDef,\n SortingColumnDef<TData>,\n GroupingColumnDef<TData, TValue>,\n ColumnSizingColumnDef {}\n\n interface ColumnDefBase<TData extends RowData, TValue = unknown>\n extends\n ColumnDefExtensions<TData, TValue>,\n Pick<CSSProps, \"lineClamp\" | \"truncated\">,\n Pick<NativeTable.TdProps, \"numeric\"> {\n cell?: ColumnDefTemplate<CellContext<TData, TValue>>\n footer?: ColumnDefTemplate<HeaderContext<TData, TValue>>\n getUniqueValues?: AccessorFn<TData, unknown[]>\n meta?: ColumnMeta<TData, TValue>\n cellProps?: NativeTable.TdProps\n footerProps?: NativeTable.ThProps\n headerProps?: NativeTable.ThProps\n }\n}\n\nexport { createColumnHelper }\nexport type {\n ColumnDef,\n ColumnFiltersState,\n PaginationState,\n RowSelectionState,\n SortDirection,\n}\n\nfunction getMergeHeaderGroups(\n headerGroups: HeaderGroup<any>[],\n): HeaderGroup<any>[] {\n if (headerGroups.length <= 1) return headerGroups\n\n const columnsIds = new Set()\n\n return headerGroups.map((headerGroup, depth, { length: fullDepth }) => {\n return {\n ...headerGroup,\n headers: headerGroup.headers\n .filter((header) => !columnsIds.has(header.column.id))\n .map((header) => {\n columnsIds.add(header.column.id)\n\n return header.isPlaceholder\n ? { ...header, isPlaceholder: false, rowSpan: fullDepth - depth }\n : { ...header, rowSpan: 1 }\n }),\n }\n })\n}\n\nfunction getMergeFooterGroups(\n headerGroups: HeaderGroup<any>[],\n): HeaderGroup<any>[] {\n if (headerGroups.length <= 1) return headerGroups\n\n return headerGroups.map((headerGroup, depth) => {\n const nextHeaderGroups = headerGroups.slice(depth + 1)\n\n return {\n ...headerGroup,\n headers: headerGroup.headers\n .filter((header) => !header.isPlaceholder)\n .map((header) => {\n if (nextHeaderGroups.length === 0) return header\n\n const rowSpan = nextHeaderGroups.reduce((acc, nextHeaderGroup) => {\n const hasNextHeader = nextHeaderGroup.headers.some(\n (nextHeader) => nextHeader.column.id === header.column.id,\n )\n\n return acc + (hasNextHeader ? 1 : 0)\n }, 1)\n\n return { ...header, rowSpan }\n }),\n }\n })\n}\n\nexport interface ColumnSort<Y extends RowData> {\n desc: boolean\n id: keyof Y\n}\nexport type SortingState<Y extends RowData> = ColumnSort<Y>[]\n\ninterface ComponentContext extends Pick<\n TableProps<any>,\n | \"columnResizeMode\"\n | \"resizableTriggerProps\"\n | \"sortingIcon\"\n | \"sortingIconProps\"\n> {\n table: ReactTable<any>\n}\n\ninterface OmittedTableOptions<Y extends RowData> extends Omit<\n TableOptions<Y>,\n | \"getCoreRowModel\"\n | \"onColumnFiltersChange\"\n | \"onPaginationChange\"\n | \"onSortingChange\"\n> {}\n\ninterface PickedNativeTableProps extends Pick<\n NativeTable.RootProps,\n | \"highlightOnHover\"\n | \"highlightOnSelected\"\n | \"layout\"\n | \"scrollAreaProps\"\n | \"size\"\n | \"stickyFooter\"\n | \"stickyHeader\"\n | \"striped\"\n | \"variant\"\n | \"withBorder\"\n | \"withColumnBorders\"\n | \"withScrollArea\"\n> {}\n\nexport interface TableProps<Y extends RowData>\n extends\n OmittedTableOptions<Y>,\n PickedNativeTableProps,\n Pick<CSSProps, \"colorScheme\" | \"lineClamp\" | \"truncated\"> {\n /**\n * The column filters state of the table.\n */\n columnFilters?: ColumnFiltersState\n /**\n * The default column filters state of the table.\n */\n defaultColumnFilters?: ColumnFiltersState\n /**\n * The default pagination state of the table.\n */\n defaultPagination?: PaginationState\n /**\n * The default row selection state of the table.\n */\n defaultRowSelection?: RowSelectionState\n /**\n * The default sorting state of the table.\n */\n defaultSorting?: SortingState<Y>\n /**\n * If `true`, the table width will be automatically resized to the content.\n *\n * @default false\n */\n enableAutoResizeTableWidth?: boolean\n /**\n * If `true`, the keyboard navigation will be enabled.\n *\n * @default true\n */\n enableKeyboardNavigation?: boolean\n /**\n * If `true`, the pagination will be enabled.\n *\n * @default false\n */\n enablePagination?: boolean\n /**\n * The footer of the table.\n */\n footer?: ReactNodeOrFunction<ReactTable<Y>>\n /**\n * The header of the table.\n */\n header?: ReactNodeOrFunction<ReactTable<Y>>\n /**\n * The initial focusable cell of the table.\n *\n * @default {rowIndex: 0, colIndex: 0}\n */\n initialFocusableCell?: { colIndex: number; rowIndex: number }\n /**\n * The pagination state of the table.\n */\n pagination?: PaginationState\n /**\n * The row selection state of the table.\n */\n rowSelection?: RowSelectionState\n /**\n * If `true`, the row will be selected when the row is clicked.\n *\n * @default false\n */\n selectOnClickRow?: boolean\n /**\n * The sorting state of the table.\n */\n sorting?: SortingState<Y>\n /**\n * The sorting icon of the table.\n */\n sortingIcon?: ReactNodeOrFunction<false | SortDirection>\n /**\n * If `true`, the table will have a checkbox column.\n *\n * @default true\n */\n withCheckbox?: boolean\n /**\n * If `true`, the table will have a checkbox in the footer.\n *\n * @default false\n */\n withFooterCheckbox?: boolean\n /**\n * If `true`, the table will have footer groups.\n *\n * @default false\n */\n withFooterGroups?: boolean\n /**\n * The props for the table cell.\n */\n cellProps?: TransformProps<NativeTable.TdProps, Cell<Y, unknown>>\n /**\n * The props for the checkbox.\n */\n checkboxProps?: CheckboxProps\n /**\n * The props for the table footer group.\n */\n footerGroupProps?: TransformProps<NativeTable.TrProps, HeaderGroup<Y>>\n /**\n * The props for the table footer.\n */\n footerProps?: TransformProps<NativeTable.ThProps, Header<Y, unknown>>\n /**\n * The props for the table header checkbox.\n */\n headerCheckboxProps?: TransformProps<CheckboxProps, Header<Y, unknown>>\n /**\n * The props for the table header group.\n */\n headerGroupProps?: TransformProps<NativeTable.TrProps, HeaderGroup<Y>>\n /**\n * The props for the table header.\n */\n headerProps?: TransformProps<NativeTable.ThProps, Header<Y, unknown>>\n /**\n * The props for the resizable trigger.\n */\n resizableTriggerProps?: TransformProps<\n Omit<ResizableTriggerProps, \"resizing\">,\n Header<Y, unknown>\n >\n /**\n * The props for the table row checkbox.\n */\n rowCheckboxProps?: TransformProps<CheckboxProps, Row<Y>>\n /**\n * The props for the table row.\n */\n rowProps?: TransformProps<NativeTable.TrProps, Row<Y>>\n /**\n * The props for the sorting icon.\n */\n sortingIconProps?: TransformProps<\n Omit<SortingIconProps, \"sorted\">,\n Header<Y, unknown>\n >\n /**\n * The props for the table.\n */\n tableProps?: NativeTable.RootProps\n /**\n * The props for the table tbody.\n */\n tbodyProps?: NativeTable.TbodyProps\n /**\n * The props for the table tfoot.\n */\n tfootProps?: NativeTable.TfootProps\n /**\n * The props for the table thead.\n */\n theadProps?: NativeTable.TheadProps\n /**\n * The callback invoked when the column filters state changes.\n */\n onColumnFiltersChange?: (columnFilters: ColumnFiltersState) => void\n /**\n * The callback invoked when the pagination state changes.\n */\n onPaginationChange?: (pagination: PaginationState) => void\n /**\n * The callback invoked when the row is clicked.\n */\n onRowClick?: (row: Row<Y>) => void\n /**\n * The callback invoked when the row is double clicked.\n */\n onRowDoubleClick?: (row: Row<Y>) => void\n /**\n * The callback invoked when the sorting state changes.\n */\n onSortingChange?: (sorting: SortingState<Y>) => void\n}\n\nconst {\n ComponentContext,\n PropsContext: TablePropsContext,\n useComponentContext,\n usePropsContext: useTablePropsContext,\n withContext,\n} = createComponent<TableProps<any>, any, ComponentContext>(\"table\")\n\nexport { TablePropsContext, useTablePropsContext }\n\n/**\n * `Table` is a table component equipped with column sorting, row selection, and click event features.\n *\n * @see https://yamada-ui.com/docs/components/table\n */\nexport const Table = withContext(\n <Y extends RowData>({\n colorScheme,\n size,\n variant,\n columnFilters: columnFiltersProp,\n columnResizeMode = \"onChange\",\n columns: columnsProp,\n data,\n defaultColumnFilters,\n defaultPagination = { pageIndex: 0, pageSize: 20 },\n defaultRowSelection = {},\n defaultSorting,\n enableAutoResizeTableWidth = false,\n enableColumnResizing = false,\n enableKeyboardNavigation = true,\n enablePagination = false,\n enableRowSelection = false,\n footer,\n header,\n highlightOnHover = !!enableRowSelection,\n highlightOnSelected = !!enableRowSelection,\n initialFocusableCell = { colIndex: 0, rowIndex: 0 },\n layout,\n lineClamp,\n manualPagination,\n pagination: paginationProp,\n rowCount: totalRowCount,\n rowSelection: rowSelectionProp,\n selectOnClickRow = false,\n sortDescFirst = false,\n sorting: sortingProp,\n sortingIcon,\n state,\n stickyFooter,\n stickyHeader,\n striped,\n truncated,\n withBorder,\n withCheckbox = true,\n withColumnBorders,\n withFooterCheckbox = false,\n withFooterGroups = false,\n withScrollArea,\n cellProps,\n checkboxProps,\n footerGroupProps,\n footerProps,\n headerCheckboxProps,\n headerGroupProps,\n headerProps,\n resizableTriggerProps,\n rowCheckboxProps,\n rowProps,\n scrollAreaProps,\n sortingIconProps,\n tableProps,\n tbodyProps,\n tfootProps,\n theadProps,\n onColumnFiltersChange: onColumnFiltersChangeProp,\n onPaginationChange: onPaginationChangeProp,\n onRowClick,\n onRowDoubleClick,\n onRowSelectionChange: onRowSelectionChangeProp,\n onSortingChange: onSortingChangeProp,\n ...rest\n }: TableProps<Y>) => {\n const { t } = useI18n(\"table\")\n const initialFocus = useRef<boolean>(false)\n const ref = useRef<HTMLTableElement>(null)\n const focusedCell = useRef<null | { colIndex: number; rowIndex: number }>(\n null,\n )\n const [rowSelection, onRowSelectionChange] = useControllableState({\n defaultValue: defaultRowSelection,\n value: rowSelectionProp,\n onChange: onRowSelectionChangeProp,\n })\n const [sorting, onSortingChange] = useControllableState({\n defaultValue: defaultSorting,\n value: sortingProp,\n onChange: onSortingChangeProp,\n })\n const [pagination, onPaginationChange] = useControllableState({\n defaultValue: defaultPagination,\n value: paginationProp,\n onChange: onPaginationChangeProp,\n })\n const [columnFilters, onColumnFiltersChange] = useControllableState({\n defaultValue: defaultColumnFilters,\n value: columnFiltersProp,\n onChange: onColumnFiltersChangeProp,\n })\n const columns = useMemo(() => {\n if (!enableRowSelection || !withCheckbox) return columnsProp\n\n const clonedColumns = [...columnsProp]\n\n const header = ({ header, table }: HeaderContext<Y, any>) => {\n return (\n <Checkbox\n {...mergeProps(\n {\n checked: table.getIsAllRowsSelected(),\n indeterminate: table.getIsSomeRowsSelected(),\n indicatorProps: { outline: \"none\" },\n inputProps: {\n \"aria-label\": t(\"Select all rows\"),\n \"data-focusable\": \"\",\n tabIndex: -1,\n },\n onChange: table.getToggleAllRowsSelectedHandler(),\n },\n checkboxProps ?? {},\n runIfFn(headerCheckboxProps, header) ?? {},\n )()}\n />\n )\n }\n\n const cell = ({ row }: CellContext<Y, any>) => {\n return (\n <Checkbox\n {...mergeProps(\n {\n checked: row.getIsSelected(),\n disabled: !row.getCanSelect(),\n indeterminate: row.getIsSomeSelected(),\n indicatorProps: { outline: \"none\" },\n inputProps: {\n \"aria-label\": t(\"Select row\"),\n \"data-focusable\": \"\",\n tabIndex: -1,\n },\n onChange: row.getToggleSelectedHandler(),\n },\n checkboxProps ?? {},\n runIfFn(rowCheckboxProps, row) ?? {},\n )()}\n />\n )\n }\n\n clonedColumns.unshift({\n id: \"select\",\n cell,\n header,\n ...(withFooterCheckbox\n ? { footer: header }\n : { footerProps: { \"aria-hidden\": \"true\" } }),\n cellProps: { verticalAlign: \"middle\" },\n headerProps: { w: \"calc({spaces.4} + {space-x} * 2)\" },\n })\n\n return clonedColumns\n }, [\n checkboxProps,\n columnsProp,\n enableRowSelection,\n headerCheckboxProps,\n rowCheckboxProps,\n t,\n withCheckbox,\n withFooterCheckbox,\n ])\n const table = useReactTable<Y>({\n columnResizeMode,\n columns,\n data,\n enableColumnResizing,\n enableRowSelection,\n getCoreRowModel: getCoreRowModel(),\n getFilteredRowModel: getFilteredRowModel(),\n getSortedRowModel: getSortedRowModel(),\n manualPagination,\n rowCount: totalRowCount,\n sortDescFirst,\n state: {\n columnFilters,\n pagination: enablePagination ? pagination : undefined,\n rowSelection,\n sorting: sorting as OriginalSortingState,\n ...state,\n },\n onColumnFiltersChange,\n onPaginationChange,\n onRowSelectionChange,\n onSortingChange: onSortingChange as OnChangeFn<OriginalSortingState>,\n ...(enablePagination\n ? { getPaginationRowModel: getPaginationRowModel() }\n : {}),\n ...rest,\n })\n const headerGroups = table.getHeaderGroups()\n const mergedHeaderGroups = getMergeHeaderGroups(headerGroups)\n const rows = table.getRowModel().rows\n const footerGroups = table.getFooterGroups()\n const mergedFooterGroups = getMergeFooterGroups(\n withFooterGroups ? footerGroups : [],\n )\n const headerGroupCount = headerGroups.length\n const rowCount = rows.length\n const colCount = table.getAllLeafColumns().length\n const maxColIndex = colCount - 1\n const pageIndex = enablePagination\n ? table.getState().pagination.pageIndex\n : 0\n const cellMap = useMemo(() => {\n const cellMap = new Map<string, string>()\n\n if (!enableKeyboardNavigation) return cellMap\n\n const insertCellMap = (\n id: string,\n colSpan: number,\n rowSpan: number,\n colIndex: number,\n rowIndex: number,\n ) => {\n for (let i = 0; i < colSpan; i++) {\n cellMap.set(`${colIndex + i}-${rowIndex}`, `${colIndex}-${rowIndex}`)\n }\n\n for (let i = 1; i < rowSpan; i++) {\n cellMap.set(`${colIndex}-${rowIndex + i}`, `${colIndex}-${rowIndex}`)\n }\n }\n\n const insertCellMapByHeaderGroup = (\n headerGroup: HeaderGroup<Y>,\n rowIndex: number,\n ) => {\n let placeholderCount = 0\n\n headerGroup.headers.forEach((header) => {\n const colSpan = header.colSpan || 1\n const rowSpan = header.rowSpan || 1\n const colIndex = header.index + placeholderCount\n\n placeholderCount += colSpan - 1\n\n insertCellMap(header.id, colSpan, rowSpan, colIndex, rowIndex)\n })\n }\n\n mergedHeaderGroups.forEach((headerGroup, rowIndex) => {\n insertCellMapByHeaderGroup(headerGroup, rowIndex)\n })\n\n rows.forEach((row, rowIndex) => {\n rowIndex += headerGroupCount\n\n row.getVisibleCells().forEach((cell) => {\n const colIndex = cell.column.getIndex()\n\n insertCellMap(cell.id, 1, 1, colIndex, rowIndex)\n })\n })\n\n mergedFooterGroups.forEach((footerGroup, rowIndex) => {\n rowIndex += headerGroupCount + rowCount\n\n insertCellMapByHeaderGroup(footerGroup, rowIndex)\n })\n\n return cellMap\n }, [\n enableKeyboardNavigation,\n headerGroupCount,\n mergedFooterGroups,\n mergedHeaderGroups,\n rows,\n rowCount,\n ])\n const context = useMemo(\n () => ({\n columnResizeMode,\n sortingIcon,\n table,\n resizableTriggerProps,\n sortingIconProps,\n }),\n [\n columnResizeMode,\n sortingIcon,\n sortingIconProps,\n resizableTriggerProps,\n table,\n ],\n )\n const getCell = (\n evOrEl:\n | Element\n | FocusEvent<HTMLTableElement>\n | KeyboardEvent<HTMLTableElement>\n | null\n | undefined,\n ) => {\n if (!evOrEl) return\n\n const el =\n evOrEl instanceof HTMLElement\n ? evOrEl.closest(\"th, td\")\n : \"target\" in evOrEl && evOrEl.target instanceof HTMLElement\n ? evOrEl.target.closest(\"th, td\")\n : null\n\n if (!(el instanceof HTMLTableCellElement)) return\n\n const { colindex, rowindex } = el.dataset\n const { colSpan, rowSpan } = el\n\n if (!colindex || !rowindex) return\n\n const colIndex = parseInt(colindex)\n const rowIndex = parseInt(rowindex)\n\n return { colIndex, colSpan, el, rowIndex, rowSpan }\n }\n const getShouldFocusCell = (colIndex: number, rowIndex: number) => {\n const [trulyColIndex, trulyRowIndex] =\n cellMap.get(`${colIndex}-${rowIndex}`)?.split(\"-\") ?? []\n\n if (!trulyColIndex || !trulyRowIndex) return\n\n const targetEl = ref.current?.querySelector(\n `[data-colindex=\"${trulyColIndex}\"][data-rowindex=\"${trulyRowIndex}\"]`,\n )\n\n if (!targetEl || !(targetEl instanceof HTMLTableCellElement)) return\n\n return targetEl\n }\n const removeTabIndex = (el: Element | null | undefined) => {\n if (!el || !(el instanceof HTMLElement)) return\n\n el.tabIndex = -1\n el.querySelectorAll(\"[data-focusable]\").forEach((el) => {\n if (el instanceof HTMLElement) el.tabIndex = -1\n })\n }\n const onCellFocus = (\n el: HTMLTableCellElement | null | undefined,\n colIndex: number,\n rowIndex: number,\n ) => {\n const targetEl = getShouldFocusCell(colIndex, rowIndex)\n\n if (!targetEl) return\n\n focusedCell.current = { colIndex, rowIndex }\n\n removeTabIndex(el)\n\n const shouldFocusEl =\n targetEl.querySelector(\"[data-focusable]\") ?? targetEl\n\n if (shouldFocusEl instanceof HTMLElement) {\n shouldFocusEl.tabIndex = 0\n shouldFocusEl.focus()\n }\n }\n const onFocus = (ev: FocusEvent<HTMLTableElement>) => {\n if (initialFocus.current) return\n\n initialFocus.current = true\n\n const cell = getCell(ev)\n\n if (!cell) return\n\n onCellFocus(cell.el, cell.colIndex, cell.rowIndex)\n }\n const onKeyDown = (ev: KeyboardEvent<HTMLTableElement>) => {\n if (!enableKeyboardNavigation) return\n\n const cell = getCell(ev)\n\n if (!cell) return\n\n runKeyAction(ev, {\n ArrowDown: () =>\n onCellFocus(cell.el, cell.colIndex, cell.rowIndex + cell.rowSpan),\n ArrowLeft: () => onCellFocus(cell.el, cell.colIndex - 1, cell.rowIndex),\n ArrowRight: () =>\n onCellFocus(cell.el, cell.colIndex + cell.colSpan, cell.rowIndex),\n ArrowUp: () => onCellFocus(cell.el, cell.colIndex, cell.rowIndex - 1),\n End: () => onCellFocus(cell.el, maxColIndex, cell.rowIndex),\n Home: () => onCellFocus(cell.el, 0, cell.rowIndex),\n ...(enablePagination\n ? {\n PageDown: () => {\n if (!table.getCanNextPage()) return\n\n table.setPageIndex(pageIndex + 1)\n },\n PageUp: () => {\n if (!table.getCanPreviousPage()) return\n\n table.setPageIndex(pageIndex - 1)\n },\n }\n : {}),\n })\n }\n const getTabIndex = (colIndex: number, rowIndex: number) => {\n if (!enableKeyboardNavigation) return undefined\n\n return colIndex === initialFocusableCell.colIndex &&\n rowIndex === initialFocusableCell.rowIndex\n ? 0\n : undefined\n }\n\n useUpdateEffect(() => {\n if (!enableKeyboardNavigation) return\n\n const { colIndex, rowIndex } = focusedCell.current ?? initialFocusableCell\n const targetEl = getShouldFocusCell(colIndex, rowIndex)\n\n if (targetEl) targetEl.tabIndex = 0\n }, [pageIndex, enableKeyboardNavigation])\n\n return (\n <ComponentContext value={context}>\n {header ? runIfFn(header, table) : null}\n\n <NativeTable.Root\n {...mergeProps(\n {\n ref,\n style:\n enableColumnResizing && enableAutoResizeTableWidth\n ? { width: table.getCenterTotalSize() }\n : {},\n colorScheme,\n size,\n variant,\n \"aria-colcount\": colCount,\n \"aria-multiselectable\": enableRowSelection ? \"true\" : undefined,\n \"aria-rowcount\": totalRowCount || data.length,\n highlightOnHover,\n highlightOnSelected,\n layout,\n role: \"grid\",\n stickyFooter,\n stickyHeader,\n striped,\n withBorder,\n withColumnBorders,\n withScrollArea,\n scrollAreaProps,\n onFocus,\n onKeyDown,\n },\n tableProps ?? {},\n )()}\n >\n <NativeTable.Thead role=\"rowgroup\" {...theadProps}>\n {mergedHeaderGroups.map((headerGroup, rowIndex) => {\n let placeholderCount = 0\n\n return (\n <NativeTable.Tr\n key={headerGroup.id}\n aria-rowindex={rowIndex + 1}\n role=\"row\"\n {...runIfFn(headerGroupProps, headerGroup)}\n >\n {headerGroup.headers.map((header) => {\n const { columnDef } = header.column\n const colIndex = header.index + placeholderCount\n const tabIndex = getTabIndex(colIndex, rowIndex)\n const canSort = header.column.getCanSort()\n const sorted = header.column.getIsSorted()\n const canResize = header.column.getCanResize()\n const resizing = header.column.getIsResizing()\n const children = header.isPlaceholder\n ? null\n : flexRender(\n header.column.columnDef.header,\n header.getContext(),\n )\n\n placeholderCount += (header.colSpan || 1) - 1\n\n return (\n <NativeTable.Th\n key={header.id}\n aria-colindex={colIndex + 1}\n aria-rowindex={rowIndex + 1}\n aria-sort={\n sorted\n ? sorted === \"asc\"\n ? \"ascending\"\n : \"descending\"\n : \"none\"\n }\n data-colindex={colIndex}\n data-rowindex={rowIndex}\n colSpan={header.colSpan || undefined}\n numeric={columnDef.numeric}\n pe={\n canSort\n ? \"calc((1rem * {lineHeights.moderate}) + {space-x})\"\n : undefined\n }\n position=\"relative\"\n role=\"columnheader\"\n rowSpan={header.rowSpan || undefined}\n tabIndex={tabIndex}\n {...mergeProps(\n {\n css: {\n \"&:has([data-focusable]:focus-visible)\":\n focusRingStyle.outline,\n },\n style: enableColumnResizing\n ? { width: header.getSize() }\n : {},\n },\n runIfFn(headerProps, header) ?? {},\n columnDef.headerProps ?? {},\n )()}\n >\n <TruncatedText\n lineClamp={columnDef.lineClamp ?? lineClamp}\n truncated={columnDef.truncated ?? truncated}\n >\n {children}\n </TruncatedText>\n\n {canSort ? (\n <SortingIcon\n sorted={sorted}\n onClick={header.column.getToggleSortingHandler()}\n />\n ) : null}\n\n {canResize ? (\n <ResizableTrigger\n resizing={resizing}\n onDoubleClick={header.column.resetSize}\n onMouseDown={header.getResizeHandler()}\n onTouchStart={header.getResizeHandler()}\n />\n ) : null}\n </NativeTable.Th>\n )\n })}\n </NativeTable.Tr>\n )\n })}\n </NativeTable.Thead>\n\n <NativeTable.Tbody role=\"rowgroup\" {...tbodyProps}>\n {rows.map((row, rowIndex) => {\n rowIndex += headerGroupCount\n\n const selected = !!rowSelection[row.id]\n const disabled =\n isFunction(enableRowSelection) && !enableRowSelection(row)\n\n return (\n <NativeTable.Tr\n id={row.id}\n key={row.id}\n aria-disabled={ariaAttr(disabled)}\n aria-rowindex={rowIndex + 1}\n aria-selected={ariaAttr(selected)}\n data-disabled={dataAttr(disabled)}\n data-selected={dataAttr(selected)}\n role=\"row\"\n {...mergeProps(\n {\n onClick:\n !disabled && selectOnClickRow\n ? () => row.toggleSelected(!selected)\n : undefined,\n },\n {\n onClick: !disabled ? () => onRowClick?.(row) : undefined,\n onDoubleClick: !disabled\n ? () => onRowDoubleClick?.(row)\n : undefined,\n },\n runIfFn(rowProps, row) ?? {},\n )()}\n >\n {row.getVisibleCells().map((cell) => {\n const { columnDef } = cell.column\n const colIndex = cell.column.getIndex()\n const tabIndex = getTabIndex(colIndex, rowIndex)\n const children = flexRender(\n cell.column.columnDef.cell,\n cell.getContext(),\n )\n\n return (\n <NativeTable.Td\n key={cell.id}\n aria-colindex={colIndex + 1}\n aria-rowindex={rowIndex + 1}\n data-colindex={colIndex}\n data-rowindex={rowIndex}\n numeric={columnDef.numeric}\n role=\"gridcell\"\n tabIndex={tabIndex}\n {...mergeProps(\n {\n css: {\n \"&:has([data-focusable]:focus-visible)\":\n focusRingStyle.outline,\n },\n },\n runIfFn(cellProps, cell) ?? {},\n columnDef.cellProps ?? {},\n )()}\n >\n <TruncatedText\n lineClamp={columnDef.lineClamp ?? lineClamp}\n truncated={columnDef.truncated ?? truncated}\n >\n {children}\n </TruncatedText>\n </NativeTable.Td>\n )\n })}\n </NativeTable.Tr>\n )\n })}\n </NativeTable.Tbody>\n\n {withFooterGroups ? (\n <NativeTable.Tfoot role=\"rowgroup\" {...tfootProps}>\n {mergedFooterGroups.map((footerGroup, rowIndex) => {\n rowIndex += headerGroupCount + rowCount\n\n let placeholderCount = 0\n\n return (\n <NativeTable.Tr\n key={footerGroup.id}\n aria-rowindex={rowIndex + 1}\n role=\"row\"\n {...runIfFn(footerGroupProps, footerGroup)}\n >\n {footerGroup.headers.map((header) => {\n const { columnDef } = header.column\n const colIndex = header.index + placeholderCount\n const tabIndex = getTabIndex(colIndex, rowIndex)\n const children = header.isPlaceholder\n ? null\n : flexRender(\n header.column.columnDef.footer,\n header.getContext(),\n )\n\n placeholderCount += (header.colSpan || 1) - 1\n\n return (\n <NativeTable.Td\n key={header.id}\n aria-colindex={colIndex + 1}\n aria-rowindex={rowIndex + 1}\n data-colindex={colIndex}\n data-rowindex={rowIndex}\n colSpan={header.colSpan || undefined}\n numeric={columnDef.numeric}\n role=\"gridcell\"\n rowSpan={header.rowSpan || undefined}\n tabIndex={tabIndex}\n {...mergeProps(\n {\n css: {\n \"&:has([data-focusable]:focus-visible)\":\n focusRingStyle.outline,\n },\n },\n runIfFn(footerProps, header) ?? {},\n columnDef.footerProps ?? {},\n )()}\n >\n <TruncatedText\n lineClamp={columnDef.lineClamp ?? lineClamp}\n truncated={columnDef.truncated ?? truncated}\n >\n {children}\n </TruncatedText>\n </NativeTable.Td>\n )\n })}\n </NativeTable.Tr>\n )\n })}\n </NativeTable.Tfoot>\n ) : null}\n </NativeTable.Root>\n\n {footer ? runIfFn(footer, table) : null}\n </ComponentContext>\n )\n },\n)() as GenericsComponent<{\n <Y extends RowData>(props: TableProps<Y>): ReactElement\n}>\n\ninterface SortingIconProps extends HTMLStyledProps<\"button\"> {\n sorted: false | SortDirection\n}\n\nconst SortingIcon: FC<SortingIconProps> = ({ sorted, ...rest }) => {\n const { t } = useI18n(\"table\")\n const { sortingIcon, sortingIconProps = {} } = useComponentContext()\n const Icon = sorted ? ChevronUpIcon : ChevronsUpDownIcon\n\n return (\n <styled.button\n type=\"button\"\n layerStyle=\"ghost\"\n colorScheme=\"mono\"\n aria-label={t(\n sorted\n ? sorted === \"desc\"\n ? \"Sort descending\"\n : \"Sort ascending\"\n : \"Clear sorting\",\n )}\n data-focusable\n aspectRatio=\"1\"\n cursor=\"pointer\"\n display=\"center\"\n focusVisibleRing=\"none\"\n h=\"calc(1em * {lineHeights.moderate})\"\n position=\"absolute\"\n right=\"{space-x}\"\n rounded=\"l1\"\n tabIndex={-1}\n top=\"50%\"\n transform=\"translateY(-50%)\"\n transitionDuration=\"moderate\"\n transitionProperty=\"common\"\n _hover={{ layerStyle: \"ghost.hover\" }}\n {...mergeProps(rest, sortingIconProps)()}\n >\n {runIfFn(sortingIcon, sorted) ?? (\n <Icon transform={`rotate(${sorted === \"desc\" ? 180 : 0}deg)`} />\n )}\n </styled.button>\n )\n}\n\ninterface ResizableTriggerProps extends HTMLStyledProps {\n resizing: boolean\n}\n\nconst ResizableTrigger: FC<ResizableTriggerProps> = ({ resizing, ...rest }) => {\n const {\n columnResizeMode,\n table,\n resizableTriggerProps = {},\n } = useComponentContext()\n const offset = table.getState().columnSizingInfo.deltaOffset\n\n return (\n <styled.div\n data-active={dataAttr(resizing)}\n bg=\"colorScheme.solid\"\n cursor=\"col-resize\"\n insetY=\"0\"\n opacity={{ base: \"0\", _hover: \"1\", _active: \"1\" }}\n position=\"absolute\"\n right=\"0\"\n touchAction=\"none\"\n transform={`translateX(${columnResizeMode === \"onEnd\" && resizing && offset ? `${offset}px` : \"50%\"})`}\n userSelect=\"none\"\n w=\"1\"\n {...mergeProps(rest, resizableTriggerProps)()}\n />\n )\n}\n\ninterface TruncatedTextProps extends HTMLStyledProps<\"span\"> {}\n\nconst TruncatedText: FC<TruncatedTextProps> = ({\n children,\n lineClamp,\n truncated,\n ...rest\n}) => {\n if (lineClamp || truncated) {\n return (\n <styled.span\n lineClamp={lineClamp}\n truncated={truncated}\n wordBreak=\"break-all\"\n {...rest}\n >\n {children}\n </styled.span>\n )\n } else {\n return children\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA8FA,SAAS,qBACP,cACoB;AACpB,KAAI,aAAa,UAAU,EAAG,QAAO;CAErC,MAAM,6BAAa,IAAI,KAAK;AAE5B,QAAO,aAAa,KAAK,aAAa,OAAO,EAAE,QAAQ,gBAAgB;AACrE,SAAO;GACL,GAAG;GACH,SAAS,YAAY,QAClB,QAAQ,WAAW,CAAC,WAAW,IAAI,OAAO,OAAO,GAAG,CAAC,CACrD,KAAK,WAAW;AACf,eAAW,IAAI,OAAO,OAAO,GAAG;AAEhC,WAAO,OAAO,gBACV;KAAE,GAAG;KAAQ,eAAe;KAAO,SAAS,YAAY;KAAO,GAC/D;KAAE,GAAG;KAAQ,SAAS;KAAG;KAC7B;GACL;GACD;;AAGJ,SAAS,qBACP,cACoB;AACpB,KAAI,aAAa,UAAU,EAAG,QAAO;AAErC,QAAO,aAAa,KAAK,aAAa,UAAU;EAC9C,MAAM,mBAAmB,aAAa,MAAM,QAAQ,EAAE;AAEtD,SAAO;GACL,GAAG;GACH,SAAS,YAAY,QAClB,QAAQ,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GAEpD;;AAQpB,MAAMC,oBAA+C,EAAE,UAAU,GAAG,WAAW;CAC7E,MAAM,EACJ,kBACA,OACA,wBAAwB,EAAE,KACxB,qBAAqB;CACzB,MAAM,SAAS,MAAM,UAAU,CAAC,iBAAiB;AAEjD,QACE,oBAAC,OAAO;EACN,2CAAsB,SAAS;EAC/B,IAAG;EACH,QAAO;EACP,QAAO;EACP,SAAS;GAAE,MAAM;GAAK,QAAQ;GAAK,SAAS;GAAK;EACjD,UAAS;EACT,OAAM;EACN,aAAY;EACZ,WAAW,cAAc,qBAAqB,WAAW,YAAY,SAAS,GAAG,OAAO,MAAM,MAAM;EACpG,YAAW;EACX,GAAE;EACF,GAAI,WAAW,MAAM,sBAAsB,EAAE;GAC7C;;AAMN,MAAMC,iBAAyC,EAC7C,UACA,WACA,WACA,GAAG,WACC;AACJ,KAAI,aAAa,UACf,QACE,oBAAC,OAAO;EACK;EACA;EACX,WAAU;EACV,GAAI;EAEH;GACW;KAGhB,QAAO"}
|
|
1
|
+
{"version":3,"file":"table.js","names":["header","table","cellMap","el","NativeTable.Root","NativeTable.Thead","NativeTable.Tr","NativeTable.Th","NativeTable.Tbody","NativeTable.Td","NativeTable.Tfoot","SortingIcon: FC<SortingIconProps>","ResizableTrigger: FC<ResizableTriggerProps>","TruncatedText: FC<TruncatedTextProps>"],"sources":["../../../../src/components/table/table.tsx"],"sourcesContent":["\"use client\"\n\nimport type {\n AccessorFn,\n Cell,\n CellContext,\n ColumnDef,\n ColumnDefTemplate,\n ColumnFiltersColumnDef,\n ColumnFiltersState,\n ColumnMeta,\n ColumnPinningColumnDef,\n ColumnSizingColumnDef,\n GlobalFilterColumnDef,\n GroupingColumnDef,\n Header,\n HeaderContext,\n HeaderGroup,\n OnChangeFn,\n SortingState as OriginalSortingState,\n PaginationState,\n Table as ReactTable,\n Row,\n RowData,\n RowSelectionState,\n SortDirection,\n SortingColumnDef,\n TableOptions,\n VisibilityColumnDef,\n} from \"@tanstack/react-table\"\nimport type { FC, FocusEvent, KeyboardEvent, ReactElement } from \"react\"\nimport type { CSSProps, GenericsComponent, HTMLStyledProps } from \"../../core\"\nimport type { ReactNodeOrFunction, TransformProps } from \"../../utils\"\nimport type { CheckboxProps } from \"../checkbox\"\nimport {\n createColumnHelper,\n flexRender,\n getCoreRowModel,\n getFilteredRowModel,\n getPaginationRowModel,\n getSortedRowModel,\n useReactTable,\n} from \"@tanstack/react-table\"\nimport { useMemo, useRef } from \"react\"\nimport { createComponent, focusRingStyle, mergeProps, styled } from \"../../core\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport {\n ariaAttr,\n dataAttr,\n isFunction,\n runIfFn,\n runKeyAction,\n useUpdateEffect,\n} from \"../../utils\"\nimport { Checkbox } from \"../checkbox\"\nimport { ChevronsUpDownIcon, ChevronUpIcon } from \"../icon\"\nimport { NativeTable } from \"../native-table\"\n\ndeclare module \"@tanstack/react-table\" {\n interface ColumnDefExtensions<TData extends RowData, TValue = unknown>\n extends\n VisibilityColumnDef,\n ColumnPinningColumnDef,\n ColumnFiltersColumnDef<TData>,\n GlobalFilterColumnDef,\n SortingColumnDef<TData>,\n GroupingColumnDef<TData, TValue>,\n ColumnSizingColumnDef {}\n\n interface ColumnDefBase<TData extends RowData, TValue = unknown>\n extends\n ColumnDefExtensions<TData, TValue>,\n Pick<CSSProps, \"lineClamp\" | \"truncated\">,\n Pick<NativeTable.TdProps, \"numeric\"> {\n cell?: ColumnDefTemplate<CellContext<TData, TValue>>\n footer?: ColumnDefTemplate<HeaderContext<TData, TValue>>\n getUniqueValues?: AccessorFn<TData, unknown[]>\n meta?: ColumnMeta<TData, TValue>\n cellProps?: NativeTable.TdProps\n footerProps?: NativeTable.ThProps\n headerProps?: NativeTable.ThProps\n }\n}\n\nexport { createColumnHelper }\nexport type {\n ColumnDef,\n ColumnFiltersState,\n PaginationState,\n RowSelectionState,\n SortDirection,\n}\n\nfunction getMergeHeaderGroups(\n headerGroups: HeaderGroup<any>[],\n): HeaderGroup<any>[] {\n if (headerGroups.length <= 1) return headerGroups\n\n const columnsIds = new Set()\n\n return headerGroups.map((headerGroup, depth, { length: fullDepth }) => {\n return {\n ...headerGroup,\n headers: headerGroup.headers\n .filter((header) => !columnsIds.has(header.column.id))\n .map((header) => {\n columnsIds.add(header.column.id)\n\n return header.isPlaceholder\n ? { ...header, isPlaceholder: false, rowSpan: fullDepth - depth }\n : { ...header, rowSpan: 1 }\n }),\n }\n })\n}\n\nfunction getMergeFooterGroups(\n headerGroups: HeaderGroup<any>[],\n): HeaderGroup<any>[] {\n if (headerGroups.length <= 1) return headerGroups\n\n return headerGroups.map((headerGroup, depth) => {\n const nextHeaderGroups = headerGroups.slice(depth + 1)\n\n return {\n ...headerGroup,\n headers: headerGroup.headers\n .filter((header) => !header.isPlaceholder)\n .map((header) => {\n if (nextHeaderGroups.length === 0) return header\n\n const rowSpan = nextHeaderGroups.reduce((acc, nextHeaderGroup) => {\n const hasNextHeader = nextHeaderGroup.headers.some(\n (nextHeader) => nextHeader.column.id === header.column.id,\n )\n\n return acc + (hasNextHeader ? 1 : 0)\n }, 1)\n\n return { ...header, rowSpan }\n }),\n }\n })\n}\n\nexport interface ColumnSort<Y extends RowData> {\n desc: boolean\n id: keyof Y\n}\nexport type SortingState<Y extends RowData> = ColumnSort<Y>[]\n\ninterface ComponentContext extends Pick<\n TableProps<any>,\n | \"columnResizeMode\"\n | \"resizableTriggerProps\"\n | \"sortingIcon\"\n | \"sortingIconProps\"\n> {\n table: ReactTable<any>\n}\n\ninterface OmittedTableOptions<Y extends RowData> extends Omit<\n TableOptions<Y>,\n | \"getCoreRowModel\"\n | \"onColumnFiltersChange\"\n | \"onPaginationChange\"\n | \"onSortingChange\"\n> {}\n\ninterface PickedNativeTableProps extends Pick<\n NativeTable.RootProps,\n | \"className\"\n | \"highlightOnHover\"\n | \"highlightOnSelected\"\n | \"layout\"\n | \"scrollAreaProps\"\n | \"size\"\n | \"stickyFooter\"\n | \"stickyHeader\"\n | \"striped\"\n | \"variant\"\n | \"withBorder\"\n | \"withColumnBorders\"\n | \"withScrollArea\"\n> {}\n\nexport interface TableProps<Y extends RowData>\n extends\n OmittedTableOptions<Y>,\n PickedNativeTableProps,\n Pick<CSSProps, \"colorScheme\" | \"lineClamp\" | \"truncated\"> {\n /**\n * The column filters state of the table.\n */\n columnFilters?: ColumnFiltersState\n /**\n * The default column filters state of the table.\n */\n defaultColumnFilters?: ColumnFiltersState\n /**\n * The default pagination state of the table.\n */\n defaultPagination?: PaginationState\n /**\n * The default row selection state of the table.\n */\n defaultRowSelection?: RowSelectionState\n /**\n * The default sorting state of the table.\n */\n defaultSorting?: SortingState<Y>\n /**\n * If `true`, the table width will be automatically resized to the content.\n *\n * @default false\n */\n enableAutoResizeTableWidth?: boolean\n /**\n * If `true`, the keyboard navigation will be enabled.\n *\n * @default true\n */\n enableKeyboardNavigation?: boolean\n /**\n * If `true`, the pagination will be enabled.\n *\n * @default false\n */\n enablePagination?: boolean\n /**\n * The footer of the table.\n */\n footer?: ReactNodeOrFunction<ReactTable<Y>>\n /**\n * The header of the table.\n */\n header?: ReactNodeOrFunction<ReactTable<Y>>\n /**\n * The initial focusable cell of the table.\n *\n * @default {rowIndex: 0, colIndex: 0}\n */\n initialFocusableCell?: { colIndex: number; rowIndex: number }\n /**\n * The pagination state of the table.\n */\n pagination?: PaginationState\n /**\n * The row selection state of the table.\n */\n rowSelection?: RowSelectionState\n /**\n * If `true`, the row will be selected when the row is clicked.\n *\n * @default false\n */\n selectOnClickRow?: boolean\n /**\n * The sorting state of the table.\n */\n sorting?: SortingState<Y>\n /**\n * The sorting icon of the table.\n */\n sortingIcon?: ReactNodeOrFunction<false | SortDirection>\n /**\n * If `true`, the table will have a checkbox column.\n *\n * @default true\n */\n withCheckbox?: boolean\n /**\n * If `true`, the table will have a checkbox in the footer.\n *\n * @default false\n */\n withFooterCheckbox?: boolean\n /**\n * If `true`, the table will have footer groups.\n *\n * @default false\n */\n withFooterGroups?: boolean\n /**\n * The props for the table cell.\n */\n cellProps?: TransformProps<NativeTable.TdProps, Cell<Y, unknown>>\n /**\n * The props for the checkbox.\n */\n checkboxProps?: CheckboxProps\n /**\n * The props for the table footer group.\n */\n footerGroupProps?: TransformProps<NativeTable.TrProps, HeaderGroup<Y>>\n /**\n * The props for the table footer.\n */\n footerProps?: TransformProps<NativeTable.ThProps, Header<Y, unknown>>\n /**\n * The props for the table header checkbox.\n */\n headerCheckboxProps?: TransformProps<CheckboxProps, Header<Y, unknown>>\n /**\n * The props for the table header group.\n */\n headerGroupProps?: TransformProps<NativeTable.TrProps, HeaderGroup<Y>>\n /**\n * The props for the table header.\n */\n headerProps?: TransformProps<NativeTable.ThProps, Header<Y, unknown>>\n /**\n * The props for the resizable trigger.\n */\n resizableTriggerProps?: TransformProps<\n Omit<ResizableTriggerProps, \"resizing\">,\n Header<Y, unknown>\n >\n /**\n * The props for the table row checkbox.\n */\n rowCheckboxProps?: TransformProps<CheckboxProps, Row<Y>>\n /**\n * The props for the table row.\n */\n rowProps?: TransformProps<NativeTable.TrProps, Row<Y>>\n /**\n * The props for the sorting icon.\n */\n sortingIconProps?: TransformProps<\n Omit<SortingIconProps, \"sorted\">,\n Header<Y, unknown>\n >\n /**\n * The props for the table.\n */\n tableProps?: NativeTable.RootProps\n /**\n * The props for the table tbody.\n */\n tbodyProps?: NativeTable.TbodyProps\n /**\n * The props for the table tfoot.\n */\n tfootProps?: NativeTable.TfootProps\n /**\n * The props for the table thead.\n */\n theadProps?: NativeTable.TheadProps\n /**\n * The callback invoked when the column filters state changes.\n */\n onColumnFiltersChange?: (columnFilters: ColumnFiltersState) => void\n /**\n * The callback invoked when the pagination state changes.\n */\n onPaginationChange?: (pagination: PaginationState) => void\n /**\n * The callback invoked when the row is clicked.\n */\n onRowClick?: (row: Row<Y>) => void\n /**\n * The callback invoked when the row is double clicked.\n */\n onRowDoubleClick?: (row: Row<Y>) => void\n /**\n * The callback invoked when the sorting state changes.\n */\n onSortingChange?: (sorting: SortingState<Y>) => void\n}\n\nconst {\n ComponentContext,\n PropsContext: TablePropsContext,\n useComponentContext,\n usePropsContext: useTablePropsContext,\n withContext,\n} = createComponent<TableProps<any>, any, ComponentContext>(\"table\")\n\nexport { TablePropsContext, useTablePropsContext }\n\n/**\n * `Table` is a table component equipped with column sorting, row selection, and click event features.\n *\n * @see https://yamada-ui.com/docs/components/table\n */\nexport const Table = withContext(\n <Y extends RowData>({\n className,\n colorScheme,\n size,\n variant,\n columnFilters: columnFiltersProp,\n columnResizeMode = \"onChange\",\n columns: columnsProp,\n data,\n defaultColumnFilters,\n defaultPagination = { pageIndex: 0, pageSize: 20 },\n defaultRowSelection = {},\n defaultSorting,\n enableAutoResizeTableWidth = false,\n enableColumnResizing = false,\n enableKeyboardNavigation = true,\n enablePagination = false,\n enableRowSelection = false,\n footer,\n header,\n highlightOnHover = !!enableRowSelection,\n highlightOnSelected = !!enableRowSelection,\n initialFocusableCell = { colIndex: 0, rowIndex: 0 },\n layout,\n lineClamp,\n manualPagination,\n pagination: paginationProp,\n rowCount: totalRowCount,\n rowSelection: rowSelectionProp,\n selectOnClickRow = false,\n sortDescFirst = false,\n sorting: sortingProp,\n sortingIcon,\n state,\n stickyFooter,\n stickyHeader,\n striped,\n truncated,\n withBorder,\n withCheckbox = true,\n withColumnBorders,\n withFooterCheckbox = false,\n withFooterGroups = false,\n withScrollArea,\n cellProps,\n checkboxProps,\n footerGroupProps,\n footerProps,\n headerCheckboxProps,\n headerGroupProps,\n headerProps,\n resizableTriggerProps,\n rowCheckboxProps,\n rowProps,\n scrollAreaProps,\n sortingIconProps,\n tableProps,\n tbodyProps,\n tfootProps,\n theadProps,\n onColumnFiltersChange: onColumnFiltersChangeProp,\n onPaginationChange: onPaginationChangeProp,\n onRowClick,\n onRowDoubleClick,\n onRowSelectionChange: onRowSelectionChangeProp,\n onSortingChange: onSortingChangeProp,\n ...rest\n }: TableProps<Y>) => {\n const { t } = useI18n(\"table\")\n const initialFocus = useRef<boolean>(false)\n const ref = useRef<HTMLTableElement>(null)\n const focusedCell = useRef<null | { colIndex: number; rowIndex: number }>(\n null,\n )\n const [rowSelection, onRowSelectionChange] = useControllableState({\n defaultValue: defaultRowSelection,\n value: rowSelectionProp,\n onChange: onRowSelectionChangeProp,\n })\n const [sorting, onSortingChange] = useControllableState({\n defaultValue: defaultSorting,\n value: sortingProp,\n onChange: onSortingChangeProp,\n })\n const [pagination, onPaginationChange] = useControllableState({\n defaultValue: defaultPagination,\n value: paginationProp,\n onChange: onPaginationChangeProp,\n })\n const [columnFilters, onColumnFiltersChange] = useControllableState({\n defaultValue: defaultColumnFilters,\n value: columnFiltersProp,\n onChange: onColumnFiltersChangeProp,\n })\n const columns = useMemo(() => {\n if (!enableRowSelection || !withCheckbox) return columnsProp\n\n const clonedColumns = [...columnsProp]\n\n const header = ({ header, table }: HeaderContext<Y, any>) => {\n return (\n <Checkbox\n {...mergeProps(\n {\n checked: table.getIsAllRowsSelected(),\n indeterminate: table.getIsSomeRowsSelected(),\n indicatorProps: { outline: \"none\" },\n inputProps: {\n \"aria-label\": t(\"Select all rows\"),\n \"data-focusable\": \"\",\n tabIndex: -1,\n },\n onChange: table.getToggleAllRowsSelectedHandler(),\n },\n checkboxProps ?? {},\n runIfFn(headerCheckboxProps, header) ?? {},\n )()}\n />\n )\n }\n\n const cell = ({ row }: CellContext<Y, any>) => {\n return (\n <Checkbox\n {...mergeProps(\n {\n checked: row.getIsSelected(),\n disabled: !row.getCanSelect(),\n indeterminate: row.getIsSomeSelected(),\n indicatorProps: { outline: \"none\" },\n inputProps: {\n \"aria-label\": t(\"Select row\"),\n \"data-focusable\": \"\",\n tabIndex: -1,\n },\n onChange: row.getToggleSelectedHandler(),\n },\n checkboxProps ?? {},\n runIfFn(rowCheckboxProps, row) ?? {},\n )()}\n />\n )\n }\n\n clonedColumns.unshift({\n id: \"select\",\n cell,\n header,\n ...(withFooterCheckbox\n ? { footer: header }\n : { footerProps: { \"aria-hidden\": \"true\" } }),\n cellProps: { verticalAlign: \"middle\" },\n headerProps: { w: \"calc({spaces.4} + {space-x} * 2)\" },\n })\n\n return clonedColumns\n }, [\n checkboxProps,\n columnsProp,\n enableRowSelection,\n headerCheckboxProps,\n rowCheckboxProps,\n t,\n withCheckbox,\n withFooterCheckbox,\n ])\n const table = useReactTable<Y>({\n columnResizeMode,\n columns,\n data,\n enableColumnResizing,\n enableRowSelection,\n getCoreRowModel: getCoreRowModel(),\n getFilteredRowModel: getFilteredRowModel(),\n getSortedRowModel: getSortedRowModel(),\n manualPagination,\n rowCount: totalRowCount,\n sortDescFirst,\n state: {\n columnFilters,\n pagination: enablePagination ? pagination : undefined,\n rowSelection,\n sorting: sorting as OriginalSortingState,\n ...state,\n },\n onColumnFiltersChange,\n onPaginationChange,\n onRowSelectionChange,\n onSortingChange: onSortingChange as OnChangeFn<OriginalSortingState>,\n ...(enablePagination\n ? { getPaginationRowModel: getPaginationRowModel() }\n : {}),\n ...rest,\n })\n const headerGroups = table.getHeaderGroups()\n const mergedHeaderGroups = getMergeHeaderGroups(headerGroups)\n const rows = table.getRowModel().rows\n const footerGroups = table.getFooterGroups()\n const mergedFooterGroups = getMergeFooterGroups(\n withFooterGroups ? footerGroups : [],\n )\n const headerGroupCount = headerGroups.length\n const rowCount = rows.length\n const colCount = table.getAllLeafColumns().length\n const maxColIndex = colCount - 1\n const pageIndex = enablePagination\n ? table.getState().pagination.pageIndex\n : 0\n const cellMap = useMemo(() => {\n const cellMap = new Map<string, string>()\n\n if (!enableKeyboardNavigation) return cellMap\n\n const insertCellMap = (\n id: string,\n colSpan: number,\n rowSpan: number,\n colIndex: number,\n rowIndex: number,\n ) => {\n for (let i = 0; i < colSpan; i++) {\n cellMap.set(`${colIndex + i}-${rowIndex}`, `${colIndex}-${rowIndex}`)\n }\n\n for (let i = 1; i < rowSpan; i++) {\n cellMap.set(`${colIndex}-${rowIndex + i}`, `${colIndex}-${rowIndex}`)\n }\n }\n\n const insertCellMapByHeaderGroup = (\n headerGroup: HeaderGroup<Y>,\n rowIndex: number,\n ) => {\n let placeholderCount = 0\n\n headerGroup.headers.forEach((header) => {\n const colSpan = header.colSpan || 1\n const rowSpan = header.rowSpan || 1\n const colIndex = header.index + placeholderCount\n\n placeholderCount += colSpan - 1\n\n insertCellMap(header.id, colSpan, rowSpan, colIndex, rowIndex)\n })\n }\n\n mergedHeaderGroups.forEach((headerGroup, rowIndex) => {\n insertCellMapByHeaderGroup(headerGroup, rowIndex)\n })\n\n rows.forEach((row, rowIndex) => {\n rowIndex += headerGroupCount\n\n row.getVisibleCells().forEach((cell) => {\n const colIndex = cell.column.getIndex()\n\n insertCellMap(cell.id, 1, 1, colIndex, rowIndex)\n })\n })\n\n mergedFooterGroups.forEach((footerGroup, rowIndex) => {\n rowIndex += headerGroupCount + rowCount\n\n insertCellMapByHeaderGroup(footerGroup, rowIndex)\n })\n\n return cellMap\n }, [\n enableKeyboardNavigation,\n headerGroupCount,\n mergedFooterGroups,\n mergedHeaderGroups,\n rows,\n rowCount,\n ])\n const context = useMemo(\n () => ({\n columnResizeMode,\n sortingIcon,\n table,\n resizableTriggerProps,\n sortingIconProps,\n }),\n [\n columnResizeMode,\n sortingIcon,\n sortingIconProps,\n resizableTriggerProps,\n table,\n ],\n )\n const getCell = (\n evOrEl:\n | Element\n | FocusEvent<HTMLTableElement>\n | KeyboardEvent<HTMLTableElement>\n | null\n | undefined,\n ) => {\n if (!evOrEl) return\n\n const el =\n evOrEl instanceof HTMLElement\n ? evOrEl.closest(\"th, td\")\n : \"target\" in evOrEl && evOrEl.target instanceof HTMLElement\n ? evOrEl.target.closest(\"th, td\")\n : null\n\n if (!(el instanceof HTMLTableCellElement)) return\n\n const { colindex, rowindex } = el.dataset\n const { colSpan, rowSpan } = el\n\n if (!colindex || !rowindex) return\n\n const colIndex = parseInt(colindex)\n const rowIndex = parseInt(rowindex)\n\n return { colIndex, colSpan, el, rowIndex, rowSpan }\n }\n const getShouldFocusCell = (colIndex: number, rowIndex: number) => {\n const [trulyColIndex, trulyRowIndex] =\n cellMap.get(`${colIndex}-${rowIndex}`)?.split(\"-\") ?? []\n\n if (!trulyColIndex || !trulyRowIndex) return\n\n const targetEl = ref.current?.querySelector(\n `[data-colindex=\"${trulyColIndex}\"][data-rowindex=\"${trulyRowIndex}\"]`,\n )\n\n if (!targetEl || !(targetEl instanceof HTMLTableCellElement)) return\n\n return targetEl\n }\n const removeTabIndex = (el: Element | null | undefined) => {\n if (!el || !(el instanceof HTMLElement)) return\n\n el.tabIndex = -1\n el.querySelectorAll(\"[data-focusable]\").forEach((el) => {\n if (el instanceof HTMLElement) el.tabIndex = -1\n })\n }\n const onCellFocus = (\n el: HTMLTableCellElement | null | undefined,\n colIndex: number,\n rowIndex: number,\n ) => {\n const targetEl = getShouldFocusCell(colIndex, rowIndex)\n\n if (!targetEl) return\n\n focusedCell.current = { colIndex, rowIndex }\n\n removeTabIndex(el)\n\n const shouldFocusEl =\n targetEl.querySelector(\"[data-focusable]\") ?? targetEl\n\n if (shouldFocusEl instanceof HTMLElement) {\n shouldFocusEl.tabIndex = 0\n shouldFocusEl.focus()\n }\n }\n const onFocus = (ev: FocusEvent<HTMLTableElement>) => {\n if (initialFocus.current) return\n\n initialFocus.current = true\n\n const cell = getCell(ev)\n\n if (!cell) return\n\n onCellFocus(cell.el, cell.colIndex, cell.rowIndex)\n }\n const onKeyDown = (ev: KeyboardEvent<HTMLTableElement>) => {\n if (!enableKeyboardNavigation) return\n\n const cell = getCell(ev)\n\n if (!cell) return\n\n runKeyAction(ev, {\n ArrowDown: () =>\n onCellFocus(cell.el, cell.colIndex, cell.rowIndex + cell.rowSpan),\n ArrowLeft: () => onCellFocus(cell.el, cell.colIndex - 1, cell.rowIndex),\n ArrowRight: () =>\n onCellFocus(cell.el, cell.colIndex + cell.colSpan, cell.rowIndex),\n ArrowUp: () => onCellFocus(cell.el, cell.colIndex, cell.rowIndex - 1),\n End: () => onCellFocus(cell.el, maxColIndex, cell.rowIndex),\n Home: () => onCellFocus(cell.el, 0, cell.rowIndex),\n ...(enablePagination\n ? {\n PageDown: () => {\n if (!table.getCanNextPage()) return\n\n table.setPageIndex(pageIndex + 1)\n },\n PageUp: () => {\n if (!table.getCanPreviousPage()) return\n\n table.setPageIndex(pageIndex - 1)\n },\n }\n : {}),\n })\n }\n const getTabIndex = (colIndex: number, rowIndex: number) => {\n if (!enableKeyboardNavigation) return undefined\n\n return colIndex === initialFocusableCell.colIndex &&\n rowIndex === initialFocusableCell.rowIndex\n ? 0\n : undefined\n }\n\n useUpdateEffect(() => {\n if (!enableKeyboardNavigation) return\n\n const { colIndex, rowIndex } = focusedCell.current ?? initialFocusableCell\n const targetEl = getShouldFocusCell(colIndex, rowIndex)\n\n if (targetEl) targetEl.tabIndex = 0\n }, [pageIndex, enableKeyboardNavigation])\n\n return (\n <ComponentContext value={context}>\n {header ? runIfFn(header, table) : null}\n\n <NativeTable.Root\n {...mergeProps(\n {\n ref,\n className,\n style:\n enableColumnResizing && enableAutoResizeTableWidth\n ? { width: table.getCenterTotalSize() }\n : {},\n colorScheme,\n size,\n variant,\n \"aria-colcount\": colCount,\n \"aria-multiselectable\": enableRowSelection ? \"true\" : undefined,\n \"aria-rowcount\": totalRowCount || data.length,\n highlightOnHover,\n highlightOnSelected,\n layout,\n role: \"grid\",\n stickyFooter,\n stickyHeader,\n striped,\n withBorder,\n withColumnBorders,\n withScrollArea,\n scrollAreaProps,\n onFocus,\n onKeyDown,\n },\n tableProps ?? {},\n )()}\n >\n <NativeTable.Thead role=\"rowgroup\" {...theadProps}>\n {mergedHeaderGroups.map((headerGroup, rowIndex) => {\n let placeholderCount = 0\n\n return (\n <NativeTable.Tr\n key={headerGroup.id}\n aria-rowindex={rowIndex + 1}\n role=\"row\"\n {...runIfFn(headerGroupProps, headerGroup)}\n >\n {headerGroup.headers.map((header) => {\n const { columnDef } = header.column\n const colIndex = header.index + placeholderCount\n const tabIndex = getTabIndex(colIndex, rowIndex)\n const canSort = header.column.getCanSort()\n const sorted = header.column.getIsSorted()\n const canResize = header.column.getCanResize()\n const resizing = header.column.getIsResizing()\n const children = header.isPlaceholder\n ? null\n : flexRender(\n header.column.columnDef.header,\n header.getContext(),\n )\n\n placeholderCount += (header.colSpan || 1) - 1\n\n return (\n <NativeTable.Th\n key={header.id}\n aria-colindex={colIndex + 1}\n aria-rowindex={rowIndex + 1}\n aria-sort={\n sorted\n ? sorted === \"asc\"\n ? \"ascending\"\n : \"descending\"\n : \"none\"\n }\n data-colindex={colIndex}\n data-rowindex={rowIndex}\n colSpan={header.colSpan || undefined}\n numeric={columnDef.numeric}\n pe={\n canSort\n ? \"calc((1rem * {lineHeights.moderate}) + {space-x})\"\n : undefined\n }\n position=\"relative\"\n role=\"columnheader\"\n rowSpan={header.rowSpan || undefined}\n tabIndex={tabIndex}\n {...mergeProps(\n {\n css: {\n \"&:has([data-focusable]:focus-visible)\":\n focusRingStyle.outline,\n },\n style: enableColumnResizing\n ? { width: header.getSize() }\n : {},\n },\n runIfFn(headerProps, header) ?? {},\n columnDef.headerProps ?? {},\n )()}\n >\n <TruncatedText\n lineClamp={columnDef.lineClamp ?? lineClamp}\n truncated={columnDef.truncated ?? truncated}\n >\n {children}\n </TruncatedText>\n\n {canSort ? (\n <SortingIcon\n sorted={sorted}\n onClick={header.column.getToggleSortingHandler()}\n />\n ) : null}\n\n {canResize ? (\n <ResizableTrigger\n resizing={resizing}\n onDoubleClick={header.column.resetSize}\n onMouseDown={header.getResizeHandler()}\n onTouchStart={header.getResizeHandler()}\n />\n ) : null}\n </NativeTable.Th>\n )\n })}\n </NativeTable.Tr>\n )\n })}\n </NativeTable.Thead>\n\n <NativeTable.Tbody role=\"rowgroup\" {...tbodyProps}>\n {rows.map((row, rowIndex) => {\n rowIndex += headerGroupCount\n\n const selected = !!rowSelection[row.id]\n const disabled =\n isFunction(enableRowSelection) && !enableRowSelection(row)\n\n return (\n <NativeTable.Tr\n id={row.id}\n key={row.id}\n aria-disabled={ariaAttr(disabled)}\n aria-rowindex={rowIndex + 1}\n aria-selected={ariaAttr(selected)}\n data-disabled={dataAttr(disabled)}\n data-selected={dataAttr(selected)}\n role=\"row\"\n {...mergeProps(\n {\n onClick:\n !disabled && selectOnClickRow\n ? () => row.toggleSelected(!selected)\n : undefined,\n },\n {\n onClick: !disabled ? () => onRowClick?.(row) : undefined,\n onDoubleClick: !disabled\n ? () => onRowDoubleClick?.(row)\n : undefined,\n },\n runIfFn(rowProps, row) ?? {},\n )()}\n >\n {row.getVisibleCells().map((cell) => {\n const { columnDef } = cell.column\n const colIndex = cell.column.getIndex()\n const tabIndex = getTabIndex(colIndex, rowIndex)\n const children = flexRender(\n cell.column.columnDef.cell,\n cell.getContext(),\n )\n\n return (\n <NativeTable.Td\n key={cell.id}\n aria-colindex={colIndex + 1}\n aria-rowindex={rowIndex + 1}\n data-colindex={colIndex}\n data-rowindex={rowIndex}\n numeric={columnDef.numeric}\n role=\"gridcell\"\n tabIndex={tabIndex}\n {...mergeProps(\n {\n css: {\n \"&:has([data-focusable]:focus-visible)\":\n focusRingStyle.outline,\n },\n },\n runIfFn(cellProps, cell) ?? {},\n columnDef.cellProps ?? {},\n )()}\n >\n <TruncatedText\n lineClamp={columnDef.lineClamp ?? lineClamp}\n truncated={columnDef.truncated ?? truncated}\n >\n {children}\n </TruncatedText>\n </NativeTable.Td>\n )\n })}\n </NativeTable.Tr>\n )\n })}\n </NativeTable.Tbody>\n\n {withFooterGroups ? (\n <NativeTable.Tfoot role=\"rowgroup\" {...tfootProps}>\n {mergedFooterGroups.map((footerGroup, rowIndex) => {\n rowIndex += headerGroupCount + rowCount\n\n let placeholderCount = 0\n\n return (\n <NativeTable.Tr\n key={footerGroup.id}\n aria-rowindex={rowIndex + 1}\n role=\"row\"\n {...runIfFn(footerGroupProps, footerGroup)}\n >\n {footerGroup.headers.map((header) => {\n const { columnDef } = header.column\n const colIndex = header.index + placeholderCount\n const tabIndex = getTabIndex(colIndex, rowIndex)\n const children = header.isPlaceholder\n ? null\n : flexRender(\n header.column.columnDef.footer,\n header.getContext(),\n )\n\n placeholderCount += (header.colSpan || 1) - 1\n\n return (\n <NativeTable.Td\n key={header.id}\n aria-colindex={colIndex + 1}\n aria-rowindex={rowIndex + 1}\n data-colindex={colIndex}\n data-rowindex={rowIndex}\n colSpan={header.colSpan || undefined}\n numeric={columnDef.numeric}\n role=\"gridcell\"\n rowSpan={header.rowSpan || undefined}\n tabIndex={tabIndex}\n {...mergeProps(\n {\n css: {\n \"&:has([data-focusable]:focus-visible)\":\n focusRingStyle.outline,\n },\n },\n runIfFn(footerProps, header) ?? {},\n columnDef.footerProps ?? {},\n )()}\n >\n <TruncatedText\n lineClamp={columnDef.lineClamp ?? lineClamp}\n truncated={columnDef.truncated ?? truncated}\n >\n {children}\n </TruncatedText>\n </NativeTable.Td>\n )\n })}\n </NativeTable.Tr>\n )\n })}\n </NativeTable.Tfoot>\n ) : null}\n </NativeTable.Root>\n\n {footer ? runIfFn(footer, table) : null}\n </ComponentContext>\n )\n },\n)() as GenericsComponent<{\n <Y extends RowData>(props: TableProps<Y>): ReactElement\n}>\n\ninterface SortingIconProps extends HTMLStyledProps<\"button\"> {\n sorted: false | SortDirection\n}\n\nconst SortingIcon: FC<SortingIconProps> = ({ sorted, ...rest }) => {\n const { t } = useI18n(\"table\")\n const { sortingIcon, sortingIconProps = {} } = useComponentContext()\n const Icon = sorted ? ChevronUpIcon : ChevronsUpDownIcon\n\n return (\n <styled.button\n type=\"button\"\n layerStyle=\"ghost\"\n colorScheme=\"mono\"\n aria-label={t(\n sorted\n ? sorted === \"desc\"\n ? \"Sort descending\"\n : \"Sort ascending\"\n : \"Clear sorting\",\n )}\n data-focusable\n aspectRatio=\"1\"\n cursor=\"pointer\"\n display=\"center\"\n focusVisibleRing=\"none\"\n h=\"calc(1em * {lineHeights.moderate})\"\n position=\"absolute\"\n right=\"{space-x}\"\n rounded=\"l1\"\n tabIndex={-1}\n top=\"50%\"\n transform=\"translateY(-50%)\"\n transitionDuration=\"moderate\"\n transitionProperty=\"common\"\n _hover={{ layerStyle: \"ghost.hover\" }}\n {...mergeProps(rest, sortingIconProps)()}\n >\n {runIfFn(sortingIcon, sorted) ?? (\n <Icon transform={`rotate(${sorted === \"desc\" ? 180 : 0}deg)`} />\n )}\n </styled.button>\n )\n}\n\ninterface ResizableTriggerProps extends HTMLStyledProps {\n resizing: boolean\n}\n\nconst ResizableTrigger: FC<ResizableTriggerProps> = ({ resizing, ...rest }) => {\n const {\n columnResizeMode,\n table,\n resizableTriggerProps = {},\n } = useComponentContext()\n const offset = table.getState().columnSizingInfo.deltaOffset\n\n return (\n <styled.div\n data-active={dataAttr(resizing)}\n bg=\"colorScheme.solid\"\n cursor=\"col-resize\"\n insetY=\"0\"\n opacity={{ base: \"0\", _hover: \"1\", _active: \"1\" }}\n position=\"absolute\"\n right=\"0\"\n touchAction=\"none\"\n transform={`translateX(${columnResizeMode === \"onEnd\" && resizing && offset ? `${offset}px` : \"50%\"})`}\n userSelect=\"none\"\n w=\"1\"\n {...mergeProps(rest, resizableTriggerProps)()}\n />\n )\n}\n\ninterface TruncatedTextProps extends HTMLStyledProps<\"span\"> {}\n\nconst TruncatedText: FC<TruncatedTextProps> = ({\n children,\n lineClamp,\n truncated,\n ...rest\n}) => {\n if (lineClamp || truncated) {\n return (\n <styled.span\n lineClamp={lineClamp}\n truncated={truncated}\n wordBreak=\"break-all\"\n {...rest}\n >\n {children}\n </styled.span>\n )\n } else {\n return children\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA8FA,SAAS,qBACP,cACoB;AACpB,KAAI,aAAa,UAAU,EAAG,QAAO;CAErC,MAAM,6BAAa,IAAI,KAAK;AAE5B,QAAO,aAAa,KAAK,aAAa,OAAO,EAAE,QAAQ,gBAAgB;AACrE,SAAO;GACL,GAAG;GACH,SAAS,YAAY,QAClB,QAAQ,WAAW,CAAC,WAAW,IAAI,OAAO,OAAO,GAAG,CAAC,CACrD,KAAK,WAAW;AACf,eAAW,IAAI,O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AAY,EACV,SACI,WAAW,SACT,oBACA,mBACF,gBACL;EACD;EACA,aAAY;EACZ,QAAO;EACP,SAAQ;EACR,kBAAiB;EACjB,GAAE;EACF,UAAS;EACT,OAAM;EACN,SAAQ;EACR,UAAU;EACV,KAAI;EACJ,WAAU;EACV,oBAAmB;EACnB,oBAAmB;EACnB,QAAQ,EAAE,YAAY,eAAe;EACrC,GAAI,WAAW,MAAM,iBAAiB,EAAE;uCAE/B,aAAa,OAAO,IAC3B,oBAAC,QAAK,WAAW,UAAU,WAAW,SAAS,MAAM,EAAE,QAAS;GAEpD;;AAQpB,MAAMC,oBAA+C,EAAE,UAAU,GAAG,WAAW;CAC7E,MAAM,EACJ,kBACA,OACA,wBAAwB,EAAE,KACxB,qBAAqB;CACzB,MAAM,SAAS,MAAM,UAAU,CAAC,iBAAiB;AAEjD,QACE,oBAAC,OAAO;EACN,2CAAsB,SAAS;EAC/B,IAAG;EACH,QAAO;EACP,QAAO;EACP,SAAS;GAAE,MAAM;GAAK,QAAQ;GAAK,SAAS;GAAK;EACjD,UAAS;EACT,OAAM;EACN,aAAY;EACZ,WAAW,cAAc,qBAAqB,WAAW,YAAY,SAAS,GAAG,OAAO,MAAM,MAAM;EACpG,YAAW;EACX,GAAE;EACF,GAAI,WAAW,MAAM,sBAAsB,EAAE;GAC7C;;AAMN,MAAMC,iBAAyC,EAC7C,UACA,WACA,WACA,GAAG,WACC;AACJ,KAAI,aAAa,UACf,QACE,oBAAC,OAAO;EACK;EACA;EACX,WAAU;EACV,GAAI;EAEH;GACW;KAGhB,QAAO"}
|
|
@@ -28,8 +28,11 @@ const generateAtRule = (identifier) => (values, { system }) => {
|
|
|
28
28
|
return `(${(0, utils_exports.toKebabCase)(key)}: ${value})`;
|
|
29
29
|
}).join(" and ");
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
|
|
31
|
+
const conditions = [`@${identifier}`];
|
|
32
|
+
if (type) conditions.push(type);
|
|
33
|
+
if (name) conditions.push(name);
|
|
34
|
+
if (query) conditions.push(query);
|
|
35
|
+
prev[conditions.join(" ")] = css;
|
|
33
36
|
return prev;
|
|
34
37
|
}, {});
|
|
35
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"at-rule.js","names":["style"],"sources":["../../../../src/core/css/at-rule.ts"],"sourcesContent":["import type { Dict } from \"../../utils\"\nimport type { Transform } from \"./utils\"\nimport { filterUndefined, isArray, toArray, toKebabCase } from \"../../utils\"\nimport { tokenToVar } from \"./utils\"\n\nexport const generateAtRule =\n (identifier: string): Transform =>\n (values, { system }) => {\n if (!isArray(values)) return values\n\n return values.reduce<Dict>(\n (\n prev,\n {\n type,\n name,\n css,\n style,\n h,\n height,\n maxH,\n maxHeight,\n maxW,\n maxWidth,\n minH,\n minHeight,\n minW,\n minWidth,\n prefersColorMode,\n query,\n w,\n width,\n ...rest\n },\n ) => {\n width ??= w\n minWidth ??= minW\n maxWidth ??= maxW\n height ??= h\n minHeight ??= minH\n maxHeight ??= maxH\n\n if (!query) {\n if (style) {\n query = toArray(style)\n .map((style) => `style(${style})`)\n .join(\" and \")\n } else {\n const resolvedRest = filterUndefined({\n height,\n maxHeight,\n maxWidth,\n minHeight,\n minWidth,\n prefersColorScheme: prefersColorMode,\n width,\n ...rest,\n })\n\n query = Object.entries(resolvedRest)\n .map(([key, value]) => {\n value = tokenToVar(system)(\"sizes\", value)\n\n return `(${toKebabCase(key)}: ${value})`\n })\n .join(\" and \")\n }\n }\n\n const
|
|
1
|
+
{"version":3,"file":"at-rule.js","names":["style"],"sources":["../../../../src/core/css/at-rule.ts"],"sourcesContent":["import type { Dict } from \"../../utils\"\nimport type { Transform } from \"./utils\"\nimport { filterUndefined, isArray, toArray, toKebabCase } from \"../../utils\"\nimport { tokenToVar } from \"./utils\"\n\nexport const generateAtRule =\n (identifier: string): Transform =>\n (values, { system }) => {\n if (!isArray(values)) return values\n\n return values.reduce<Dict>(\n (\n prev,\n {\n type,\n name,\n css,\n style,\n h,\n height,\n maxH,\n maxHeight,\n maxW,\n maxWidth,\n minH,\n minHeight,\n minW,\n minWidth,\n prefersColorMode,\n query,\n w,\n width,\n ...rest\n },\n ) => {\n width ??= w\n minWidth ??= minW\n maxWidth ??= maxW\n height ??= h\n minHeight ??= minH\n maxHeight ??= maxH\n\n if (!query) {\n if (style) {\n query = toArray(style)\n .map((style) => `style(${style})`)\n .join(\" and \")\n } else {\n const resolvedRest = filterUndefined({\n height,\n maxHeight,\n maxWidth,\n minHeight,\n minWidth,\n prefersColorScheme: prefersColorMode,\n width,\n ...rest,\n })\n\n query = Object.entries(resolvedRest)\n .map(([key, value]) => {\n value = tokenToVar(system)(\"sizes\", value)\n\n return `(${toKebabCase(key)}: ${value})`\n })\n .join(\" and \")\n }\n }\n\n const conditions = [`@${identifier}`]\n\n if (type) conditions.push(type)\n if (name) conditions.push(name)\n if (query) conditions.push(query)\n\n prev[conditions.join(\" \")] = css\n\n return prev\n },\n {},\n )\n }\n"],"mappings":";;;;AAKA,MAAa,kBACV,gBACA,QAAQ,EAAE,aAAa;AACtB,KAAI,4BAAS,OAAO,CAAE,QAAO;AAE7B,QAAO,OAAO,QAEV,MACA,EACE,MACA,MACA,KACA,OACA,GACA,QACA,MACA,WACA,MACA,UACA,MACA,WACA,MACA,UACA,kBACA,OACA,GACA,OACA,GAAG,WAEF;AACH,YAAU;AACV,eAAa;AACb,eAAa;AACb,aAAW;AACX,gBAAc;AACd,gBAAc;AAEd,MAAI,CAAC,MACH,KAAI,MACF,oCAAgB,MAAM,CACnB,KAAK,YAAU,SAASA,QAAM,GAAG,CACjC,KAAK,QAAQ;OACX;GACL,MAAM,kDAA+B;IACnC;IACA;IACA;IACA;IACA;IACA,oBAAoB;IACpB;IACA,GAAG;IACJ,CAAC;AAEF,WAAQ,OAAO,QAAQ,aAAa,CACjC,KAAK,CAAC,KAAK,WAAW;AACrB,YAAQ,WAAW,OAAO,CAAC,SAAS,MAAM;AAE1C,WAAO,mCAAgB,IAAI,CAAC,IAAI,MAAM;KACtC,CACD,KAAK,QAAQ;;EAIpB,MAAM,aAAa,CAAC,IAAI,aAAa;AAErC,MAAI,KAAM,YAAW,KAAK,KAAK;AAC/B,MAAI,KAAM,YAAW,KAAK,KAAK;AAC/B,MAAI,MAAO,YAAW,KAAK,MAAM;AAEjC,OAAK,WAAW,KAAK,IAAI,IAAI;AAE7B,SAAO;IAET,EAAE,CACH"}
|
|
@@ -40,7 +40,7 @@ const transforms = {
|
|
|
40
40
|
},
|
|
41
41
|
deg: (value) => {
|
|
42
42
|
if (isCSSVar(value) || value == null) return value;
|
|
43
|
-
return typeof value === "string" && !value.endsWith("deg") || (0, utils_exports.isNumber)(value) ? `${value}deg` : value;
|
|
43
|
+
return typeof value === "string" && !value.endsWith("deg") && !value.endsWith("grad") && !value.endsWith("turn") && !value.endsWith("rad") || (0, utils_exports.isNumber)(value) ? `${value}deg` : value;
|
|
44
44
|
},
|
|
45
45
|
display,
|
|
46
46
|
filter: generateFilter,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","names":[],"sources":["../../../../src/core/css/config.ts"],"sourcesContent":["import type { CSSObject } from \"@emotion/styled\"\nimport type { ThemeToken } from \"../system\"\nimport type { CSSProperties } from \"./index.types\"\nimport type { Transform } from \"./utils\"\nimport { isNumber, isObject } from \"../../utils\"\nimport { animation, keyframes } from \"./animation\"\nimport { generateAtRule } from \"./at-rule\"\nimport { generateCalc } from \"./calc\"\nimport { colorMix } from \"./color-mix\"\nimport { colorScheme } from \"./color-scheme\"\nimport { display } from \"./display\"\nimport { generateFilter } from \"./filter\"\nimport { generateFocusRing } from \"./focus-ring\"\nimport { generateFunction } from \"./function\"\nimport { gradient } from \"./gradient\"\nimport { grid } from \"./grid\"\nimport { generateStyle } from \"./style\"\nimport { generateToken } from \"./token\"\nimport { transform } from \"./transform\"\nimport { generateTransition } from \"./transition\"\nimport { analyzeCSSValue, isCSSVar } from \"./utils\"\n\nexport interface StyleConfig {\n important?: boolean\n properties?: CSSProperties[]\n static?: CSSObject\n token?: ThemeToken\n transform?: Transform\n}\n\nexport interface StyleConfigs {\n [key: string]: StyleConfig | true\n}\n\nexport const transforms = {\n style: generateStyle,\n colorScheme,\n animation,\n bgClip: (value, { prev }) => {\n if (value === \"text\") {\n prev ??= {}\n prev.color ??= \"transparent\"\n\n return value\n } else {\n return value\n }\n },\n calc: generateCalc,\n colorMix,\n container: generateAtRule(\"container\"),\n content: (value) => {\n if (isObject(value)) {\n return { content: \"''\", ...value }\n } else {\n return value\n }\n },\n deg: (value) => {\n if (isCSSVar(value) || value == null) return value\n\n const isUnitless
|
|
1
|
+
{"version":3,"file":"config.js","names":[],"sources":["../../../../src/core/css/config.ts"],"sourcesContent":["import type { CSSObject } from \"@emotion/styled\"\nimport type { ThemeToken } from \"../system\"\nimport type { CSSProperties } from \"./index.types\"\nimport type { Transform } from \"./utils\"\nimport { isNumber, isObject } from \"../../utils\"\nimport { animation, keyframes } from \"./animation\"\nimport { generateAtRule } from \"./at-rule\"\nimport { generateCalc } from \"./calc\"\nimport { colorMix } from \"./color-mix\"\nimport { colorScheme } from \"./color-scheme\"\nimport { display } from \"./display\"\nimport { generateFilter } from \"./filter\"\nimport { generateFocusRing } from \"./focus-ring\"\nimport { generateFunction } from \"./function\"\nimport { gradient } from \"./gradient\"\nimport { grid } from \"./grid\"\nimport { generateStyle } from \"./style\"\nimport { generateToken } from \"./token\"\nimport { transform } from \"./transform\"\nimport { generateTransition } from \"./transition\"\nimport { analyzeCSSValue, isCSSVar } from \"./utils\"\n\nexport interface StyleConfig {\n important?: boolean\n properties?: CSSProperties[]\n static?: CSSObject\n token?: ThemeToken\n transform?: Transform\n}\n\nexport interface StyleConfigs {\n [key: string]: StyleConfig | true\n}\n\nexport const transforms = {\n style: generateStyle,\n colorScheme,\n animation,\n bgClip: (value, { prev }) => {\n if (value === \"text\") {\n prev ??= {}\n prev.color ??= \"transparent\"\n\n return value\n } else {\n return value\n }\n },\n calc: generateCalc,\n colorMix,\n container: generateAtRule(\"container\"),\n content: (value) => {\n if (isObject(value)) {\n return { content: \"''\", ...value }\n } else {\n return value\n }\n },\n deg: (value) => {\n if (isCSSVar(value) || value == null) return value\n\n const isUnitless =\n typeof value === \"string\" &&\n !value.endsWith(\"deg\") &&\n !value.endsWith(\"grad\") &&\n !value.endsWith(\"turn\") &&\n !value.endsWith(\"rad\")\n\n return isUnitless || isNumber(value) ? `${value}deg` : value\n },\n display,\n filter: generateFilter,\n focusRing: generateFocusRing,\n fraction: (value) => {\n if (isNumber(value) && value <= 1) value = `${value * 100}%`\n\n return value\n },\n function: generateFunction,\n gradient,\n grid,\n keyframes,\n media: generateAtRule(\"media\"),\n px: (value) => {\n if (value == null) return value\n\n const { unitless } = analyzeCSSValue(value)\n\n return unitless || isNumber(value) ? `${value}px` : value\n },\n supports: generateAtRule(\"supports\"),\n token: generateToken,\n transform,\n transition: generateTransition,\n truncated: (value: boolean) => {\n if (value) {\n return {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }\n }\n },\n} satisfies { [key: string]: Transform }\n\nexport type Transforms = keyof typeof transforms\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkCA,MAAa,aAAa;CACxB,OAAO;CACP;CACA;CACA,SAAS,OAAO,EAAE,WAAW;AAC3B,MAAI,UAAU,QAAQ;AACpB,YAAS,EAAE;AACX,QAAK,UAAU;AAEf,UAAO;QAEP,QAAO;;CAGX,MAAM;CACN;CACA,WAAW,eAAe,YAAY;CACtC,UAAU,UAAU;AAClB,kCAAa,MAAM,CACjB,QAAO;GAAE,SAAS;GAAM,GAAG;GAAO;MAElC,QAAO;;CAGX,MAAM,UAAU;AACd,MAAI,SAAS,MAAM,IAAI,SAAS,KAAM,QAAO;AAS7C,SANE,OAAO,UAAU,YACjB,CAAC,MAAM,SAAS,MAAM,IACtB,CAAC,MAAM,SAAS,OAAO,IACvB,CAAC,MAAM,SAAS,OAAO,IACvB,CAAC,MAAM,SAAS,MAAM,gCAEM,MAAM,GAAG,GAAG,MAAM,OAAO;;CAEzD;CACA,QAAQ;CACR,WAAW;CACX,WAAW,UAAU;AACnB,kCAAa,MAAM,IAAI,SAAS,EAAG,SAAQ,GAAG,QAAQ,IAAI;AAE1D,SAAO;;CAET,UAAU;CACV;CACA;CACA;CACA,OAAO,eAAe,QAAQ;CAC9B,KAAK,UAAU;AACb,MAAI,SAAS,KAAM,QAAO;EAE1B,MAAM,EAAE,aAAa,gBAAgB,MAAM;AAE3C,SAAO,wCAAqB,MAAM,GAAG,GAAG,MAAM,MAAM;;CAEtD,UAAU,eAAe,WAAW;CACpC,OAAO;CACP;CACA,YAAY;CACZ,YAAY,UAAmB;AAC7B,MAAI,MACF,QAAO;GACL,UAAU;GACV,cAAc;GACd,YAAY;GACb;;CAGN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-system.js","names":["tokenMap: {\n [key in \"primary\" | \"secondary\" | \"tertiary\"]: TokenOptions\n}","defaultSystem: System","bem","results: VariableTokens","colors","options: FlattenObjectOptions"],"sources":["../../../../src/core/system/create-system.ts"],"sourcesContent":["import type { Dict, FlattenObjectOptions } from \"../../utils\"\nimport type {\n DefineThemeValue,\n System,\n ThemeConfig,\n UsageTheme,\n} from \"./index.types\"\nimport { bem, flattenObject, isArray, isObject, isUndefined } from \"../../utils\"\nimport { DEFAULT_VAR_PREFIX } from \"../constant\"\nimport { createBreakpoints } from \"./breakpoint\"\nimport { createLayers } from \"./layer\"\nimport { createVars, mergeVars } from \"./var\"\n\nexport type VariableResponsiveValue = Dict<\n [DefineThemeValue, DefineThemeValue] | DefineThemeValue\n>\n\nexport type VariableColorModeValue = [\n DefineThemeValue | Dict<DefineThemeValue>,\n DefineThemeValue | Dict<DefineThemeValue>,\n]\n\nexport type VariableValue =\n | DefineThemeValue\n | VariableColorModeValue\n | VariableResponsiveValue\n\ninterface VariableToken {\n semantic: boolean\n value: VariableValue\n}\n\nexport interface VariableTokens {\n [key: string]: VariableToken\n}\n\ninterface TokenOptions {\n [key: string]: FlattenObjectOptions\n}\n\nconst primaryTokens = {\n aspectRatios: {},\n blurs: {},\n borders: {},\n colors: {},\n durations: {},\n easings: {},\n fonts: {},\n fontSizes: {},\n fontWeights: {},\n letterSpacings: {},\n lineHeights: {},\n radii: {},\n sizes: {},\n spaces: {},\n zIndices: {},\n} satisfies TokenOptions\n\ntype PrimaryToken = keyof typeof primaryTokens\n\nconst secondaryTokens = {\n gradients: {},\n keyframes: { maxDepth: 1 },\n shadows: {},\n} satisfies TokenOptions\n\ntype SecondaryToken = keyof typeof secondaryTokens\n\nconst tertiaryTokens = {\n animations: { shouldProcess: (obj) => !obj.keyframes },\n} satisfies TokenOptions\n\ntype TertiaryToken = keyof typeof tertiaryTokens\n\nconst tokenMap: {\n [key in \"primary\" | \"secondary\" | \"tertiary\"]: TokenOptions\n} = {\n primary: primaryTokens,\n secondary: secondaryTokens,\n tertiary: tertiaryTokens,\n}\n\nexport type ThemeToken =\n | \"breakpoints\"\n | PrimaryToken\n | SecondaryToken\n | TertiaryToken\n\nexport const defaultSystem: System = {\n breakpoints: createBreakpoints(),\n config: {},\n cssMap: {},\n cssVars: {},\n layers: createLayers(),\n utils: { getClassName: bem },\n}\n\nexport function createSystem(\n theme: UsageTheme,\n config: ThemeConfig = {},\n): System {\n const prefix = config.css?.varPrefix ?? DEFAULT_VAR_PREFIX\n const breakpoints = createBreakpoints(theme.breakpoints, config.breakpoint)\n const layers = createLayers(config.css?.layers)\n const shouldProcess = config.theme?.responsive\n ? (obj: any) => !breakpoints.isResponsive(obj, true)\n : () => true\n\n const primaryTokens = {\n ...createTokens(theme, \"primary\", shouldProcess),\n ...createColorSchemeTokens(theme, undefined, shouldProcess),\n }\n const secondaryTokens = createTokens(theme, \"secondary\", shouldProcess)\n const tertiaryTokens = createTokens(theme, \"tertiary\", shouldProcess)\n\n const { cssMap, cssVars } = mergeVars(\n createVars(prefix, theme, breakpoints)(primaryTokens),\n createVars(prefix, theme, breakpoints)(secondaryTokens),\n createVars(prefix, theme, breakpoints)(tertiaryTokens),\n )()\n\n const getClassName = (\n block?: string,\n element?: string,\n modifier?: string,\n ) => {\n if (!block) return \"\"\n\n const className = bem(block, element, modifier)\n\n return `${prefix}-${className}`\n }\n\n if (theme.themeSchemes) {\n const themeSchemeEntries = Object.entries<Dict>(theme.themeSchemes)\n\n for (const [themeScheme, nestedTheme] of themeSchemeEntries) {\n const themeCondition = `[data-theme=${themeScheme}] &:not([data-theme]), &[data-theme=${themeScheme}]`\n\n const nestedPrimaryTokens = {\n ...createTokens(nestedTheme, \"primary\", shouldProcess),\n ...createColorSchemeTokens(theme, nestedTheme, shouldProcess),\n }\n const nestedSecondaryTokens = createTokens(\n nestedTheme,\n \"secondary\",\n shouldProcess,\n )\n const nestedTertiaryTokens = createTokens(\n nestedTheme,\n \"tertiary\",\n shouldProcess,\n )\n\n const { cssVars: nestedCSSVars } = mergeVars(\n createVars(prefix, theme, breakpoints)(nestedPrimaryTokens),\n createVars(prefix, theme, breakpoints)(nestedSecondaryTokens),\n createVars(prefix, theme, breakpoints)(nestedTertiaryTokens),\n )({ ...primaryTokens, ...secondaryTokens, ...tertiaryTokens })\n\n cssVars[themeCondition] = nestedCSSVars\n }\n }\n\n return {\n breakpoints,\n config,\n cssMap,\n cssVars,\n layers,\n utils: { getClassName },\n }\n}\n\nfunction createColorSchemeTokens(\n theme: Dict,\n nestedTheme: Dict | undefined,\n shouldProcess: FlattenObjectOptions[\"shouldProcess\"],\n) {\n const colors = { base: theme.colors ?? {}, nested: nestedTheme?.colors ?? {} }\n const semanticColors = {\n base: theme.semanticTokens?.colors ?? {},\n nested: nestedTheme?.semanticTokens?.colors ?? {},\n }\n const colorSchemeTokens = flattenObject(\n (nestedTheme ?? theme).semanticTokens?.colorSchemes ?? {},\n { shouldProcess },\n )\n\n const results: VariableTokens = {}\n\n function insertToken(\n primaryKey: string,\n secondaryKey: string | undefined,\n value: any,\n ) {\n if (isUndefined(value)) return\n\n if (!secondaryKey || secondaryKey === \"base\") {\n results[`colors.${primaryKey}`] = { semantic: true, value }\n } else {\n results[`colors.${primaryKey}.${secondaryKey}`] = {\n semantic: true,\n value,\n }\n }\n }\n\n function processValue(primaryKey: string, colors: any, keyOrValue: any) {\n const value = colors.nested[keyOrValue] ?? colors.base[keyOrValue]\n\n if (isObject(value)) {\n const tokens = flattenObject(value, { shouldProcess })\n\n Object.keys(tokens).forEach((secondaryKey) => {\n const value =\n secondaryKey === \"base\" ? keyOrValue : `${keyOrValue}.${secondaryKey}`\n\n insertToken(primaryKey, secondaryKey, value)\n })\n } else {\n insertToken(primaryKey, undefined, keyOrValue)\n }\n }\n\n function processColorModeValue(\n primaryKey: string,\n colors: any,\n keyOrValue: any[],\n ) {\n const [lightValue, darkValue] = keyOrValue\n const lightColors = colors.nested[lightValue] ?? colors.base[lightValue]\n const darkColors = colors.nested[darkValue] ?? colors.base[darkValue]\n\n if (isObject(lightColors) && isObject(darkColors)) {\n const tokens = flattenObject(lightColors, { shouldProcess })\n\n Object.keys(tokens).forEach((secondaryKey) => {\n const value = [\n secondaryKey === \"base\"\n ? lightValue\n : `${lightValue}.${secondaryKey}`,\n secondaryKey === \"base\" ? darkValue : `${darkValue}.${secondaryKey}`,\n ]\n\n insertToken(primaryKey, secondaryKey, value)\n })\n } else if (!isObject(lightValue) && !isObject(darkValue)) {\n insertToken(primaryKey, undefined, [lightValue, darkValue])\n }\n }\n\n Object.entries(colorSchemeTokens).forEach(([primaryKey, value]) => {\n if (isArray(value)) {\n processColorModeValue(primaryKey, colors, value)\n processColorModeValue(primaryKey, semanticColors, value)\n } else {\n processValue(primaryKey, colors, value)\n processValue(primaryKey, semanticColors, value)\n }\n })\n\n return results\n}\n\nfunction createTokens(\n theme: Dict,\n target: \"primary\" | \"secondary\" | \"tertiary\",\n shouldProcess: FlattenObjectOptions[\"shouldProcess\"] = () => true,\n) {\n const results: VariableTokens = {}\n\n Object.entries(tokenMap[target]).forEach(\n ([primaryKey, { shouldProcess: shouldProcessProp, ...rest }]) => {\n const options: FlattenObjectOptions = {\n ...rest,\n shouldProcess: (obj) =>\n shouldProcess(obj) && (!shouldProcessProp || shouldProcessProp(obj)),\n }\n\n const tokens = flattenObject(theme[primaryKey] ?? {}, options)\n const semanticTokens = flattenObject(\n theme.semanticTokens?.[primaryKey] ?? {},\n options,\n )\n\n Object.entries(tokens).forEach(([secondaryKey, value]) => {\n const token = `${primaryKey}.${secondaryKey}`\n\n results[token] = { semantic: false, value }\n })\n\n Object.entries(semanticTokens).forEach(([secondaryKey, value]) => {\n let token = `${primaryKey}.${secondaryKey}`\n\n if (token.endsWith(\".base\")) token = token.replace(\".base\", \"\")\n\n results[token] = { semantic: true, value }\n })\n },\n )\n\n return results\n}\n"],"mappings":";;;;;;;AA0EA,MAAMA,WAEF;CACF,SArCoB;EACpB,cAAc,EAAE;EAChB,OAAO,EAAE;EACT,SAAS,EAAE;EACX,QAAQ,EAAE;EACV,WAAW,EAAE;EACb,SAAS,EAAE;EACX,OAAO,EAAE;EACT,WAAW,EAAE;EACb,aAAa,EAAE;EACf,gBAAgB,EAAE;EAClB,aAAa,EAAE;EACf,OAAO,EAAE;EACT,OAAO,EAAE;EACT,QAAQ,EAAE;EACV,UAAU,EAAE;EACb;CAsBC,WAlBsB;EACtB,WAAW,EAAE;EACb,WAAW,EAAE,UAAU,GAAG;EAC1B,SAAS,EAAE;EACZ;CAeC,UAXqB,EACrB,YAAY,EAAE,gBAAgB,QAAQ,CAAC,IAAI,WAAW,EACvD;CAUA;AAQD,MAAaC,gBAAwB;CACnC,aAAa,mBAAmB;CAChC,QAAQ,EAAE;CACV,QAAQ,EAAE;CACV,SAAS,EAAE;CACX,QAAQ,cAAc;CACtB,OAAO,EAAE,cAAcC,mBAAK;CAC7B;AAED,SAAgB,aACd,OACA,SAAsB,EAAE,EAChB;CACR,MAAM,SAAS,OAAO,KAAK,aAAa;CACxC,MAAM,cAAc,kBAAkB,MAAM,aAAa,OAAO,WAAW;CAC3E,MAAM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\" | \"tertiary\"]: TokenOptions\n}","defaultSystem: System","bem","results: VariableTokens","colors","options: FlattenObjectOptions"],"sources":["../../../../src/core/system/create-system.ts"],"sourcesContent":["import type { Dict, FlattenObjectOptions } from \"../../utils\"\nimport type { CSSAnimationObject, CSSModifierObject } from \"../css\"\nimport type {\n DefineThemeValue,\n System,\n ThemeConfig,\n UsageTheme,\n} from \"./index.types\"\nimport { bem, flattenObject, isArray, isObject, isUndefined } from \"../../utils\"\nimport { DEFAULT_VAR_PREFIX } from \"../constant\"\nimport { createBreakpoints } from \"./breakpoint\"\nimport { createLayers } from \"./layer\"\nimport { createVars, mergeVars } from \"./var\"\n\nexport type VariableResponsiveValue = Dict<\n [DefineThemeValue, DefineThemeValue] | DefineThemeValue\n>\n\nexport type VariableColorModeValue = [\n DefineThemeValue | Dict<DefineThemeValue>,\n DefineThemeValue | Dict<DefineThemeValue>,\n]\n\nexport type VariableKeyframeValue =\n | [\n CSSModifierObject | Dict<CSSModifierObject>,\n CSSModifierObject | Dict<CSSModifierObject>,\n ]\n | CSSModifierObject\n | Dict<CSSModifierObject>\n\nexport type VariableAnimationValue =\n | CSSAnimationObject\n | CSSAnimationObject[]\n | Dict<CSSAnimationObject>\n\nexport type VariableValue =\n | DefineThemeValue\n | VariableAnimationValue\n | VariableColorModeValue\n | VariableKeyframeValue\n | VariableResponsiveValue\n\ninterface VariableToken {\n semantic: boolean\n value: VariableValue\n}\n\nexport interface VariableTokens {\n [key: string]: VariableToken\n}\n\ninterface TokenOptions {\n [key: string]: FlattenObjectOptions\n}\n\nconst primaryTokens = {\n aspectRatios: {},\n blurs: {},\n borders: {},\n colors: {},\n durations: {},\n easings: {},\n fonts: {},\n fontSizes: {},\n fontWeights: {},\n letterSpacings: {},\n lineHeights: {},\n radii: {},\n sizes: {},\n spaces: {},\n zIndices: {},\n} satisfies TokenOptions\n\ntype PrimaryToken = keyof typeof primaryTokens\n\nconst secondaryTokens = {\n gradients: {},\n keyframes: { maxDepth: 1 },\n shadows: {},\n} satisfies TokenOptions\n\ntype SecondaryToken = keyof typeof secondaryTokens\n\nconst tertiaryTokens = {\n animations: { shouldProcess: (obj) => !obj.keyframes },\n} satisfies TokenOptions\n\ntype TertiaryToken = keyof typeof tertiaryTokens\n\nconst tokenMap: {\n [key in \"primary\" | \"secondary\" | \"tertiary\"]: TokenOptions\n} = {\n primary: primaryTokens,\n secondary: secondaryTokens,\n tertiary: tertiaryTokens,\n}\n\nexport type ThemeToken =\n | \"breakpoints\"\n | PrimaryToken\n | SecondaryToken\n | TertiaryToken\n\nexport const defaultSystem: System = {\n breakpoints: createBreakpoints(),\n config: {},\n cssMap: {},\n cssVars: {},\n layers: createLayers(),\n utils: { getClassName: bem },\n}\n\nexport function createSystem(\n theme: UsageTheme,\n config: ThemeConfig = {},\n): System {\n const prefix = config.css?.varPrefix ?? DEFAULT_VAR_PREFIX\n const breakpoints = createBreakpoints(theme.breakpoints, config.breakpoint)\n const layers = createLayers(config.css?.layers)\n const shouldProcess = config.theme?.responsive\n ? (obj: any) => !breakpoints.isResponsive(obj, true)\n : () => true\n\n const primaryTokens = {\n ...createTokens(theme, \"primary\", shouldProcess),\n ...createColorSchemeTokens(theme, undefined, shouldProcess),\n }\n const secondaryTokens = createTokens(theme, \"secondary\", shouldProcess)\n const tertiaryTokens = createTokens(theme, \"tertiary\", shouldProcess)\n\n const { cssMap, cssVars } = mergeVars(\n createVars(prefix, theme, breakpoints)(primaryTokens),\n createVars(prefix, theme, breakpoints)(secondaryTokens),\n createVars(prefix, theme, breakpoints)(tertiaryTokens),\n )()\n\n const getClassName = (\n block?: string,\n element?: string,\n modifier?: string,\n ) => {\n if (!block) return \"\"\n\n const className = bem(block, element, modifier)\n\n return `${prefix}-${className}`\n }\n\n if (theme.themeSchemes) {\n const themeSchemeEntries = Object.entries<Dict>(theme.themeSchemes)\n\n for (const [themeScheme, nestedTheme] of themeSchemeEntries) {\n const themeCondition = `[data-theme=${themeScheme}] &:not([data-theme]), &[data-theme=${themeScheme}]`\n\n const nestedPrimaryTokens = {\n ...createTokens(nestedTheme, \"primary\", shouldProcess),\n ...createColorSchemeTokens(theme, nestedTheme, shouldProcess),\n }\n const nestedSecondaryTokens = createTokens(\n nestedTheme,\n \"secondary\",\n shouldProcess,\n )\n const nestedTertiaryTokens = createTokens(\n nestedTheme,\n \"tertiary\",\n shouldProcess,\n )\n\n const { cssVars: nestedCSSVars } = mergeVars(\n createVars(prefix, theme, breakpoints)(nestedPrimaryTokens),\n createVars(prefix, theme, breakpoints)(nestedSecondaryTokens),\n createVars(prefix, theme, breakpoints)(nestedTertiaryTokens),\n )({ ...primaryTokens, ...secondaryTokens, ...tertiaryTokens })\n\n cssVars[themeCondition] = nestedCSSVars\n }\n }\n\n return {\n breakpoints,\n config,\n cssMap,\n cssVars,\n layers,\n utils: { getClassName },\n }\n}\n\nfunction createColorSchemeTokens(\n theme: Dict,\n nestedTheme: Dict | undefined,\n shouldProcess: FlattenObjectOptions[\"shouldProcess\"],\n) {\n const colors = { base: theme.colors ?? {}, nested: nestedTheme?.colors ?? {} }\n const semanticColors = {\n base: theme.semanticTokens?.colors ?? {},\n nested: nestedTheme?.semanticTokens?.colors ?? {},\n }\n const colorSchemeTokens = flattenObject(\n (nestedTheme ?? theme).semanticTokens?.colorSchemes ?? {},\n { shouldProcess },\n )\n\n const results: VariableTokens = {}\n\n function insertToken(\n primaryKey: string,\n secondaryKey: string | undefined,\n value: any,\n ) {\n if (isUndefined(value)) return\n\n if (!secondaryKey || secondaryKey === \"base\") {\n results[`colors.${primaryKey}`] = { semantic: true, value }\n } else {\n results[`colors.${primaryKey}.${secondaryKey}`] = {\n semantic: true,\n value,\n }\n }\n }\n\n function processValue(primaryKey: string, colors: any, keyOrValue: any) {\n const value = colors.nested[keyOrValue] ?? colors.base[keyOrValue]\n\n if (isObject(value)) {\n const tokens = flattenObject(value, { shouldProcess })\n\n Object.keys(tokens).forEach((secondaryKey) => {\n const value =\n secondaryKey === \"base\" ? keyOrValue : `${keyOrValue}.${secondaryKey}`\n\n insertToken(primaryKey, secondaryKey, value)\n })\n } else {\n insertToken(primaryKey, undefined, keyOrValue)\n }\n }\n\n function processColorModeValue(\n primaryKey: string,\n colors: any,\n keyOrValue: any[],\n ) {\n const [lightValue, darkValue] = keyOrValue\n const lightColors = colors.nested[lightValue] ?? colors.base[lightValue]\n const darkColors = colors.nested[darkValue] ?? colors.base[darkValue]\n\n if (isObject(lightColors) && isObject(darkColors)) {\n const tokens = flattenObject(lightColors, { shouldProcess })\n\n Object.keys(tokens).forEach((secondaryKey) => {\n const value = [\n secondaryKey === \"base\"\n ? lightValue\n : `${lightValue}.${secondaryKey}`,\n secondaryKey === \"base\" ? darkValue : `${darkValue}.${secondaryKey}`,\n ]\n\n insertToken(primaryKey, secondaryKey, value)\n })\n } else if (!isObject(lightValue) && !isObject(darkValue)) {\n insertToken(primaryKey, undefined, [lightValue, darkValue])\n }\n }\n\n Object.entries(colorSchemeTokens).forEach(([primaryKey, value]) => {\n if (isArray(value)) {\n processColorModeValue(primaryKey, colors, value)\n processColorModeValue(primaryKey, semanticColors, value)\n } else {\n processValue(primaryKey, colors, value)\n processValue(primaryKey, semanticColors, value)\n }\n })\n\n return results\n}\n\nfunction createTokens(\n theme: Dict,\n target: \"primary\" | \"secondary\" | \"tertiary\",\n shouldProcess: FlattenObjectOptions[\"shouldProcess\"] = () => true,\n) {\n const results: VariableTokens = {}\n\n Object.entries(tokenMap[target]).forEach(\n ([primaryKey, { shouldProcess: shouldProcessProp, ...rest }]) => {\n const options: FlattenObjectOptions = {\n ...rest,\n shouldProcess: (obj) =>\n shouldProcess(obj) && (!shouldProcessProp || shouldProcessProp(obj)),\n }\n\n const tokens = flattenObject(theme[primaryKey] ?? {}, options)\n const semanticTokens = flattenObject(\n theme.semanticTokens?.[primaryKey] ?? {},\n options,\n )\n\n Object.entries(tokens).forEach(([secondaryKey, value]) => {\n const token = `${primaryKey}.${secondaryKey}`\n\n results[token] = { semantic: false, value }\n })\n\n Object.entries(semanticTokens).forEach(([secondaryKey, value]) => {\n let token = `${primaryKey}.${secondaryKey}`\n\n if (token.endsWith(\".base\")) token = token.replace(\".base\", \"\")\n\n results[token] = { semantic: true, value }\n })\n },\n )\n\n return results\n}\n"],"mappings":";;;;;;;AA0FA,MAAMA,WAEF;CACF,SArCoB;EACpB,cAAc,EAAE;EAChB,OAAO,EAAE;EACT,SAAS,EAAE;EACX,QAAQ,EAAE;EACV,WAAW,EAAE;EACb,SAAS,EAAE;EACX,OAAO,EAAE;EACT,WAAW,EAAE;EACb,aAAa,EAAE;EACf,gBAAgB,EAAE;EAClB,aAAa,EAAE;EACf,OAAO,EAAE;EACT,OAAO,EAAE;EACT,QAAQ,EAAE;EACV,UAAU,EAAE;EACb;CAsBC,WAlBsB;EACtB,WAAW,EAAE;EACb,WAAW,EAAE,UAAU,GAAG;EAC1B,SAAS,EAAE;EACZ;CAeC,UAXqB,EACrB,YAAY,EAAE,gBAAgB,QAAQ,CAAC,IAAI,WAAW,EACvD;CAUA;AAQD,MAAaC,gBAAwB;CACnC,aAAa,mBAAmB;CAChC,QAAQ,EAAE;CACV,QAAQ,EAAE;CACV,SAAS,EAAE;CACX,QAAQ,cAAc;CACtB,OAAO,EAAE,cAAcC,mBAAK;CAC7B;AAED,SAAgB,aACd,OACA,SAAsB,EAAE,EAChB;CACR,MAAM,SAAS,OAAO,KAAK,aAAa;CACxC,MAAM,cAAc,kBAAkB,MAAM,aAAa,OAAO,WAAW;CAC3E,MAAM,SAAS,aAAa,OAAO,KAAK,OAAO;CAC/C,MAAM,gBAAgB,OAAO,OAAO,cAC/B,QAAa,CAAC,YAAY,aAAa,KAAK,KAAK,SAC5C;CAEV,MAAM,gBAAgB;EACpB,GAAG,aAAa,OAAO,WAAW,cAAc;EAChD,GAAG,wBAAwB,OAAO,QAAW,cAAc;EAC5D;CACD,MAAM,kBAAkB,aAAa,OAAO,aAAa,cAAc;CACvE,MAAM,iBAAiB,aAAa,OAAO,YAAY,cAAc;CAErE,MAAM,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AgB,MAAM;SACnD;AACL,gBAAa,YAAY,QAAQ,MAAM;AACvC,gBAAa,YAAY,gBAAgB,MAAM;;GAEjD;AAEF,QAAO;;AAGT,SAAS,aACP,OACA,QACA,sBAA6D,MAC7D;CACA,MAAMD,UAA0B,EAAE;AAElC,QAAO,QAAQ,SAAS,QAAQ,CAAC,SAC9B,CAAC,YAAY,EAAE,eAAe,mBAAmB,GAAG,YAAY;EAC/D,MAAME,UAAgC;GACpC,GAAG;GACH,gBAAgB,QACd,cAAc,IAAI,KAAK,CAAC,qBAAqB,kBAAkB,IAAI;GACtE;EAED,MAAM,0CAAuB,MAAM,eAAe,EAAE,EAAE,QAAQ;EAC9D,MAAM,kDACJ,MAAM,iBAAiB,eAAe,EAAE,EACxC,QACD;AAED,SAAO,QAAQ,OAAO,CAAC,SAAS,CAAC,cAAc,WAAW;GACxD,MAAM,QAAQ,GAAG,WAAW,GAAG;AAE/B,WAAQ,SAAS;IAAE,UAAU;IAAO;IAAO;IAC3C;AAEF,SAAO,QAAQ,eAAe,CAAC,SAAS,CAAC,cAAc,WAAW;GAChE,IAAI,QAAQ,GAAG,WAAW,GAAG;AAE7B,OAAI,MAAM,SAAS,QAAQ,CAAE,SAAQ,MAAM,QAAQ,SAAS,GAAG;AAE/D,WAAQ,SAAS;IAAE,UAAU;IAAM;IAAO;IAC1C;GAEL;AAED,QAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-manager.js","names":[],"sources":["../../../../src/core/system/storage-manager.ts"],"sourcesContent":["\"use client\"\n\nexport type Storage = \"cookie\" | \"localStorage\"\n\nconst hasSupport = !!(globalThis.document as Document | undefined)\n\nfunction parseCookie<Y extends string>(\n cookie: string,\n key: string,\n): undefined | Y {\n const match = cookie.match(new RegExp(`(^| )${key}=([^;]+)`))\n\n return match?.[2] as undefined | Y\n}\n\nexport interface StorageManager<Y extends string, M extends Y> {\n default(value: M): M\n get(value?: Y): Y\n set(value: Y): void\n}\n\nexport function createStorageManager<Y extends string, M extends Y>(\n storage: Storage,\n storageKey: string,\n defaultValue: Y,\n cookie?: string,\n): StorageManager<Y, M> {\n return {\n default(value) {\n const defaultStorageKey = `default-${storageKey}`\n\n if (cookie) return parseCookie(cookie, defaultStorageKey) || value\n\n if (storage === \"localStorage\") {\n try {\n return (localStorage.getItem(defaultStorageKey) as M | null) || value\n } catch {\n return value\n }\n } else {\n if (!hasSupport) return value\n\n return parseCookie(document.cookie, defaultStorageKey) || value\n }\n },\n get(value = defaultValue) {\n if (cookie) return parseCookie(cookie, storageKey) || value\n\n if (storage === \"localStorage\") {\n try {\n return (localStorage.getItem(storageKey) as null | Y) || value\n } catch {\n return value\n }\n } else {\n if (!hasSupport) return value\n\n return parseCookie(document.cookie, storageKey) || value\n }\n },\n set(value: Y) {\n if (storage === \"localStorage\") {\n localStorage.setItem(storageKey, value)\n } else {\n document.cookie = `${storageKey}=${value}; max-age=31536000; path=/`\n }\n },\n }\n}\n"],"mappings":";;;AAIA,MAAM,aAAa,CAAC,CAAE,WAAW;AAEjC,SAAS,YACP,QACA,KACe;AAGf,QAFc,OAAO,sBAAM,IAAI,OAAO,QAAQ,IAAI,UAAU,CAAC,GAE9C;;AASjB,SAAgB,qBACd,SACA,YACA,cACA,QACsB;AACtB,QAAO;EACL,QAAQ,OAAO;GACb,MAAM,oBAAoB,WAAW;AAErC,OAAI,OAAQ,QAAO,YAAY,QAAQ,kBAAkB,IAAI;AAE7D,OAAI,YAAY,eACd,KAAI;AACF,WAAQ,aAAa,QAAQ,kBAAkB,IAAiB;WAC1D;AACN,WAAO;;QAEJ;AACL,QAAI,CAAC,WAAY,QAAO;AAExB,WAAO,YAAY,SAAS,QAAQ,kBAAkB,IAAI;;;EAG9D,IAAI,QAAQ,cAAc;AACxB,OAAI,OAAQ,QAAO,YAAY,QAAQ,WAAW,IAAI;AAEtD,OAAI,YAAY,eACd,KAAI;AACF,WAAQ,aAAa,QAAQ,WAAW,IAAiB;WACnD;AACN,WAAO;;QAEJ;AACL,QAAI,CAAC,WAAY,QAAO;AAExB,WAAO,YAAY,SAAS,QAAQ,WAAW,IAAI;;;EAGvD,IAAI,OAAU;AACZ,OAAI,YAAY,eACd,cAAa,QAAQ,YAAY,MAAM;OAEvC,UAAS,SAAS,GAAG,WAAW,GAAG,MAAM;;EAG9C"}
|
|
1
|
+
{"version":3,"file":"storage-manager.js","names":[],"sources":["../../../../src/core/system/storage-manager.ts"],"sourcesContent":["\"use client\"\n\nexport type Storage = \"cookie\" | \"localStorage\"\n\nconst hasSupport = !!(globalThis.document as Document | undefined)\n\nfunction parseCookie<Y extends string>(\n cookie: string,\n key: string,\n): undefined | Y {\n const match = cookie.match(new RegExp(`(^| )${key}=([^;]+)`))\n\n return match?.[2] as undefined | Y\n}\n\nexport interface StorageManager<Y extends string, M extends Y = Y> {\n default(value: M): M\n get(value?: Y): Y\n set(value: Y): void\n}\n\nexport function createStorageManager<Y extends string, M extends Y = Y>(\n storage: Storage,\n storageKey: string,\n defaultValue: Y,\n cookie?: string,\n): StorageManager<Y, M> {\n return {\n default(value) {\n const defaultStorageKey = `default-${storageKey}`\n\n if (cookie) return parseCookie(cookie, defaultStorageKey) || value\n\n if (storage === \"localStorage\") {\n try {\n return (localStorage.getItem(defaultStorageKey) as M | null) || value\n } catch {\n return value\n }\n } else {\n if (!hasSupport) return value\n\n return parseCookie(document.cookie, defaultStorageKey) || value\n }\n },\n get(value = defaultValue) {\n if (cookie) return parseCookie(cookie, storageKey) || value\n\n if (storage === \"localStorage\") {\n try {\n return (localStorage.getItem(storageKey) as null | Y) || value\n } catch {\n return value\n }\n } else {\n if (!hasSupport) return value\n\n return parseCookie(document.cookie, storageKey) || value\n }\n },\n set(value: Y) {\n if (storage === \"localStorage\") {\n localStorage.setItem(storageKey, value)\n } else {\n document.cookie = `${storageKey}=${value}; max-age=31536000; path=/`\n }\n },\n }\n}\n"],"mappings":";;;AAIA,MAAM,aAAa,CAAC,CAAE,WAAW;AAEjC,SAAS,YACP,QACA,KACe;AAGf,QAFc,OAAO,sBAAM,IAAI,OAAO,QAAQ,IAAI,UAAU,CAAC,GAE9C;;AASjB,SAAgB,qBACd,SACA,YACA,cACA,QACsB;AACtB,QAAO;EACL,QAAQ,OAAO;GACb,MAAM,oBAAoB,WAAW;AAErC,OAAI,OAAQ,QAAO,YAAY,QAAQ,kBAAkB,IAAI;AAE7D,OAAI,YAAY,eACd,KAAI;AACF,WAAQ,aAAa,QAAQ,kBAAkB,IAAiB;WAC1D;AACN,WAAO;;QAEJ;AACL,QAAI,CAAC,WAAY,QAAO;AAExB,WAAO,YAAY,SAAS,QAAQ,kBAAkB,IAAI;;;EAG9D,IAAI,QAAQ,cAAc;AACxB,OAAI,OAAQ,QAAO,YAAY,QAAQ,WAAW,IAAI;AAEtD,OAAI,YAAY,eACd,KAAI;AACF,WAAQ,aAAa,QAAQ,WAAW,IAAiB;WACnD;AACN,WAAO;;QAEJ;AACL,QAAI,CAAC,WAAY,QAAO;AAExB,WAAO,YAAY,SAAS,QAAQ,WAAW,IAAI;;;EAGvD,IAAI,OAAU;AACZ,OAAI,YAAY,eACd,cAAa,QAAQ,YAAY,MAAM;OAEvC,UAAS,SAAS,GAAG,WAAW,GAAG,MAAM;;EAG9C"}
|
|
@@ -9,7 +9,7 @@ import "../collapse/index.js";
|
|
|
9
9
|
import "../../index.js";
|
|
10
10
|
import { AccordionStyle } from "./accordion.style.js";
|
|
11
11
|
import { UseAccordionItemProps, UseAccordionProps } from "./use-accordion.js";
|
|
12
|
-
import * as
|
|
12
|
+
import * as react996 from "react";
|
|
13
13
|
|
|
14
14
|
//#region src/components/accordion/accordion.d.ts
|
|
15
15
|
interface AccordionCallBackProps {
|
|
@@ -33,7 +33,7 @@ interface AccordionRootProps extends Omit<HTMLStyledProps, "onChange">, ThemePro
|
|
|
33
33
|
*/
|
|
34
34
|
items?: AccordionItem[];
|
|
35
35
|
}
|
|
36
|
-
declare const AccordionPropsContext:
|
|
36
|
+
declare const AccordionPropsContext: react996.Context<Partial<AccordionRootProps> | undefined>, useAccordionPropsContext: () => Partial<AccordionRootProps> | undefined;
|
|
37
37
|
/**
|
|
38
38
|
* `Accordion` is a component for a list that displays information in an expandable or collapsible manner.
|
|
39
39
|
*
|
|
@@ -3,7 +3,7 @@ import { CSSModifierObject, CSSPropObject, CSSSlotObject } from "../../core/css/
|
|
|
3
3
|
import "../../index.js";
|
|
4
4
|
|
|
5
5
|
//#region src/components/accordion/accordion.style.d.ts
|
|
6
|
-
declare const accordionStyle: ComponentSlotStyle<"button" | "panel" | "icon" | "
|
|
6
|
+
declare const accordionStyle: ComponentSlotStyle<"button" | "panel" | "icon" | "item" | "root", CSSPropObject<CSSSlotObject<"button" | "panel" | "icon" | "item" | "root">>, CSSModifierObject<CSSSlotObject<"button" | "panel" | "icon" | "item" | "root">>, {
|
|
7
7
|
panel: {
|
|
8
8
|
button: {
|
|
9
9
|
rounded: "l2";
|
|
@@ -2,10 +2,10 @@ import { HTMLProps, PropGetter } from "../../core/components/index.types.js";
|
|
|
2
2
|
import "../../core/index.js";
|
|
3
3
|
import { Descendant } from "../../hooks/use-descendants/index.js";
|
|
4
4
|
import "../../index.js";
|
|
5
|
-
import * as
|
|
5
|
+
import * as react984 from "react";
|
|
6
6
|
|
|
7
7
|
//#region src/components/accordion/use-accordion.d.ts
|
|
8
|
-
declare const AccordionDescendantsContext:
|
|
8
|
+
declare const AccordionDescendantsContext: react984.Context<{
|
|
9
9
|
active: (target?: HTMLButtonElement | Descendant<HTMLButtonElement, {}> | null | undefined, options?: FocusOptions) => void;
|
|
10
10
|
count: () => number;
|
|
11
11
|
destroy: () => void;
|
|
@@ -24,7 +24,7 @@ declare const AccordionDescendantsContext: react1024.Context<{
|
|
|
24
24
|
prevValue: (indexOrNode: number | HTMLButtonElement | Descendant<HTMLButtonElement, {}> | null, loop?: boolean) => Descendant<HTMLButtonElement, {}> | undefined;
|
|
25
25
|
register: (props?: {
|
|
26
26
|
disabled?: boolean | ((node: HTMLButtonElement) => boolean) | undefined;
|
|
27
|
-
} | undefined) =>
|
|
27
|
+
} | undefined) => react984.RefCallback<HTMLButtonElement>;
|
|
28
28
|
unregister: (node?: HTMLButtonElement | null | undefined) => void;
|
|
29
29
|
value: (indexOrNode: number | HTMLButtonElement | null) => Descendant<HTMLButtonElement, {}> | undefined;
|
|
30
30
|
values: () => Descendant<HTMLButtonElement, {}>[];
|
|
@@ -50,12 +50,12 @@ declare const AccordionDescendantsContext: react1024.Context<{
|
|
|
50
50
|
prevValue: (indexOrNode: number | HTMLButtonElement | Descendant<HTMLButtonElement, {}> | null, loop?: boolean) => Descendant<HTMLButtonElement, {}> | undefined;
|
|
51
51
|
register: (props?: {
|
|
52
52
|
disabled?: boolean | ((node: HTMLButtonElement) => boolean) | undefined;
|
|
53
|
-
} | undefined) =>
|
|
53
|
+
} | undefined) => react984.RefCallback<HTMLButtonElement>;
|
|
54
54
|
unregister: (node?: HTMLButtonElement | null | undefined) => void;
|
|
55
55
|
value: (indexOrNode: number | HTMLButtonElement | null) => Descendant<HTMLButtonElement, {}> | undefined;
|
|
56
56
|
values: () => Descendant<HTMLButtonElement, {}>[];
|
|
57
57
|
};
|
|
58
|
-
register:
|
|
58
|
+
register: react984.RefCallback<HTMLButtonElement>;
|
|
59
59
|
}, useAccordionDescendants: () => {
|
|
60
60
|
active: (target?: HTMLButtonElement | Descendant<HTMLButtonElement, {}> | null | undefined, options?: FocusOptions) => void;
|
|
61
61
|
count: () => number;
|
|
@@ -75,15 +75,15 @@ declare const AccordionDescendantsContext: react1024.Context<{
|
|
|
75
75
|
prevValue: (indexOrNode: number | HTMLButtonElement | Descendant<HTMLButtonElement, {}> | null, loop?: boolean) => Descendant<HTMLButtonElement, {}> | undefined;
|
|
76
76
|
register: (props?: {
|
|
77
77
|
disabled?: boolean | ((node: HTMLButtonElement) => boolean) | undefined;
|
|
78
|
-
} | undefined) =>
|
|
78
|
+
} | undefined) => react984.RefCallback<HTMLButtonElement>;
|
|
79
79
|
unregister: (node?: HTMLButtonElement | null | undefined) => void;
|
|
80
80
|
value: (indexOrNode: number | HTMLButtonElement | null) => Descendant<HTMLButtonElement, {}> | undefined;
|
|
81
81
|
values: () => Descendant<HTMLButtonElement, {}>[];
|
|
82
82
|
};
|
|
83
83
|
interface AccordionContext extends Omit<UseAccordionReturn, "descendants" | "getRootProps"> {}
|
|
84
|
-
declare const AccordionContext:
|
|
84
|
+
declare const AccordionContext: react984.Context<AccordionContext>, useAccordionContext: () => AccordionContext;
|
|
85
85
|
interface AccordionItemContext extends Omit<UseAccordionItemReturn, "getItemProps"> {}
|
|
86
|
-
declare const AccordionItemContext:
|
|
86
|
+
declare const AccordionItemContext: react984.Context<AccordionItemContext>, useAccordionItemContext: () => AccordionItemContext;
|
|
87
87
|
interface UseAccordionProps extends Omit<HTMLProps, "onChange"> {
|
|
88
88
|
/**
|
|
89
89
|
* The initial index(es) of the accordion item to expand.
|
|
@@ -137,7 +137,7 @@ declare const useAccordion: ({
|
|
|
137
137
|
prevValue: (indexOrNode: number | HTMLButtonElement | Descendant<HTMLButtonElement, {}> | null, loop?: boolean) => Descendant<HTMLButtonElement, {}> | undefined;
|
|
138
138
|
register: (props?: {
|
|
139
139
|
disabled?: boolean | ((node: HTMLButtonElement) => boolean) | undefined;
|
|
140
|
-
} | undefined) =>
|
|
140
|
+
} | undefined) => react984.RefCallback<HTMLButtonElement>;
|
|
141
141
|
unregister: (node?: HTMLButtonElement | null | undefined) => void;
|
|
142
142
|
value: (indexOrNode: number | HTMLButtonElement | null) => Descendant<HTMLButtonElement, {}> | undefined;
|
|
143
143
|
values: () => Descendant<HTMLButtonElement, {}>[];
|
|
@@ -145,8 +145,8 @@ declare const useAccordion: ({
|
|
|
145
145
|
focusedIndex: number;
|
|
146
146
|
index: number | number[];
|
|
147
147
|
multiple: boolean | undefined;
|
|
148
|
-
setFocusedIndex:
|
|
149
|
-
setIndex:
|
|
148
|
+
setFocusedIndex: react984.Dispatch<react984.SetStateAction<number>>;
|
|
149
|
+
setIndex: react984.Dispatch<react984.SetStateAction<number | number[]>>;
|
|
150
150
|
toggle: boolean | undefined;
|
|
151
151
|
getRootProps: PropGetter<"div", undefined, undefined>;
|
|
152
152
|
};
|
|
@@ -5,7 +5,7 @@ import { AiryStyle } from "./airy.style.js";
|
|
|
5
5
|
import { HTMLMotionProps } from "../motion/index.types.js";
|
|
6
6
|
import "../motion/index.js";
|
|
7
7
|
import "../../index.js";
|
|
8
|
-
import * as
|
|
8
|
+
import * as react997 from "react";
|
|
9
9
|
import { ReactNode } from "react";
|
|
10
10
|
|
|
11
11
|
//#region src/components/airy/airy.d.ts
|
|
@@ -57,7 +57,7 @@ interface AiryProps extends Omit<HTMLMotionProps<"button">, "onChange">, ThemePr
|
|
|
57
57
|
*/
|
|
58
58
|
onChange?: (value: KeyframeIdent) => void;
|
|
59
59
|
}
|
|
60
|
-
declare const AiryPropsContext:
|
|
60
|
+
declare const AiryPropsContext: react997.Context<Partial<AiryProps> | undefined>, useAiryPropsContext: () => Partial<AiryProps> | undefined;
|
|
61
61
|
/**
|
|
62
62
|
* `Airy` is a component that creates an airy animation, switching between two elements when one is clicked.
|
|
63
63
|
*
|
|
@@ -9,7 +9,7 @@ import "../loading/index.js";
|
|
|
9
9
|
import { StatusScheme } from "../status/status.js";
|
|
10
10
|
import "../status/index.js";
|
|
11
11
|
import "../../index.js";
|
|
12
|
-
import * as
|
|
12
|
+
import * as react983 from "react";
|
|
13
13
|
|
|
14
14
|
//#region src/components/alert/alert.d.ts
|
|
15
15
|
interface AlertRootProps extends HTMLStyledProps, ThemeProps<AlertStyle> {
|
|
@@ -20,7 +20,7 @@ interface AlertRootProps extends HTMLStyledProps, ThemeProps<AlertStyle> {
|
|
|
20
20
|
*/
|
|
21
21
|
status?: StatusScheme;
|
|
22
22
|
}
|
|
23
|
-
declare const AlertPropsContext:
|
|
23
|
+
declare const AlertPropsContext: react983.Context<Partial<AlertRootProps> | undefined>, useAlertPropsContext: () => Partial<AlertRootProps> | undefined;
|
|
24
24
|
/**
|
|
25
25
|
* `Alert` is a component that conveys information to the user.
|
|
26
26
|
*
|
|
@@ -5,7 +5,7 @@ import { AlphaSliderStyle } from "./alpha-slider.style.js";
|
|
|
5
5
|
import { HueSliderOverlayProps, HueSliderRootProps, HueSliderThumbProps, HueSliderTrackProps } from "../hue-slider/hue-slider.js";
|
|
6
6
|
import "../hue-slider/index.js";
|
|
7
7
|
import "../../index.js";
|
|
8
|
-
import * as
|
|
8
|
+
import * as react982 from "react";
|
|
9
9
|
|
|
10
10
|
//#region src/components/alpha-slider/alpha-slider.d.ts
|
|
11
11
|
interface AlphaSliderRootProps extends WithoutThemeProps<Omit<HueSliderRootProps, "color" | "max" | "step" | "thumbProps" | "trackProps">, AlphaSliderStyle> {
|
|
@@ -38,7 +38,7 @@ interface AlphaSliderRootProps extends WithoutThemeProps<Omit<HueSliderRootProps
|
|
|
38
38
|
*/
|
|
39
39
|
trackProps?: AlphaSliderTrackProps;
|
|
40
40
|
}
|
|
41
|
-
declare const AlphaSliderPropsContext:
|
|
41
|
+
declare const AlphaSliderPropsContext: react982.Context<Partial<AlphaSliderRootProps> | undefined>, useAlphaSliderPropsContext: () => Partial<AlphaSliderRootProps> | undefined;
|
|
42
42
|
/**
|
|
43
43
|
* `AlphaSlider` is a component used to allow the user to select color transparency.
|
|
44
44
|
*
|
|
@@ -2,7 +2,7 @@ import { StyleValue } from "../../core/css/index.types.js";
|
|
|
2
2
|
import { Component, HTMLStyledProps } from "../../core/components/index.types.js";
|
|
3
3
|
import "../../core/index.js";
|
|
4
4
|
import "../../index.js";
|
|
5
|
-
import * as
|
|
5
|
+
import * as react974 from "react";
|
|
6
6
|
|
|
7
7
|
//#region src/components/aspect-ratio/aspect-ratio.d.ts
|
|
8
8
|
interface AspectRatioProps extends HTMLStyledProps {
|
|
@@ -13,7 +13,7 @@ interface AspectRatioProps extends HTMLStyledProps {
|
|
|
13
13
|
*/
|
|
14
14
|
ratio?: StyleValue<number>;
|
|
15
15
|
}
|
|
16
|
-
declare const AspectRatioPropsContext:
|
|
16
|
+
declare const AspectRatioPropsContext: react974.Context<Partial<AspectRatioProps> | undefined>, useAspectRatioPropsContext: () => Partial<AspectRatioProps> | undefined;
|
|
17
17
|
/**
|
|
18
18
|
* `AspectRatio` is a component for embedding things like videos and maps while maintaining the aspect ratio.
|
|
19
19
|
*
|
|
@@ -11,7 +11,7 @@ import { InputGroupRootProps } from "../input/input-group.js";
|
|
|
11
11
|
import "../input/index.js";
|
|
12
12
|
import { UseAutocompleteOptionProps, UseAutocompleteProps } from "./use-autocomplete.js";
|
|
13
13
|
import "../../index.js";
|
|
14
|
-
import * as
|
|
14
|
+
import * as react981 from "react";
|
|
15
15
|
import { ReactElement, ReactNode } from "react";
|
|
16
16
|
|
|
17
17
|
//#region src/components/autocomplete/autocomplete.d.ts
|
|
@@ -67,7 +67,7 @@ interface AutocompleteRootProps<Multiple extends boolean = false> extends Omit<H
|
|
|
67
67
|
*/
|
|
68
68
|
rootProps?: InputGroupRootProps;
|
|
69
69
|
}
|
|
70
|
-
declare const AutocompletePropsContext:
|
|
70
|
+
declare const AutocompletePropsContext: react981.Context<Partial<AutocompleteRootProps<false>> | undefined>, useAutocompletePropsContext: () => Partial<AutocompleteRootProps<false>> | undefined;
|
|
71
71
|
/**
|
|
72
72
|
* `Autocomplete` is a component used to display suggestions in response to user text input.
|
|
73
73
|
*
|