@bitrise/bitkit-v2 0.3.289 → 0.3.291

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.
Files changed (79) hide show
  1. package/dist/atoms/DatePicker/DatePicker.js +1 -1
  2. package/dist/atoms/ImageCropper/ImageCropper.js +1 -1
  3. package/dist/components/BitkitAccordion/BitkitAccordion.js.map +1 -1
  4. package/dist/components/BitkitAvatar/BitkitAvatar.js.map +1 -1
  5. package/dist/components/BitkitBadge/BitkitBadge.js.map +1 -1
  6. package/dist/components/BitkitBreadcrumb/BitkitBreadcrumb.js.map +1 -1
  7. package/dist/components/BitkitBreadcrumb/components/OverflowMenu.js.map +1 -1
  8. package/dist/components/BitkitCalendar/BitkitCalendar.js +2 -1
  9. package/dist/components/BitkitCalendar/BitkitCalendar.js.map +1 -1
  10. package/dist/components/BitkitCalendar/components/CalendarFooter.js +2 -1
  11. package/dist/components/BitkitCalendar/components/CalendarFooter.js.map +1 -1
  12. package/dist/components/BitkitCalendar/components/CalendarMonthSelect.js.map +1 -1
  13. package/dist/components/BitkitCalendar/components/CalendarNextTrigger.js.map +1 -1
  14. package/dist/components/BitkitCalendar/components/CalendarPrevTrigger.js.map +1 -1
  15. package/dist/components/BitkitCalendar/components/CalendarSelect.js.map +1 -1
  16. package/dist/components/BitkitCalendar/components/CalendarTrigger.js.map +1 -1
  17. package/dist/components/BitkitCalendar/components/CalendarYearSelect.js.map +1 -1
  18. package/dist/components/BitkitCodeSnippet/BitkitCodeSnippet.js.map +1 -1
  19. package/dist/components/BitkitCollapsible/BitkitCollapsible.js.map +1 -1
  20. package/dist/components/BitkitCombobox/BitkitCombobox.js.map +1 -1
  21. package/dist/components/BitkitDataWidget/BitkitDataWidget.js.map +1 -1
  22. package/dist/components/BitkitDialog/BitkitStepperDialog.js +2 -2
  23. package/dist/components/BitkitDialog/BitkitStepperDialog.js.map +1 -1
  24. package/dist/components/BitkitDialog/DialogBodyContext.js +2 -1
  25. package/dist/components/BitkitDialog/DialogBodyContext.js.map +1 -1
  26. package/dist/components/BitkitDraggableCard/BitkitDraggableCard.js.map +1 -1
  27. package/dist/components/BitkitExpandableCard/BitkitExpandableCard.d.ts +3 -1
  28. package/dist/components/BitkitExpandableCard/BitkitExpandableCard.js +9 -5
  29. package/dist/components/BitkitExpandableCard/BitkitExpandableCard.js.map +1 -1
  30. package/dist/components/BitkitFileInput/BitkitFileInput.js.map +1 -1
  31. package/dist/components/BitkitGroupHeading/BitkitGroupHeading.js.map +1 -1
  32. package/dist/components/BitkitInlineLoading/BitkitInlineLoading.js.map +1 -1
  33. package/dist/components/BitkitLabel/BitkitLabel.js.map +1 -1
  34. package/dist/components/BitkitLabeledData/BitkitLabeledData.js.map +1 -1
  35. package/dist/components/BitkitMarkdown/BitkitMarkdown.js.map +1 -1
  36. package/dist/components/BitkitMarkdownCard/BitkitMarkdownCard.js.map +1 -1
  37. package/dist/components/BitkitMultiselect/BitkitMultiselect.js.map +1 -1
  38. package/dist/components/BitkitMultiselectMenu/BitkitMultiselectMenu.js.map +1 -1
  39. package/dist/components/BitkitNativeSelect/BitkitNativeSelect.js.map +1 -1
  40. package/dist/components/BitkitNoteCard/BitkitNoteCard.js.map +1 -1
  41. package/dist/components/BitkitOverflowContent/BitkitOverflowContent.js.map +1 -1
  42. package/dist/components/BitkitPageFooter/BitkitPageFooter.js.map +1 -1
  43. package/dist/components/BitkitPagination/BitkitPagination.js.map +1 -1
  44. package/dist/components/BitkitPaginationLoadMore/BitkitPaginationLoadMore.js.map +1 -1
  45. package/dist/components/BitkitPopover/BitkitPopover.js +2 -1
  46. package/dist/components/BitkitPopover/BitkitPopover.js.map +1 -1
  47. package/dist/components/BitkitRibbon/BitkitRibbon.js.map +1 -1
  48. package/dist/components/BitkitSectionHeading/BitkitSectionHeading.js.map +1 -1
  49. package/dist/components/BitkitSelect/BitkitSelect.js.map +1 -1
  50. package/dist/components/BitkitSelectMenu/BitkitSelectMenu.js.map +1 -1
  51. package/dist/components/BitkitSelectMenu/SelectMenuShell.js.map +1 -1
  52. package/dist/components/BitkitSelectableTag/BitkitSelectableTag.js.map +1 -1
  53. package/dist/components/BitkitSettingsCard/BitkitSettingsCard.js.map +1 -1
  54. package/dist/components/BitkitSidebar/BitkitSidebar.js.map +1 -1
  55. package/dist/components/BitkitSplitButton/BitkitSplitButton.js.map +1 -1
  56. package/dist/components/BitkitStat/BitkitStat.js.map +1 -1
  57. package/dist/components/BitkitSteps/BitkitSteps.js.map +1 -1
  58. package/dist/components/BitkitStepsCard/BitkitStepsCard.js.map +1 -1
  59. package/dist/components/BitkitSwitch/BitkitSwitch.js.map +1 -1
  60. package/dist/components/BitkitTabs/BitkitTabs.js +1 -1
  61. package/dist/components/BitkitTabs/BitkitTabs.js.map +1 -1
  62. package/dist/components/BitkitTagsInput/BitkitTagsInput.js.map +1 -1
  63. package/dist/components/BitkitTextInput/BitkitTextInput.js.map +1 -1
  64. package/dist/components/BitkitTreeView/BitkitTreeView.js.map +1 -1
  65. package/dist/theme/recipes/Button.recipe.js.map +1 -1
  66. package/dist/theme/slot-recipes/ExpandableCard.recipe.d.ts +3 -3
  67. package/dist/theme/slot-recipes/ExpandableCard.recipe.js +4 -4
  68. package/dist/theme/slot-recipes/ExpandableCard.recipe.js.map +1 -1
  69. package/dist/theme/slot-recipes/Multiselect.recipe.js +1 -1
  70. package/dist/theme/slot-recipes/NumberInput.recipe.js +1 -1
  71. package/dist/theme/slot-recipes/StepCard.recipe.js.map +1 -1
  72. package/dist/theme/slot-recipes/TagsInput.recipe.js.map +1 -1
  73. package/dist/theme/slot-recipes/index.d.ts +3 -3
  74. package/dist/theme/text-styles.js +4 -3
  75. package/dist/theme/text-styles.js.map +1 -1
  76. package/dist/theme/themeUtils.js +1 -1
  77. package/dist/theme/themeUtils.js.map +1 -1
  78. package/dist/theme/tokens/sizesAndSpacing.js +4 -2
  79. package/package.json +21 -21
@@ -1 +1 @@
1
- {"version":3,"file":"BitkitTabs.js","names":[],"sources":["../../../lib/components/BitkitTabs/BitkitTabs.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext, mergeRefs, useSafeLayoutEffect } from '@chakra-ui/react';\nimport { Box } from '@chakra-ui/react/box';\nimport { Menu } from '@chakra-ui/react/menu';\nimport { Portal } from '@chakra-ui/react/portal';\nimport { chakra, useRecipe } from '@chakra-ui/react/styled-system';\nimport { Tabs, useTabsContext, useTabsStyles } from '@chakra-ui/react/tabs';\nimport { Text } from '@chakra-ui/react/text';\nimport {\n Children,\n cloneElement,\n forwardRef,\n Fragment,\n isValidElement,\n type KeyboardEvent,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type BitkitIconComponent, IconCross, IconPlus } from '../../icons';\nimport BitkitControlButton, { type BitkitControlButtonProps } from '../BitkitControlButton/BitkitControlButton';\n\n/**\n * Root props. `onValueChange` is re-declared with a concrete `{ value }` arg so the callback\n * parameter is inferred at the call site: the base `Tabs.RootProps` intersection breaks\n * contextual typing, which otherwise leaves consumers' `({ value }) => …` flagged as an\n * implicit `any` under `noImplicitAny`.\n */\nexport type BitkitTabsRootProps = Omit<Tabs.RootProps, 'onValueChange'> & {\n onValueChange?: (details: { value: string }) => void;\n};\n\nexport const [RootPropsProvider, useRootPropsContext] = createContext<BitkitTabsRootProps>({\n name: 'RootPropsContext',\n hookName: 'useRootPropsContext',\n providerName: '<RootProps />',\n});\n\nconst Root = forwardRef<HTMLDivElement, BitkitTabsRootProps>((props, ref) => {\n return (\n <RootPropsProvider value={props}>\n <Tabs.Root ref={ref} {...props} />\n </RootPropsProvider>\n );\n});\n\n/** Status-dot colors for the `canvas` variant. */\nexport type BitkitTabsStatusColor = 'neutral' | 'purple' | 'red' | 'yellow';\n\nconst STATUS_COLOR_TOKEN: Record<BitkitTabsStatusColor, string> = {\n neutral: 'color/neutral/muted',\n purple: 'interactive/bold',\n red: 'color/red/base',\n yellow: 'color/yellow/bold',\n};\n\ntype TriggerProps = Tabs.TriggerProps & {\n badge?: ReactNode;\n children?: string;\n icon?: BitkitIconComponent;\n /** `canvas` variant only — when provided, a close button reveals on hover and calls this handler when clicked. */\n onClose?: () => void;\n secondaryText?: ReactNode;\n /** `canvas` variant only — shows a status indicator dot. When hovered (and `onClose` is set), the close button replaces it. */\n statusColor?: BitkitTabsStatusColor;\n};\n\nRoot.displayName = 'BitkitTabs.Root';\n\nconst Trigger = forwardRef<HTMLButtonElement, TriggerProps>((props, ref) => {\n const { badge, children, className, icon: Icon, onClose, onKeyDown, secondaryText, statusColor, ...rest } = props;\n // Mirror the recipe's defaultVariant so an unset `variant` renders the line layout (not the\n // contained one) — otherwise an undefined variant would fall through to the contained branch.\n const { variant = 'line' } = useRootPropsContext();\n const closeButtonRecipe = useRecipe({ key: 'closeButton' });\n\n // Close button and status dot are exclusive to the canvas variant.\n const isCanvas = variant === 'canvas';\n const closable = isCanvas && !!onClose && !rest.disabled;\n const hasStatus = isCanvas && !!statusColor && !rest.disabled;\n const showTrailing = closable || hasStatus;\n const mergedClassName = showTrailing ? (className ? `group ${className}` : 'group') : className;\n // The close button is always visible when there is no status dot; when the dot is shown it is\n // revealed on hover/focus instead (replacing the dot).\n const revealCloseOnInteraction = closable && hasStatus;\n const revealOnInteraction = { opacity: 1, pointerEvents: 'auto' } as const;\n\n const handleCloseClick = (event: MouseEvent<HTMLSpanElement>) => {\n event.stopPropagation();\n event.preventDefault();\n onClose?.();\n };\n\n // The close control is not in the tab order; keyboard users close the focused tab with Delete/Backspace.\n const handleTriggerKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (closable && (event.key === 'Delete' || event.key === 'Backspace')) {\n event.preventDefault();\n // Move focus to a sibling tab before removal so keyboard navigation can continue.\n const trigger = event.currentTarget;\n // Skip overflowed (`hidden`) tabs — they aren't focusable.\n const triggers = [\n ...(trigger.closest('[role=\"tablist\"]')?.querySelectorAll<HTMLElement>('[role=\"tab\"]:not([hidden])') ?? []),\n ];\n const index = triggers.indexOf(trigger);\n (triggers[index + 1] ?? triggers[index - 1])?.focus();\n onClose?.();\n }\n onKeyDown?.(event);\n };\n\n const trailing = showTrailing ? (\n <chakra.span\n position=\"relative\"\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n boxSize=\"24\"\n flexShrink={0}\n >\n {hasStatus && statusColor && (\n <chakra.span\n position=\"absolute\"\n inset={0}\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n pointerEvents=\"none\"\n transition=\"opacity 0.1s\"\n _groupHover={closable ? { opacity: 0 } : undefined}\n _groupFocusWithin={closable ? { opacity: 0 } : undefined}\n >\n <chakra.span boxSize=\"8\" borderRadius=\"full\" backgroundColor={STATUS_COLOR_TOKEN[statusColor]} />\n </chakra.span>\n )}\n {closable && (\n <chakra.span\n aria-hidden\n tabIndex={-1}\n onClick={handleCloseClick}\n css={closeButtonRecipe({ size: 'xs' })}\n position=\"absolute\"\n inset={0}\n color=\"icon/primary\"\n opacity={revealCloseOnInteraction ? 0 : 1}\n pointerEvents={revealCloseOnInteraction ? 'none' : 'auto'}\n transition=\"opacity 0.1s\"\n _groupHover={revealCloseOnInteraction ? revealOnInteraction : undefined}\n _groupFocusWithin={revealCloseOnInteraction ? revealOnInteraction : undefined}\n >\n <IconCross size=\"16\" />\n </chakra.span>\n )}\n </chakra.span>\n ) : null;\n\n return (\n <Tabs.Trigger\n ref={ref}\n {...rest}\n className={mergedClassName}\n gap={isCanvas ? '4' : showTrailing ? '12' : undefined}\n onKeyDown={handleTriggerKeyDown}\n paddingInlineEnd={isCanvas ? (showTrailing ? '8' : undefined) : showTrailing ? '12' : undefined}\n paddingInlineStart={isCanvas && Icon ? '8' : undefined}\n >\n {isCanvas ? (\n <>\n <Box display=\"flex\" alignItems=\"center\" gap=\"8\">\n {Icon && <Icon size=\"16\" />}\n {children}\n </Box>\n {trailing}\n </>\n ) : variant === 'line' ? (\n <>\n <Box display=\"flex\" alignItems=\"center\" gap=\"8\">\n {Icon && <Icon size=\"24\" />}\n {children}\n {badge}\n </Box>\n {trailing}\n </>\n ) : (\n <>\n <Box display=\"flex\" gap=\"16\">\n {children}\n {Icon && <Icon size=\"24\" />}\n </Box>\n {!!secondaryText && (\n <Text as=\"span\" textStyle=\"body/md/regular\" color={rest.disabled ? 'text/on-disabled' : 'text/secondary'}>\n {secondaryText}\n </Text>\n )}\n {trailing}\n </>\n )}\n </Tabs.Trigger>\n );\n});\n\nTrigger.displayName = 'BitkitTabs.Trigger';\n\ntype TabItem = ReactElement<TriggerProps>;\n\n// Flattens children to a list of elements, unwrapping fragments so a Trigger grouped inside a\n// fragment (e.g. conditional rendering) isn't silently dropped.\nconst flattenChildren = (nodes: ReactNode): ReactElement[] =>\n Children.toArray(nodes).flatMap((child) => {\n if (!isValidElement(child)) return [];\n if (child.type === Fragment) return flattenChildren((child.props as { children?: ReactNode }).children);\n return [child];\n });\n\n// Returns the set of visible tab indices for the overflow, always keeping the selected tab\n// visible: if it would overflow, it takes the last visible slot.\nconst getVisibleIndices = (total: number, count: number, selectedIndex: number) => {\n const visible = new Set<number>();\n for (let i = 0; i < count; i += 1) visible.add(i);\n if (selectedIndex >= 0 && selectedIndex < total && !visible.has(selectedIndex)) {\n visible.delete(count - 1);\n visible.add(selectedIndex);\n }\n return visible;\n};\n\nexport type BitkitTabsAddButtonProps = Omit<\n Extract<BitkitControlButtonProps, { href?: undefined }>,\n 'icon' | 'label' | 'size'\n> & {\n /** Accessible label / tooltip for the add button. */\n label?: string;\n};\n\n// \"+\" button to add a tab. Place it as a child of `List`; it always renders at the end of the row\n// (after the overflow menu). A compact `xxs` control button (16px icon, 4px padding) per the design.\nconst AddButton = forwardRef<HTMLButtonElement, BitkitTabsAddButtonProps>((props, ref) => {\n const { label = 'Add tab', ...rest } = props;\n return <BitkitControlButton ref={ref} icon={IconPlus} label={label} size=\"xxs\" {...rest} />;\n});\n\nAddButton.displayName = 'BitkitTabs.AddButton';\n\n// Overflow-aware List (all variants): measures the tabs and collapses the overflowing ones into a\n// \"N more…\" menu. The more-button look comes from the variant's `moreTrigger` recipe slot.\nconst List = forwardRef<HTMLDivElement, Tabs.ListProps>((props, ref) => {\n // Semantic/labelling attributes belong on the actual tablist, not the visual wrapper.\n const { children, id, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, ...rest } = props;\n const { variant = 'line' } = useRootPropsContext();\n const api = useTabsContext();\n const styles = useTabsStyles();\n\n // Split children: tab triggers participate in overflow; the optional add button always renders last.\n const allChildren = flattenChildren(children);\n const addButton = allChildren.find((child) => child.type === AddButton) ?? null;\n // Only Trigger elements are measured/overflowed; anything else (fragments, stray nodes) is ignored.\n const items = allChildren.filter((child) => child.type === Trigger) as TabItem[];\n // Re-measure whenever the tab set OR any width-affecting input changes — the variant, each tab's\n // value/label, icon/status/close/disabled state, and badge/secondaryText content (best-effort\n // string form, so width-changing text like \"3 errors\" → \"12 errors\" invalidates the cache).\n const measureKey =\n variant +\n items\n .map((item) => {\n const p = item.props;\n return [\n p.value,\n String(p.children),\n p.icon ? 'i' : '',\n p.badge ? String(p.badge) : '',\n p.secondaryText ? String(p.secondaryText) : '',\n p.statusColor ?? '',\n p.onClose ? 'c' : '',\n p.disabled ? 'd' : '',\n ].join(':');\n })\n .join('|');\n const selectedIndex = items.findIndex((item) => item.props.value === api.value);\n // Conservative width reservations: the more button (wider for the lg/semibold variants) and the\n // always-visible add button.\n const moreReserve = variant === 'canvas' ? 100 : 140;\n const addReserve = addButton ? 48 : 0;\n\n const listRef = useRef<HTMLDivElement | null>(null);\n const widthsRef = useRef<number[]>([]);\n // Horizontal padding of the list, cached during the measure pass so the resize hot path doesn't\n // call getComputedStyle on every tick.\n const paddingRef = useRef(0);\n // `measuredKey` is state (not a ref) so finishing the measure pass always re-renders and flips\n // `measuring` off — even when recompute keeps the same visibleCount (which would skip a re-render).\n const [measuredKey, setMeasuredKey] = useState<string | null>(null);\n const [visibleCount, setVisibleCount] = useState(items.length);\n\n const setListRef = useMemo(() => mergeRefs(listRef, ref), [ref]);\n\n const recompute = useCallback(() => {\n const el = listRef.current;\n const widths = widthsRef.current;\n if (!el || !widths.length) return;\n const available = el.clientWidth - paddingRef.current - addReserve;\n const totalWidth = widths.reduce((sum, w) => sum + w, 0);\n if (totalWidth <= available) {\n setVisibleCount(widths.length);\n return;\n }\n let used = moreReserve;\n let count = 0;\n for (let i = 0; i < widths.length; i += 1) {\n if (used + widths[i] > available) break;\n used += widths[i];\n count += 1;\n }\n setVisibleCount(Math.max(count, 1));\n }, [addReserve, moreReserve]);\n\n // Measure once per width-affecting change (all tabs are rendered visible during this pass).\n // Isomorphic layout effect: avoids the SSR \"useLayoutEffect does nothing on the server\" warning.\n const measuring = measuredKey !== measureKey;\n useSafeLayoutEffect(() => {\n const el = listRef.current;\n if (!el) return;\n if (measuredKey !== measureKey) {\n const tabEls = el.querySelectorAll<HTMLElement>('[data-tab-trigger]');\n widthsRef.current = Array.from(tabEls, (node) => node.offsetWidth);\n const cs = getComputedStyle(el);\n paddingRef.current = parseFloat(cs.paddingLeft) + parseFloat(cs.paddingRight);\n setMeasuredKey(measureKey);\n }\n recompute();\n }, [measureKey, measuredKey, recompute]);\n\n useEffect(() => {\n const el = listRef.current;\n if (!el || typeof ResizeObserver === 'undefined') return;\n // Coalesce resize bursts into one recompute per frame to avoid a read/write layout storm.\n let raf = 0;\n const observer = new ResizeObserver(() => {\n cancelAnimationFrame(raf);\n raf = requestAnimationFrame(recompute);\n });\n observer.observe(el);\n return () => {\n cancelAnimationFrame(raf);\n observer.disconnect();\n };\n }, [recompute]);\n\n const showAll = measuring || visibleCount >= items.length;\n const visible = showAll ? null : getVisibleIndices(items.length, visibleCount, selectedIndex);\n const hiddenItems = visible ? items.filter((_, i) => !visible.has(i)) : [];\n\n return (\n // The visual row carries the list styling (background, baseline border, leading padding) and is\n // measured for overflow. The tablist itself only wraps the tabs (`display: contents` keeps the\n // flex layout intact), so the more/add controls stay outside `role=\"tablist\"` per the ARIA spec.\n <Box ref={setListRef} css={styles.list} {...rest}>\n <Tabs.List display=\"contents\" id={id} aria-label={ariaLabel} aria-labelledby={ariaLabelledby}>\n {items.map((item, i) =>\n cloneElement(item, {\n key: item.props.value,\n 'data-tab-trigger': '',\n hidden: visible ? !visible.has(i) : undefined,\n } as Partial<TriggerProps>),\n )}\n </Tabs.List>\n {hiddenItems.length > 0 && (\n <Menu.Root size=\"md\" positioning={{ gutter: 0, shift: -4 }}>\n <Menu.Trigger asChild>\n <chakra.button type=\"button\" css={styles.moreTrigger}>\n {hiddenItems.length} more…\n </chakra.button>\n </Menu.Trigger>\n <Portal>\n <Menu.Positioner>\n <Menu.Content>\n {hiddenItems.map((item) => (\n <Menu.Item\n key={item.props.value}\n value={item.props.value}\n disabled={item.props.disabled}\n onSelect={() => api.setValue(item.props.value)}\n alignItems=\"center\"\n >\n <Text flex=\"1\" color={item.props.disabled ? 'text/on-disabled' : 'inherit'}>\n {item.props.children}\n </Text>\n {variant === 'canvas' && item.props.statusColor && (\n <chakra.span\n boxSize=\"8\"\n borderRadius=\"full\"\n flexShrink={0}\n backgroundColor={STATUS_COLOR_TOKEN[item.props.statusColor]}\n />\n )}\n </Menu.Item>\n ))}\n </Menu.Content>\n </Menu.Positioner>\n </Portal>\n </Menu.Root>\n )}\n {addButton && (\n <Box display=\"flex\" alignItems=\"center\" flexShrink={0} paddingInline=\"8\">\n {addButton}\n </Box>\n )}\n </Box>\n );\n});\n\nList.displayName = 'BitkitTabs.List';\n\nconst BitkitTabs: Omit<typeof Tabs, 'Root' | 'Trigger' | 'List'> & {\n AddButton: typeof AddButton;\n List: typeof List;\n Root: typeof Root;\n Trigger: typeof Trigger;\n} = {\n ...Tabs,\n AddButton,\n List,\n Root,\n Trigger,\n};\n\nBitkitTabs.Content.displayName = 'BitkitTabs.Content';\nBitkitTabs.ContentGroup.displayName = 'BitkitTabs.ContentGroup';\nBitkitTabs.Root.displayName = 'BitkitTabs.Root';\n\nexport default BitkitTabs;\n"],"mappings":";;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KAAK,cAAc;AAEnB,IAAM,aAKF;CACF,GAAG;CACH;CACA;CACA;CACA;AACF;AAEA,WAAW,QAAQ,cAAc;AACjC,WAAW,aAAa,cAAc;AACtC,WAAW,KAAK,cAAc"}
1
+ {"version":3,"file":"BitkitTabs.js","names":[],"sources":["../../../lib/components/BitkitTabs/BitkitTabs.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext, mergeRefs, useSafeLayoutEffect } from '@chakra-ui/react';\nimport { Box } from '@chakra-ui/react/box';\nimport { Menu } from '@chakra-ui/react/menu';\nimport { Portal } from '@chakra-ui/react/portal';\nimport { chakra, useRecipe } from '@chakra-ui/react/styled-system';\nimport { Tabs, useTabsContext, useTabsStyles } from '@chakra-ui/react/tabs';\nimport { Text } from '@chakra-ui/react/text';\nimport {\n Children,\n cloneElement,\n forwardRef,\n Fragment,\n isValidElement,\n type KeyboardEvent,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type BitkitIconComponent, IconCross, IconPlus } from '../../icons';\nimport BitkitControlButton, { type BitkitControlButtonProps } from '../BitkitControlButton/BitkitControlButton';\n\n/**\n * Root props. `onValueChange` is re-declared with a concrete `{ value }` arg so the callback\n * parameter is inferred at the call site: the base `Tabs.RootProps` intersection breaks\n * contextual typing, which otherwise leaves consumers' `({ value }) => …` flagged as an\n * implicit `any` under `noImplicitAny`.\n */\nexport type BitkitTabsRootProps = Omit<Tabs.RootProps, 'onValueChange'> & {\n onValueChange?: (details: { value: string }) => void;\n};\n\nexport const [RootPropsProvider, useRootPropsContext] = createContext<BitkitTabsRootProps>({\n name: 'RootPropsContext',\n hookName: 'useRootPropsContext',\n providerName: '<RootProps />',\n});\n\nconst Root = forwardRef<HTMLDivElement, BitkitTabsRootProps>((props, ref) => {\n return (\n <RootPropsProvider value={props}>\n <Tabs.Root ref={ref} {...props} />\n </RootPropsProvider>\n );\n});\n\n/** Status-dot colors for the `canvas` variant. */\nexport type BitkitTabsStatusColor = 'neutral' | 'purple' | 'red' | 'yellow';\n\nconst STATUS_COLOR_TOKEN: Record<BitkitTabsStatusColor, string> = {\n neutral: 'color/neutral/muted',\n purple: 'interactive/bold',\n red: 'color/red/base',\n yellow: 'color/yellow/bold',\n};\n\ntype TriggerProps = Tabs.TriggerProps & {\n badge?: ReactNode;\n children?: string;\n icon?: BitkitIconComponent;\n /** `canvas` variant only — when provided, a close button reveals on hover and calls this handler when clicked. */\n onClose?: () => void;\n secondaryText?: ReactNode;\n /** `canvas` variant only — shows a status indicator dot. When hovered (and `onClose` is set), the close button replaces it. */\n statusColor?: BitkitTabsStatusColor;\n};\n\nRoot.displayName = 'BitkitTabs.Root';\n\nconst Trigger = forwardRef<HTMLButtonElement, TriggerProps>((props, ref) => {\n const { badge, children, className, icon: Icon, onClose, onKeyDown, secondaryText, statusColor, ...rest } = props;\n // Mirror the recipe's defaultVariant so an unset `variant` renders the line layout (not the\n // contained one) — otherwise an undefined variant would fall through to the contained branch.\n const { variant = 'line' } = useRootPropsContext();\n const closeButtonRecipe = useRecipe({ key: 'closeButton' });\n\n // Close button and status dot are exclusive to the canvas variant.\n const isCanvas = variant === 'canvas';\n const closable = isCanvas && !!onClose && !rest.disabled;\n const hasStatus = isCanvas && !!statusColor && !rest.disabled;\n const showTrailing = closable || hasStatus;\n const mergedClassName = showTrailing ? (className ? `group ${className}` : 'group') : className;\n // The close button is always visible when there is no status dot; when the dot is shown it is\n // revealed on hover/focus instead (replacing the dot).\n const revealCloseOnInteraction = closable && hasStatus;\n const revealOnInteraction = { opacity: 1, pointerEvents: 'auto' } as const;\n\n const handleCloseClick = (event: MouseEvent<HTMLSpanElement>) => {\n event.stopPropagation();\n event.preventDefault();\n onClose?.();\n };\n\n // The close control is not in the tab order; keyboard users close the focused tab with Delete/Backspace.\n const handleTriggerKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (closable && (event.key === 'Delete' || event.key === 'Backspace')) {\n event.preventDefault();\n // Move focus to a sibling tab before removal so keyboard navigation can continue.\n const trigger = event.currentTarget;\n // Skip overflowed (`hidden`) tabs — they aren't focusable.\n const triggers = [\n ...(trigger.closest('[role=\"tablist\"]')?.querySelectorAll<HTMLElement>('[role=\"tab\"]:not([hidden])') ?? []),\n ];\n const index = triggers.indexOf(trigger);\n (triggers[index + 1] ?? triggers[index - 1])?.focus();\n onClose?.();\n }\n onKeyDown?.(event);\n };\n\n const trailing = showTrailing ? (\n <chakra.span\n position=\"relative\"\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n boxSize=\"24\"\n flexShrink={0}\n >\n {hasStatus && statusColor && (\n <chakra.span\n position=\"absolute\"\n inset={0}\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n pointerEvents=\"none\"\n transition=\"opacity 0.1s\"\n _groupHover={closable ? { opacity: 0 } : undefined}\n _groupFocusWithin={closable ? { opacity: 0 } : undefined}\n >\n <chakra.span boxSize=\"8\" borderRadius=\"full\" backgroundColor={STATUS_COLOR_TOKEN[statusColor]} />\n </chakra.span>\n )}\n {closable && (\n <chakra.span\n aria-hidden\n tabIndex={-1}\n onClick={handleCloseClick}\n css={closeButtonRecipe({ size: 'xs' })}\n position=\"absolute\"\n inset={0}\n color=\"icon/primary\"\n opacity={revealCloseOnInteraction ? 0 : 1}\n pointerEvents={revealCloseOnInteraction ? 'none' : 'auto'}\n transition=\"opacity 0.1s\"\n _groupHover={revealCloseOnInteraction ? revealOnInteraction : undefined}\n _groupFocusWithin={revealCloseOnInteraction ? revealOnInteraction : undefined}\n >\n <IconCross size=\"16\" />\n </chakra.span>\n )}\n </chakra.span>\n ) : null;\n\n return (\n <Tabs.Trigger\n ref={ref}\n {...rest}\n className={mergedClassName}\n gap={isCanvas ? '4' : showTrailing ? '12' : undefined}\n onKeyDown={handleTriggerKeyDown}\n paddingInlineEnd={isCanvas ? (showTrailing ? '8' : undefined) : showTrailing ? '12' : undefined}\n paddingInlineStart={isCanvas && Icon ? '8' : undefined}\n >\n {isCanvas ? (\n <>\n <Box display=\"flex\" alignItems=\"center\" gap=\"8\">\n {Icon && <Icon size=\"16\" />}\n {children}\n </Box>\n {trailing}\n </>\n ) : variant === 'line' ? (\n <>\n <Box display=\"flex\" alignItems=\"center\" gap=\"8\">\n {Icon && <Icon size=\"24\" />}\n {children}\n {badge}\n </Box>\n {trailing}\n </>\n ) : (\n <>\n <Box display=\"flex\" gap=\"16\">\n {children}\n {Icon && <Icon size=\"24\" />}\n </Box>\n {!!secondaryText && (\n <Text as=\"span\" textStyle=\"body/md/regular\" color={rest.disabled ? 'text/on-disabled' : 'text/secondary'}>\n {secondaryText}\n </Text>\n )}\n {trailing}\n </>\n )}\n </Tabs.Trigger>\n );\n});\n\nTrigger.displayName = 'BitkitTabs.Trigger';\n\ntype TabItem = ReactElement<TriggerProps>;\n\n// Flattens children to a list of elements, unwrapping fragments so a Trigger grouped inside a\n// fragment (e.g. conditional rendering) isn't silently dropped.\nconst flattenChildren = (nodes: ReactNode): ReactElement[] =>\n Children.toArray(nodes).flatMap((child) => {\n if (!isValidElement(child)) return [];\n if (child.type === Fragment) return flattenChildren((child.props as { children?: ReactNode }).children);\n return [child];\n });\n\n// Returns the set of visible tab indices for the overflow, always keeping the selected tab\n// visible: if it would overflow, it takes the last visible slot.\nconst getVisibleIndices = (total: number, count: number, selectedIndex: number) => {\n const visible = new Set<number>();\n for (let i = 0; i < count; i += 1) visible.add(i);\n if (selectedIndex >= 0 && selectedIndex < total && !visible.has(selectedIndex)) {\n visible.delete(count - 1);\n visible.add(selectedIndex);\n }\n return visible;\n};\n\nexport type BitkitTabsAddButtonProps = Omit<\n Extract<BitkitControlButtonProps, { href?: undefined }>,\n 'icon' | 'label' | 'size'\n> & {\n /** Accessible label / tooltip for the add button. */\n label?: string;\n};\n\n// \"+\" button to add a tab. Place it as a child of `List`; it always renders at the end of the row\n// (after the overflow menu). A compact `xxs` control button (16px icon, 4px padding) per the design.\nconst AddButton = forwardRef<HTMLButtonElement, BitkitTabsAddButtonProps>((props, ref) => {\n const { label = 'Add tab', ...rest } = props;\n return <BitkitControlButton ref={ref} icon={IconPlus} label={label} size=\"xxs\" {...rest} />;\n});\n\nAddButton.displayName = 'BitkitTabs.AddButton';\n\n// Overflow-aware List (all variants): measures the tabs and collapses the overflowing ones into a\n// \"N more…\" menu. The more-button look comes from the variant's `moreTrigger` recipe slot.\nconst List = forwardRef<HTMLDivElement, Tabs.ListProps>((props, ref) => {\n // Semantic/labelling attributes belong on the actual tablist, not the visual wrapper.\n const { children, id, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, ...rest } = props;\n const { variant = 'line' } = useRootPropsContext();\n const api = useTabsContext();\n const styles = useTabsStyles();\n\n // Split children: tab triggers participate in overflow; the optional add button always renders last.\n const allChildren = flattenChildren(children);\n const addButton = allChildren.find((child) => child.type === AddButton) ?? null;\n // Only Trigger elements are measured/overflowed; anything else (fragments, stray nodes) is ignored.\n const items = allChildren.filter((child) => child.type === Trigger) as TabItem[];\n // Re-measure whenever the tab set OR any width-affecting input changes — the variant, each tab's\n // value/label, icon/status/close/disabled state, and badge/secondaryText content (best-effort\n // string form, so width-changing text like \"3 errors\" → \"12 errors\" invalidates the cache).\n const measureKey =\n variant +\n items\n .map((item) => {\n const p = item.props;\n return [\n p.value,\n String(p.children),\n p.icon ? 'i' : '',\n p.badge ? String(p.badge) : '',\n p.secondaryText ? String(p.secondaryText) : '',\n p.statusColor ?? '',\n p.onClose ? 'c' : '',\n p.disabled ? 'd' : '',\n ].join(':');\n })\n .join('|');\n const selectedIndex = items.findIndex((item) => item.props.value === api.value);\n // Conservative width reservations: the more button (wider for the lg/semibold variants) and the\n // always-visible add button.\n const moreReserve = variant === 'canvas' ? 100 : 140;\n const addReserve = addButton ? 48 : 0;\n\n const listRef = useRef<HTMLDivElement | null>(null);\n const widthsRef = useRef<number[]>([]);\n // Horizontal padding of the list, cached during the measure pass so the resize hot path doesn't\n // call getComputedStyle on every tick.\n const paddingRef = useRef(0);\n // `measuredKey` is state (not a ref) so finishing the measure pass always re-renders and flips\n // `measuring` off — even when recompute keeps the same visibleCount (which would skip a re-render).\n const [measuredKey, setMeasuredKey] = useState<string | null>(null);\n const [visibleCount, setVisibleCount] = useState(items.length);\n\n const setListRef = useMemo(() => mergeRefs(listRef, ref), [ref]);\n\n const recompute = useCallback(() => {\n const el = listRef.current;\n const widths = widthsRef.current;\n if (!el || !widths.length) return;\n const available = el.clientWidth - paddingRef.current - addReserve;\n const totalWidth = widths.reduce((sum, w) => sum + w, 0);\n if (totalWidth <= available) {\n setVisibleCount(widths.length);\n return;\n }\n let used = moreReserve;\n let count = 0;\n for (let i = 0; i < widths.length; i += 1) {\n if (used + widths[i] > available) break;\n used += widths[i];\n count += 1;\n }\n setVisibleCount(Math.max(count, 1));\n }, [addReserve, moreReserve]);\n\n // Measure once per width-affecting change (all tabs are rendered visible during this pass).\n // Isomorphic layout effect: avoids the SSR \"useLayoutEffect does nothing on the server\" warning.\n const measuring = measuredKey !== measureKey;\n useSafeLayoutEffect(() => {\n const el = listRef.current;\n if (!el) return;\n if (measuredKey !== measureKey) {\n const tabEls = el.querySelectorAll<HTMLElement>('[data-tab-trigger]');\n widthsRef.current = Array.from(tabEls, (node) => node.offsetWidth);\n const cs = getComputedStyle(el);\n paddingRef.current = parseFloat(cs.paddingLeft) + parseFloat(cs.paddingRight);\n setMeasuredKey(measureKey);\n }\n recompute();\n }, [measureKey, measuredKey, recompute]);\n\n useEffect(() => {\n const el = listRef.current;\n if (!el || typeof ResizeObserver === 'undefined') return;\n // Coalesce resize bursts into one recompute per frame to avoid a read/write layout storm.\n let raf = 0;\n const observer = new ResizeObserver(() => {\n cancelAnimationFrame(raf);\n raf = requestAnimationFrame(recompute);\n });\n observer.observe(el);\n return () => {\n cancelAnimationFrame(raf);\n observer.disconnect();\n };\n }, [recompute]);\n\n const showAll = measuring || visibleCount >= items.length;\n const visible = showAll ? null : getVisibleIndices(items.length, visibleCount, selectedIndex);\n const hiddenItems = visible ? items.filter((_, i) => !visible.has(i)) : [];\n\n return (\n // The visual row carries the list styling (background, baseline border, leading padding) and is\n // measured for overflow. The tablist itself only wraps the tabs (`display: contents` keeps the\n // flex layout intact), so the more/add controls stay outside `role=\"tablist\"` per the ARIA spec.\n <Box ref={setListRef} css={styles.list} {...rest}>\n <Tabs.List display=\"contents\" id={id} aria-label={ariaLabel} aria-labelledby={ariaLabelledby}>\n {items.map((item, i) =>\n cloneElement(item, {\n key: item.props.value,\n 'data-tab-trigger': '',\n hidden: visible ? !visible.has(i) : undefined,\n } as Partial<TriggerProps>),\n )}\n </Tabs.List>\n {hiddenItems.length > 0 && (\n <Menu.Root size=\"md\" positioning={{ gutter: 0, shift: -4 }}>\n <Menu.Trigger asChild>\n <chakra.button type=\"button\" css={styles.moreTrigger}>\n {hiddenItems.length} more…\n </chakra.button>\n </Menu.Trigger>\n <Portal>\n <Menu.Positioner>\n <Menu.Content>\n {hiddenItems.map((item) => (\n <Menu.Item\n key={item.props.value}\n value={item.props.value}\n disabled={item.props.disabled}\n onSelect={() => api.setValue(item.props.value)}\n alignItems=\"center\"\n >\n <Text flex=\"1\" color={item.props.disabled ? 'text/on-disabled' : 'inherit'}>\n {item.props.children}\n </Text>\n {variant === 'canvas' && item.props.statusColor && (\n <chakra.span\n boxSize=\"8\"\n borderRadius=\"full\"\n flexShrink={0}\n backgroundColor={STATUS_COLOR_TOKEN[item.props.statusColor]}\n />\n )}\n </Menu.Item>\n ))}\n </Menu.Content>\n </Menu.Positioner>\n </Portal>\n </Menu.Root>\n )}\n {addButton && (\n <Box display=\"flex\" alignItems=\"center\" flexShrink={0} paddingInline=\"8\">\n {addButton}\n </Box>\n )}\n </Box>\n );\n});\n\nList.displayName = 'BitkitTabs.List';\n\nconst BitkitTabs: Omit<typeof Tabs, 'Root' | 'Trigger' | 'List'> & {\n AddButton: typeof AddButton;\n List: typeof List;\n Root: typeof Root;\n Trigger: typeof Trigger;\n} = {\n ...Tabs,\n AddButton,\n List,\n Root,\n Trigger,\n};\n\nBitkitTabs.Content.displayName = 'BitkitTabs.Content';\nBitkitTabs.ContentGroup.displayName = 'BitkitTabs.ContentGroup';\nBitkitTabs.Root.displayName = 'BitkitTabs.Root';\n\nexport default BitkitTabs;\n"],"mappings":";;;;;;;;;;;;;AAsCA,IAAa,CAAC,mBAAmB,uBAAuB,gBAAmC;CACzF,MAAM;CACN,UAAU;CACV,cAAc;AAChB,CAAC;AAED,IAAM,OAAO,YAAiD,OAAO,QAAQ;CAC3E,OACE,oBAAC,mBAAD;EAAmB,OAAO;YACxB,oBAAC,KAAK,MAAN;GAAgB;GAAK,GAAI;EAAQ,CAAA;CAChB,CAAA;AAEvB,CAAC;AAKD,IAAM,qBAA4D;CAChE,SAAS;CACT,QAAQ;CACR,KAAK;CACL,QAAQ;AACV;AAaA,KAAK,cAAc;AAEnB,IAAM,UAAU,YAA6C,OAAO,QAAQ;CAC1E,MAAM,EAAE,OAAO,UAAU,WAAW,MAAM,MAAM,SAAS,WAAW,eAAe,aAAa,GAAG,SAAS;CAG5G,MAAM,EAAE,UAAU,WAAW,oBAAoB;CACjD,MAAM,oBAAoB,UAAU,EAAE,KAAK,cAAc,CAAC;CAG1D,MAAM,WAAW,YAAY;CAC7B,MAAM,WAAW,YAAY,CAAC,CAAC,WAAW,CAAC,KAAK;CAChD,MAAM,YAAY,YAAY,CAAC,CAAC,eAAe,CAAC,KAAK;CACrD,MAAM,eAAe,YAAY;CACjC,MAAM,kBAAkB,eAAgB,YAAY,SAAS,cAAc,UAAW;CAGtF,MAAM,2BAA2B,YAAY;CAC7C,MAAM,sBAAsB;EAAE,SAAS;EAAG,eAAe;CAAO;CAEhE,MAAM,oBAAoB,UAAuC;EAC/D,MAAM,gBAAgB;EACtB,MAAM,eAAe;EACrB,UAAU;CACZ;CAGA,MAAM,wBAAwB,UAA4C;EACxE,IAAI,aAAa,MAAM,QAAQ,YAAY,MAAM,QAAQ,cAAc;GACrE,MAAM,eAAe;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K,MAAM;KAChD,CAAA,CAEM;OAjBJ,KAAK,MAAM,KAiBP,CACZ,EACW,CAAA,EACC,CAAA,EACX,CAAA,CACC;;GAEZ,aACC,oBAAC,KAAD;IAAK,SAAQ;IAAO,YAAW;IAAS,YAAY;IAAG,eAAc;cAClE;GACE,CAAA;EAEJ;;AAET,CAAC;AAED,KAAK,cAAc;AAEnB,IAAM,aAKF;CACF,GAAG;CACH;CACA;CACA;CACA;AACF;AAEA,WAAW,QAAQ,cAAc;AACjC,WAAW,aAAa,cAAc;AACtC,WAAW,KAAK,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"BitkitTagsInput.js","names":[],"sources":["../../../lib/components/BitkitTagsInput/BitkitTagsInput.tsx"],"sourcesContent":["import { chakra, useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { TagsInput } from '@chakra-ui/react/tags-input';\nimport { forwardRef } from 'react';\n\nimport { IconCross, IconErrorCircleFilled, IconWarningYellow } from '../../icons';\nimport BitkitField, { type BitkitFieldProps } from '../BitkitField/BitkitField';\n\nexport interface BitkitTagsInputProps extends Omit<BitkitFieldProps, 'children' | 'state'> {\n addOnPaste?: TagsInput.RootProps['addOnPaste'];\n blurBehavior?: TagsInput.RootProps['blurBehavior'];\n defaultValue?: string[];\n delimiter?: TagsInput.RootProps['delimiter'];\n max?: number;\n onValueChange?: TagsInput.RootProps['onValueChange'];\n placeholder?: string;\n size?: 'md' | 'lg';\n state?: 'disabled' | 'error' | 'readOnly' | 'warning';\n validate?: TagsInput.RootProps['validate'];\n value?: string[];\n}\n\nconst rejectEmpty: NonNullable<TagsInput.RootProps['validate']> = ({ inputValue }) => inputValue.trim().length > 0;\n\nconst BitkitTagsInput = forwardRef<HTMLDivElement, BitkitTagsInputProps>((props, ref) => {\n const {\n addOnPaste = true,\n blurBehavior = 'add',\n defaultValue,\n // Greedy `+` collapses runs of whitespace/commas into a single delimiter so pasting\n // \"alpha, beta\" doesn't spawn an empty tag between the alpha and beta.\n delimiter = /[\\s,]+/,\n max,\n onValueChange,\n placeholder,\n size = 'lg',\n state,\n validate,\n value,\n ...fieldProps\n } = props;\n\n // Always reject empty/whitespace-only input (covers leading/trailing delimiters on paste\n // and blurBehavior=\"add\" with an empty input). Chain with a user-supplied validate if any.\n const effectiveValidate: NonNullable<TagsInput.RootProps['validate']> = (details) =>\n rejectEmpty(details) && (validate?.(details) ?? true);\n\n const styles = useSlotRecipe({ key: 'tagsInput' })({ size });\n\n const hasWarning = state === 'warning' || !!fieldProps.warningText;\n const isInvalid = state === 'error' || !!fieldProps.errorText;\n const isDisabled = state === 'disabled';\n const isReadOnly = state === 'readOnly';\n\n let statusIcon = undefined;\n if (isInvalid) {\n statusIcon = <IconErrorCircleFilled color=\"icon/negative\" size={size === 'lg' ? '24' : '16'} />;\n } else if (hasWarning) {\n statusIcon = <IconWarningYellow size={size === 'lg' ? '24' : '16'} />;\n }\n\n return (\n <TagsInput.Root\n addOnPaste={addOnPaste}\n blurBehavior={blurBehavior}\n defaultValue={defaultValue}\n delimiter={delimiter}\n disabled={isDisabled}\n invalid={isInvalid}\n max={max}\n onValueChange={onValueChange}\n readOnly={isReadOnly}\n size={size}\n validate={effectiveValidate}\n value={value}\n >\n <TagsInput.Context>\n {({ value: tagValues }) => (\n <BitkitField\n counterText={max !== undefined ? `${tagValues.length}/${max}` : undefined}\n ref={ref}\n state={state}\n {...fieldProps}\n >\n <TagsInput.Control>\n <chakra.div css={styles.tagsBlock}>\n {tagValues.map((tagValue, index) => (\n <TagsInput.Item index={index} key={tagValue} value={tagValue}>\n <TagsInput.ItemPreview>\n <TagsInput.ItemText>{tagValue}</TagsInput.ItemText>\n {!isReadOnly && (\n <TagsInput.ItemDeleteTrigger>\n <IconCross size=\"16\" />\n </TagsInput.ItemDeleteTrigger>\n )}\n </TagsInput.ItemPreview>\n <TagsInput.ItemInput />\n </TagsInput.Item>\n ))}\n <TagsInput.Input placeholder={placeholder} />\n </chakra.div>\n {(statusIcon || (tagValues.length > 0 && !isDisabled && !isReadOnly)) && (\n <chakra.div css={styles.suffixBlock}>\n {statusIcon}\n {tagValues.length > 0 && !isDisabled && !isReadOnly && (\n <TagsInput.ClearTrigger css={styles.clearTrigger}>\n <IconCross size={size === 'lg' ? '24' : '16'} />\n </TagsInput.ClearTrigger>\n )}\n </chakra.div>\n )}\n </TagsInput.Control>\n <TagsInput.HiddenInput />\n </BitkitField>\n )}\n </TagsInput.Context>\n </TagsInput.Root>\n );\n});\n\nBitkitTagsInput.displayName = 'BitkitTagsInput';\nexport default BitkitTagsInput;\n"],"mappings":";;;;;;;;;AAqBA,IAAM,eAA6D,EAAE,iBAAiB,WAAW,KAAK,EAAE,SAAS;AAEjH,IAAM,kBAAkB,YAAkD,OAAO,QAAQ;CACvF,MAAM,EACJ,aAAa,MACb,eAAe,OACf,cAGA,YAAY,UACZ,KACA,eACA,aACA,OAAO,MACP,OACA,UACA,OACA,GAAG,eACD;CAIJ,MAAM,qBAAmE,YACvE,YAAY,OAAO,MAAM,WAAW,OAAO,KAAK;CAElD,MAAM,SAAS,cAAc,EAAE,KAAK,YAAY,CAAC,EAAE,EAAE,KAAK,CAAC;CAE3D,MAAM,aAAa,UAAU,aAAa,CAAC,CAAC,WAAW;CACvD,MAAM,YAAY,UAAU,WAAW,CAAC,CAAC,WAAW;CACpD,MAAM,aAAa,UAAU;CAC7B,MAAM,aAAa,UAAU;CAE7B,IAAI,aAAa,KAAA;CACjB,IAAI,WACF,aAAa,oBAAC,uBAAD;EAAuB,OAAM;EAAgB,MAAM,SAAS,OAAO,OAAO;CAAO,CAAA;MACzF,IAAI,YACT,aAAa,oBAAC,mBAAD,EAAmB,MAAM,SAAS,OAAO,OAAO,KAAO,CAAA;CAGtE,OACE,oBAAC,UAAU,MAAX;EACc;EACE;EACA;EACH;EACX,UAAU;EACV,SAAS;EACJ;EACU;EACf,UAAU;EACJ;EACN,UAAU;EACH;YAEP,oBAAC,UAAU,SAAX,EAAA,WACI,EAAE,OAAO,gBACT,qBAAC,aAAD;GACE,aAAa,QAAQ,KAAA,IAAY,GAAG,UAAU,OAAO,GAAG,QAAQ,KAAA;GAC3D;GACE;GACP,GAAI;aAJN,CAME,qBAAC,UAAU,SAAX,EAAA,UAAA,CACE,qBAAC,OAAO,KAAR;IAAY,KAAK,OAAO;cAAxB,CACG,UAAU,KAAK,UAAU,UACxB,qBAAC,UAAU,MAAX;KAAuB;KAAsB,OAAO;eAApD,CACE,qBAAC,UAAU,aAAX,EAAA,UAAA,CACE,oBAAC,UAAU,UAAX,EAAA,UAAqB,SAA6B,CAAA,GACjD,CAAC,cACA,oBAAC,UAAU,mBAAX,EAAA,UACE,oBAAC,WAAD,EAAW,MAAK,KAAM,CAAA,EACK,CAAA,CAEV,EAAA,CAAA,GACvB,oBAAC,UAAU,WAAX,CAAsB,CAAA,CACR;OAVmB,QAUnB,CACjB,GACD,oBAAC,UAAU,OAAX,EAA8B,YAAc,CAAA,CAClC;QACV,cAAe,UAAU,SAAS,KAAK,CAAC,cAAc,CAAC,eACvD,qBAAC,OAAO,KAAR;IAAY,KAAK,OAAO;cAAxB,CACG,YACA,UAAU,SAAS,KAAK,CAAC,cAAc,CAAC,cACvC,oBAAC,UAAU,cAAX;KAAwB,KAAK,OAAO;eAClC,oBAAC,WAAD,EAAW,MAAM,SAAS,OAAO,OAAO,KAAO,CAAA;IACzB,CAAA,CAEhB;KAEG,EAAA,CAAA,GACnB,oBAAC,UAAU,aAAX,CAAwB,CAAA,CACb;KAEE,CAAA;CACL,CAAA;AAEpB,CAAC;AAED,gBAAgB,cAAc"}
1
+ {"version":3,"file":"BitkitTagsInput.js","names":[],"sources":["../../../lib/components/BitkitTagsInput/BitkitTagsInput.tsx"],"sourcesContent":["import { chakra, useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { TagsInput } from '@chakra-ui/react/tags-input';\nimport { forwardRef } from 'react';\n\nimport { IconCross, IconErrorCircleFilled, IconWarningYellow } from '../../icons';\nimport BitkitField, { type BitkitFieldProps } from '../BitkitField/BitkitField';\n\nexport interface BitkitTagsInputProps extends Omit<BitkitFieldProps, 'children' | 'state'> {\n addOnPaste?: TagsInput.RootProps['addOnPaste'];\n blurBehavior?: TagsInput.RootProps['blurBehavior'];\n defaultValue?: string[];\n delimiter?: TagsInput.RootProps['delimiter'];\n max?: number;\n onValueChange?: TagsInput.RootProps['onValueChange'];\n placeholder?: string;\n size?: 'md' | 'lg';\n state?: 'disabled' | 'error' | 'readOnly' | 'warning';\n validate?: TagsInput.RootProps['validate'];\n value?: string[];\n}\n\nconst rejectEmpty: NonNullable<TagsInput.RootProps['validate']> = ({ inputValue }) => inputValue.trim().length > 0;\n\nconst BitkitTagsInput = forwardRef<HTMLDivElement, BitkitTagsInputProps>((props, ref) => {\n const {\n addOnPaste = true,\n blurBehavior = 'add',\n defaultValue,\n // Greedy `+` collapses runs of whitespace/commas into a single delimiter so pasting\n // \"alpha, beta\" doesn't spawn an empty tag between the alpha and beta.\n delimiter = /[\\s,]+/,\n max,\n onValueChange,\n placeholder,\n size = 'lg',\n state,\n validate,\n value,\n ...fieldProps\n } = props;\n\n // Always reject empty/whitespace-only input (covers leading/trailing delimiters on paste\n // and blurBehavior=\"add\" with an empty input). Chain with a user-supplied validate if any.\n const effectiveValidate: NonNullable<TagsInput.RootProps['validate']> = (details) =>\n rejectEmpty(details) && (validate?.(details) ?? true);\n\n const styles = useSlotRecipe({ key: 'tagsInput' })({ size });\n\n const hasWarning = state === 'warning' || !!fieldProps.warningText;\n const isInvalid = state === 'error' || !!fieldProps.errorText;\n const isDisabled = state === 'disabled';\n const isReadOnly = state === 'readOnly';\n\n let statusIcon = undefined;\n if (isInvalid) {\n statusIcon = <IconErrorCircleFilled color=\"icon/negative\" size={size === 'lg' ? '24' : '16'} />;\n } else if (hasWarning) {\n statusIcon = <IconWarningYellow size={size === 'lg' ? '24' : '16'} />;\n }\n\n return (\n <TagsInput.Root\n addOnPaste={addOnPaste}\n blurBehavior={blurBehavior}\n defaultValue={defaultValue}\n delimiter={delimiter}\n disabled={isDisabled}\n invalid={isInvalid}\n max={max}\n onValueChange={onValueChange}\n readOnly={isReadOnly}\n size={size}\n validate={effectiveValidate}\n value={value}\n >\n <TagsInput.Context>\n {({ value: tagValues }) => (\n <BitkitField\n counterText={max !== undefined ? `${tagValues.length}/${max}` : undefined}\n ref={ref}\n state={state}\n {...fieldProps}\n >\n <TagsInput.Control>\n <chakra.div css={styles.tagsBlock}>\n {tagValues.map((tagValue, index) => (\n <TagsInput.Item index={index} key={tagValue} value={tagValue}>\n <TagsInput.ItemPreview>\n <TagsInput.ItemText>{tagValue}</TagsInput.ItemText>\n {!isReadOnly && (\n <TagsInput.ItemDeleteTrigger>\n <IconCross size=\"16\" />\n </TagsInput.ItemDeleteTrigger>\n )}\n </TagsInput.ItemPreview>\n <TagsInput.ItemInput />\n </TagsInput.Item>\n ))}\n <TagsInput.Input placeholder={placeholder} />\n </chakra.div>\n {(statusIcon || (tagValues.length > 0 && !isDisabled && !isReadOnly)) && (\n <chakra.div css={styles.suffixBlock}>\n {statusIcon}\n {tagValues.length > 0 && !isDisabled && !isReadOnly && (\n <TagsInput.ClearTrigger css={styles.clearTrigger}>\n <IconCross size={size === 'lg' ? '24' : '16'} />\n </TagsInput.ClearTrigger>\n )}\n </chakra.div>\n )}\n </TagsInput.Control>\n <TagsInput.HiddenInput />\n </BitkitField>\n )}\n </TagsInput.Context>\n </TagsInput.Root>\n );\n});\n\nBitkitTagsInput.displayName = 'BitkitTagsInput';\nexport default BitkitTagsInput;\n"],"mappings":";;;;;;;;;AAqBA,IAAM,eAA6D,EAAE,iBAAiB,WAAW,KAAK,CAAC,CAAC,SAAS;AAEjH,IAAM,kBAAkB,YAAkD,OAAO,QAAQ;CACvF,MAAM,EACJ,aAAa,MACb,eAAe,OACf,cAGA,YAAY,UACZ,KACA,eACA,aACA,OAAO,MACP,OACA,UACA,OACA,GAAG,eACD;CAIJ,MAAM,qBAAmE,YACvE,YAAY,OAAO,MAAM,WAAW,OAAO,KAAK;CAElD,MAA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O,KAAR;IAAY,KAAK,OAAO;cAAxB,CACG,YACA,UAAU,SAAS,KAAK,CAAC,cAAc,CAAC,cACvC,oBAAC,UAAU,cAAX;KAAwB,KAAK,OAAO;eAClC,oBAAC,WAAD,EAAW,MAAM,SAAS,OAAO,OAAO,KAAO,CAAA;IACzB,CAAA,CAEhB;KAEG,EAAA,CAAA,GACnB,oBAAC,UAAU,aAAX,CAAwB,CAAA,CACb;KAEE,CAAA;CACL,CAAA;AAEpB,CAAC;AAED,gBAAgB,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"BitkitTextInput.js","names":[],"sources":["../../../lib/components/BitkitTextInput/BitkitTextInput.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { Group } from '@chakra-ui/react/group';\nimport { Input, type InputProps } from '@chakra-ui/react/input';\nimport { InputAddon, type InputAddonProps } from '@chakra-ui/react/input-addon';\nimport { useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { IconErrorCircleFilled, IconWarningYellow } from '../../icons';\nimport BitkitField, { type BitkitFieldProps } from '../BitkitField/BitkitField';\n\nexport interface BitkitTextInputProps extends Omit<BitkitFieldProps, 'children' | 'state'> {\n counter?: boolean;\n endAddon?: ReactNode;\n endAddonProps?: InputAddonProps;\n endElement?: ReactNode;\n inputProps?: InputProps;\n maxLength?: HTMLInputElement['maxLength'];\n placeholder?: string;\n size?: 'md' | 'lg';\n startAddon?: ReactNode;\n startAddonProps?: InputAddonProps;\n startElement?: ReactNode;\n state?: 'disabled' | 'error' | 'readOnly' | 'warning';\n}\n\nconst BitkitTextInput = forwardRef<HTMLDivElement, BitkitTextInputProps>((props, ref) => {\n const {\n counter,\n endAddon,\n endAddonProps,\n endElement,\n inputProps,\n maxLength,\n placeholder,\n size = 'lg',\n startAddon,\n startAddonProps,\n startElement,\n state,\n ...fieldProps\n } = props;\n\n const recipe = useSlotRecipe({ key: 'textInput' });\n const styles = recipe({ size });\n\n const iconSize = size === 'md' ? '16' : '24';\n const addonSize = size === 'md' ? 'md' : 'lg';\n\n const hasWarning = state === 'warning' || !!fieldProps.warningText;\n const isInvalid = state === 'error' || !!fieldProps.errorText;\n\n let statusIcon: ReactNode = null;\n if (isInvalid) {\n statusIcon = <IconErrorCircleFilled color=\"icon/negative\" size={iconSize} />;\n } else if (hasWarning) {\n statusIcon = <IconWarningYellow size={iconSize} />;\n }\n\n const counterText =\n counter && maxLength && inputProps?.value !== undefined\n ? `${inputProps.value.toString().length}/${maxLength}`\n : undefined;\n\n const stateAttrs = {\n 'data-disabled': state === 'disabled' ? '' : undefined,\n 'data-invalid': isInvalid ? '' : undefined,\n 'data-readonly': state === 'readOnly' ? '' : undefined,\n };\n\n return (\n <BitkitField counterText={counterText} ref={ref} state={state} {...fieldProps}>\n <Group attached width=\"100%\">\n {startAddon != null && (\n <InputAddon position=\"start\" size={addonSize} {...stateAttrs} {...startAddonProps}>\n {startAddon}\n </InputAddon>\n )}\n <Box css={styles.field} {...stateAttrs}>\n {startElement != null && (\n <Box css={styles.element} {...stateAttrs}>\n {startElement}\n </Box>\n )}\n <Input css={styles.input} maxLength={maxLength} placeholder={placeholder} {...inputProps} unstyled />\n {statusIcon != null && (\n <Box css={styles.element} {...stateAttrs}>\n {statusIcon}\n </Box>\n )}\n {endElement != null && (\n <Box css={styles.element} {...stateAttrs}>\n {endElement}\n </Box>\n )}\n </Box>\n {endAddon != null && (\n <InputAddon position=\"end\" size={addonSize} {...stateAttrs} {...endAddonProps}>\n {endAddon}\n </InputAddon>\n )}\n </Group>\n </BitkitField>\n );\n});\n\nBitkitTextInput.displayName = 'BitkitTextInput';\n\nexport default BitkitTextInput;\n"],"mappings":";;;;;;;;;;;AAyBA,IAAM,kBAAkB,YAAkD,OAAO,QAAQ;CACvF,MAAM,EACJ,SACA,UACA,eACA,YACA,YACA,WACA,aACA,OAAO,MACP,YACA,iBACA,cACA,OACA,GAAG,eACD;CAGJ,MAAM,SADS,cAAc,EAAE,KA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AAC,YAAD;KAAY,UAAS;KAAM,MAAM;KAAW,GAAI;KAAY,GAAI;eAC7D;IACS,CAAA;GAET;;CACI,CAAA;AAEjB,CAAC;AAED,gBAAgB,cAAc"}
1
+ {"version":3,"file":"BitkitTextInput.js","names":[],"sources":["../../../lib/components/BitkitTextInput/BitkitTextInput.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { Group } from '@chakra-ui/react/group';\nimport { Input, type InputProps } from '@chakra-ui/react/input';\nimport { InputAddon, type InputAddonProps } from '@chakra-ui/react/input-addon';\nimport { useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { IconErrorCircleFilled, IconWarningYellow } from '../../icons';\nimport BitkitField, { type BitkitFieldProps } from '../BitkitField/BitkitField';\n\nexport interface BitkitTextInputProps extends Omit<BitkitFieldProps, 'children' | 'state'> {\n counter?: boolean;\n endAddon?: ReactNode;\n endAddonProps?: InputAddonProps;\n endElement?: ReactNode;\n inputProps?: InputProps;\n maxLength?: HTMLInputElement['maxLength'];\n placeholder?: string;\n size?: 'md' | 'lg';\n startAddon?: ReactNode;\n startAddonProps?: InputAddonProps;\n startElement?: ReactNode;\n state?: 'disabled' | 'error' | 'readOnly' | 'warning';\n}\n\nconst BitkitTextInput = forwardRef<HTMLDivElement, BitkitTextInputProps>((props, ref) => {\n const {\n counter,\n endAddon,\n endAddonProps,\n endElement,\n inputProps,\n maxLength,\n placeholder,\n size = 'lg',\n startAddon,\n startAddonProps,\n startElement,\n state,\n ...fieldProps\n } = props;\n\n const recipe = useSlotRecipe({ key: 'textInput' });\n const styles = recipe({ size });\n\n const iconSize = size === 'md' ? '16' : '24';\n const addonSize = size === 'md' ? 'md' : 'lg';\n\n const hasWarning = state === 'warning' || !!fieldProps.warningText;\n const isInvalid = state === 'error' || !!fieldProps.errorText;\n\n let statusIcon: ReactNode = null;\n if (isInvalid) {\n statusIcon = <IconErrorCircleFilled color=\"icon/negative\" size={iconSize} />;\n } else if (hasWarning) {\n statusIcon = <IconWarningYellow size={iconSize} />;\n }\n\n const counterText =\n counter && maxLength && inputProps?.value !== undefined\n ? `${inputProps.value.toString().length}/${maxLength}`\n : undefined;\n\n const stateAttrs = {\n 'data-disabled': state === 'disabled' ? '' : undefined,\n 'data-invalid': isInvalid ? '' : undefined,\n 'data-readonly': state === 'readOnly' ? '' : undefined,\n };\n\n return (\n <BitkitField counterText={counterText} ref={ref} state={state} {...fieldProps}>\n <Group attached width=\"100%\">\n {startAddon != null && (\n <InputAddon position=\"start\" size={addonSize} {...stateAttrs} {...startAddonProps}>\n {startAddon}\n </InputAddon>\n )}\n <Box css={styles.field} {...stateAttrs}>\n {startElement != null && (\n <Box css={styles.element} {...stateAttrs}>\n {startElement}\n </Box>\n )}\n <Input css={styles.input} maxLength={maxLength} placeholder={placeholder} {...inputProps} unstyled />\n {statusIcon != null && (\n <Box css={styles.element} {...stateAttrs}>\n {statusIcon}\n </Box>\n )}\n {endElement != null && (\n <Box css={styles.element} {...stateAttrs}>\n {endElement}\n </Box>\n )}\n </Box>\n {endAddon != null && (\n <InputAddon position=\"end\" size={addonSize} {...stateAttrs} {...endAddonProps}>\n {endAddon}\n </InputAddon>\n )}\n </Group>\n </BitkitField>\n );\n});\n\nBitkitTextInput.displayName = 'BitkitTextInput';\n\nexport default BitkitTextInput;\n"],"mappings":";;;;;;;;;;;AAyBA,IAAM,kBAAkB,YAAkD,OAAO,QAAQ;CACvF,MAAM,EACJ,SACA,UACA,eACA,YACA,YACA,WACA,aACA,OAAO,MACP,YACA,iBACA,cACA,OACA,GAAG,eACD;CAGJ,MAAM,SADS,cAAc,EAAE,KAAK,YAAY,CACjC,CAAA,CAAO,EAAE,KAAK,CAAC;CAE9B,MAAM,WAAW,SAAS,OAAO,OAAO;CACxC,MAAM,YAAY,SAAS,OAAO,OAAO;CAEzC,MAAM,aAAa,UAAU,aAAa,CAAC,CAAC,WAAW;CACvD,MAAM,YAAY,UAAU,WAAW,CAAC,CAA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itTreeView/BitkitTreeView.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext } from '@chakra-ui/react';\nimport { Box } from '@chakra-ui/react/box';\nimport { useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport {\n TreeView,\n type TreeViewBranchControlProps,\n type TreeViewItemProps,\n type TreeViewNodeRenderProps,\n type TreeViewRootProps,\n} from '@chakra-ui/react/tree-view';\nimport { cloneElement, forwardRef, type ReactElement, type ReactNode } from 'react';\n\nimport { type BitkitIconComponent, IconChevronRight, IconFolder, IconWarningYellow } from '../../icons';\nimport { withSubComponents } from '../../utilities/withSubComponents';\n\n// Re-export for consumer convenience\nexport { createTreeCollection } from '@chakra-ui/react/collection';\n\n// Re-export useful types\nexport type {\n TreeViewExpandedChangeDetails as BitkitTreeViewExpandedChangeDetails,\n TreeViewNodeRenderProps as BitkitTreeViewNodeRenderProps,\n TreeViewSelectionChangeDetails as BitkitTreeViewSelectionChangeDetails,\n} from '@chakra-ui/react/tree-view';\n\n// --- Variant context ---\n\nexport type BitkitTreeViewVariant = 'files' | 'navigation';\n\nconst [VariantProvider, useVariant] = createContext<{ variant: BitkitTreeViewVariant }>({\n name: 'BitkitTreeViewVariantContext',\n defaultValue: { variant: 'files' },\n});\n\nconst useCustomSlotStyles = (variant: BitkitTreeViewVariant) => {\n const recipe = useSlotRecipe({ key: 'treeView' });\n return recipe({ variant });\n};\n\n// --- Root ---\n\nexport interface BitkitTreeViewRootProps extends Omit<TreeViewRootProps, 'children'> {\n children?: ReactNode;\n render: (props: TreeViewNodeRenderProps) => ReactNode;\n variant?: BitkitTreeViewVariant;\n}\n\nconst Root = forwardRef<HTMLDivElement, BitkitTreeViewRootProps>(\n ({ children, render, variant = 'files', ...props }, ref) => {\n const indentGuide = variant === 'files' ? <TreeView.BranchIndentGuide /> : undefined;\n\n return (\n <VariantProvider value={{ variant }}>\n <TreeView.Root ref={ref} variant={variant} {...props}>\n <TreeView.Tree>\n <TreeView.Node indentGuide={indentGuide} render={render as never} />\n {children}\n </TreeView.Tree>\n </TreeView.Root>\n </VariantProvider>\n );\n },\n);\nRoot.displayName = 'BitkitTreeView';\n\n// --- Branch ---\n\nexport interface BitkitTreeViewBranchProps extends Omit<TreeViewBranchControlProps, 'children'> {\n actions?: ReactElement[];\n hasWarning?: boolean;\n label: string;\n subtext?: ReactNode;\n suffixIcon?: BitkitIconComponent;\n suffixText?: string;\n}\n\nconst Branch = forwardRef<HTMLDivElement, BitkitTreeViewBranchProps>((props, ref) => {\n const { actions, hasWarning, label, subtext, suffixIcon: SuffixIcon, suffixText, ...rest } = props;\n const { variant } = useVariant();\n const styles = useCustomSlotStyles(variant);\n const hasSuffix = hasWarning || SuffixIcon || suffixText;\n const hasActions = actions && actions.length > 0;\n\n const BranchIcon = variant === 'navigation' ? IconChevronRight : IconFolder;\n\n return (\n <TreeView.BranchControl ref={ref} className={hasActions ? 'group' : undefined} {...rest}>\n <TreeView.BranchIndicator>\n <BranchIcon size=\"16\" />\n </TreeView.BranchIndicator>\n <TreeView.BranchText>\n {label}\n {subtext && <Text css={styles.secondaryText}>{subtext}</Text>}\n </TreeView.BranchText>\n {hasSuffix && (\n <Box css={styles.suffixGroup}>\n {hasWarning && <IconWarningYellow size=\"16\" />}\n {SuffixIcon && <SuffixIcon size=\"16\" />}\n {suffixText && <span>{suffixText}</span>}\n </Box>\n )}\n {hasActions && (\n <Box css={styles.actionGroup}>{actions.map((action) => cloneElement(action, { size: 'xs' }))}</Box>\n )}\n </TreeView.BranchControl>\n );\n});\nBranch.displayName = 'BitkitTreeView.Branch';\n\n// --- Leaf ---\n\nexport interface BitkitTreeViewLeafProps extends Omit<TreeViewItemProps, 'children'> {\n actions?: ReactElement[];\n badge?: ReactElement;\n hasWarning?: boolean;\n icon?: BitkitIconComponent;\n label: string;\n subtext?: ReactNode;\n suffixIcon?: BitkitIconComponent;\n suffixText?: string;\n}\n\nconst Leaf = forwardRef<HTMLDivElement, BitkitTreeViewLeafProps>((props, ref) => {\n const { actions, badge, hasWarning, icon: Icon, label, subtext, suffixIcon: SuffixIcon, suffixText, ...rest } = props;\n const { variant } = useVariant();\n const styles = useCustomSlotStyles(variant);\n const hasSuffix = hasWarning || SuffixIcon || suffixText;\n const hasActions = actions && actions.length > 0;\n\n return (\n <TreeView.Item ref={ref} className={hasActions ? 'group' : undefined} {...rest}>\n {Icon && <Icon size=\"16\" />}\n {badge && cloneElement(badge, { size: 'xxs' })}\n <TreeView.ItemText>\n {label}\n {subtext && <Text css={styles.secondaryText}>{subtext}</Text>}\n </TreeView.ItemText>\n {hasSuffix && (\n <Box css={styles.suffixGroup}>\n {hasWarning && <IconWarningYellow size=\"16\" />}\n {SuffixIcon && <SuffixIcon size=\"16\" />}\n {suffixText && <span>{suffixText}</span>}\n </Box>\n )}\n {hasActions && (\n <Box css={styles.actionGroup}>{actions.map((action) => cloneElement(action, { size: 'xs' }))}</Box>\n )}\n </TreeView.Item>\n );\n});\nLeaf.displayName = 'BitkitTreeView.Leaf';\n\n// --- Main export ---\n\nconst BitkitTreeView = withSubComponents(Root, {\n Branch,\n Leaf,\n});\n\nexport default BitkitTreeView;\n"],"mappings":";;;;;;;;;;;;;AA+BA,IAAM,CAAC,iBAAiB,cAAc,gBAAkD;CACtF,MAAM;CACN,cAAc,EAAE,SAAS,QAAQ;AACnC,CAAC;AAED,IAAM,uBAAuB,YAAmC;CAE9D,OADe,cAAc,EAAE,KAAK,WAAW,CACxC,EAAO,EAAE,QAAQ,CAAC;AAC3B;AAUA,IAAM,OAAO,YACV,EAAE,UAAU,QAAQ,UAAU,SAAS,GAAG,SAAS,QAAQ;CAC1D,MAAM,cAAc,YAAY,UAAU,oBAAC,SAAS,mBAAV,CAA6B,CAAA,IAAI,KAAA;CAE3E,OACE,oBAAC,iBAAD;EAAiB,OAAO,EAAE,QAAQ;YAChC,oBAAC,SAAS,MAAV;GAAoB;GAAc;GAAS,GAAI;aAC7C,qBAAC,SAAS,MAAV,EAA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AY,WAAW;CAC/B,MAAM,SAAS,oBAAoB,OAAO;CAC1C,MAAM,YAAY,cAAc,cAAc;CAC9C,MAAM,aAAa,WAAW,QAAQ,SAAS;CAE/C,OACE,qBAAC,SAAS,MAAV;EAAoB;EAAK,WAAW,aAAa,UAAU,KAAA;EAAW,GAAI;YAA1E;GACG,QAAQ,oBAAC,MAAD,EAAM,MAAK,KAAM,CAAA;GACzB,SAAS,aAAa,OAAO,EAAE,MAAM,MAAM,CAAC;GAC7C,qBAAC,SAAS,UAAV,EAAA,UAAA,CACG,OACA,WAAW,oBAAC,MAAD;IAAM,KAAK,OAAO;cAAgB;GAAc,CAAA,CAC3C,EAAA,CAAA;GAClB,aACC,qBAAC,KAAD;IAAK,KAAK,OAAO;cAAjB;KACG,cAAc,oBAAC,mBAAD,EAAmB,MAAK,KAAM,CAAA;KAC5C,cAAc,oBAAC,YAAD,EAAY,MAAK,KAAM,CAAA;KACrC,cAAc,oBAAC,QAAD,EAAA,UAAO,WAAiB,CAAA;IACpC;;GAEN,cACC,oBAAC,KAAD;IAAK,KAAK,OAAO;cAAc,QAAQ,KAAK,WAAW,aAAa,QAAQ,EAAE,MAAM,KAAK,CAAC,CAAC;GAAO,CAAA;EAEvF;;AAEnB,CAAC;AACD,KAAK,cAAc;AAInB,IAAM,iBAAiB,kBAAkB,MAAM;CAC7C;CACA;AACF,CAAC"}
1
+ {"version":3,"file":"BitkitTreeView.js","names":[],"sources":["../../../lib/components/BitkitTreeView/BitkitTreeView.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext } from '@chakra-ui/react';\nimport { Box } from '@chakra-ui/react/box';\nimport { useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport {\n TreeView,\n type TreeViewBranchControlProps,\n type TreeViewItemProps,\n type TreeViewNodeRenderProps,\n type TreeViewRootProps,\n} from '@chakra-ui/react/tree-view';\nimport { cloneElement, forwardRef, type ReactElement, type ReactNode } from 'react';\n\nimport { type BitkitIconComponent, IconChevronRight, IconFolder, IconWarningYellow } from '../../icons';\nimport { withSubComponents } from '../../utilities/withSubComponents';\n\n// Re-export for consumer convenience\nexport { createTreeCollection } from '@chakra-ui/react/collection';\n\n// Re-export useful types\nexport type {\n TreeViewExpandedChangeDetails as BitkitTreeViewExpandedChangeDetails,\n TreeViewNodeRenderProps as BitkitTreeViewNodeRenderProps,\n TreeViewSelectionChangeDetails as BitkitTreeViewSelectionChangeDetails,\n} from '@chakra-ui/react/tree-view';\n\n// --- Variant context ---\n\nexport type BitkitTreeViewVariant = 'files' | 'navigation';\n\nconst [VariantProvider, useVariant] = createContext<{ variant: BitkitTreeViewVariant }>({\n name: 'BitkitTreeViewVariantContext',\n defaultValue: { variant: 'files' },\n});\n\nconst useCustomSlotStyles = (variant: BitkitTreeViewVariant) => {\n const recipe = useSlotRecipe({ key: 'treeView' });\n return recipe({ variant });\n};\n\n// --- Root ---\n\nexport interface BitkitTreeViewRootProps extends Omit<TreeViewRootProps, 'children'> {\n children?: ReactNode;\n render: (props: TreeViewNodeRenderProps) => ReactNode;\n variant?: BitkitTreeViewVariant;\n}\n\nconst Root = forwardRef<HTMLDivElement, BitkitTreeViewRootProps>(\n ({ children, render, variant = 'files', ...props }, ref) => {\n const indentGuide = variant === 'files' ? <TreeView.BranchIndentGuide /> : undefined;\n\n return (\n <VariantProvider value={{ variant }}>\n <TreeView.Root ref={ref} variant={variant} {...props}>\n <TreeView.Tree>\n <TreeView.Node indentGuide={indentGuide} render={render as never} />\n {children}\n </TreeView.Tree>\n </TreeView.Root>\n </VariantProvider>\n );\n },\n);\nRoot.displayName = 'BitkitTreeView';\n\n// --- Branch ---\n\nexport interface BitkitTreeViewBranchProps extends Omit<TreeViewBranchControlProps, 'children'> {\n actions?: ReactElement[];\n hasWarning?: boolean;\n label: string;\n subtext?: ReactNode;\n suffixIcon?: BitkitIconComponent;\n suffixText?: string;\n}\n\nconst Branch = forwardRef<HTMLDivElement, BitkitTreeViewBranchProps>((props, ref) => {\n const { actions, hasWarning, label, subtext, suffixIcon: SuffixIcon, suffixText, ...rest } = props;\n const { variant } = useVariant();\n const styles = useCustomSlotStyles(variant);\n const hasSuffix = hasWarning || SuffixIcon || suffixText;\n const hasActions = actions && actions.length > 0;\n\n const BranchIcon = variant === 'navigation' ? IconChevronRight : IconFolder;\n\n return (\n <TreeView.BranchControl ref={ref} className={hasActions ? 'group' : undefined} {...rest}>\n <TreeView.BranchIndicator>\n <BranchIcon size=\"16\" />\n </TreeView.BranchIndicator>\n <TreeView.BranchText>\n {label}\n {subtext && <Text css={styles.secondaryText}>{subtext}</Text>}\n </TreeView.BranchText>\n {hasSuffix && (\n <Box css={styles.suffixGroup}>\n {hasWarning && <IconWarningYellow size=\"16\" />}\n {SuffixIcon && <SuffixIcon size=\"16\" />}\n {suffixText && <span>{suffixText}</span>}\n </Box>\n )}\n {hasActions && (\n <Box css={styles.actionGroup}>{actions.map((action) => cloneElement(action, { size: 'xs' }))}</Box>\n )}\n </TreeView.BranchControl>\n );\n});\nBranch.displayName = 'BitkitTreeView.Branch';\n\n// --- Leaf ---\n\nexport interface BitkitTreeViewLeafProps extends Omit<TreeViewItemProps, 'children'> {\n actions?: ReactElement[];\n badge?: ReactElement;\n hasWarning?: boolean;\n icon?: BitkitIconComponent;\n label: string;\n subtext?: ReactNode;\n suffixIcon?: BitkitIconComponent;\n suffixText?: string;\n}\n\nconst Leaf = forwardRef<HTMLDivElement, BitkitTreeViewLeafProps>((props, ref) => {\n const { actions, badge, hasWarning, icon: Icon, label, subtext, suffixIcon: SuffixIcon, suffixText, ...rest } = props;\n const { variant } = useVariant();\n const styles = useCustomSlotStyles(variant);\n const hasSuffix = hasWarning || SuffixIcon || suffixText;\n const hasActions = actions && actions.length > 0;\n\n return (\n <TreeView.Item ref={ref} className={hasActions ? 'group' : undefined} {...rest}>\n {Icon && <Icon size=\"16\" />}\n {badge && cloneElement(badge, { size: 'xxs' })}\n <TreeView.ItemText>\n {label}\n {subtext && <Text css={styles.secondaryText}>{subtext}</Text>}\n </TreeView.ItemText>\n {hasSuffix && (\n <Box css={styles.suffixGroup}>\n {hasWarning && <IconWarningYellow size=\"16\" />}\n {SuffixIcon && <SuffixIcon size=\"16\" />}\n {suffixText && <span>{suffixText}</span>}\n </Box>\n )}\n {hasActions && (\n <Box css={styles.actionGroup}>{actions.map((action) => cloneElement(action, { size: 'xs' }))}</Box>\n )}\n </TreeView.Item>\n );\n});\nLeaf.displayName = 'BitkitTreeView.Leaf';\n\n// --- Main export ---\n\nconst BitkitTreeView = withSubComponents(Root, {\n Branch,\n Leaf,\n});\n\nexport default BitkitTreeView;\n"],"mappings":";;;;;;;;;;;;;AA+BA,IAAM,CAAC,iBAAiB,cAAc,gBAAkD;CACtF,MAAM;CACN,cAAc,EAAE,SAAS,QAAQ;AACnC,CAAC;AAED,IAAM,uBAAuB,YAAmC;CAE9D,OADe,cAAc,EAAE,KAAK,WAAW,CACxC,CAAA,CAAO,EAAE,QAAQ,CAAC;AAC3B;AAUA,IAAM,OAAO,YACV,EAAE,UAAU,QAAQ,UAAU,SAAS,GAAG,SAAS,QAAQ;CAC1D,MAAM,cAAc,YAAY,UAAU,oBAAC,SAAS,mBAAV,CAA6B,CAAA,IAAI,KAAA;CAE3E,OACE,oBAAC,iBAAD;EAAiB,OAAO,EAAE,QAAQ;YAChC,oBAAC,SAAS,MAAV;GAAoB;GAAc;GAAS,GAAI;aAC7C,qBAAC,SAAS,MAAV,EAAA,UAAA,CACE,oBAAC,SAAS,MAAV;IAA4B;IAAqB;GAAkB,CAAA,GAClE,QACY,EAAA,CAAA;EACF,CAAA;CACA,CAAA;AAErB,CACF;AACA,KAAK,cAAc;AAanB,IAAM,SAAS,YAAuD,OAAO,QAAQ;CACnF,MAAM,EAAE,SAAS,YAAY,OAAO,SAAS,YAAY,YAAY,YAAY,GAAG,SAAS;CAC7F,MAAM,EAAE,YAAY,WAAW;CAC/B,MAAM,SAAS,oBAAoB,OAAO;CAC1C,MAAM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AAV,EAAA,UAAA,CACG,OACA,WAAW,oBAAC,MAAD;IAAM,KAAK,OAAO;cAAgB;GAAc,CAAA,CAC3C,EAAA,CAAA;GAClB,aACC,qBAAC,KAAD;IAAK,KAAK,OAAO;cAAjB;KACG,cAAc,oBAAC,mBAAD,EAAmB,MAAK,KAAM,CAAA;KAC5C,cAAc,oBAAC,YAAD,EAAY,MAAK,KAAM,CAAA;KACrC,cAAc,oBAAC,QAAD,EAAA,UAAO,WAAiB,CAAA;IACpC;;GAEN,cACC,oBAAC,KAAD;IAAK,KAAK,OAAO;cAAc,QAAQ,KAAK,WAAW,aAAa,QAAQ,EAAE,MAAM,KAAK,CAAC,CAAC;GAAO,CAAA;EAEvF;;AAEnB,CAAC;AACD,KAAK,cAAc;AAInB,IAAM,iBAAiB,kBAAkB,MAAM;CAC7C;CACA;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.recipe.js","names":[],"sources":["../../../lib/theme/recipes/Button.recipe.ts"],"sourcesContent":["import { defineRecipe, type SystemStyleObject } from '@chakra-ui/react/styled-system';\n\nimport { rem } from '../themeUtils';\n\n// `as const` is load-bearing: without it `(typeof buttonVariants)[number]` widens to `string`,\n// which collapses the recipe's `variant` prop type to `string` — losing TS autocomplete/checking\n// and leaving Storybook/docgen (and the bitkit-storybook MCP) unable to enumerate the variants.\nconst buttonVariants = [\n 'primary',\n 'secondary',\n 'tertiary',\n 'danger-primary',\n 'danger-secondary',\n 'danger-tertiary',\n 'ai-primary',\n 'ai-secondary',\n 'ai-tertiary',\n] as const;\n\nexport type Variant = (typeof buttonVariants)[number];\n\nconst variantStyles = buttonVariants.reduce(\n (obj, variant) => {\n let borderColor = variant?.includes('secondary') ? `button/${variant}/border` : `button/${variant}/bg`;\n let disabledBorderColor = variant?.includes('secondary')\n ? `button/${variant}/border-disabled`\n : `button/${variant}/bg-disabled`;\n if (variant?.includes('tertiary')) {\n borderColor = 'transparent';\n disabledBorderColor = 'transparent';\n }\n const isSecondary = variant === 'secondary';\n const activeStyles: SystemStyleObject = {\n backgroundColor: `button/${variant}/bg-active`,\n borderColor: variant?.includes('secondary') ? `button/${variant}/border-active` : `button/${variant}/bg-active`,\n color: isSecondary ? 'button/secondary/text-active' : `button/${variant}/fg-active`,\n _icon: {\n color: isSecondary ? 'button/secondary/icon-active' : undefined,\n },\n };\n obj[variant as NonNullable<Variant>] = {\n // `_hover`/`_active` (not raw `&:hover`/`&:active`) compile to `:not(:disabled, [data-disabled])`,\n // so they never match a disabled button — the `_disabled` styles win naturally, no `!important` needed.\n _hover: {\n backgroundColor: `button/${variant}/bg-hover`,\n borderColor: variant?.includes('secondary') ? `button/${variant}/border-hover` : `button/${variant}/bg-hover`,\n color: isSecondary ? 'button/secondary/text-hover' : `button/${variant}/fg-hover`,\n _icon: {\n color: isSecondary ? 'button/secondary/icon-hover' : undefined,\n },\n // Repeat active under hover so clicking-while-hovering keeps active styles (see CLAUDE.md).\n _active: activeStyles,\n },\n _active: activeStyles,\n _disabled: {\n backgroundColor: `button/${variant}/bg-disabled`,\n borderColor: disabledBorderColor,\n color: isSecondary ? 'button/secondary/text-disabled' : `button/${variant}/fg-disabled`,\n cursor: 'not-allowed',\n _icon: {\n color: isSecondary ? 'button/secondary/icon-disabled' : undefined,\n },\n },\n _icon: {\n color: isSecondary ? 'button/secondary/icon' : undefined,\n },\n backgroundColor: `button/${variant}/bg`,\n borderColor,\n borderStyle: 'solid',\n borderWidth: '1',\n color: isSecondary ? 'button/secondary/text' : `button/${variant}/fg`,\n };\n return obj;\n },\n {} as Record<NonNullable<Variant>, SystemStyleObject>,\n);\n\nconst buttonRecipe = defineRecipe({\n className: 'button',\n base: {\n borderRadius: '4',\n cursor: 'pointer',\n fontWeight: 600,\n border: '1px solid transparent',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: '8',\n position: 'relative',\n '--spinner-color': 'currentColor',\n '--spinner-size': 'sizes.16',\n _disabled: {\n cursor: 'not-allowed',\n },\n },\n variants: {\n variant: variantStyles,\n size: {\n sm: {\n minWidth: '32',\n height: '32',\n paddingInline: rem(11),\n paddingBlock: rem(5),\n textStyle: 'comp/button/sm',\n },\n md: {\n minWidth: '40',\n height: '40',\n paddingInline: rem(15),\n paddingBlock: rem(7),\n textStyle: 'comp/button/md',\n },\n lg: {\n minWidth: '48',\n height: '48',\n padding: rem(15),\n textStyle: 'comp/button/lg',\n },\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'lg',\n },\n});\n\nexport default buttonRecipe;\n"],"mappings":";;;AA6EA,IAAM,eAAe,aAAa;CAChC,WAAW;CACX,MAAM;EACJ,cAAc;EACd,QAAQ;EACR,YAAY;EACZ,QAAQ;EACR,SAAS;EACT,YAAY;EACZ,gBAAgB;EAChB,KAAK;EACL,UAAU;EACV,mBAAmB;EACnB,kBAAkB;EAClB,WAAW,EACT,QAAQ,cACV;CACF;CACA,UAAU;EACR,SA3EkB;GAbpB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EAKoB,EAAe,QAClC,KAAK,YAAY;GAChB,IAAI,cAAc,SAAS,SAAS,WAAW,IAAI,UAAU,QAAQ,WAAW,UAAU,QAAQ;GAClG,IAAI,sBAAsB,SAAS,SAAS,WAAW,IACnD,UAAU,QAAQ,oBAClB,UAAU,QAAQ;GACtB,IAAI,SAAS,SAAS,UAAU,GAAG;IACjC,cAAc;IACd,sBAAsB;GACxB;GACA,MAAM,cAAc,YAAY;GAChC,MAAM,eAAkC;IACtC,iBAAiB,UAAU,QAAQ;IACnC,aAAa,SAAS,SAAS,WAAW,IAAI,UAAU,QAAQ,kBAAkB,UAAU,QAAQ;IACpG,OAAO,cAAc,iCAAiC,UAAU,QAAQ;IACxE,OAAO,EACL,OAAO,cAAc,iCAAiC,KAAA,EACxD;GACF;GACA,IAAI,WAAmC;IAGrC,QAAQ;KACN,iBAAiB,UAAU,QAAQ;KACnC,aAAa,SAAS,SAAS,WAAW,IAAI,UAAU,QAAQ,iBAAiB,UAAU,QAAQ;KACnG,OAAO,cAAc,gCAAgC,UAAU,QAAQ;KACvE,OAAO,EACL,OAAO,cAAc,gCAAgC,KAAA,EACvD;KAEA,SAAS;IACX;IACA,SAAS;IACT,WAAW;KACT,iBAAiB,UAAU,QAAQ;KACnC,aAAa;KACb,OAAO,cAAc,mCAAmC,UAAU,QAAQ;KAC1E,QAAQ;KACR,OAAO,EACL,OAAO,cAAc,mCAAmC,KAAA,EAC1D;IACF;IACA,OAAO,EACL,OAAO,cAAc,0BAA0B,KAAA,EACjD;IACA,iBAAiB,UAAU,QAAQ;IACnC;IACA,aAAa;IACb,aAAa;IACb,OAAO,cAAc,0BAA0B,UAAU,QAAQ;GACnE;GACA,OAAO;EACT,GACA,CAAC,CAsBU;EACT,MAAM;GACJ,IAAI;IACF,UAAU;IACV,QAAQ;IACR,eAAe,IAAI,EAAE;IACrB,cAAc,IAAI,CAAC;IACnB,WAAW;GACb;GACA,IAAI;IACF,UAAU;IACV,QAAQ;IACR,eAAe,IAAI,EAAE;IACrB,cAAc,IAAI,CAAC;IACnB,WAAW;GACb;GACA,IAAI;IACF,UAAU;IACV,QAAQ;IACR,SAAS,IAAI,EAAE;IACf,WAAW;GACb;EACF;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CAAC"}
1
+ {"version":3,"file":"Button.recipe.js","names":[],"sources":["../../../lib/theme/recipes/Button.recipe.ts"],"sourcesContent":["import { defineRecipe, type SystemStyleObject } from '@chakra-ui/react/styled-system';\n\nimport { rem } from '../themeUtils';\n\n// `as const` is load-bearing: without it `(typeof buttonVariants)[number]` widens to `string`,\n// which collapses the recipe's `variant` prop type to `string` — losing TS autocomplete/checking\n// and leaving Storybook/docgen (and the bitkit-storybook MCP) unable to enumerate the variants.\nconst buttonVariants = [\n 'primary',\n 'secondary',\n 'tertiary',\n 'danger-primary',\n 'danger-secondary',\n 'danger-tertiary',\n 'ai-primary',\n 'ai-secondary',\n 'ai-tertiary',\n] as const;\n\nexport type Variant = (typeof buttonVariants)[number];\n\nconst variantStyles = buttonVariants.reduce(\n (obj, variant) => {\n let borderColor = variant?.includes('secondary') ? `button/${variant}/border` : `button/${variant}/bg`;\n let disabledBorderColor = variant?.includes('secondary')\n ? `button/${variant}/border-disabled`\n : `button/${variant}/bg-disabled`;\n if (variant?.includes('tertiary')) {\n borderColor = 'transparent';\n disabledBorderColor = 'transparent';\n }\n const isSecondary = variant === 'secondary';\n const activeStyles: SystemStyleObject = {\n backgroundColor: `button/${variant}/bg-active`,\n borderColor: variant?.includes('secondary') ? `button/${variant}/border-active` : `button/${variant}/bg-active`,\n color: isSecondary ? 'button/secondary/text-active' : `button/${variant}/fg-active`,\n _icon: {\n color: isSecondary ? 'button/secondary/icon-active' : undefined,\n },\n };\n obj[variant as NonNullable<Variant>] = {\n // `_hover`/`_active` (not raw `&:hover`/`&:active`) compile to `:not(:disabled, [data-disabled])`,\n // so they never match a disabled button — the `_disabled` styles win naturally, no `!important` needed.\n _hover: {\n backgroundColor: `button/${variant}/bg-hover`,\n borderColor: variant?.includes('secondary') ? `button/${variant}/border-hover` : `button/${variant}/bg-hover`,\n color: isSecondary ? 'button/secondary/text-hover' : `button/${variant}/fg-hover`,\n _icon: {\n color: isSecondary ? 'button/secondary/icon-hover' : undefined,\n },\n // Repeat active under hover so clicking-while-hovering keeps active styles (see CLAUDE.md).\n _active: activeStyles,\n },\n _active: activeStyles,\n _disabled: {\n backgroundColor: `button/${variant}/bg-disabled`,\n borderColor: disabledBorderColor,\n color: isSecondary ? 'button/secondary/text-disabled' : `button/${variant}/fg-disabled`,\n cursor: 'not-allowed',\n _icon: {\n color: isSecondary ? 'button/secondary/icon-disabled' : undefined,\n },\n },\n _icon: {\n color: isSecondary ? 'button/secondary/icon' : undefined,\n },\n backgroundColor: `button/${variant}/bg`,\n borderColor,\n borderStyle: 'solid',\n borderWidth: '1',\n color: isSecondary ? 'button/secondary/text' : `button/${variant}/fg`,\n };\n return obj;\n },\n {} as Record<NonNullable<Variant>, SystemStyleObject>,\n);\n\nconst buttonRecipe = defineRecipe({\n className: 'button',\n base: {\n borderRadius: '4',\n cursor: 'pointer',\n fontWeight: 600,\n border: '1px solid transparent',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: '8',\n position: 'relative',\n '--spinner-color': 'currentColor',\n '--spinner-size': 'sizes.16',\n _disabled: {\n cursor: 'not-allowed',\n },\n },\n variants: {\n variant: variantStyles,\n size: {\n sm: {\n minWidth: '32',\n height: '32',\n paddingInline: rem(11),\n paddingBlock: rem(5),\n textStyle: 'comp/button/sm',\n },\n md: {\n minWidth: '40',\n height: '40',\n paddingInline: rem(15),\n paddingBlock: rem(7),\n textStyle: 'comp/button/md',\n },\n lg: {\n minWidth: '48',\n height: '48',\n padding: rem(15),\n textStyle: 'comp/button/lg',\n },\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'lg',\n },\n});\n\nexport default buttonRecipe;\n"],"mappings":";;;AA6EA,IAAM,eAAe,aAAa;CAChC,WAAW;CACX,MAAM;EACJ,cAAc;EACd,QAAQ;EACR,YAAY;EACZ,QAAQ;EACR,SAAS;EACT,YAAY;EACZ,gBAAgB;EAChB,KAAK;EACL,UAAU;EACV,mBAAmB;EACnB,kBAAkB;EAClB,WAAW,EACT,QAAQ,cACV;CACF;CACA,UAAU;EACR,SA3EkB;GAbpB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EAKoB,CAAA,CAAe,QAClC,KAAK,YAAY;GAChB,IAAI,cAAc,SAAS,SAAS,WAAW,IAAI,UAAU,QAAQ,WAAW,UAAU,QAAQ;GAClG,IAAI,sBAAsB,SAAS,SAAS,WAAW,IACnD,UAAU,QAAQ,oBAClB,UAAU,QAAQ;GACtB,IAAI,SAAS,SAAS,UAAU,GAAG;IACjC,cAAc;IACd,sBAAsB;GACxB;GACA,MAAM,cAAc,YAAY;GAChC,MAAM,eAAkC;IACtC,iBAAiB,UAAU,QAAQ;IACnC,aAAa,SAAS,SAAS,WAAW,IAAI,UAAU,QAAQ,kBAAkB,UAAU,QAAQ;IACpG,OAAO,cAAc,iCAAiC,UAAU,QAAQ;IACxE,OAAO,EACL,OAAO,cAAc,iCAAiC,KAAA,EACxD;GACF;GACA,IAAI,WAAmC;IAGrC,QAAQ;KACN,iBAAiB,UAAU,QAAQ;KACnC,aAAa,SAAS,SAAS,WAAW,IAAI,UAAU,QAAQ,iBAAiB,UAAU,QAAQ;KACnG,OAAO,cAAc,gCAAgC,UAAU,QAAQ;KACvE,OAAO,EACL,OAAO,cAAc,gCAAgC,KAAA,EACvD;KAEA,SAAS;IACX;IACA,SAAS;IACT,WAAW;KACT,iBAAiB,UAAU,QAAQ;KACnC,aAAa;KACb,OAAO,cAAc,mCAAmC,UAAU,QAAQ;KAC1E,QAAQ;KACR,OAAO,EACL,OAAO,cAAc,mCAAmC,KAAA,EAC1D;IACF;IACA,OAAO,EACL,OAAO,cAAc,0BAA0B,KAAA,EACjD;IACA,iBAAiB,UAAU,QAAQ;IACnC;IACA,aAAa;IACb,aAAa;IACb,OAAO,cAAc,0BAA0B,UAAU,QAAQ;GACnE;GACA,OAAO;EACT,GACA,CAAC,CAsBU;EACT,MAAM;GACJ,IAAI;IACF,UAAU;IACV,QAAQ;IACR,eAAe,IAAI,EAAE;IACrB,cAAc,IAAI,CAAC;IACnB,WAAW;GACb;GACA,IAAI;IACF,UAAU;IACV,QAAQ;IACR,eAAe,IAAI,EAAE;IACrB,cAAc,IAAI,CAAC;IACnB,WAAW;GACb;GACA,IAAI;IACF,UAAU;IACV,QAAQ;IACR,SAAS,IAAI,EAAE;IACf,WAAW;GACb;EACF;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CAAC"}
@@ -1,4 +1,4 @@
1
- declare const expandableCardSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"header" | "title" | "icon" | "suffix" | "collapsible" | "root" | "secdText" | "description", {
1
+ declare const expandableCardSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"header" | "title" | "icon" | "suffix" | "collapsible" | "root" | "description" | "subtitle", {
2
2
  size: {
3
3
  md: {
4
4
  header: {
@@ -6,7 +6,7 @@ declare const expandableCardSlotRecipe: import('@chakra-ui/react').SlotRecipeDef
6
6
  paddingX: "16";
7
7
  paddingY: "12";
8
8
  };
9
- secdText: {
9
+ subtitle: {
10
10
  textStyle: "body/sm/regular";
11
11
  };
12
12
  };
@@ -15,7 +15,7 @@ declare const expandableCardSlotRecipe: import('@chakra-ui/react').SlotRecipeDef
15
15
  textStyle: "body/lg/regular";
16
16
  padding: "16";
17
17
  };
18
- secdText: {
18
+ subtitle: {
19
19
  textStyle: "body/md/regular";
20
20
  };
21
21
  };
@@ -7,7 +7,7 @@ var expandableCardSlotRecipe = defineSlotRecipe({
7
7
  ...cardAnatomy.omit("body", "footer").keys(),
8
8
  "collapsible",
9
9
  "icon",
10
- "secdText",
10
+ "subtitle",
11
11
  "suffix"
12
12
  ],
13
13
  base: {
@@ -39,7 +39,7 @@ var expandableCardSlotRecipe = defineSlotRecipe({
39
39
  }
40
40
  },
41
41
  icon: { color: "icon/secondary" },
42
- secdText: { color: "text/secondary" },
42
+ subtitle: { color: "text/secondary" },
43
43
  suffix: {
44
44
  color: "text/secondary",
45
45
  mx: "16",
@@ -53,14 +53,14 @@ var expandableCardSlotRecipe = defineSlotRecipe({
53
53
  paddingX: "16",
54
54
  paddingY: "12"
55
55
  },
56
- secdText: { textStyle: "body/sm/regular" }
56
+ subtitle: { textStyle: "body/sm/regular" }
57
57
  },
58
58
  lg: {
59
59
  header: {
60
60
  textStyle: "body/lg/regular",
61
61
  padding: "16"
62
62
  },
63
- secdText: { textStyle: "body/md/regular" }
63
+ subtitle: { textStyle: "body/md/regular" }
64
64
  }
65
65
  } },
66
66
  defaultVariants: { size: "lg" }
@@ -1 +1 @@
1
- {"version":3,"file":"ExpandableCard.recipe.js","names":[],"sources":["../../../lib/theme/slot-recipes/ExpandableCard.recipe.ts"],"sourcesContent":["import { cardAnatomy } from '@chakra-ui/react/anatomy';\nimport { defineSlotRecipe } from '@chakra-ui/react/styled-system';\n\nconst expandableCardSlotRecipe = defineSlotRecipe({\n className: 'expandable-card',\n slots: [...cardAnatomy.omit('body', 'footer').keys(), 'collapsible', 'icon', 'secdText', 'suffix'],\n base: {\n root: {\n backgroundColor: 'background/primary',\n overflow: 'hidden',\n },\n header: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n cursor: 'pointer',\n width: '100%',\n color: 'text/primary',\n '&:active': {\n backgroundColor: 'background/active',\n },\n '&:hover:not(:active)': {\n backgroundColor: 'background/hover',\n },\n _hover: {\n color: 'text/primary',\n },\n _open: {\n backgroundColor: 'background/secondary',\n },\n },\n collapsible: {\n overflow: 'hidden',\n _open: {\n animationName: 'expand-height, fade-in',\n animationDuration: 'moderate',\n },\n _closed: {\n animationName: 'collapse-height, fade-out',\n animationDuration: 'moderate',\n },\n },\n icon: {\n color: 'icon/secondary',\n },\n secdText: {\n color: 'text/secondary',\n },\n suffix: {\n color: 'text/secondary',\n mx: '16',\n textStyle: 'body/md/regular',\n },\n },\n variants: {\n size: {\n md: {\n header: { textStyle: 'body/md/regular', paddingX: '16', paddingY: '12' },\n secdText: { textStyle: 'body/sm/regular' },\n },\n lg: {\n header: { textStyle: 'body/lg/regular', padding: '16' },\n secdText: { textStyle: 'body/md/regular' },\n },\n },\n },\n defaultVariants: {\n size: 'lg',\n },\n});\n\nexport default expandableCardSlotRecipe;\n"],"mappings":";;;AAGA,IAAM,2BAA2B,iBAAiB;CAChD,WAAW;CACX,OAAO;EAAC,GAAG,YAAY,KAAK,QAAQ,QAAQ,EAAE,KAAK;EAAG;EAAe;EAAQ;EAAY;CAAQ;CACjG,MAAM;EACJ,MAAM;GACJ,iBAAiB;GACjB,UAAU;EACZ;EACA,QAAQ;GACN,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,QAAQ;GACR,OAAO;GACP,OAAO;GACP,YAAY,EACV,iBAAiB,oBACnB;GACA,wBAAwB,EACtB,iBAAiB,mBACnB;GACA,QAAQ,EACN,OAAO,eACT;GACA,OAAO,EACL,iBAAiB,uBACnB;EACF;EACA,aAAa;GACX,UAAU;GACV,OAAO;IACL,eAAe;IACf,mBAAmB;GACrB;GACA,SAAS;IACP,eAAe;IACf,mBAAmB;GACrB;EACF;EACA,MAAM,EACJ,OAAO,iBACT;EACA,UAAU,EACR,OAAO,iBACT;EACA,QAAQ;GACN,OAAO;GACP,IAAI;GACJ,WAAW;EACb;CACF;CACA,UAAU,EACR,MAAM;EACJ,IAAI;GACF,QAAQ;IAAE,WAAW;IAAmB,UAAU;IAAM,UAAU;GAAK;GACvE,UAAU,EAAE,WAAW,kBAAkB;EAC3C;EACA,IAAI;GACF,QAAQ;IAAE,WAAW;IAAmB,SAAS;GAAK;GACtD,UAAU,EAAE,WAAW,kBAAkB;EAC3C;CACF,EACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CAAC"}
1
+ {"version":3,"file":"ExpandableCard.recipe.js","names":[],"sources":["../../../lib/theme/slot-recipes/ExpandableCard.recipe.ts"],"sourcesContent":["import { cardAnatomy } from '@chakra-ui/react/anatomy';\nimport { defineSlotRecipe } from '@chakra-ui/react/styled-system';\n\nconst expandableCardSlotRecipe = defineSlotRecipe({\n className: 'expandable-card',\n slots: [...cardAnatomy.omit('body', 'footer').keys(), 'collapsible', 'icon', 'subtitle', 'suffix'],\n base: {\n root: {\n backgroundColor: 'background/primary',\n overflow: 'hidden',\n },\n header: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n cursor: 'pointer',\n width: '100%',\n color: 'text/primary',\n '&:active': {\n backgroundColor: 'background/active',\n },\n '&:hover:not(:active)': {\n backgroundColor: 'background/hover',\n },\n _hover: {\n color: 'text/primary',\n },\n _open: {\n backgroundColor: 'background/secondary',\n },\n },\n collapsible: {\n overflow: 'hidden',\n _open: {\n animationName: 'expand-height, fade-in',\n animationDuration: 'moderate',\n },\n _closed: {\n animationName: 'collapse-height, fade-out',\n animationDuration: 'moderate',\n },\n },\n icon: {\n color: 'icon/secondary',\n },\n subtitle: {\n color: 'text/secondary',\n },\n suffix: {\n color: 'text/secondary',\n mx: '16',\n textStyle: 'body/md/regular',\n },\n },\n variants: {\n size: {\n md: {\n header: { textStyle: 'body/md/regular', paddingX: '16', paddingY: '12' },\n subtitle: { textStyle: 'body/sm/regular' },\n },\n lg: {\n header: { textStyle: 'body/lg/regular', padding: '16' },\n subtitle: { textStyle: 'body/md/regular' },\n },\n },\n },\n defaultVariants: {\n size: 'lg',\n },\n});\n\nexport default expandableCardSlotRecipe;\n"],"mappings":";;;AAGA,IAAM,2BAA2B,iBAAiB;CAChD,WAAW;CACX,OAAO;EAAC,GAAG,YAAY,KAAK,QAAQ,QAAQ,CAAC,CAAC,KAAK;EAAG;EAAe;EAAQ;EAAY;CAAQ;CACjG,MAAM;EACJ,MAAM;GACJ,iBAAiB;GACjB,UAAU;EACZ;EACA,QAAQ;GACN,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,QAAQ;GACR,OAAO;GACP,OAAO;GACP,YAAY,EACV,iBAAiB,oBACnB;GACA,wBAAwB,EACtB,iBAAiB,mBACnB;GACA,QAAQ,EACN,OAAO,eACT;GACA,OAAO,EACL,iBAAiB,uBACnB;EACF;EACA,aAAa;GACX,UAAU;GACV,OAAO;IACL,eAAe;IACf,mBAAmB;GACrB;GACA,SAAS;IACP,eAAe;IACf,mBAAmB;GACrB;EACF;EACA,MAAM,EACJ,OAAO,iBACT;EACA,UAAU,EACR,OAAO,iBACT;EACA,QAAQ;GACN,OAAO;GACP,IAAI;GACJ,WAAW;EACb;CACF;CACA,UAAU,EACR,MAAM;EACJ,IAAI;GACF,QAAQ;IAAE,WAAW;IAAmB,UAAU;IAAM,UAAU;GAAK;GACvE,UAAU,EAAE,WAAW,kBAAkB;EAC3C;EACA,IAAI;GACF,QAAQ;IAAE,WAAW;IAAmB,SAAS;GAAK;GACtD,UAAU,EAAE,WAAW,kBAAkB;EAC3C;CACF,EACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CAAC"}
@@ -145,6 +145,6 @@ var multiselectSlotRecipe = defineSlotRecipe({
145
145
  }
146
146
  });
147
147
  //#endregion
148
- export { multiselectSlotRecipe as default };
148
+ export { multiselectSlotRecipe as default, multiselectSlotRecipe };
149
149
 
150
150
  //# sourceMappingURL=Multiselect.recipe.js.map
@@ -87,6 +87,6 @@ var numberInputSlotRecipe = defineSlotRecipe({
87
87
  defaultVariants: { size: "lg" }
88
88
  });
89
89
  //#endregion
90
- export { numberInputSlotRecipe as default, triggerSeparatorStyle };
90
+ export { numberInputSlotRecipe as default, numberInputSlotRecipe, triggerSeparatorStyle };
91
91
 
92
92
  //# sourceMappingURL=NumberInput.recipe.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StepCard.recipe.js","names":[],"sources":["../../../lib/theme/slot-recipes/StepCard.recipe.ts"],"sourcesContent":["import { cardAnatomy } from '@chakra-ui/react/anatomy';\nimport { defineSlotRecipe } from '@chakra-ui/react/styled-system';\n\nconst stepsCardAnatomy = cardAnatomy.extendWith('titleGroup');\n\nconst stepCardSlotRecipe = defineSlotRecipe({\n className: 'steps-card',\n slots: stepsCardAnatomy.keys(),\n base: {\n root: {\n backgroundColor: 'background/primary',\n border: '1px solid',\n borderColor: 'border/minimal',\n borderRadius: '8',\n boxShadow: 'elevation/md',\n overflow: 'hidden',\n },\n header: {\n paddingBlockStart: '32',\n paddingInline: '32',\n },\n body: {\n display: 'flex',\n flexDirection: 'column',\n gap: '24',\n paddingBlockEnd: '48',\n paddingBlockStart: '32',\n paddingInline: '32',\n },\n titleGroup: {\n display: 'flex',\n flexDirection: 'column',\n gap: '4',\n },\n title: {\n color: 'text/primary',\n textStyle: 'heading/h3',\n },\n description: {\n color: 'text/secondary',\n textStyle: 'body/md/regular',\n },\n footer: {\n alignItems: 'center',\n borderBlockStart: '1px solid',\n borderColor: 'border/minimal',\n display: 'flex',\n gap: '16',\n justifyContent: 'flex-end',\n padding: '32',\n },\n },\n});\n\nexport default stepCardSlotRecipe;\n"],"mappings":";;;AAKA,IAAM,qBAAqB,iBAAiB;CAC1C,WAAW;CACX,OAJuB,YAAY,WAAW,YAIvC,EAAiB,KAAK;CAC7B,MAAM;EACJ,MAAM;GACJ,iBAAiB;GACjB,QAAQ;GACR,aAAa;GACb,cAAc;GACd,WAAW;GACX,UAAU;EACZ;EACA,QAAQ;GACN,mBAAmB;GACnB,eAAe;EACjB;EACA,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACL,iBAAiB;GACjB,mBAAmB;GACnB,eAAe;EACjB;EACA,YAAY;GACV,SAAS;GACT,eAAe;GACf,KAAK;EACP;EACA,OAAO;GACL,OAAO;GACP,WAAW;EACb;EACA,aAAa;GACX,OAAO;GACP,WAAW;EACb;EACA,QAAQ;GACN,YAAY;GACZ,kBAAkB;GAClB,aAAa;GACb,SAAS;GACT,KAAK;GACL,gBAAgB;GAChB,SAAS;EACX;CACF;AACF,CAAC"}
1
+ {"version":3,"file":"StepCard.recipe.js","names":[],"sources":["../../../lib/theme/slot-recipes/StepCard.recipe.ts"],"sourcesContent":["import { cardAnatomy } from '@chakra-ui/react/anatomy';\nimport { defineSlotRecipe } from '@chakra-ui/react/styled-system';\n\nconst stepsCardAnatomy = cardAnatomy.extendWith('titleGroup');\n\nconst stepCardSlotRecipe = defineSlotRecipe({\n className: 'steps-card',\n slots: stepsCardAnatomy.keys(),\n base: {\n root: {\n backgroundColor: 'background/primary',\n border: '1px solid',\n borderColor: 'border/minimal',\n borderRadius: '8',\n boxShadow: 'elevation/md',\n overflow: 'hidden',\n },\n header: {\n paddingBlockStart: '32',\n paddingInline: '32',\n },\n body: {\n display: 'flex',\n flexDirection: 'column',\n gap: '24',\n paddingBlockEnd: '48',\n paddingBlockStart: '32',\n paddingInline: '32',\n },\n titleGroup: {\n display: 'flex',\n flexDirection: 'column',\n gap: '4',\n },\n title: {\n color: 'text/primary',\n textStyle: 'heading/h3',\n },\n description: {\n color: 'text/secondary',\n textStyle: 'body/md/regular',\n },\n footer: {\n alignItems: 'center',\n borderBlockStart: '1px solid',\n borderColor: 'border/minimal',\n display: 'flex',\n gap: '16',\n justifyContent: 'flex-end',\n padding: '32',\n },\n },\n});\n\nexport default stepCardSlotRecipe;\n"],"mappings":";;;AAKA,IAAM,qBAAqB,iBAAiB;CAC1C,WAAW;CACX,OAJuB,YAAY,WAAW,YAIvC,CAAA,CAAiB,KAAK;CAC7B,MAAM;EACJ,MAAM;GACJ,iBAAiB;GACjB,QAAQ;GACR,aAAa;GACb,cAAc;GACd,WAAW;GACX,UAAU;EACZ;EACA,QAAQ;GACN,mBAAmB;GACnB,eAAe;EACjB;EACA,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACL,iBAAiB;GACjB,mBAAmB;GACnB,eAAe;EACjB;EACA,YAAY;GACV,SAAS;GACT,eAAe;GACf,KAAK;EACP;EACA,OAAO;GACL,OAAO;GACP,WAAW;EACb;EACA,aAAa;GACX,OAAO;GACP,WAAW;EACb;EACA,QAAQ;GACN,YAAY;GACZ,kBAAkB;GAClB,aAAa;GACb,SAAS;GACT,KAAK;GACL,gBAAgB;GAChB,SAAS;EACX;CACF;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TagsInput.recipe.js","names":[],"sources":["../../../lib/theme/slot-recipes/TagsInput.recipe.ts"],"sourcesContent":["import { tagsInputAnatomy } from '@chakra-ui/react/anatomy';\nimport { defineSlotRecipe } from '@chakra-ui/react/styled-system';\n\nimport { rem } from '../themeUtils';\n\nconst extendedTagsInputAnatomy = tagsInputAnatomy.extendWith('tagsBlock', 'suffixBlock');\n\nconst tagsInputSlotRecipe = defineSlotRecipe({\n className: 'tags-input',\n slots: extendedTagsInputAnatomy.keys(),\n base: {\n root: {\n width: 'full',\n },\n control: {\n alignItems: 'flex-start',\n background: 'background/primary',\n borderColor: 'border/regular',\n borderRadius: '4',\n borderStyle: 'solid',\n borderWidth: '1',\n boxShadow: 'inset/field',\n display: 'flex',\n height: rem(88),\n overflowY: 'auto',\n transition: 'border-color 200ms',\n _focusWithin: {\n focusRing: 'outside',\n },\n _hover: {\n borderColor: 'border/hover',\n },\n _invalid: {\n borderColor: 'border/error',\n _hover: {\n borderColor: 'border/error',\n },\n },\n _disabled: {\n background: 'background/disabled',\n borderColor: 'border/disabled',\n cursor: 'not-allowed',\n _hover: {\n borderColor: 'border/disabled',\n },\n },\n _readOnly: {\n background: 'background/disabled',\n borderColor: 'border/disabled',\n _hover: {\n borderColor: 'border/disabled',\n },\n },\n },\n tagsBlock: {\n alignContent: 'flex-start',\n alignItems: 'center',\n display: 'flex',\n flex: '1',\n flexWrap: 'wrap',\n gap: '8',\n minWidth: 0,\n },\n suffixBlock: {\n alignItems: 'center',\n alignSelf: 'flex-start',\n display: 'flex',\n flexShrink: '0',\n gap: '8',\n paddingInline: '4',\n position: 'sticky',\n top: 0,\n '&:has(button)': {\n paddingInline: 0,\n },\n },\n input: {\n background: 'transparent',\n color: 'input/text/inputValue',\n flex: '1',\n lineHeight: 'normal',\n minWidth: rem(80),\n outline: 'none',\n // Per Figma, the empty-state placeholder is offset 4px further from the control's\n // left edge than a filled-state tag chip. That 4px comes from an \"input\" layer in\n // Figma that wraps the typing area — in our recipe we apply it as a left padding on\n // the typing <input> itself so tag chips (which live alongside but not inside the\n // input) remain flush with the control's padding.\n paddingInlineStart: '4',\n _placeholder: {\n color: 'input/text/placeholder',\n },\n _disabled: {\n cursor: 'not-allowed',\n _placeholder: {\n color: 'text/disabled',\n },\n },\n _readOnly: {\n display: 'none',\n },\n },\n item: {\n display: 'flex',\n maxWidth: '100%',\n minWidth: 0,\n },\n itemPreview: {\n alignItems: 'center',\n background: 'color/neutral/subtle',\n borderColor: 'color/neutral/muted',\n borderRadius: '4',\n borderStyle: 'solid',\n borderWidth: '1',\n color: 'text/primary',\n display: 'flex',\n gap: '4',\n height: '24',\n maxWidth: '100%',\n overflow: 'hidden',\n paddingBlock: '2',\n paddingInlineEnd: '1',\n paddingInlineStart: '8',\n textStyle: 'comp/tag/sm',\n _highlighted: {\n background: 'color/neutral/moderate',\n },\n _disabled: {\n background: 'background/disabled',\n borderColor: 'border/disabled',\n color: 'text/on-disabled',\n },\n '&:not(:has(button))': {\n paddingInlineEnd: '8',\n },\n },\n itemText: {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n itemInput: {\n background: 'transparent',\n height: '24',\n minWidth: '20',\n outline: 'none',\n },\n itemDeleteTrigger: {\n alignItems: 'center',\n borderRadius: '2',\n color: 'icon/secondary',\n cursor: 'pointer',\n display: 'flex',\n flexShrink: '0',\n height: '20',\n justifyContent: 'center',\n width: '20',\n _hover: {\n background: 'color/neutral/moderate',\n },\n _disabled: {\n cursor: 'not-allowed',\n opacity: '0.5',\n },\n },\n clearTrigger: {\n alignItems: 'center',\n borderRadius: '4',\n color: 'icon/secondary',\n cursor: 'pointer',\n display: 'flex',\n justifyContent: 'center',\n padding: '4',\n _hover: {\n background: 'color/neutral/moderate',\n },\n _disabled: {\n cursor: 'not-allowed',\n opacity: '0.5',\n },\n },\n },\n variants: {\n size: {\n // Padding values below match the Figma control + input layer spec exactly\n // (see FRONTEND-572 thread / Figma node 1941:3510 for md, 1941:3487 for lg).\n // The outer control carries the size-specific padding; the inner tagsBlock adds a\n // constant 4px horizontal padding (set in the base) around the content regardless of size.\n md: {\n control: {\n paddingInlineEnd: '12',\n paddingInlineStart: '8',\n },\n // paddingBlock lives on tagsBlock (not control) so the suffixBlock (clear button) sits\n // at the control's inner top and its vertical center lines up with the first tag-row /\n // placeholder center — matches Figma's filled-state layout.\n tagsBlock: {\n paddingBlock: '8',\n },\n suffixBlock: {\n height: '40',\n },\n input: {\n height: '24',\n fontSize: '0.875rem',\n fontWeight: '400',\n lineHeight: 'normal',\n },\n },\n lg: {\n control: {\n paddingInlineEnd: '16',\n paddingInlineStart: '12',\n },\n tagsBlock: {\n paddingBlock: '12',\n },\n suffixBlock: {\n height: '48',\n },\n input: {\n fontSize: '1rem',\n fontWeight: '400',\n lineHeight: 'normal',\n },\n },\n },\n },\n defaultVariants: {\n size: 'lg',\n },\n});\n\nexport default tagsInputSlotRecipe;\n"],"mappings":";;;;AAOA,IAAM,sBAAsB,iBAAiB;CAC3C,WAAW;CACX,OAJ+B,iBAAiB,WAAW,aAAa,aAIjE,EAAyB,KAAK;CACrC,MAAM;EACJ,MAAM,EACJ,OAAO,OACT;EACA,SAAS;GACP,YAAY;GACZ,YAAY;GACZ,aAAa;GACb,cAAc;GACd,aAAa;GACb,aAAa;GACb,WAAW;GACX,SAAS;GACT,QAAQ,IAAI,EAAE;GACd,WAAW;GACX,YAAY;GACZ,cAAc,EACZ,WAAW,UACb;GACA,QAAQ,EACN,aAAa,eACf;GACA,UAAU;IACR,aAAa;IACb,QAAQ,EACN,aAAa,eACf;GACF;GACA,WAAW;IACT,YAAY;IACZ,aAAa;IACb,QAAQ;IACR,QAAQ,EACN,aAAa,kBACf;GACF;GACA,WAAW;IACT,YAAY;IACZ,aAAa;IACb,QAAQ,EACN,aAAa,kBACf;GACF;EACF;EACA,WAAW;GACT,cAAc;GACd,YAAY;GACZ,SAAS;GACT,MAAM;GACN,UAAU;GACV,KAAK;GACL,UAAU;EACZ;EACA,aAAa;GACX,YAAY;GACZ,WAAW;GACX,SAAS;GACT,YAAY;GACZ,KAAK;GACL,eAAe;GACf,UAAU;GACV,KAAK;GACL,iBAAiB,EACf,eAAe,EACjB;EACF;EACA,OAAO;GACL,YAAY;GACZ,OAAO;GACP,MAAM;GACN,YAAY;GACZ,UAAU,IAAI,EAAE;GAChB,SAAS;GAMT,oBAAoB;GACpB,cAAc,EACZ,OAAO,yBACT;GACA,WAAW;IACT,QAAQ;IACR,cAAc,EACZ,OAAO,gBACT;GACF;GACA,WAAW,EACT,SAAS,OACX;EACF;EACA,MAAM;GACJ,SAAS;GACT,UAAU;GACV,UAAU;EACZ;EACA,aAAa;GACX,YAAY;GACZ,YAAY;GACZ,aAAa;GACb,cAAc;GACd,aAAa;GACb,aAAa;GACb,OAAO;GACP,SAAS;GACT,KAAK;GACL,QAAQ;GACR,UAAU;GACV,UAAU;GACV,cAAc;GACd,kBAAkB;GAClB,oBAAoB;GACpB,WAAW;GACX,cAAc,EACZ,YAAY,yBACd;GACA,WAAW;IACT,YAAY;IACZ,aAAa;IACb,OAAO;GACT;GACA,uBAAuB,EACrB,kBAAkB,IACpB;EACF;EACA,UAAU;GACR,UAAU;GACV,cAAc;GACd,YAAY;EACd;EACA,WAAW;GACT,YAAY;GACZ,QAAQ;GACR,UAAU;GACV,SAAS;EACX;EACA,mBAAmB;GACjB,YAAY;GACZ,cAAc;GACd,OAAO;GACP,QAAQ;GACR,SAAS;GACT,YAAY;GACZ,QAAQ;GACR,gBAAgB;GAChB,OAAO;GACP,QAAQ,EACN,YAAY,yBACd;GACA,WAAW;IACT,QAAQ;IACR,SAAS;GACX;EACF;EACA,cAAc;GACZ,YAAY;GACZ,cAAc;GACd,OAAO;GACP,QAAQ;GACR,SAAS;GACT,gBAAgB;GAChB,SAAS;GACT,QAAQ,EACN,YAAY,yBACd;GACA,WAAW;IACT,QAAQ;IACR,SAAS;GACX;EACF;CACF;CACA,UAAU,EACR,MAAM;EAKJ,IAAI;GACF,SAAS;IACP,kBAAkB;IAClB,oBAAoB;GACtB;GAIA,WAAW,EACT,cAAc,IAChB;GACA,aAAa,EACX,QAAQ,KACV;GACA,OAAO;IACL,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,YAAY;GACd;EACF;EACA,IAAI;GACF,SAAS;IACP,kBAAkB;IAClB,oBAAoB;GACtB;GACA,WAAW,EACT,cAAc,KAChB;GACA,aAAa,EACX,QAAQ,KACV;GACA,OAAO;IACL,UAAU;IACV,YAAY;IACZ,YAAY;GACd;EACF;CACF,EACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CAAC"}
1
+ {"version":3,"file":"TagsInput.recipe.js","names":[],"sources":["../../../lib/theme/slot-recipes/TagsInput.recipe.ts"],"sourcesContent":["import { tagsInputAnatomy } from '@chakra-ui/react/anatomy';\nimport { defineSlotRecipe } from '@chakra-ui/react/styled-system';\n\nimport { rem } from '../themeUtils';\n\nconst extendedTagsInputAnatomy = tagsInputAnatomy.extendWith('tagsBlock', 'suffixBlock');\n\nconst tagsInputSlotRecipe = defineSlotRecipe({\n className: 'tags-input',\n slots: extendedTagsInputAnatomy.keys(),\n base: {\n root: {\n width: 'full',\n },\n control: {\n alignItems: 'flex-start',\n background: 'background/primary',\n borderColor: 'border/regular',\n borderRadius: '4',\n borderStyle: 'solid',\n borderWidth: '1',\n boxShadow: 'inset/field',\n display: 'flex',\n height: rem(88),\n overflowY: 'auto',\n transition: 'border-color 200ms',\n _focusWithin: {\n focusRing: 'outside',\n },\n _hover: {\n borderColor: 'border/hover',\n },\n _invalid: {\n borderColor: 'border/error',\n _hover: {\n borderColor: 'border/error',\n },\n },\n _disabled: {\n background: 'background/disabled',\n borderColor: 'border/disabled',\n cursor: 'not-allowed',\n _hover: {\n borderColor: 'border/disabled',\n },\n },\n _readOnly: {\n background: 'background/disabled',\n borderColor: 'border/disabled',\n _hover: {\n borderColor: 'border/disabled',\n },\n },\n },\n tagsBlock: {\n alignContent: 'flex-start',\n alignItems: 'center',\n display: 'flex',\n flex: '1',\n flexWrap: 'wrap',\n gap: '8',\n minWidth: 0,\n },\n suffixBlock: {\n alignItems: 'center',\n alignSelf: 'flex-start',\n display: 'flex',\n flexShrink: '0',\n gap: '8',\n paddingInline: '4',\n position: 'sticky',\n top: 0,\n '&:has(button)': {\n paddingInline: 0,\n },\n },\n input: {\n background: 'transparent',\n color: 'input/text/inputValue',\n flex: '1',\n lineHeight: 'normal',\n minWidth: rem(80),\n outline: 'none',\n // Per Figma, the empty-state placeholder is offset 4px further from the control's\n // left edge than a filled-state tag chip. That 4px comes from an \"input\" layer in\n // Figma that wraps the typing area — in our recipe we apply it as a left padding on\n // the typing <input> itself so tag chips (which live alongside but not inside the\n // input) remain flush with the control's padding.\n paddingInlineStart: '4',\n _placeholder: {\n color: 'input/text/placeholder',\n },\n _disabled: {\n cursor: 'not-allowed',\n _placeholder: {\n color: 'text/disabled',\n },\n },\n _readOnly: {\n display: 'none',\n },\n },\n item: {\n display: 'flex',\n maxWidth: '100%',\n minWidth: 0,\n },\n itemPreview: {\n alignItems: 'center',\n background: 'color/neutral/subtle',\n borderColor: 'color/neutral/muted',\n borderRadius: '4',\n borderStyle: 'solid',\n borderWidth: '1',\n color: 'text/primary',\n display: 'flex',\n gap: '4',\n height: '24',\n maxWidth: '100%',\n overflow: 'hidden',\n paddingBlock: '2',\n paddingInlineEnd: '1',\n paddingInlineStart: '8',\n textStyle: 'comp/tag/sm',\n _highlighted: {\n background: 'color/neutral/moderate',\n },\n _disabled: {\n background: 'background/disabled',\n borderColor: 'border/disabled',\n color: 'text/on-disabled',\n },\n '&:not(:has(button))': {\n paddingInlineEnd: '8',\n },\n },\n itemText: {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n itemInput: {\n background: 'transparent',\n height: '24',\n minWidth: '20',\n outline: 'none',\n },\n itemDeleteTrigger: {\n alignItems: 'center',\n borderRadius: '2',\n color: 'icon/secondary',\n cursor: 'pointer',\n display: 'flex',\n flexShrink: '0',\n height: '20',\n justifyContent: 'center',\n width: '20',\n _hover: {\n background: 'color/neutral/moderate',\n },\n _disabled: {\n cursor: 'not-allowed',\n opacity: '0.5',\n },\n },\n clearTrigger: {\n alignItems: 'center',\n borderRadius: '4',\n color: 'icon/secondary',\n cursor: 'pointer',\n display: 'flex',\n justifyContent: 'center',\n padding: '4',\n _hover: {\n background: 'color/neutral/moderate',\n },\n _disabled: {\n cursor: 'not-allowed',\n opacity: '0.5',\n },\n },\n },\n variants: {\n size: {\n // Padding values below match the Figma control + input layer spec exactly\n // (see FRONTEND-572 thread / Figma node 1941:3510 for md, 1941:3487 for lg).\n // The outer control carries the size-specific padding; the inner tagsBlock adds a\n // constant 4px horizontal padding (set in the base) around the content regardless of size.\n md: {\n control: {\n paddingInlineEnd: '12',\n paddingInlineStart: '8',\n },\n // paddingBlock lives on tagsBlock (not control) so the suffixBlock (clear button) sits\n // at the control's inner top and its vertical center lines up with the first tag-row /\n // placeholder center — matches Figma's filled-state layout.\n tagsBlock: {\n paddingBlock: '8',\n },\n suffixBlock: {\n height: '40',\n },\n input: {\n height: '24',\n fontSize: '0.875rem',\n fontWeight: '400',\n lineHeight: 'normal',\n },\n },\n lg: {\n control: {\n paddingInlineEnd: '16',\n paddingInlineStart: '12',\n },\n tagsBlock: {\n paddingBlock: '12',\n },\n suffixBlock: {\n height: '48',\n },\n input: {\n fontSize: '1rem',\n fontWeight: '400',\n lineHeight: 'normal',\n },\n },\n },\n },\n defaultVariants: {\n size: 'lg',\n },\n});\n\nexport default tagsInputSlotRecipe;\n"],"mappings":";;;;AAOA,IAAM,sBAAsB,iBAAiB;CAC3C,WAAW;CACX,OAJ+B,iBAAiB,WAAW,aAAa,aAIjE,CAAA,CAAyB,KAAK;CACrC,MAAM;EACJ,MAAM,EACJ,OAAO,OACT;EACA,SAAS;GACP,YAAY;GACZ,YAAY;GACZ,aAAa;GACb,cAAc;GACd,aAAa;GACb,aAAa;GACb,WAAW;GACX,SAAS;GACT,QAAQ,IAAI,EAAE;GACd,WAAW;GACX,YAAY;GACZ,cAAc,EACZ,WAAW,UACb;GACA,QAAQ,EACN,aAAa,eACf;GACA,UAAU;IACR,aAAa;IACb,QAAQ,EACN,aAAa,eACf;GACF;GACA,WAAW;IACT,YAAY;IACZ,aAAa;IACb,QAAQ;IACR,QAAQ,EACN,aAAa,kBACf;GACF;GACA,WAAW;IACT,YAAY;IACZ,aAAa;IACb,QAAQ,EACN,aAAa,kBACf;GACF;EACF;EACA,WAAW;GACT,cAAc;GACd,YAAY;GACZ,SAAS;GACT,MAAM;GACN,UAAU;GACV,KAAK;GACL,UAAU;EACZ;EACA,aAAa;GACX,YAAY;GACZ,WAAW;GACX,SAAS;GACT,YAAY;G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,cAAc,IAChB;GACA,aAAa,EACX,QAAQ,KACV;GACA,OAAO;IACL,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,YAAY;GACd;EACF;EACA,IAAI;GACF,SAAS;IACP,kBAAkB;IAClB,oBAAoB;GACtB;GACA,WAAW,EACT,cAAc,KAChB;GACA,aAAa,EACX,QAAQ,KACV;GACA,OAAO;IACL,UAAU;IACV,YAAY;IACZ,YAAY;GACd;EACF;CACF,EACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CAAC"}
@@ -939,7 +939,7 @@ declare const slotRecipes: {
939
939
  };
940
940
  };
941
941
  }>;
942
- expandableCard: import('@chakra-ui/react').SlotRecipeDefinition<"header" | "title" | "icon" | "suffix" | "collapsible" | "root" | "secdText" | "description", {
942
+ expandableCard: import('@chakra-ui/react').SlotRecipeDefinition<"header" | "title" | "icon" | "suffix" | "collapsible" | "root" | "description" | "subtitle", {
943
943
  size: {
944
944
  md: {
945
945
  header: {
@@ -947,7 +947,7 @@ declare const slotRecipes: {
947
947
  paddingX: "16";
948
948
  paddingY: "12";
949
949
  };
950
- secdText: {
950
+ subtitle: {
951
951
  textStyle: "body/sm/regular";
952
952
  };
953
953
  };
@@ -956,7 +956,7 @@ declare const slotRecipes: {
956
956
  textStyle: "body/lg/regular";
957
957
  padding: "16";
958
958
  };
959
- secdText: {
959
+ subtitle: {
960
960
  textStyle: "body/md/regular";
961
961
  };
962
962
  };
@@ -173,7 +173,7 @@ var basicTextStyles = {
173
173
  fontSize: "3rem"
174
174
  } }
175
175
  };
176
- var textStyles = defineTextStyles({
176
+ var dataObject = {
177
177
  ...basicTextStyles,
178
178
  "display/lg": basicTextStyles["sans/size-8/bold"],
179
179
  "display/sm": basicTextStyles["sans/size-7/bold"],
@@ -232,8 +232,9 @@ var textStyles = defineTextStyles({
232
232
  "comp/avatar/48": basicTextStyles["sans/size-5/bold"],
233
233
  "comp/avatar/64": basicTextStyles["sans/size-6/bold"],
234
234
  "comp/avatar/128": basicTextStyles["sans/size-8/bold"]
235
- });
235
+ };
236
+ var textStyles = defineTextStyles(dataObject);
236
237
  //#endregion
237
- export { textStyles as default };
238
+ export { dataObject, textStyles as default };
238
239
 
239
240
  //# sourceMappingURL=text-styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-styles.js","names":[],"sources":["../../lib/theme/text-styles.ts"],"sourcesContent":["import { defineTextStyles } from '@chakra-ui/react/styled-system';\n\nconst basicTextStyles = {\n 'mono/code-2': {\n value: {\n fontFamily: 'mono',\n fontSize: '0.75rem',\n lineHeight: '1rem',\n letterSpacing: '-0.009375rem',\n fontWeight: '400',\n },\n },\n 'mono/code-3': {\n value: {\n fontFamily: 'mono',\n fontSize: '0.875rem',\n lineHeight: '1.25rem',\n letterSpacing: '-0.009375rem',\n fontWeight: '400',\n },\n },\n 'sans/size-1/normal': {\n value: {\n lineHeight: '1rem',\n fontSize: '0.75rem',\n letterSpacing: '0.009375rem',\n fontWeight: '400',\n },\n },\n 'sans/size-1/semibold': {\n value: {\n fontWeight: '600',\n lineHeight: '1rem',\n fontSize: '0.75rem',\n letterSpacing: '0.009375rem',\n },\n },\n 'sans/size-1/bold': {\n value: {\n fontWeight: '700',\n lineHeight: '1rem',\n fontSize: '0.75rem',\n letterSpacing: '0.009375rem',\n },\n },\n 'sans/size-1/uppercase-bold': {\n value: {\n fontWeight: '700',\n lineHeight: '1rem',\n fontSize: '0.75rem',\n letterSpacing: '0.009375rem',\n textTransform: 'uppercase',\n },\n },\n 'sans/size-2/normal': {\n value: {\n lineHeight: '1.25rem',\n fontSize: '0.875rem',\n fontWeight: '400',\n },\n },\n 'sans/size-2/normal-underline': {\n value: {\n lineHeight: '1.25rem',\n fontSize: '0.875rem',\n textDecoration: 'underline',\n fontWeight: '400',\n },\n },\n 'sans/size-2/semibold': {\n value: {\n fontWeight: '600',\n lineHeight: '1.25rem',\n fontSize: '0.875rem',\n },\n },\n 'sans/size-2/semibold-underline': {\n value: {\n fontWeight: '600',\n lineHeight: '1.25rem',\n fontSize: '0.875rem',\n textDecoration: 'underline',\n },\n },\n 'sans/size-2/bold': {\n value: {\n fontWeight: '700',\n lineHeight: '1.25rem',\n fontSize: '0.875rem',\n },\n },\n 'sans/size-2/uppercase-normal': {\n value: {\n lineHeight: '1.25rem',\n fontSize: '0.875rem',\n letterSpacing: '0.009375rem',\n textTransform: 'uppercase',\n },\n },\n 'sans/size-2/uppercase-semibold': {\n value: {\n fontWeight: '600',\n lineHeight: '1.25rem',\n fontSize: '0.875rem',\n letterSpacing: '0.009375rem',\n textTransform: 'uppercase',\n },\n },\n 'sans/size-3/normal': {\n value: {\n lineHeight: '1.5rem',\n fontSize: '1rem',\n fontWeight: '400',\n },\n },\n 'sans/size-3/normal-underline': {\n value: {\n lineHeight: '1.5rem',\n fontSize: '1rem',\n textDecoration: 'underline',\n fontWeight: '400',\n },\n },\n 'sans/size-3/semibold': {\n value: {\n fontWeight: '600',\n lineHeight: '1.5rem',\n fontSize: '1rem',\n },\n },\n 'sans/size-3/semibold-underline': {\n value: {\n fontWeight: '600',\n lineHeight: '1.5rem',\n fontSize: '1rem',\n textDecoration: 'underline',\n },\n },\n 'sans/size-3/bold': {\n value: {\n fontWeight: '700',\n lineHeight: '1.5rem',\n fontSize: '1rem',\n },\n },\n 'sans/size-4/normal': {\n value: {\n lineHeight: '1.75rem',\n fontSize: '1.1875rem',\n fontWeight: '400',\n },\n },\n 'sans/size-4/semibold': {\n value: {\n fontWeight: '600',\n lineHeight: '1.75rem',\n fontSize: '1.1875rem',\n },\n },\n 'sans/size-4/bold': {\n value: {\n fontWeight: '700',\n lineHeight: '1.75rem',\n fontSize: '1.1875rem',\n },\n },\n 'sans/size-5/normal': {\n value: {\n lineHeight: '2.25rem',\n fontSize: '1.5rem',\n fontWeight: '400',\n },\n },\n 'sans/size-5/semibold': {\n value: {\n fontWeight: '600',\n lineHeight: '2.25rem',\n fontSize: '1.5rem',\n },\n },\n 'sans/size-5/bold': {\n value: {\n fontWeight: '700',\n lineHeight: '2.25rem',\n fontSize: '1.5rem',\n },\n },\n 'sans/size-6/normal': {\n value: {\n lineHeight: '2.5rem',\n fontSize: '1.875rem',\n fontWeight: '400',\n },\n },\n 'sans/size-6/semibold': {\n value: {\n fontWeight: '600',\n lineHeight: '2.5rem',\n fontSize: '1.875rem',\n },\n },\n 'sans/size-6/bold': {\n value: {\n fontWeight: '700',\n lineHeight: '2.5rem',\n fontSize: '1.875rem',\n },\n },\n 'sans/size-7/semibold': {\n value: {\n fontWeight: '600',\n lineHeight: '3rem',\n fontSize: '2.25rem',\n },\n },\n 'sans/size-7/bold': {\n value: {\n fontWeight: '700',\n lineHeight: '3rem',\n fontSize: '2.25rem',\n },\n },\n 'sans/size-8/semibold': {\n value: {\n fontWeight: '600',\n lineHeight: '3.75rem',\n fontSize: '3rem',\n },\n },\n 'sans/size-8/bold': {\n value: {\n fontWeight: '700',\n lineHeight: '3.75rem',\n fontSize: '3rem',\n },\n },\n};\n\nexport const dataObject = {\n ...basicTextStyles,\n 'display/lg': basicTextStyles['sans/size-8/bold'],\n 'display/sm': basicTextStyles['sans/size-7/bold'],\n 'heading/h1': basicTextStyles['sans/size-6/bold'],\n 'heading/h2': basicTextStyles['sans/size-5/bold'],\n 'heading/h3': basicTextStyles['sans/size-4/bold'],\n 'heading/h4': basicTextStyles['sans/size-3/bold'],\n 'heading/h5': basicTextStyles['sans/size-2/bold'],\n 'heading/h6': basicTextStyles['sans/size-1/uppercase-bold'],\n 'heading/mobile/h1': basicTextStyles['sans/size-5/bold'],\n 'heading/mobile/h2': basicTextStyles['sans/size-4/bold'],\n 'heading/mobile/h3': basicTextStyles['sans/size-3/bold'],\n 'body/sm/regular': basicTextStyles['sans/size-1/normal'],\n 'body/sm/semibold': basicTextStyles['sans/size-1/semibold'],\n 'body/md/regular': basicTextStyles['sans/size-2/normal'],\n 'body/md/semibold': basicTextStyles['sans/size-2/semibold'],\n 'body/md/underline': basicTextStyles['sans/size-2/normal-underline'],\n 'body/lg/regular': basicTextStyles['sans/size-3/normal'],\n 'body/lg/semibold': basicTextStyles['sans/size-3/semibold'],\n 'body/lg/underline': basicTextStyles['sans/size-3/normal-underline'],\n 'body/xl/regular': basicTextStyles['sans/size-4/normal'],\n 'body/xl/semibold': basicTextStyles['sans/size-4/semibold'],\n 'body/2xl/regular': basicTextStyles['sans/size-5/normal'],\n 'body/2xl/semibold': basicTextStyles['sans/size-5/semibold'],\n 'body/3xl/regular': basicTextStyles['sans/size-6/normal'],\n 'body/3xl/semibold': basicTextStyles['sans/size-6/semibold'],\n 'code/md': basicTextStyles['mono/code-2'],\n 'code/lg': basicTextStyles['mono/code-3'],\n 'comp/button/sm': basicTextStyles['sans/size-2/semibold'],\n 'comp/button/md': basicTextStyles['sans/size-2/semibold'],\n 'comp/button/lg': basicTextStyles['sans/size-3/semibold'],\n 'comp/notification/title': basicTextStyles['sans/size-3/semibold'],\n 'comp/notification/message': basicTextStyles['sans/size-2/normal'],\n 'comp/notification/message-link': basicTextStyles['sans/size-2/normal-underline'],\n 'comp/notification/button': basicTextStyles['sans/size-2/normal'],\n 'comp/input/label': basicTextStyles['sans/size-2/semibold'],\n 'comp/input/helperText': basicTextStyles['sans/size-1/normal'],\n 'comp/link/md': basicTextStyles['sans/size-2/normal'],\n 'comp/link/md-hover': basicTextStyles['sans/size-2/normal-underline'],\n 'comp/link/lg': basicTextStyles['sans/size-3/normal'],\n 'comp/link/lg-hover': basicTextStyles['sans/size-3/normal-underline'],\n 'comp/data/sm': basicTextStyles['sans/size-3/normal'],\n 'comp/data/md': basicTextStyles['sans/size-5/semibold'],\n 'comp/data/lg': basicTextStyles['sans/size-6/semibold'],\n 'comp/tabs/line': basicTextStyles['sans/size-3/bold'],\n 'comp/tabs/contained': basicTextStyles['sans/size-3/bold'],\n 'comp/tabs/contained-secondary': basicTextStyles['sans/size-2/normal'],\n 'comp/tag/sm': basicTextStyles['sans/size-1/normal'],\n 'comp/tag/md': basicTextStyles['sans/size-2/normal'],\n 'comp/badge/sm': basicTextStyles['sans/size-1/uppercase-bold'],\n 'comp/dialog/title': basicTextStyles['sans/size-5/bold'],\n 'comp/dialog/label': basicTextStyles['sans/size-2/uppercase-semibold'],\n 'comp/avatar/24': basicTextStyles['sans/size-1/bold'],\n 'comp/avatar/32': basicTextStyles['sans/size-3/bold'],\n 'comp/avatar/40': basicTextStyles['sans/size-4/bold'],\n 'comp/avatar/48': basicTextStyles['sans/size-5/bold'],\n 'comp/avatar/64': basicTextStyles['sans/size-6/bold'],\n 'comp/avatar/128': basicTextStyles['sans/size-8/bold'],\n};\n\nconst textStyles = defineTextStyles(dataObject);\n\nexport default textStyles;\n"],"mappings":";;AAEA,IAAM,kBAAkB;CACtB,eAAe,EACb,OAAO;EACL,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EACf,YAAY;CACd,EACF;CACA,eAAe,EACb,OAAO;EACL,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EACf,YAAY;CACd,EACF;CACA,sBAAsB,EACpB,OAAO;EACL,YAAY;EACZ,UAAU;EACV,eAAe;EACf,YAAY;CACd,EACF;CACA,wBAAwB,EACtB,OAAO;EACL,YAAY;EACZ,YAAY;EACZ,UAAU;EACV,eAAe;CACjB,EACF;CACA,oBAAoB,EAClB,OAAO;EACL,YAAY;EACZ,YAAY;EACZ,UAAU;EACV,eAAe;CACjB,EACF;CACA,8BAA8B,EAC5B,OAAO;EACL,YAAY;EACZ,YAAY;EACZ,UAAU;EACV,eAAe;EACf,eAAe;CACjB,EACF;CACA,sBAAsB,EACpB,OAAO;EACL,YAAY;EACZ,UAAU;EACV,YAAY;CACd,EACF;CACA,gCAAgC,EAC9B,OAAO;EACL,YAAY;EACZ,UAAU;EACV,gBAAgB;EAChB,YAAY;CACd,EACF;CACA,wBAAwB,EACtB,OAAO;EACL,YAAY;EACZ,YAAY;EACZ,UAAU;CACZ,EACF;CACA,kCAAkC,EAChC,OAAO;EACL,YAAY;EACZ,YAAY;EACZ,UAAU;EACV,gBAAgB;CAClB,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,gBAAgB;CAChC,sBAAsB,gBAAgB;CACtC,gBAAgB,gBAAgB;CAChC,gBAAgB,gBAAgB;CAChC,gBAAgB,gBAAgB;CAChC,kBAAkB,gBAAgB;CAClC,uBAAuB,gBAAgB;CACvC,iCAAiC,gBAAgB;CACjD,eAAe,gBAAgB;CAC/B,eAAe,gBAAgB;CAC/B,iBAAiB,gBAAgB;CACjC,qBAAqB,gBAAgB;CACrC,qBAAqB,gBAAgB;CACrC,kBAAkB,gBAAgB;CAClC,kBAAkB,gBAAgB;CAClC,kBAAkB,gBAAgB;CAClC,kBAAkB,gBAAgB;CAClC,kBAAkB,gBAAgB;CAClC,mBAAmB,gBAAgB;AAGD,CAAU"}
1
+ {"version":3,"file":"text-styles.js","names":[],"sources":["../../lib/theme/text-styles.ts"],"sourcesContent":["import { defineTextStyles } from '@chakra-ui/react/styled-system';\n\nconst basicTextStyles = {\n 'mono/code-2': {\n value: {\n fontFamily: 'mono',\n fontSize: '0.75rem',\n lineHeight: '1rem',\n letterSpacing: '-0.009375rem',\n fontWeight: '400',\n },\n },\n 'mono/code-3': {\n value: {\n fontFamily: 'mono',\n fontSize: '0.875rem',\n lineHeight: '1.25rem',\n letterSpacing: '-0.009375rem',\n fontWeight: '400',\n },\n },\n 'sans/size-1/normal': {\n value: {\n lineHeight: '1rem',\n fontSize: '0.75rem',\n letterSpacing: '0.009375rem',\n fontWeight: '400',\n },\n },\n 'sans/size-1/semibold': {\n value: {\n fontWeight: '600',\n lineHeight: '1rem',\n fontSize: '0.75rem',\n letterSpacing: '0.009375rem',\n },\n },\n 'sans/size-1/bold': {\n value: {\n fontWeight: '700',\n lineHeight: '1rem',\n fontSize: '0.75rem',\n letterSpacing: '0.009375rem',\n },\n },\n 'sans/size-1/uppercase-bold': {\n value: {\n fontWeight: '700',\n lineHeight: '1rem',\n fontSize: '0.75rem',\n letterSpacing: '0.009375rem',\n textTransform: 'uppercase',\n },\n },\n 'sans/size-2/normal': {\n value: {\n lineHeight: '1.25rem',\n fontSize: '0.875rem',\n fontWeight: '400',\n },\n },\n 'sans/size-2/normal-underline': {\n value: {\n lineHeight: '1.25rem',\n fontSize: '0.875rem',\n textDecoration: 'underline',\n fontWeight: '400',\n },\n },\n 'sans/size-2/semibold': {\n value: {\n fontWeight: '600',\n lineHeight: '1.25rem',\n fontSize: '0.875rem',\n },\n },\n 'sans/size-2/semibold-underline': {\n value: {\n fontWeight: '600',\n lineHeight: '1.25rem',\n fontSize: '0.875rem',\n textDecoration: 'underline',\n },\n },\n 'sans/size-2/bold': {\n value: {\n fontWeight: '700',\n lineHeight: '1.25rem',\n fontSize: '0.875rem',\n },\n },\n 'sans/size-2/uppercase-normal': {\n value: {\n lineHeight: '1.25rem',\n fontSize: '0.875rem',\n letterSpacing: '0.009375rem',\n textTransform: 'uppercase',\n },\n },\n 'sans/size-2/uppercase-semibold': {\n value: {\n fontWeight: '600',\n lineHeight: '1.25rem',\n fontSize: '0.875rem',\n letterSpacing: '0.009375rem',\n textTransform: 'uppercase',\n },\n },\n 'sans/size-3/normal': {\n value: {\n lineHeight: '1.5rem',\n fontSize: '1rem',\n fontWeight: '400',\n },\n },\n 'sans/size-3/normal-underline': {\n value: {\n lineHeight: '1.5rem',\n fontSize: '1rem',\n textDecoration: 'underline',\n fontWeight: '400',\n },\n },\n 'sans/size-3/semibold': {\n value: {\n fontWeight: '600',\n lineHeight: '1.5rem',\n fontSize: '1rem',\n },\n },\n 'sans/size-3/semibold-underline': {\n value: {\n fontWeight: '600',\n lineHeight: '1.5rem',\n fontSize: '1rem',\n textDecoration: 'underline',\n },\n },\n 'sans/size-3/bold': {\n value: {\n fontWeight: '700',\n lineHeight: '1.5rem',\n fontSize: '1rem',\n },\n },\n 'sans/size-4/normal': {\n value: {\n lineHeight: '1.75rem',\n fontSize: '1.1875rem',\n fontWeight: '400',\n },\n },\n 'sans/size-4/semibold': {\n value: {\n fontWeight: '600',\n lineHeight: '1.75rem',\n fontSize: '1.1875rem',\n },\n },\n 'sans/size-4/bold': {\n value: {\n fontWeight: '700',\n lineHeight: '1.75rem',\n fontSize: '1.1875rem',\n },\n },\n 'sans/size-5/normal': {\n value: {\n lineHeight: '2.25rem',\n fontSize: '1.5rem',\n fontWeight: '400',\n },\n },\n 'sans/size-5/semibold': {\n value: {\n fontWeight: '600',\n lineHeight: '2.25rem',\n fontSize: '1.5rem',\n },\n },\n 'sans/size-5/bold': {\n value: {\n fontWeight: '700',\n lineHeight: '2.25rem',\n fontSize: '1.5rem',\n },\n },\n 'sans/size-6/normal': {\n value: {\n lineHeight: '2.5rem',\n fontSize: '1.875rem',\n fontWeight: '400',\n },\n },\n 'sans/size-6/semibold': {\n value: {\n fontWeight: '600',\n lineHeight: '2.5rem',\n fontSize: '1.875rem',\n },\n },\n 'sans/size-6/bold': {\n value: {\n fontWeight: '700',\n lineHeight: '2.5rem',\n fontSize: '1.875rem',\n },\n },\n 'sans/size-7/semibold': {\n value: {\n fontWeight: '600',\n lineHeight: '3rem',\n fontSize: '2.25rem',\n },\n },\n 'sans/size-7/bold': {\n value: {\n fontWeight: '700',\n lineHeight: '3rem',\n fontSize: '2.25rem',\n },\n },\n 'sans/size-8/semibold': {\n value: {\n fontWeight: '600',\n lineHeight: '3.75rem',\n fontSize: '3rem',\n },\n },\n 'sans/size-8/bold': {\n value: {\n fontWeight: '700',\n lineHeight: '3.75rem',\n fontSize: '3rem',\n },\n },\n};\n\nexport const dataObject = {\n ...basicTextStyles,\n 'display/lg': basicTextStyles['sans/size-8/bold'],\n 'display/sm': basicTextStyles['sans/size-7/bold'],\n 'heading/h1': basicTextStyles['sans/size-6/bold'],\n 'heading/h2': basicTextStyles['sans/size-5/bold'],\n 'heading/h3': basicTextStyles['sans/size-4/bold'],\n 'heading/h4': basicTextStyles['sans/size-3/bold'],\n 'heading/h5': basicTextStyles['sans/size-2/bold'],\n 'heading/h6': basicTextStyles['sans/size-1/uppercase-bold'],\n 'heading/mobile/h1': basicTextStyles['sans/size-5/bold'],\n 'heading/mobile/h2': basicTextStyles['sans/size-4/bold'],\n 'heading/mobile/h3': basicTextStyles['sans/size-3/bold'],\n 'body/sm/regular': basicTextStyles['sans/size-1/normal'],\n 'body/sm/semibold': basicTextStyles['sans/size-1/semibold'],\n 'body/md/regular': basicTextStyles['sans/size-2/normal'],\n 'body/md/semibold': basicTextStyles['sans/size-2/semibold'],\n 'body/md/underline': basicTextStyles['sans/size-2/normal-underline'],\n 'body/lg/regular': basicTextStyles['sans/size-3/normal'],\n 'body/lg/semibold': basicTextStyles['sans/size-3/semibold'],\n 'body/lg/underline': basicTextStyles['sans/size-3/normal-underline'],\n 'body/xl/regular': basicTextStyles['sans/size-4/normal'],\n 'body/xl/semibold': basicTextStyles['sans/size-4/semibold'],\n 'body/2xl/regular': basicTextStyles['sans/size-5/normal'],\n 'body/2xl/semibold': basicTextStyles['sans/size-5/semibold'],\n 'body/3xl/regular': basicTextStyles['sans/size-6/normal'],\n 'body/3xl/semibold': basicTextStyles['sans/size-6/semibold'],\n 'code/md': basicTextStyles['mono/code-2'],\n 'code/lg': basicTextStyles['mono/code-3'],\n 'comp/button/sm': basicTextStyles['sans/size-2/semibold'],\n 'comp/button/md': basicTextStyles['sans/size-2/semibold'],\n 'comp/button/lg': basicTextStyles['sans/size-3/semibold'],\n 'comp/notification/title': basicTextStyles['sans/size-3/semibold'],\n 'comp/notification/message': basicTextStyles['sans/size-2/normal'],\n 'comp/notification/message-link': basicTextStyles['sans/size-2/normal-underline'],\n 'comp/notification/button': basicTextStyles['sans/size-2/normal'],\n 'comp/input/label': basicTextStyles['sans/size-2/semibold'],\n 'comp/input/helperText': basicTextStyles['sans/size-1/normal'],\n 'comp/link/md': basicTextStyles['sans/size-2/normal'],\n 'comp/link/md-hover': basicTextStyles['sans/size-2/normal-underline'],\n 'comp/link/lg': basicTextStyles['sans/size-3/normal'],\n 'comp/link/lg-hover': basicTextStyles['sans/size-3/normal-underline'],\n 'comp/data/sm': basicTextStyles['sans/size-3/normal'],\n 'comp/data/md': basicTextStyles['sans/size-5/semibold'],\n 'comp/data/lg': basicTextStyles['sans/size-6/semibold'],\n 'comp/tabs/line': basicTextStyles['sans/size-3/bold'],\n 'comp/tabs/contained': basicTextStyles['sans/size-3/bold'],\n 'comp/tabs/contained-secondary': basicTextStyles['sans/size-2/normal'],\n 'comp/tag/sm': basicTextStyles['sans/size-1/normal'],\n 'comp/tag/md': basicTextStyles['sans/size-2/normal'],\n 'comp/badge/sm': basicTextStyles['sans/size-1/uppercase-bold'],\n 'comp/dialog/title': basicTextStyles['sans/size-5/bold'],\n 'comp/dialog/label': basicTextStyles['sans/size-2/uppercase-semibold'],\n 'comp/avatar/24': basicTextStyles['sans/size-1/bold'],\n 'comp/avatar/32': basicTextStyles['sans/size-3/bold'],\n 'comp/avatar/40': basicTextStyles['sans/size-4/bold'],\n 'comp/avatar/48': basicTextStyles['sans/size-5/bold'],\n 'comp/avatar/64': basicTextStyles['sans/size-6/bold'],\n 'comp/avatar/128': basicTextStyles['sans/size-8/bold'],\n};\n\nconst textStyles = defineTextStyles(dataObject);\n\nexport default textStyles;\n"],"mappings":";;AAEA,IAAM,kBAAkB;CACtB,eAAe,EACb,OAAO;EACL,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EACf,YAAY;CACd,EACF;CACA,eAAe,EACb,OAAO;EACL,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EACf,YAAY;CACd,EACF;CACA,sBAAsB,EACpB,OAAO;EACL,YAAY;EACZ,UAAU;EACV,eAAe;EACf,YAAY;CACd,EACF;CACA,wBAAwB,EACtB,OAAO;EACL,YAAY;EACZ,YAAY;EACZ,UAAU;EACV,eAAe;CACjB,EACF;CACA,oBAAoB,EAClB,OAAO;EACL,YAAY;EACZ,YAAY;EACZ,UAAU;EACV,eAAe;CACjB,EACF;CACA,8BAA8B,EAC5B,OAAO;EACL,YAAY;EACZ,YAAY;EACZ,UAAU;EACV,eAAe;EACf,eAAe;CACjB,EACF;CACA,sBAAsB,EACpB,OAAO;EACL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kBAAkB,gBAAgB;CAClC,kBAAkB,gBAAgB;CAClC,kBAAkB,gBAAgB;CAClC,2BAA2B,gBAAgB;CAC3C,6BAA6B,gBAAgB;CAC7C,kCAAkC,gBAAgB;CAClD,4BAA4B,gBAAgB;CAC5C,oBAAoB,gBAAgB;CACpC,yBAAyB,gBAAgB;CACzC,gBAAgB,gBAAgB;CAChC,sBAAsB,gBAAgB;CACtC,gBAAgB,gBAAgB;CAChC,sBAAsB,gBAAgB;CACtC,gBAAgB,gBAAgB;CAChC,gBAAgB,gBAAgB;CAChC,gBAAgB,gBAAgB;CAChC,kBAAkB,gBAAgB;CAClC,uBAAuB,gBAAgB;CACvC,iCAAiC,gBAAgB;CACjD,eAAe,gBAAgB;CAC/B,eAAe,gBAAgB;CAC/B,iBAAiB,gBAAgB;CACjC,qBAAqB,gBAAgB;CACrC,qBAAqB,gBAAgB;CACrC,kBAAkB,gBAAgB;CAClC,kBAAkB,gBAAgB;CAClC,kBAAkB,gBAAgB;CAClC,kBAAkB,gBAAgB;CAClC,kBAAkB,gBAAgB;CAClC,mBAAmB,gBAAgB;AACrC;AAEA,IAAM,aAAa,iBAAiB,UAAU"}
@@ -30,6 +30,6 @@ var rem = (input) => {
30
30
  return `${input / 16}rem`;
31
31
  };
32
32
  //#endregion
33
- export { rem, withSlashes };
33
+ export { flattenTokens, rem, withSlashes };
34
34
 
35
35
  //# sourceMappingURL=themeUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"themeUtils.js","names":[],"sources":["../../lib/theme/themeUtils.ts"],"sourcesContent":["import { type TextProps } from '@chakra-ui/react/text';\nimport { isPlainObject } from 'es-toolkit';\n\n// Based on https://github.com/toss/es-toolkit/blob/main/src/object/flattenObject.ts\nexport const flattenTokens = (object: object, prefix: string = ''): Record<string, any> => {\n const result: Record<string, any> = {};\n const keys = Object.keys(object);\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const value = (object as any)[key];\n\n const prefixedKey = prefix ? `${prefix}/${key}` : key;\n\n if (isPlainObject(value) && Object.keys(value).length > 0 && Object.keys(value)[0] !== 'value') {\n Object.assign(result, flattenTokens(value, prefixedKey));\n continue;\n }\n\n result[prefixedKey] = value;\n }\n\n return result;\n};\n\nexport function withSlashes(object: Record<string, any>): Record<string, any> {\n return {\n ...object,\n ...flattenTokens(object),\n };\n}\n\n/**\n *\n * @param input Value in pixels\n * @returns Value in rems\n */\nexport const rem = (input: number): string => {\n return `${input / 16}rem`;\n};\n\nexport const getTextStyle = (as: TextProps['as']) => {\n if (['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(as as string)) {\n return `heading/${as}`;\n }\n return undefined;\n};\n"],"mappings":";;AAIA,IAAa,iBAAiB,QAAgB,SAAiB,OAA4B;CACzF,MAAM,SAA8B,CAAC;CACrC,MAAM,OAAO,OAAO,KAAK,MAAM;CAE/B,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,MAAM,MAAM,KAAK;EACjB,MAAM,QAAS,OAAe;EAE9B,MAAM,cAAc,SAAS,GAAG,OAAO,GAAG,QAAQ;EAElD,IAAI,cAAc,KAAK,KAAK,OAAO,KAAK,KAAK,EAAE,SAAS,KAAK,OAAO,KAAK,KAAK,EAAE,OAAO,SAAS;GAC9F,OAAO,OAAO,QAAQ,cAAc,OAAO,WAAW,CAAC;GACvD;EACF;EAEA,OAAO,eAAe;CACxB;CAEA,OAAO;AACT;AAEA,SAAgB,YAAY,QAAkD;CAC5E,OAAO;EACL,GAAG;EACH,GAAG,cAAc,MAAM;CACzB;AACF;;;;;;AAOA,IAAa,OAAO,UAA0B;CAC5C,OAAO,GAAG,QAAQ,GAAG;AACvB"}
1
+ {"version":3,"file":"themeUtils.js","names":[],"sources":["../../lib/theme/themeUtils.ts"],"sourcesContent":["import { type TextProps } from '@chakra-ui/react/text';\nimport { isPlainObject } from 'es-toolkit';\n\n// Based on https://github.com/toss/es-toolkit/blob/main/src/object/flattenObject.ts\nexport const flattenTokens = (object: object, prefix: string = ''): Record<string, any> => {\n const result: Record<string, any> = {};\n const keys = Object.keys(object);\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const value = (object as any)[key];\n\n const prefixedKey = prefix ? `${prefix}/${key}` : key;\n\n if (isPlainObject(value) && Object.keys(value).length > 0 && Object.keys(value)[0] !== 'value') {\n Object.assign(result, flattenTokens(value, prefixedKey));\n continue;\n }\n\n result[prefixedKey] = value;\n }\n\n return result;\n};\n\nexport function withSlashes(object: Record<string, any>): Record<string, any> {\n return {\n ...object,\n ...flattenTokens(object),\n };\n}\n\n/**\n *\n * @param input Value in pixels\n * @returns Value in rems\n */\nexport const rem = (input: number): string => {\n return `${input / 16}rem`;\n};\n\nexport const getTextStyle = (as: TextProps['as']) => {\n if (['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(as as string)) {\n return `heading/${as}`;\n }\n return undefined;\n};\n"],"mappings":";;AAIA,IAAa,iBAAiB,QAAgB,SAAiB,OAA4B;CACzF,MAAM,SAA8B,CAAC;CACrC,MAAM,OAAO,OAAO,KAAK,MAAM;CAE/B,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,MAAM,MAAM,KAAK;EACjB,MAAM,QAAS,OAAe;EAE9B,MAAM,cAAc,SAAS,GAAG,OAAO,GAAG,QAAQ;EAElD,IAAI,cAAc,KAAK,KAAK,OAAO,KAAK,KAAK,CAAC,CAAC,SAAS,KAAK,OAAO,KAAK,KAAK,CAAC,CAAC,OAAO,SAAS;GAC9F,OAAO,OAAO,QAAQ,cAAc,OAAO,WAAW,CAAC;GACvD;EACF;EAEA,OAAO,eAAe;CACxB;CAEA,OAAO;AACT;AAEA,SAAgB,YAAY,QAAkD;CAC5E,OAAO;EACL,GAAG;EACH,GAAG,cAAc,MAAM;CACzB;AACF;;;;;;AAOA,IAAa,OAAO,UAA0B;CAC5C,OAAO,GAAG,QAAQ,GAAG;AACvB"}