@accelint/design-system 1.2.2 → 1.2.3

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 (136) hide show
  1. package/dist/components/aria/index.js.map +1 -1
  2. package/dist/components/button/button.css.d.ts +25 -24
  3. package/dist/components/button/index.d.ts +9 -40
  4. package/dist/components/button/index.js +23 -17
  5. package/dist/components/button/index.js.map +1 -1
  6. package/dist/components/button/types.d.ts +3 -2
  7. package/dist/components/checkbox/checkbox.css.d.ts +23 -23
  8. package/dist/components/checkbox/index.js.map +1 -1
  9. package/dist/components/chip/chip.css.d.ts +18 -18
  10. package/dist/components/chip/index.js.map +1 -1
  11. package/dist/components/collection/index.d.ts +3 -3
  12. package/dist/components/collection/index.js.map +1 -1
  13. package/dist/components/combo-box/combo-box.css.d.ts +9 -9
  14. package/dist/components/combo-box/index.js +9 -5
  15. package/dist/components/combo-box/index.js.map +1 -1
  16. package/dist/components/date-field/date-field.css.d.ts +17 -17
  17. package/dist/components/date-field/index.js +8 -4
  18. package/dist/components/date-field/index.js.map +1 -1
  19. package/dist/components/date-input/date-input.css.d.ts +25 -25
  20. package/dist/components/date-input/index.js +19 -8
  21. package/dist/components/date-input/index.js.map +1 -1
  22. package/dist/components/dialog/dialog.css.d.ts +16 -15
  23. package/dist/components/dialog/index.d.ts +1 -0
  24. package/dist/components/dialog/index.js +7 -5
  25. package/dist/components/dialog/index.js.map +1 -1
  26. package/dist/components/dialog/types.d.ts +1 -0
  27. package/dist/components/drawer/drawer.css.d.ts +17 -17
  28. package/dist/components/drawer/index.d.ts +1 -1
  29. package/dist/components/drawer/index.js +21 -8
  30. package/dist/components/drawer/index.js.map +1 -1
  31. package/dist/components/drawer/types.d.ts +1 -1
  32. package/dist/components/element/index.d.ts +1 -1
  33. package/dist/components/element/index.js +7 -3
  34. package/dist/components/element/index.js.map +1 -1
  35. package/dist/components/element/types.d.ts +2 -0
  36. package/dist/components/group/group.css.d.ts +7 -7
  37. package/dist/components/group/index.js +6 -6
  38. package/dist/components/group/index.js.map +1 -1
  39. package/dist/components/icon/icon.css.d.ts +9 -9
  40. package/dist/components/icon/index.js +4 -4
  41. package/dist/components/icon/index.js.map +1 -1
  42. package/dist/components/index.d.ts +35 -35
  43. package/dist/components/input/index.js +17 -8
  44. package/dist/components/input/index.js.map +1 -1
  45. package/dist/components/input/input.css.d.ts +20 -20
  46. package/dist/components/menu/index.d.ts +2 -2
  47. package/dist/components/menu/index.js +1 -1
  48. package/dist/components/menu/index.js.map +1 -1
  49. package/dist/components/menu/menu.css.d.ts +42 -42
  50. package/dist/components/merge-provider/index.js +15 -7
  51. package/dist/components/merge-provider/index.js.map +1 -1
  52. package/dist/components/merge-provider/types.d.ts +2 -0
  53. package/dist/components/number-field/index.d.ts +1 -1
  54. package/dist/components/number-field/index.js +8 -4
  55. package/dist/components/number-field/index.js.map +1 -1
  56. package/dist/components/number-field/number-field.css.d.ts +12 -12
  57. package/dist/components/number-field/types.d.ts +1 -1
  58. package/dist/components/options/index.js +1 -1
  59. package/dist/components/options/index.js.map +1 -1
  60. package/dist/components/options/options.css.d.ts +44 -44
  61. package/dist/components/picker/index.js.map +1 -1
  62. package/dist/components/picker/picker.css.d.ts +18 -18
  63. package/dist/components/popover/index.js +8 -4
  64. package/dist/components/popover/index.js.map +1 -1
  65. package/dist/components/popover/popover.css.d.ts +12 -12
  66. package/dist/components/query-builder/action-element.js.map +1 -1
  67. package/dist/components/query-builder/dataset-sample.js.map +1 -1
  68. package/dist/components/query-builder/group.js.map +1 -1
  69. package/dist/components/query-builder/index.js.map +1 -1
  70. package/dist/components/query-builder/query-builder.css.d.ts +53 -53
  71. package/dist/components/query-builder/value-editor.js.map +1 -1
  72. package/dist/components/query-builder/value-selector.js.map +1 -1
  73. package/dist/components/radio/index.js +12 -8
  74. package/dist/components/radio/index.js.map +1 -1
  75. package/dist/components/radio/radio.css.d.ts +22 -22
  76. package/dist/components/search-field/index.js +9 -5
  77. package/dist/components/search-field/index.js.map +1 -1
  78. package/dist/components/search-field/search-field.css.d.ts +9 -9
  79. package/dist/components/select/index.js +5 -5
  80. package/dist/components/select/index.js.map +1 -1
  81. package/dist/components/select/select.css.d.ts +12 -12
  82. package/dist/components/slider/index.js +48 -20
  83. package/dist/components/slider/index.js.map +1 -1
  84. package/dist/components/slider/slider.css.d.ts +27 -27
  85. package/dist/components/switch/index.js +4 -4
  86. package/dist/components/switch/index.js.map +1 -1
  87. package/dist/components/switch/switch.css.d.ts +16 -16
  88. package/dist/components/tabs/index.js +32 -20
  89. package/dist/components/tabs/index.js.map +1 -1
  90. package/dist/components/tabs/tabs.css.d.ts +25 -25
  91. package/dist/components/text-field/index.d.ts +3 -128
  92. package/dist/components/text-field/index.js +11 -7
  93. package/dist/components/text-field/index.js.map +1 -1
  94. package/dist/components/text-field/text-field.css.d.ts +8 -8
  95. package/dist/components/textarea/index.js +16 -7
  96. package/dist/components/textarea/index.js.map +1 -1
  97. package/dist/components/textarea/textarea.css.d.ts +22 -22
  98. package/dist/components/time-field/index.js +8 -4
  99. package/dist/components/time-field/index.js.map +1 -1
  100. package/dist/components/time-field/time-field.css.d.ts +17 -17
  101. package/dist/components/tooltip/index.js +17 -9
  102. package/dist/components/tooltip/index.js.map +1 -1
  103. package/dist/components/tooltip/tooltip.css.d.ts +11 -11
  104. package/dist/components/tree/index.js +5 -2
  105. package/dist/components/tree/index.js.map +1 -1
  106. package/dist/components/tree/tree.css.d.ts +45 -45
  107. package/dist/hooks/index.d.ts +13 -13
  108. package/dist/hooks/use-collection-render/index.d.ts +1 -1
  109. package/dist/hooks/use-collection-render/index.js +2 -3
  110. package/dist/hooks/use-collection-render/index.js.map +1 -1
  111. package/dist/hooks/use-context-props/index.js.map +1 -1
  112. package/dist/hooks/use-defaults/index.d.ts +32 -80
  113. package/dist/hooks/use-defaults/index.js +1 -4
  114. package/dist/hooks/use-defaults/index.js.map +1 -1
  115. package/dist/hooks/use-defaults/types.d.ts +1 -1
  116. package/dist/hooks/use-theme/index.d.ts +2 -2
  117. package/dist/hooks/use-theme/index.js.map +1 -1
  118. package/dist/hooks/use-theme/types.d.ts +1 -1
  119. package/dist/hooks/use-tree/index.js +3 -2
  120. package/dist/hooks/use-tree/index.js.map +1 -1
  121. package/dist/hooks/use-tree/utils.js +6 -9
  122. package/dist/hooks/use-tree/utils.js.map +1 -1
  123. package/dist/hooks/use-update-effect/index.js.map +1 -1
  124. package/dist/index.css +32 -32
  125. package/dist/index.d.ts +39 -39
  126. package/dist/ladle/actions.js.map +1 -1
  127. package/dist/styles/theme.css.d.ts +200 -200
  128. package/dist/test/setup.js +778 -1276
  129. package/dist/test/setup.js.map +1 -1
  130. package/dist/utils/css/index.d.ts +1 -1
  131. package/dist/utils/css/index.js.map +1 -1
  132. package/dist/utils/props/index.d.ts +1 -2
  133. package/dist/utils/props/index.js +1 -2
  134. package/dist/utils/props/index.js.map +1 -1
  135. package/dist/vanilla.d.ts +29 -29
  136. package/package.json +49 -48
@@ -31,7 +31,7 @@ declare function computeContract<T extends Contract>(contract: T, css: CSSStyleD
31
31
  * The contract provides a lookup for CSS vars
32
32
  * The values are expected to partially match the contract shapeForm
33
33
  */
34
- declare function reduceContract<T extends Contract, U>(contract: T, values: PartialMapLeafNodes<T, U>): Record<`var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`, U>;
34
+ declare function reduceContract<T extends Contract, U>(contract: T, values: PartialMapLeafNodes<T, U>): Record<`var(--${string})`, U>;
35
35
  /**
36
36
  * Reduce contract and values into Vanilla Extract friendly CSS vars
37
37
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/css/index.ts"],"names":[],"mappings":";;;;;;AA4CO,SAAS,aAAa,MAAA,EAAgB;AAC3C,EAAA,OAAO,MAAA,CAAO,OAAA,CAAQ,4BAAA,EAA8B,IAAI,CAAA;AAC1D;AAgBO,SAAS,eAAA,CACd,UACA,GAAA,EACsB;AACtB,EAAA,OAAO,MAAA,CAAO,OAAA,CAAQ,QAAQ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","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type { GlobalStyleRule, StyleRule } from '@vanilla-extract/css';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport kebabCase from 'lodash/kebabCase';\nimport { layers } from '../../styles/layers.css';\nimport type { RGBA } from '../../types/deckgl';\nimport type {\n Contract,\n CssVarFunction,\n MapLeafNodes,\n PartialMapLeafNodes,\n Primitive,\n} from '../../types/vanilla-extract';\nimport {\n pixelValueAsStringValidator,\n rgbaAsStringValidator,\n} from '../validators';\n\n/**\n * Parse out CSS var name from CSS var implementation\n *\n * @example\n * unwrapCssVar('var(--foo)')\n * // returns '--foo'\n *\n * @example\n * unwrapCssVar('var(--foo, blue)')\n * // returns '--foo'\n *\n * @example\n * unwrapCssVar('var(--foo, var(--bar))')\n * // returns '--foo'\n */\nexport function unwrapCssVar(cssVar: string) {\n return cssVar.replace(/^var\\((--[\\w-]+)[^\\w-]+.*/i, '$1');\n}\n\ntype FulfilledContract<T> = MapLeafNodes<T, null | number | string | RGBA>;\n\n// TODO: remove if possible\n// NOTE: had to create a generic version not bound to type of T because of type issues around setting values on accumulator\ntype GenericFulfilledContract = {\n [key: string]: GenericFulfilledContract | null | number | string | RGBA;\n};\n\n/**\n * Convert contract to nested object of identical shape with computed CSS values\n * Pixel values are converted to numbers\n * RGB(A) values are converted to DeckGL compatible tuples\n * All other values are left unconverted\n */\nexport function computeContract<T extends Contract>(\n contract: T,\n css: CSSStyleDeclaration,\n): FulfilledContract<T> {\n return Object.entries(contract).reduce<GenericFulfilledContract>(\n (acc, [key, cssVarOrContract]) => {\n if (cssVarOrContract == null) {\n acc[key] = null;\n\n return acc;\n }\n\n if (typeof cssVarOrContract === 'object') {\n acc[key] = computeContract(cssVarOrContract, css);\n\n return acc;\n }\n\n const cssVar = unwrapCssVar(cssVarOrContract);\n const value = css.getPropertyValue(cssVar);\n const pixel = pixelValueAsStringValidator.safeParse(value);\n\n if (pixel.success) {\n acc[key] = pixel.data;\n\n return acc;\n }\n\n const rgba = rgbaAsStringValidator.safeParse(value);\n\n if (rgba.success) {\n acc[key] = rgba.data;\n\n return acc;\n }\n\n acc[key] = value ?? null;\n\n return acc;\n },\n {},\n ) as FulfilledContract<T>;\n}\n\n/**\n * Convert potentially nested contract and values pair into flattened CSS var record\n * The contract provides a lookup for CSS vars\n * The values are expected to partially match the contract shapeForm\n */\nexport function reduceContract<T extends Contract, U>(\n contract: T,\n values: PartialMapLeafNodes<T, U>,\n) {\n const nodes: { contract: Contract; values: PartialMapLeafNodes<T, U> }[] = [\n { contract, values },\n ];\n\n const vars: Record<CssVarFunction, U> = {};\n\n for (const node of nodes) {\n // biome-ignore lint/complexity/noForEach: TODO: refactor. converting to for...of results in breaking complexity rule limit 🫠\n Object.entries(node.values).forEach(([key, value]: [string, U]) => {\n const cssVarOrSubContract = node.contract[key];\n\n if (cssVarOrSubContract == null || value == null) {\n return;\n }\n\n if (\n typeof cssVarOrSubContract === 'string' &&\n (typeof value !== 'object' || Array.isArray(value))\n ) {\n vars[cssVarOrSubContract] = value;\n\n return;\n }\n\n if (\n typeof cssVarOrSubContract === 'object' &&\n typeof value === 'object'\n ) {\n nodes.push({ contract: cssVarOrSubContract, values: value });\n }\n });\n }\n\n return vars;\n}\n\n/**\n * Reduce contract and values into Vanilla Extract friendly CSS vars\n */\nexport function assignPartialVars<T extends Contract>(\n contract: T,\n values: PartialMapLeafNodes<T, Primitive>,\n) {\n return Object.fromEntries(\n Object.entries(reduceContract(contract, values)).map(([key, value]) => [\n key,\n `${value}`,\n ]),\n );\n}\n\ntype CssVarValues = {\n [key: string]: CssVarValues | Primitive;\n};\n\ntype CssVarValueOptions<T extends object> = {\n [P in keyof T]?: T[P] extends object\n ? CssVarValueOptions<T[P]>\n : T[P] | T[P][];\n};\n\ntype Operators = 'and' | 'or';\n\ntype ContainerQueryOptions = {\n container?: string;\n operator?: Operators;\n maxHeight?: string;\n minHeight?: string;\n maxWidth?: string;\n minWidth?: string;\n};\n\ntype ContainerQueryValues<T extends CssVarValues> = CssVarValueOptions<T> &\n ContainerQueryOptions;\n\ntype MultiContainerQuery<T extends CssVarValues> = {\n operator?: Operators;\n groups: ContainerQueryValues<T>[];\n};\n\n/**\n * Handle creation of query groups based on options and values\n * Internal to containerQueries\n */\nfunction processConditions<T extends CssVarValues>(\n contract: MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n values: ContainerQueryValues<T>,\n) {\n return Object.entries(\n reduceContract(\n {\n ...contract,\n maxHeight: 'maxHeight', // NOTE: Passthrough these values not as CSS vars\n minHeight: 'minHeight',\n maxWidth: 'maxWidth',\n minWidth: 'minWidth',\n },\n values as PartialMapLeafNodes<\n MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n ContainerQueryValues<T>[string]\n >,\n ),\n ).reduce<string[]>((acc, [key, value]) => {\n if (key === 'container' || key === 'operator' || value == null) {\n return acc;\n }\n\n const isStyle = !/^(?:max|min)(?:Height|Width)$/.test(key);\n const prefix = isStyle ? 'style' : '';\n const prop = isStyle ? unwrapCssVar(key) : kebabCase(key);\n\n if (Array.isArray(value)) {\n const group = value.reduce<string[]>((ac, val) => {\n if (val != null) {\n ac.push(`${prefix}(${prop}: ${val})`);\n }\n\n return ac;\n }, []);\n\n acc.push(`(${group.join(' or ')})`);\n } else {\n acc.push(`${prefix}(${prop}: ${value})`);\n }\n\n return acc;\n }, []);\n}\n\nfunction isMultiQuery<T extends CssVarValues>(\n value: unknown,\n): value is MultiContainerQuery<T> {\n return (\n value != null &&\n typeof value === 'object' &&\n (!('operator' in value) ||\n ('operator' in value &&\n (value.operator === 'and' || value.operator === 'or'))) &&\n 'groups' in value &&\n Array.isArray(value.groups) &&\n value.groups.every((group) => group != null && typeof group === 'object')\n );\n}\n\n/**\n * Create simple or complex container queries with and/or operators.\n *\n * To provide type safety and ease of use, this function accepts a generic and a contract\n * The generic type defines the possible values for the parameters defined within the contract\n *\n * Ex: `containerQuery<{ foo: boolean }>({ foo: 'var(--foo)' }, { foo: true })`\n *\n * By providing the type constraint and contract, the query parameters will have intellisense\n * on which parameters exist and what their possible values can be\n *\n * @example\n * containerQuery(contract, { a: true })\n * // returns (a: true)\n *\n * @example\n * containerQuery(contract, { a: true, b: true })\n * // returns (a: true) and (b: true)\n *\n * @example\n * containerQuery(contract, { operator: 'or', a: true, b: true })\n * // returns (a: true) or (b: true)\n *\n * @example\n * containerQuery(contract, { groups: [{ a: true }, { b: true }] })\n * // returns (a: true) or (b: true)\n *\n * @example\n * containerQuery(contract, { a: ['foo', 'bar'] })\n * // returns (a: 'foo') or (a: 'bar')\n *\n * @example\n * containerQuery(contract, { a: ['foo', 'bar'], b: true })\n * // returns ((a: 'foo') or (a: 'bar')) and (b: true)\n *\n * @example\n * containerQuery(contract, { operator: 'or', a: ['foo', 'bar'], b: true })\n * // returns ((a: 'foo') or (a: 'bar')) or (b: true)\n *\n * @example\n * containerQuery(contract, { groups: [{ a: true, b: true }, { c: true, d: true }] })\n * // returns ((a: true) and (b: true)) or ((c: true) and (d: true))\n *\n * @example\n * containerQuery(contract, { operator: 'and', groups: [{ operator: 'or', a: true, b: true }, { c: true, d: true }] })\n * // returns ((a: true) or (b: true)) and ((c: true) and (d: true))\n *\n * @example\n * containerQuery(contract, { operator: 'and', groups: [{ operator: 'or', a: true, b: true }, { operator: 'or', c: true, d: true }] })\n * // returns ((a: true) or (b: true)) and ((c: true) or (d: true))\n */\nexport function containerQuery<T extends CssVarValues = CssVarValues>(\n contract: MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n query: ContainerQueryValues<T> | MultiContainerQuery<T>,\n) {\n const isMultiGroup = isMultiQuery<T>(query);\n const groups = isMultiGroup ? query.groups : [query];\n const groupsOperator = ` ${(isMultiGroup ? query.operator : null) ?? 'or'} `;\n\n return groups\n .map((group, index) => {\n const operator = ` ${group.operator ?? 'and'} `;\n\n let container = group.container ?? '';\n\n if (index) {\n // Multiple container specifiers is not yet supported: https://github.com/w3c/csswg-drafts/issues/6876\n container = '';\n }\n\n const conditions = processConditions(contract, group);\n const isMultiCondition = groups.length > 1 && conditions.length > 1;\n\n return [\n container,\n container && ' ',\n isMultiCondition ? '(' : '',\n conditions.join(operator),\n isMultiCondition ? ')' : '',\n ].join('');\n })\n .join(groupsOperator);\n}\n\ntype ContainerStyle = Exclude<StyleRule['@container'], undefined>[string];\n\ntype ContainerQuery<T extends CssVarValues> = {\n query: ContainerQueryValues<T> | MultiContainerQuery<T>;\n};\n\ntype ContainerQueries<T extends CssVarValues> = ContainerStyle &\n ContainerQuery<T>;\n\ntype GlobalContainerStyle = Exclude<\n GlobalStyleRule['@container'],\n undefined\n>[string];\n\ntype GlobalContainerQueries<T extends CssVarValues> = GlobalContainerStyle &\n ContainerQuery<T>;\n\n/**\n * Bulk container query creation based on the same contract\n */\nexport function containerQueries<T extends CssVarValues = CssVarValues>(\n contract: MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n ...styles: ContainerQueries<T>[]\n): Record<string, ContainerStyle>;\n\nexport function containerQueries<T extends CssVarValues = CssVarValues>(\n contract: MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n ...styles: GlobalContainerQueries<T>[]\n): Record<string, GlobalContainerStyle>;\n\nexport function containerQueries<T extends CssVarValues = CssVarValues>(\n contract: MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n ...styles: ContainerQueries<T>[] | GlobalContainerQueries<T>[]\n): Record<string, ContainerStyle | GlobalContainerStyle> {\n return Object.fromEntries(\n styles.map(({ query, ...style }) => [\n containerQuery<T>(contract, query),\n style,\n ]),\n );\n}\n\ntype VarsOnlyContainerQuery<T extends CssVarValues> = Required<\n Pick<ContainerQueries<T>, 'query' | 'vars'>\n>;\n\ntype QueryOptionalVarsOnlyContainerQuery<T extends CssVarValues> = Partial<\n Pick<VarsOnlyContainerQuery<T>, 'query'>\n> &\n Pick<VarsOnlyContainerQuery<T>, 'vars'>;\n\n/**\n * Helper for establishing global theme variables with the restriction that\n * only variables may be set (and are required). All other styles must be\n * established using alternative utils\n *\n * The first style rule has an optional query. If the query is missing, the vars\n * are set outside of a container query\n */\nexport function applyThemeVars<T extends CssVarValues = CssVarValues>(\n contract: MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n styles:\n | [QueryOptionalVarsOnlyContainerQuery<T>, ...VarsOnlyContainerQuery<T>[]]\n | VarsOnlyContainerQuery<T>[],\n layer = layers.variables.l1,\n): StyleRule {\n const [style, ...rest] = styles;\n\n const stylesWithQueries = (\n style.query ? styles : rest\n ) as VarsOnlyContainerQuery<T>[];\n\n return {\n '@layer': {\n [layer]: {\n ...(style.query ? {} : { vars: style.vars }),\n ...(stylesWithQueries.length\n ? {\n '@container': containerQueries<T>(contract, ...stylesWithQueries),\n }\n : {}),\n },\n },\n };\n}\n\n/**\n * Runtime creation of inline style CSS vars that enable CSS container queries\n */\nexport function inlineVars(\n vars: Record<string, Primitive>,\n): Record<string, string>;\n\nexport function inlineVars<T extends Contract>(\n contract: T,\n values: PartialMapLeafNodes<T, Primitive>,\n): Record<string, string>;\n\nexport function inlineVars<T extends Contract>(\n varsOrContract: Record<string, Primitive> | T,\n values?: PartialMapLeafNodes<T, Primitive>,\n): Record<string, string> {\n return assignInlineVars(\n values\n ? assignPartialVars(varsOrContract as T, values)\n : Object.entries(varsOrContract).reduce<Record<string, string>>(\n (acc, [key, value]) => {\n if (value != null) {\n acc[key] = `${value}`;\n }\n\n return acc;\n },\n {},\n ),\n );\n}\n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,MAC7B,CAAC,GAAA,EAAK,CAAC,GAAA,EAAK,KAAK,CAAA,KAAM;AACrB,QAAA,IAAI,SAAS,IAAA,EAAM;AACjB,UAAA,GAAA,CAAI,GAAG,CAAA,GAAI,CAAA,EAAG,KAAK,CAAA,CAAA;AAAA,QACrB;AAEA,QAAA,OAAO,GAAA;AAAA,MACT,CAAA;AAAA,MACA;AAAC;AACH,GACN;AACF","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport kebabCase from 'lodash/kebabCase';\nimport { layers } from '../../styles/layers.css';\nimport {\n pixelValueAsStringValidator,\n rgbaAsStringValidator,\n} from '../validators';\nimport type { GlobalStyleRule, StyleRule } from '@vanilla-extract/css';\nimport type { RGBA } from '../../types/deckgl';\nimport type {\n Contract,\n CssVarFunction,\n MapLeafNodes,\n PartialMapLeafNodes,\n Primitive,\n} from '../../types/vanilla-extract';\n\n/**\n * Parse out CSS var name from CSS var implementation\n *\n * @example\n * unwrapCssVar('var(--foo)')\n * // returns '--foo'\n *\n * @example\n * unwrapCssVar('var(--foo, blue)')\n * // returns '--foo'\n *\n * @example\n * unwrapCssVar('var(--foo, var(--bar))')\n * // returns '--foo'\n */\nexport function unwrapCssVar(cssVar: string) {\n return cssVar.replace(/^var\\((--[\\w-]+)[^\\w-]+.*/i, '$1');\n}\n\ntype FulfilledContract<T> = MapLeafNodes<T, null | number | string | RGBA>;\n\n// TODO: remove if possible\n// NOTE: had to create a generic version not bound to type of T because of type issues around setting values on accumulator\ntype GenericFulfilledContract = {\n [key: string]: GenericFulfilledContract | null | number | string | RGBA;\n};\n\n/**\n * Convert contract to nested object of identical shape with computed CSS values\n * Pixel values are converted to numbers\n * RGB(A) values are converted to DeckGL compatible tuples\n * All other values are left unconverted\n */\nexport function computeContract<T extends Contract>(\n contract: T,\n css: CSSStyleDeclaration,\n): FulfilledContract<T> {\n return Object.entries(contract).reduce<GenericFulfilledContract>(\n (acc, [key, cssVarOrContract]) => {\n if (cssVarOrContract == null) {\n acc[key] = null;\n\n return acc;\n }\n\n if (typeof cssVarOrContract === 'object') {\n acc[key] = computeContract(cssVarOrContract, css);\n\n return acc;\n }\n\n const cssVar = unwrapCssVar(cssVarOrContract);\n const value = css.getPropertyValue(cssVar);\n const pixel = pixelValueAsStringValidator.safeParse(value);\n\n if (pixel.success) {\n acc[key] = pixel.data;\n\n return acc;\n }\n\n const rgba = rgbaAsStringValidator.safeParse(value);\n\n if (rgba.success) {\n acc[key] = rgba.data;\n\n return acc;\n }\n\n acc[key] = value ?? null;\n\n return acc;\n },\n {},\n ) as FulfilledContract<T>;\n}\n\n/**\n * Convert potentially nested contract and values pair into flattened CSS var record\n * The contract provides a lookup for CSS vars\n * The values are expected to partially match the contract shapeForm\n */\nexport function reduceContract<T extends Contract, U>(\n contract: T,\n values: PartialMapLeafNodes<T, U>,\n) {\n const nodes: { contract: Contract; values: PartialMapLeafNodes<T, U> }[] = [\n { contract, values },\n ];\n\n const vars: Record<CssVarFunction, U> = {};\n\n for (const node of nodes) {\n Object.entries(node.values).forEach(([key, value]: [string, U]) => {\n const cssVarOrSubContract = node.contract[key];\n\n if (cssVarOrSubContract == null || value == null) {\n return;\n }\n\n if (\n typeof cssVarOrSubContract === 'string' &&\n (typeof value !== 'object' || Array.isArray(value))\n ) {\n vars[cssVarOrSubContract] = value;\n\n return;\n }\n\n if (\n typeof cssVarOrSubContract === 'object' &&\n typeof value === 'object'\n ) {\n nodes.push({ contract: cssVarOrSubContract, values: value });\n }\n });\n }\n\n return vars;\n}\n\n/**\n * Reduce contract and values into Vanilla Extract friendly CSS vars\n */\nexport function assignPartialVars<T extends Contract>(\n contract: T,\n values: PartialMapLeafNodes<T, Primitive>,\n) {\n return Object.fromEntries(\n Object.entries(reduceContract(contract, values)).map(([key, value]) => [\n key,\n `${value}`,\n ]),\n );\n}\n\ntype CssVarValues = {\n [key: string]: CssVarValues | Primitive;\n};\n\ntype CssVarValueOptions<T extends object> = {\n [P in keyof T]?: T[P] extends object\n ? CssVarValueOptions<T[P]>\n : T[P] | T[P][];\n};\n\ntype Operators = 'and' | 'or';\n\ntype ContainerQueryOptions = {\n container?: string;\n operator?: Operators;\n maxHeight?: string;\n minHeight?: string;\n maxWidth?: string;\n minWidth?: string;\n};\n\ntype ContainerQueryValues<T extends CssVarValues> = CssVarValueOptions<T> &\n ContainerQueryOptions;\n\ntype MultiContainerQuery<T extends CssVarValues> = {\n operator?: Operators;\n groups: ContainerQueryValues<T>[];\n};\n\n/**\n * Handle creation of query groups based on options and values\n * Internal to containerQueries\n */\nfunction processConditions<T extends CssVarValues>(\n contract: MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n values: ContainerQueryValues<T>,\n) {\n return Object.entries(\n reduceContract(\n {\n ...contract,\n maxHeight: 'maxHeight', // NOTE: Passthrough these values not as CSS vars\n minHeight: 'minHeight',\n maxWidth: 'maxWidth',\n minWidth: 'minWidth',\n },\n values as PartialMapLeafNodes<\n MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n ContainerQueryValues<T>[string]\n >,\n ),\n ).reduce<string[]>((acc, [key, value]) => {\n if (key === 'container' || key === 'operator' || value == null) {\n return acc;\n }\n\n const isStyle = !/^(?:max|min)(?:Height|Width)$/.test(key);\n const prefix = isStyle ? 'style' : '';\n const prop = isStyle ? unwrapCssVar(key) : kebabCase(key);\n\n if (Array.isArray(value)) {\n const group = value.reduce<string[]>((ac, val) => {\n if (val != null) {\n ac.push(`${prefix}(${prop}: ${val})`);\n }\n\n return ac;\n }, []);\n\n acc.push(`(${group.join(' or ')})`);\n } else {\n acc.push(`${prefix}(${prop}: ${value})`);\n }\n\n return acc;\n }, []);\n}\n\nfunction isMultiQuery<T extends CssVarValues>(\n value: unknown,\n): value is MultiContainerQuery<T> {\n return (\n value != null &&\n typeof value === 'object' &&\n (!('operator' in value) ||\n ('operator' in value &&\n (value.operator === 'and' || value.operator === 'or'))) &&\n 'groups' in value &&\n Array.isArray(value.groups) &&\n value.groups.every((group) => group != null && typeof group === 'object')\n );\n}\n\n/**\n * Create simple or complex container queries with and/or operators.\n *\n * To provide type safety and ease of use, this function accepts a generic and a contract\n * The generic type defines the possible values for the parameters defined within the contract\n *\n * Ex: `containerQuery<{ foo: boolean }>({ foo: 'var(--foo)' }, { foo: true })`\n *\n * By providing the type constraint and contract, the query parameters will have intellisense\n * on which parameters exist and what their possible values can be\n *\n * @example\n * containerQuery(contract, { a: true })\n * // returns (a: true)\n *\n * @example\n * containerQuery(contract, { a: true, b: true })\n * // returns (a: true) and (b: true)\n *\n * @example\n * containerQuery(contract, { operator: 'or', a: true, b: true })\n * // returns (a: true) or (b: true)\n *\n * @example\n * containerQuery(contract, { groups: [{ a: true }, { b: true }] })\n * // returns (a: true) or (b: true)\n *\n * @example\n * containerQuery(contract, { a: ['foo', 'bar'] })\n * // returns (a: 'foo') or (a: 'bar')\n *\n * @example\n * containerQuery(contract, { a: ['foo', 'bar'], b: true })\n * // returns ((a: 'foo') or (a: 'bar')) and (b: true)\n *\n * @example\n * containerQuery(contract, { operator: 'or', a: ['foo', 'bar'], b: true })\n * // returns ((a: 'foo') or (a: 'bar')) or (b: true)\n *\n * @example\n * containerQuery(contract, { groups: [{ a: true, b: true }, { c: true, d: true }] })\n * // returns ((a: true) and (b: true)) or ((c: true) and (d: true))\n *\n * @example\n * containerQuery(contract, { operator: 'and', groups: [{ operator: 'or', a: true, b: true }, { c: true, d: true }] })\n * // returns ((a: true) or (b: true)) and ((c: true) and (d: true))\n *\n * @example\n * containerQuery(contract, { operator: 'and', groups: [{ operator: 'or', a: true, b: true }, { operator: 'or', c: true, d: true }] })\n * // returns ((a: true) or (b: true)) and ((c: true) or (d: true))\n */\nexport function containerQuery<T extends CssVarValues = CssVarValues>(\n contract: MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n query: ContainerQueryValues<T> | MultiContainerQuery<T>,\n) {\n const isMultiGroup = isMultiQuery<T>(query);\n const groups = isMultiGroup ? query.groups : [query];\n const groupsOperator = ` ${(isMultiGroup ? query.operator : null) ?? 'or'} `;\n\n return groups\n .map((group, index) => {\n const operator = ` ${group.operator ?? 'and'} `;\n\n let container = group.container ?? '';\n\n if (index) {\n // Multiple container specifiers is not yet supported: https://github.com/w3c/csswg-drafts/issues/6876\n container = '';\n }\n\n const conditions = processConditions(contract, group);\n const isMultiCondition = groups.length > 1 && conditions.length > 1;\n\n return [\n container,\n container && ' ',\n isMultiCondition ? '(' : '',\n conditions.join(operator),\n isMultiCondition ? ')' : '',\n ].join('');\n })\n .join(groupsOperator);\n}\n\ntype ContainerStyle = Exclude<StyleRule['@container'], undefined>[string];\n\ntype ContainerQuery<T extends CssVarValues> = {\n query: ContainerQueryValues<T> | MultiContainerQuery<T>;\n};\n\ntype ContainerQueries<T extends CssVarValues> = ContainerStyle &\n ContainerQuery<T>;\n\ntype GlobalContainerStyle = Exclude<\n GlobalStyleRule['@container'],\n undefined\n>[string];\n\ntype GlobalContainerQueries<T extends CssVarValues> = GlobalContainerStyle &\n ContainerQuery<T>;\n\n/**\n * Bulk container query creation based on the same contract\n */\nexport function containerQueries<T extends CssVarValues = CssVarValues>(\n contract: MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n ...styles: ContainerQueries<T>[]\n): Record<string, ContainerStyle>;\n\nexport function containerQueries<T extends CssVarValues = CssVarValues>(\n contract: MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n ...styles: GlobalContainerQueries<T>[]\n): Record<string, GlobalContainerStyle>;\n\nexport function containerQueries<T extends CssVarValues = CssVarValues>(\n contract: MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n ...styles: ContainerQueries<T>[] | GlobalContainerQueries<T>[]\n): Record<string, ContainerStyle | GlobalContainerStyle> {\n return Object.fromEntries(\n styles.map(({ query, ...style }) => [\n containerQuery<T>(contract, query),\n style,\n ]),\n );\n}\n\ntype VarsOnlyContainerQuery<T extends CssVarValues> = Required<\n Pick<ContainerQueries<T>, 'query' | 'vars'>\n>;\n\ntype QueryOptionalVarsOnlyContainerQuery<T extends CssVarValues> = Partial<\n Pick<VarsOnlyContainerQuery<T>, 'query'>\n> &\n Pick<VarsOnlyContainerQuery<T>, 'vars'>;\n\n/**\n * Helper for establishing global theme variables with the restriction that\n * only variables may be set (and are required). All other styles must be\n * established using alternative utils\n *\n * The first style rule has an optional query. If the query is missing, the vars\n * are set outside of a container query\n */\nexport function applyThemeVars<T extends CssVarValues = CssVarValues>(\n contract: MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n styles:\n | [QueryOptionalVarsOnlyContainerQuery<T>, ...VarsOnlyContainerQuery<T>[]]\n | VarsOnlyContainerQuery<T>[],\n layer = layers.variables.l1,\n): StyleRule {\n const [style, ...rest] = styles;\n\n const stylesWithQueries = (\n style.query ? styles : rest\n ) as VarsOnlyContainerQuery<T>[];\n\n return {\n '@layer': {\n [layer]: {\n ...(style.query ? {} : { vars: style.vars }),\n ...(stylesWithQueries.length\n ? {\n '@container': containerQueries<T>(contract, ...stylesWithQueries),\n }\n : {}),\n },\n },\n };\n}\n\n/**\n * Runtime creation of inline style CSS vars that enable CSS container queries\n */\nexport function inlineVars(\n vars: Record<string, Primitive>,\n): Record<string, string>;\n\nexport function inlineVars<T extends Contract>(\n contract: T,\n values: PartialMapLeafNodes<T, Primitive>,\n): Record<string, string>;\n\nexport function inlineVars<T extends Contract>(\n varsOrContract: Record<string, Primitive> | T,\n values?: PartialMapLeafNodes<T, Primitive>,\n): Record<string, string> {\n return assignInlineVars(\n values\n ? assignPartialVars(varsOrContract as T, values)\n : Object.entries(varsOrContract).reduce<Record<string, string>>(\n (acc, [key, value]) => {\n if (value != null) {\n acc[key] = `${value}`;\n }\n\n return acc;\n },\n {},\n ),\n );\n}\n"]}
@@ -1,7 +1,6 @@
1
1
  import { AsType } from '../../types/generic.js';
2
2
  import { ClassNames } from '../../types/props.js';
3
3
 
4
- type Props<T extends object> = AsType<T> | null | undefined;
5
4
  /**
6
5
  * Deep merges classNames objects by concatenating class values
7
6
  *
@@ -13,7 +12,7 @@ declare function mergeClassNames<T extends ClassNames>(...classNamesToMerge: (T
13
12
  /**
14
13
  * Extends the base margeProps functionality to also merge styles and handle class/style render props
15
14
  */
16
- declare function mergeProps<T extends object>(...propsToMerge: Props<T>[]): T;
15
+ declare function mergeProps<T extends object>(...propsToMerge: AsType<T>[]): T;
17
16
  /**
18
17
  * A helper for not having to reimplement the type check for a renderProp value being a function or not everywhere
19
18
  */
@@ -96,8 +96,7 @@ function mergeStaticStyle(...propsToMerge) {
96
96
  if (!props?.style) {
97
97
  return acc;
98
98
  }
99
- Object.assign(acc, props.style);
100
- return acc;
99
+ return Object.assign({}, acc, props.style);
101
100
  }, {});
102
101
  }
103
102
  function mergeStyleProps(...propsToMerge) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/props/index.ts"],"names":["mergePropsWithoutStyles"],"mappings":";;;;;;;AA+BA,SAAS,2BAAA,CACP,KAAA,EACA,WAAA,EAAA,GACG,YAAA,EACK;AACR,EAAA,IAAI,CAAC,aAAa,MAAA,EAAQ;AACxB,IAAA,OAAO,EAAA;AAAA,EACT;AAEA,EAAA,MAAM,CAAC,KAAA,EAAO,GAAG,IAAI,CAAA,GAAI,YAAA;AAEzB,EAAA,OAAO,IAAA;AAAA,IACL,KAAA;AAAA,IACA,kBAAA;AAAA,MACE,OAAO,SAAA,IAAa,EAAA;AAAA,MACpB,CA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,GAAa,oBAAA,CAAqB,GAAG,YAAY,CAAA;AACvD,EAAA,MAAM,KAAA,GAAQ,eAAA,CAAgB,GAAG,YAAY,CAAA;AAE7C,EAAA,OAAO;AAAA,IACL,GAAIA,YAAA,CAAwB,GAAG,YAAY,CAAA;AAAA,IAC3C,GAAI,SAAA,GAAY,EAAE,SAAA,KAAc,EAAC;AAAA,IACjC,GAAI,UAAA,GAAa,EAAE,UAAA,KAAe,EAAC;AAAA,IACnC,GAAI,KAAA,GAAQ,EAAE,KAAA,KAAU;AAAC,GAC3B;AACF;AAKO,SAAS,eAAA,CACd,OACA,MAAA,EACA;AACA,EAAA,IAAI,OAAO,UAAU,UAAA,EAAY;AAC/B,IAAA,OAAQ,MAAgC,MAAM,CAAA;AAAA,EAChD;AAEA,EAAA,OAAO,KAAA;AACT;AAWO,SAAS,eAAA,CACd,OACA,MAAA,EACA;AACA,EAAA,IAAI,OAAO,UAAU,UAAA,EAAY;AAC/B,IAAA,OAAO,CAAC,gBACL,KAAA,CAAoC;AAAA,MACnC,GAAG,WAAA;AAAA,MACH,GAAG;AAAA,KACK,CAAA;AAAA,EACd;AAEA,EAAA,OAAO,KAAA;AACT","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { mergeProps as mergePropsWithoutStyles } from '@react-aria/utils';\nimport { clsx } from 'clsx';\nimport mergeWith from 'lodash/mergeWith';\nimport type { CSSProperties } from 'react';\nimport { composeRenderProps } from 'react-aria-components';\nimport { z } from 'zod';\nimport type { AsType } from '../../types/generic';\nimport type { ClassNames } from '../../types/props';\nimport type {\n ClassNameRenderProps,\n RenderProps,\n StylePropRenderProps,\n} from '../../types/react-aria';\n\ntype Props<T extends object> = AsType<T> | null | undefined;\n\n/**\n * Recursively process merging of all class name render props\n */\nfunction processClassNameRenderProps<T extends RenderProps<object>>(\n value: string,\n renderProps: ClassNameRenderProps<object>,\n ...propsToMerge: Props<T>[]\n): string {\n if (!propsToMerge.length) {\n return '';\n }\n\n const [props, ...rest] = propsToMerge;\n\n return clsx(\n value,\n composeRenderProps<string, ClassNameRenderProps<object>, string>(\n props?.className ?? '',\n (prev) => processClassNameRenderProps(prev, renderProps, ...rest),\n )(renderProps),\n );\n}\n\n/**\n * Compose class name render props to be processed and merged\n */\nfunction mergeRenderClassName<T extends RenderProps<object>>(\n ...propsToMerge: Props<T>[]\n) {\n return composeRenderProps<string, ClassNameRenderProps<object>, string>(\n (renderProps) => renderProps.defaultClassName ?? '',\n (prev, renderProps) =>\n processClassNameRenderProps(prev, renderProps, ...propsToMerge),\n );\n}\n\n/**\n * Merge static class names\n */\nfunction mergeStaticClassName<T extends RenderProps<object>>(\n ...propsToMerge: Props<T>[]\n) {\n return clsx(\n propsToMerge.reduce<string[]>((acc, props) => {\n if (typeof props?.className !== 'string') {\n return acc;\n }\n\n acc.push(props.className);\n\n return acc;\n }, []),\n );\n}\n\n/**\n * Determine if a static or composed merge of class names is necesary based on the presence of functions\n */\nfunction mergeClassNameProps<T extends RenderProps<object>>(\n ...propsToMerge: Props<T>[]\n) {\n const anyFunctions = propsToMerge.some(\n (props) => typeof props?.className === 'function',\n );\n\n const anyPrimitives = propsToMerge.some(\n (props) => typeof props?.className === 'string',\n );\n\n if (!(anyFunctions || anyPrimitives)) {\n return undefined;\n }\n\n return anyFunctions\n ? mergeRenderClassName(...propsToMerge)\n : mergeStaticClassName(...propsToMerge);\n}\n\nconst classNamesValidator: z.ZodType<ClassNames> = z.record(\n z.string(),\n z.union([z.string(), z.lazy(() => classNamesValidator)]),\n);\n\nconst propsValidator = z.object({\n classNames: classNamesValidator,\n});\n\n/**\n * Deep merges classNames objects within props\n */\nfunction mergeClassNamesProps<T extends object>(...propsToMerge: Props<T>[]) {\n return propsToMerge.reduce<ClassNames | undefined>((acc, props) => {\n const result = propsValidator.safeParse(props);\n\n if (result.success) {\n return acc\n ? mergeWith(acc, result.data.classNames, (accValue, srcValue) =>\n (!accValue || typeof accValue === 'string') &&\n (!srcValue || typeof srcValue === 'string')\n ? clsx(accValue, srcValue)\n : undefined,\n )\n : result.data.classNames;\n }\n\n return acc;\n }, undefined);\n}\n\n/**\n * Deep merges classNames objects by concatenating class values\n *\n * @example\n * mergeClassNames({ foo: 'foo' }, { foo: 'FOO', bar: 'bar' })\n * // returns { foo: 'foo FOO', bar: 'bar' }\n */\nexport function mergeClassNames<T extends ClassNames>(\n ...classNamesToMerge: (T | null | undefined)[]\n) {\n return mergeClassNamesProps(\n ...classNamesToMerge.map((classNames) => ({ classNames })),\n ) as T | undefined;\n}\n\n/**\n * Recursively process merging of all style render props\n */\nfunction processStyleRenderProps<T extends RenderProps<object>>(\n value: CSSProperties,\n renderProps: StylePropRenderProps<object>,\n ...propsToMerge: Props<T>[]\n): CSSProperties {\n if (!propsToMerge.length) {\n return {};\n }\n\n const [props, ...rest] = propsToMerge;\n\n return {\n ...value,\n ...composeRenderProps<\n CSSProperties,\n StylePropRenderProps<object>,\n CSSProperties\n >(props?.style ?? {}, (prev) =>\n processStyleRenderProps(prev, renderProps, ...rest),\n )(renderProps),\n };\n}\n\n/**\n * Compose style render props to be processed and merged\n */\nfunction mergeRenderStyle<T extends RenderProps<object>>(\n ...propsToMerge: Props<T>[]\n) {\n return composeRenderProps<\n CSSProperties,\n StylePropRenderProps<object>,\n CSSProperties\n >(\n (renderProps) => renderProps.defaultStyle ?? {},\n (prev, renderProps) =>\n processStyleRenderProps(prev, renderProps, ...propsToMerge),\n );\n}\n\n/**\n * Merge static styles\n */\nfunction mergeStaticStyle<T extends RenderProps<object>>(\n ...propsToMerge: Props<T>[]\n) {\n return propsToMerge.reduce<CSSProperties>((acc, props) => {\n if (!props?.style) {\n return acc;\n }\n\n Object.assign(acc, props.style);\n\n return acc;\n }, {});\n}\n\n/**\n * Determine if a static or composed merge of styles is necesary based on the presence of functions\n */\nfunction mergeStyleProps<T extends RenderProps<object>>(\n ...propsToMerge: Props<T>[]\n) {\n const anyFunctions = propsToMerge.some(\n (props) => typeof props?.style === 'function',\n );\n\n const anyObjects = propsToMerge.some(\n (props) => typeof props?.style === 'object' && props.style != null,\n );\n\n if (!(anyFunctions || anyObjects)) {\n return undefined;\n }\n\n return anyFunctions\n ? mergeRenderStyle(...propsToMerge)\n : mergeStaticStyle(...propsToMerge);\n}\n\n/**\n * Extends the base margeProps functionality to also merge styles and handle class/style render props\n */\nexport function mergeProps<T extends object>(...propsToMerge: Props<T>[]): T {\n const className = mergeClassNameProps(...propsToMerge);\n const classNames = mergeClassNamesProps(...propsToMerge);\n const style = mergeStyleProps(...propsToMerge);\n\n return {\n ...(mergePropsWithoutStyles(...propsToMerge) as T),\n ...(className ? { className } : {}),\n ...(classNames ? { classNames } : {}),\n ...(style ? { style } : {}),\n };\n}\n\n/**\n * A helper for not having to reimplement the type check for a renderProp value being a function or not everywhere\n */\nexport function callRenderProps<T extends object, R>(\n value: R | ((renderProps: T) => R),\n values: T,\n) {\n if (typeof value === 'function') {\n return (value as (renderProps: T) => R)(values);\n }\n\n return value;\n}\n\n/**\n * A helper function to pair with React Aria's render props. Typically\n * implemented with children, className and styles\n *\n * Allows for the injection of additional renderProps that a component\n * from React Aria may not already provide\n *\n * If the value isn't a renderProp function, then it is passed through unchanged\n */\nexport function wrapRenderProps<T extends object, U extends object, R>(\n value: R | ((renderProps: T & U) => R),\n inject?: U,\n) {\n if (typeof value === 'function') {\n return (renderProps: T) =>\n (value as (renderProps: T & U) => R)({\n ...renderProps,\n ...inject,\n } as T & U);\n }\n\n return value;\n}\n"]}
1
+ {"version":3,"sources":["../../../src/utils/props/index.ts"],"names":["mergeProp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AA,IAAS;AAAA,GAChE;AAEA,EAAA,IAAI,EAAE,gBAAgB,UAAA,CAAA,EAAa;AACjC,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,OAAO,eACH,gBAAA,CAAiB,GAAG,YAAY,CAAA,GAChC,gBAAA,CAAiB,GAAG,YAAY,CAAA;AACtC;AAKO,SAAS,cAAgC,YAAA,EAA8B;AAC5E,EAAA,MAAM,SAAA,GAAY,mBAAA,CAAoB,GAAG,YAAY,CAAA;AACrD,EAAA,MAAM,UAAA,GAAa,oBAAA,CAAqB,GAAG,YAAY,CAAA;AACvD,EAAA,MAAM,KAAA,GAAQ,eAAA,CAAgB,GAAG,YAAY,CAAA;AAE7C,EAAA,OAAO;AAAA,IACL,GAAIA,YAAA,CAAwB,GAAG,YAAY,CAAA;AAAA,IAC3C,GAAI,SAAA,GAAY,EAAE,SAAA,KAAc,EAAC;AAAA,IACjC,GAAI,UAAA,GAAa,EAAE,UAAA,KAAe,EAAC;AAAA,IACnC,GAAI,KAAA,GAAQ,EAAE,KAAA,KAAU;AAAC,GAC3B;AACF;AAKO,SAAS,eAAA,CACd,OACA,MAAA,EACA;AACA,EAAA,IAAI,OAAO,UAAU,UAAA,EAAY;AAC/B,IAAA,OAAQ,MAAgC,MAAM,CAAA;AAAA,EAChD;AAEA,EAAA,OAAO,KAAA;AACT;AAWO,SAAS,eAAA,CACd,OACA,MAAA,EACA;AACA,EAAA,IAAI,OAAO,UAAU,UAAA,EAAY;AAC/B,IAAA,OAAO,CAAC,gBACL,KAAA,CAAoC;AAAA,MACnC,GAAG,WAAA;AAAA,MACH,GAAG;AAAA,KACK,CAAA;AAAA,EACd;AAEA,EAAA,OAAO,KAAA;AACT","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { mergeProps as mergePropsWithoutStyles } from '@react-aria/utils';\nimport { clsx } from 'clsx';\nimport mergeWith from 'lodash/mergeWith';\nimport { composeRenderProps } from 'react-aria-components';\nimport { z } from 'zod';\nimport type { CSSProperties } from 'react';\nimport type { AsType } from '../../types/generic';\nimport type { ClassNames } from '../../types/props';\nimport type {\n ClassNameRenderProps,\n RenderProps,\n StylePropRenderProps,\n} from '../../types/react-aria';\n\ntype Props<T extends object> = AsType<T> | null | undefined;\n\n/**\n * Recursively process merging of all class name render props\n */\nfunction processClassNameRenderProps<T extends RenderProps<object>>(\n value: string,\n renderProps: ClassNameRenderProps<object>,\n ...propsToMerge: Props<T>[]\n): string {\n if (!propsToMerge.length) {\n return '';\n }\n\n const [props, ...rest] = propsToMerge;\n\n return clsx(\n value,\n composeRenderProps<string, ClassNameRenderProps<object>, string>(\n props?.className ?? '',\n (prev) => processClassNameRenderProps(prev, renderProps, ...rest),\n )(renderProps),\n );\n}\n\n/**\n * Compose class name render props to be processed and merged\n */\nfunction mergeRenderClassName<T extends RenderProps<object>>(\n ...propsToMerge: Props<T>[]\n) {\n return composeRenderProps<string, ClassNameRenderProps<object>, string>(\n (renderProps) => renderProps.defaultClassName ?? '',\n (prev, renderProps) =>\n processClassNameRenderProps(prev, renderProps, ...propsToMerge),\n );\n}\n\n/**\n * Merge static class names\n */\nfunction mergeStaticClassName<T extends RenderProps<object>>(\n ...propsToMerge: Props<T>[]\n) {\n return clsx(\n propsToMerge.reduce<string[]>((acc, props) => {\n if (typeof props?.className !== 'string') {\n return acc;\n }\n\n acc.push(props.className);\n\n return acc;\n }, []),\n );\n}\n\n/**\n * Determine if a static or composed merge of class names is necesary based on the presence of functions\n */\nfunction mergeClassNameProps<T extends RenderProps<object>>(\n ...propsToMerge: Props<T>[]\n) {\n const anyFunctions = propsToMerge.some(\n (props) => typeof props?.className === 'function',\n );\n\n const anyPrimitives = propsToMerge.some(\n (props) => typeof props?.className === 'string',\n );\n\n if (!(anyFunctions || anyPrimitives)) {\n return undefined;\n }\n\n return anyFunctions\n ? mergeRenderClassName(...propsToMerge)\n : mergeStaticClassName(...propsToMerge);\n}\n\nconst classNamesValidator: z.ZodType<ClassNames> = z.record(\n z.string(),\n z.union([z.string(), z.lazy(() => classNamesValidator)]),\n);\n\nconst propsValidator = z.object({\n classNames: classNamesValidator,\n});\n\n/**\n * Deep merges classNames objects within props\n */\nfunction mergeClassNamesProps<T extends object>(...propsToMerge: Props<T>[]) {\n return propsToMerge.reduce<ClassNames | undefined>((acc, props) => {\n const result = propsValidator.safeParse(props);\n\n if (result.success) {\n return acc\n ? mergeWith(acc, result.data.classNames, (accValue, srcValue) =>\n (!accValue || typeof accValue === 'string') &&\n (!srcValue || typeof srcValue === 'string')\n ? clsx(accValue, srcValue)\n : undefined,\n )\n : result.data.classNames;\n }\n\n return acc;\n }, undefined);\n}\n\n/**\n * Deep merges classNames objects by concatenating class values\n *\n * @example\n * mergeClassNames({ foo: 'foo' }, { foo: 'FOO', bar: 'bar' })\n * // returns { foo: 'foo FOO', bar: 'bar' }\n */\nexport function mergeClassNames<T extends ClassNames>(\n ...classNamesToMerge: (T | null | undefined)[]\n) {\n return mergeClassNamesProps(\n ...classNamesToMerge.map((classNames) => ({ classNames })),\n ) as T | undefined;\n}\n\n/**\n * Recursively process merging of all style render props\n */\nfunction processStyleRenderProps<T extends RenderProps<object>>(\n value: CSSProperties,\n renderProps: StylePropRenderProps<object>,\n ...propsToMerge: Props<T>[]\n): CSSProperties {\n if (!propsToMerge.length) {\n return {};\n }\n\n const [props, ...rest] = propsToMerge;\n\n return {\n ...value,\n ...composeRenderProps<\n CSSProperties,\n StylePropRenderProps<object>,\n CSSProperties\n >(props?.style ?? {}, (prev) =>\n processStyleRenderProps(prev, renderProps, ...rest),\n )(renderProps),\n };\n}\n\n/**\n * Compose style render props to be processed and merged\n */\nfunction mergeRenderStyle<T extends RenderProps<object>>(\n ...propsToMerge: Props<T>[]\n) {\n return composeRenderProps<\n CSSProperties,\n StylePropRenderProps<object>,\n CSSProperties\n >(\n (renderProps) => renderProps.defaultStyle ?? {},\n (prev, renderProps) =>\n processStyleRenderProps(prev, renderProps, ...propsToMerge),\n );\n}\n\n/**\n * Merge static styles\n */\nfunction mergeStaticStyle<T extends RenderProps<object>>(\n ...propsToMerge: Props<T>[]\n) {\n return propsToMerge.reduce<CSSProperties>((acc, props) => {\n if (!props?.style) {\n return acc;\n }\n\n return Object.assign({}, acc, props.style);\n }, {});\n}\n\n/**\n * Determine if a static or composed merge of styles is necesary based on the presence of functions\n */\nfunction mergeStyleProps<T extends RenderProps<object>>(\n ...propsToMerge: Props<T>[]\n) {\n const anyFunctions = propsToMerge.some(\n (props) => typeof props?.style === 'function',\n );\n\n const anyObjects = propsToMerge.some(\n (props) => typeof props?.style === 'object' && props.style != null,\n );\n\n if (!(anyFunctions || anyObjects)) {\n return undefined;\n }\n\n return anyFunctions\n ? mergeRenderStyle(...propsToMerge)\n : mergeStaticStyle(...propsToMerge);\n}\n\n/**\n * Extends the base margeProps functionality to also merge styles and handle class/style render props\n */\nexport function mergeProps<T extends object>(...propsToMerge: AsType<T>[]): T {\n const className = mergeClassNameProps(...propsToMerge);\n const classNames = mergeClassNamesProps(...propsToMerge);\n const style = mergeStyleProps(...propsToMerge);\n\n return {\n ...(mergePropsWithoutStyles(...propsToMerge) as T),\n ...(className ? { className } : {}),\n ...(classNames ? { classNames } : {}),\n ...(style ? { style } : {}),\n };\n}\n\n/**\n * A helper for not having to reimplement the type check for a renderProp value being a function or not everywhere\n */\nexport function callRenderProps<T extends object, R>(\n value: R | ((renderProps: T) => R),\n values: T,\n) {\n if (typeof value === 'function') {\n return (value as (renderProps: T) => R)(values);\n }\n\n return value;\n}\n\n/**\n * A helper function to pair with React Aria's render props. Typically\n * implemented with children, className and styles\n *\n * Allows for the injection of additional renderProps that a component\n * from React Aria may not already provide\n *\n * If the value isn't a renderProp function, then it is passed through unchanged\n */\nexport function wrapRenderProps<T extends object, U extends object, R>(\n value: R | ((renderProps: T & U) => R),\n inject?: U,\n) {\n if (typeof value === 'function') {\n return (renderProps: T) =>\n (value as (renderProps: T & U) => R)({\n ...renderProps,\n ...inject,\n } as T & U);\n }\n\n return value;\n}\n"]}
package/dist/vanilla.d.ts CHANGED
@@ -1,66 +1,67 @@
1
1
  export { buttonClassNames, buttonColorVars, buttonContainer, buttonSpaceVars, buttonStateVars } from './components/button/button.css.js';
2
- export { ButtonClassNames, ButtonColors, ButtonMapping, ButtonProps, ButtonRenderProps, ButtonSizes, ButtonState, LinkButtonProps, ToggleButtonProps } from './components/button/types.js';
3
2
  export { checkboxClassNames, checkboxColorVars, checkboxContainer, checkboxGroupStateVars, checkboxSpaceVars, checkboxStateVars } from './components/checkbox/checkbox.css.js';
4
- export { CheckboxAlignment, CheckboxClassNames, CheckboxGroupProps, CheckboxGroupRenderProps, CheckboxGroupState, CheckboxProps, CheckboxRenderProps, CheckboxState } from './components/checkbox/types.js';
5
3
  export { chipClassNames, chipColorVars, chipContainer, chipSpaceVars, chipStateVars } from './components/chip/chip.css.js';
6
- export { ChipClassNames, ChipColors, ChipGroupProps, ChipItemProps, ChipListProps, ChipMapping, ChipProps, ChipRenderProps, ChipSizes, ChipState } from './components/chip/types.js';
7
4
  export { comboBoxColorVars, comboBoxContainer, comboBoxSpaceVars, comboBoxStateVars } from './components/combo-box/combo-box.css.js';
8
- export { ComboBoxClassNames, ComboBoxMapping, ComboBoxProps, ComboBoxRenderProps, ComboBoxSizes, ComboBoxState } from './components/combo-box/types.js';
9
5
  export { dialogClassNames, dialogColorVars, dialogContainer, dialogSpaceVars, dialogStateVars } from './components/dialog/dialog.css.js';
10
- export { DialogClassNames, DialogMapping, DialogProps, DialogRenderProps, DialogSizes, DialogState } from './components/dialog/types.js';
11
6
  export { drawerAnimationVars, drawerClassNames, drawerColorVars, drawerContainer, drawerDialogStateVars, drawerSpaceVars, drawerStateVars } from './components/drawer/drawer.css.js';
12
- export { DrawerAnchor, DrawerClassNames, DrawerDialogProps, DrawerDialogState, DrawerMapping, DrawerProps, DrawerRenderProps, DrawerState, DrawerTabListProps, DrawerTabProps, DrawerTabRenderProps } from './components/drawer/types.js';
13
7
  export { groupClassNames, groupContainer, groupSpaceVars, groupStateVars } from './components/group/group.css.js';
14
- export { GroupClassNames, GroupProps, GroupState } from './components/group/types.js';
15
8
  export { iconClassNames, iconColorVars, iconContainer, iconSpaceVars, iconStateVars } from './components/icon/icon.css.js';
16
- export { IconClassNames, IconProps, IconSizes, IconState } from './components/icon/types.js';
17
9
  export { inputClassNames, inputColorVars, inputContainer, inputSpaceVars, inputStateVars } from './components/input/input.css.js';
18
- export { InputClassNames, InputMapping, InputProps, InputRenderProps, InputState, InputType } from './components/input/types.js';
19
10
  export { menuColorVars, menuItemStateVars, menuSpaceVars, menuStateVars } from './components/menu/menu.css.js';
20
- export { MenuClassNames, MenuItemProps, MenuItemRenderProps, MenuItemState, MenuListProps, MenuMapping, MenuProps, MenuSizes, MenuState } from './components/menu/types.js';
21
11
  export { numberFieldClassNames, numberFieldColorVars, numberFieldContainer, numberFieldSpaceVars, numberFieldStateVars } from './components/number-field/number-field.css.js';
22
- export { NumberFieldClassNames, NumberFieldMapping, NumberFieldProps, NumberFieldSizes, NumberFieldState } from './components/number-field/types.js';
23
12
  export { optionsClassNames, optionsColorVars, optionsContainers, optionsItemStateVars, optionsListStateVars, optionsSpaceVars, optionsStateVars } from './components/options/options.css.js';
24
- export { OptionsClassNames, OptionsItemProps, OptionsItemState, OptionsListProps, OptionsListState, OptionsMapping, OptionsProps, OptionsSizes, OptionsState } from './components/options/types.js';
25
13
  export { pickerClassNames, pickerContainers, pickerItemColorVars, pickerItemStateVars, pickerSpaceVars, pickerStateVars } from './components/picker/picker.css.js';
26
- export { PickerClassNames, PickerItemProps, PickerItemRenderProps, PickerItemState, PickerProps, PickerState } from './components/picker/types.js';
27
14
  export { popoverClassNames, popoverColorVars, popoverSpaceVars, popoverStateVars } from './components/popover/popover.css.js';
28
- export { PopoverClassNames, PopoverProps, PopoverState } from './components/popover/types.js';
29
15
  export { queryBuilderClassNames, queryBuilderColorVars, queryBuilderContainers, queryBuilderGroupStateVars, queryBuilderRuleStateVars, queryBuilderSpaceVars, queryBuilderStateVars } from './components/query-builder/query-builder.css.js';
30
- export { QueryBuilderClassNames, QueryBuilderContextValue, QueryBuilderGroupState, QueryBuilderMapping, QueryBuilderProps, QueryBuilderRuleState, QueryBuilderSizes, QueryBuilderState, QueryBuilderValueEditors } from './components/query-builder/types.js';
31
16
  export { radioClassNames, radioColorVars, radioGroupStateVars, radioSpaceVars, radioStateVars } from './components/radio/radio.css.js';
32
- export { RadioAlignment, RadioClassNames, RadioGroupProps, RadioGroupState, RadioProps, RadioState } from './components/radio/types.js';
33
17
  export { searchFieldClassNames, searchFieldContainer, searchFieldSpaceVars, searchFieldStateVars } from './components/search-field/search-field.css.js';
34
- export { SearchFieldClassNames, SearchFieldMapping, SearchFieldProps, SearchFieldRenderProps, SearchFieldState } from './components/search-field/types.js';
35
18
  export { selectClassNames, selectColorVars, selectContainer, selectSpaceVars, selectStateVars } from './components/select/select.css.js';
36
- export { SelectClassNames, SelectMapping, SelectProps, SelectRenderProps, SelectState } from './components/select/types.js';
37
19
  export { sliderClassNames, sliderColorVars, sliderSpaceVars, sliderStateVars, sliderThumbStateVars } from './components/slider/slider.css.js';
38
- export { SliderClassNames, SliderLayout, SliderProps, SliderRenderProps, SliderState, SliderThumbState } from './components/slider/types.js';
39
20
  export { switchClassNames, switchColorVars, switchContainer, switchSpaceVars, switchStateVars } from './components/switch/switch.css.js';
40
- export { SwitchAlignment, SwitchClassNames, SwitchProps, SwitchRenderProps, SwitchState } from './components/switch/types.js';
41
21
  export { tabColorVars, tabListStateVars, tabPanelStateVars, tabPanelsStateVars, tabSpaceVars, tabStateVars, tabsClassNames, tabsContainers } from './components/tabs/tabs.css.js';
42
- export { TabListAlignment, TabListAnchor, TabListProps, TabListState, TabListVariants, TabPanelProps, TabPanelRenderProps, TabPanelState, TabPanelsProps, TabPanelsState, TabProps, TabRenderProps, TabState, TabsClassNames, TabsProps } from './components/tabs/types.js';
43
22
  export { textFieldClassNames, textFieldColorVars, textFieldContainer, textFieldSpaceVars, textFieldStateVars } from './components/text-field/text-field.css.js';
44
- export { TextFieldClassNames, TextFieldMapping, TextFieldProps, TextFieldSizes, TextFieldState } from './components/text-field/types.js';
45
23
  export { textAreaClassNames, textAreaColorVars, textAreaContainer, textAreaSpaceVars, textAreaStateVars } from './components/textarea/textarea.css.js';
46
- export { TextAreaClassNames, TextAreaProps, TextAreaRenderProps, TextAreaState } from './components/textarea/types.js';
47
24
  export { tooltipClassNames, tooltipContainers, tooltipSpaceVars, tooltipStateVars, tooltipTargetStateVars } from './components/tooltip/tooltip.css.js';
48
- export { TooltipClassNames, TooltipMapping, TooltipProps, TooltipRenderProps, TooltipState, TooltipTargetProps, TooltipTargetState } from './components/tooltip/types.js';
49
25
  export { treeClassNames, treeColorVars, treeContainers, treeGroupStateVars, treeIndicatorStateVars, treeItemStateVars, treeSpaceVars, treeStateVars } from './components/tree/tree.css.js';
50
- export { TreeClassNames, TreeGroupProps, TreeGroupRenderProps, TreeGroupState, TreeIndicatorRenderProps, TreeIndicatorState, TreeItemProps, TreeItemRenderProps, TreeItemState, TreeMapping, TreeProps, TreeRenderProps, TreeSizes, TreeState, TreeStateContextValue } from './components/tree/types.js';
51
- export { DefaultsContext, DefaultsProviderProps } from './hooks/use-defaults/types.js';
52
- export { ThemeContext, ThemeProviderProps, ThemeVars } from './hooks/use-theme/types.js';
53
26
  export { layers } from './styles/layers.css.js';
54
27
  export { surfaces } from './styles/surfaces.css.js';
55
28
  export { defaultElevationVarValues, defaultElevations, defaultFocus, defaultFocusVarValues, defaultGenericColorVarValues, defaultGenericColors, defaultRadius, defaultRadiusVarValues, defaultSemanticColorVarValues, defaultSemanticColors, defaultSizes, defaultSizesVarValues, defaultSpace, defaultSpaceVarValues, defaultTypography, defaultTypographyVarValues, defaultZIndex, defaultZIndexVarValues, elevationVars, focusOutlineStyle, focusVars, genericColorVars, radiusVars, semanticColorVars, sizeVars, spaceVars, typographyVars, zIndexVars } from './styles/theme.css.js';
56
29
  export { bodies, families, headings, inputs, label } from './styles/typography.css.js';
30
+ export { applyThemeVars, assignPartialVars, computeContract, containerQueries, containerQuery, inlineVars, reduceContract, unwrapCssVar } from './utils/css/index.js';
31
+ export { ButtonClassNames, ButtonColors, ButtonMapping, ButtonProps, ButtonRenderProps, ButtonSizes, ButtonState, LinkButtonProps, ToggleButtonProps } from './components/button/types.js';
32
+ export { CheckboxAlignment, CheckboxClassNames, CheckboxGroupProps, CheckboxGroupRenderProps, CheckboxGroupState, CheckboxProps, CheckboxRenderProps, CheckboxState } from './components/checkbox/types.js';
33
+ export { ChipClassNames, ChipColors, ChipGroupProps, ChipItemProps, ChipListProps, ChipMapping, ChipProps, ChipRenderProps, ChipSizes, ChipState } from './components/chip/types.js';
34
+ export { ComboBoxClassNames, ComboBoxMapping, ComboBoxProps, ComboBoxRenderProps, ComboBoxSizes, ComboBoxState } from './components/combo-box/types.js';
35
+ export { DialogClassNames, DialogMapping, DialogProps, DialogRenderProps, DialogSizes, DialogState } from './components/dialog/types.js';
36
+ export { DrawerAnchor, DrawerClassNames, DrawerDialogProps, DrawerDialogState, DrawerMapping, DrawerProps, DrawerRenderProps, DrawerState, DrawerTabListProps, DrawerTabProps, DrawerTabRenderProps } from './components/drawer/types.js';
37
+ export { GroupClassNames, GroupProps, GroupState } from './components/group/types.js';
38
+ export { IconClassNames, IconProps, IconSizes, IconState } from './components/icon/types.js';
39
+ export { InputClassNames, InputMapping, InputProps, InputRenderProps, InputState, InputType } from './components/input/types.js';
40
+ export { MenuClassNames, MenuItemProps, MenuItemRenderProps, MenuItemState, MenuListProps, MenuMapping, MenuProps, MenuSizes, MenuState } from './components/menu/types.js';
41
+ export { NumberFieldClassNames, NumberFieldMapping, NumberFieldProps, NumberFieldSizes, NumberFieldState } from './components/number-field/types.js';
42
+ export { OptionsClassNames, OptionsItemProps, OptionsItemState, OptionsListProps, OptionsListState, OptionsMapping, OptionsProps, OptionsSizes, OptionsState } from './components/options/types.js';
43
+ export { PickerClassNames, PickerItemProps, PickerItemRenderProps, PickerItemState, PickerProps, PickerState } from './components/picker/types.js';
44
+ export { PopoverClassNames, PopoverProps, PopoverState } from './components/popover/types.js';
45
+ export { QueryBuilderClassNames, QueryBuilderContextValue, QueryBuilderGroupState, QueryBuilderMapping, QueryBuilderProps, QueryBuilderRuleState, QueryBuilderSizes, QueryBuilderState, QueryBuilderValueEditors } from './components/query-builder/types.js';
46
+ export { RadioAlignment, RadioClassNames, RadioGroupProps, RadioGroupState, RadioProps, RadioState } from './components/radio/types.js';
47
+ export { SearchFieldClassNames, SearchFieldMapping, SearchFieldProps, SearchFieldRenderProps, SearchFieldState } from './components/search-field/types.js';
48
+ export { SelectClassNames, SelectMapping, SelectProps, SelectRenderProps, SelectState } from './components/select/types.js';
49
+ export { SliderClassNames, SliderLayout, SliderProps, SliderRenderProps, SliderState, SliderThumbState } from './components/slider/types.js';
50
+ export { SwitchAlignment, SwitchClassNames, SwitchProps, SwitchRenderProps, SwitchState } from './components/switch/types.js';
51
+ export { TabListAlignment, TabListAnchor, TabListProps, TabListState, TabListVariants, TabPanelProps, TabPanelRenderProps, TabPanelState, TabPanelsProps, TabPanelsState, TabProps, TabRenderProps, TabState, TabsClassNames, TabsProps } from './components/tabs/types.js';
52
+ export { TextFieldClassNames, TextFieldMapping, TextFieldProps, TextFieldSizes, TextFieldState } from './components/text-field/types.js';
53
+ export { TextAreaClassNames, TextAreaProps, TextAreaRenderProps, TextAreaState } from './components/textarea/types.js';
54
+ export { TooltipClassNames, TooltipMapping, TooltipProps, TooltipRenderProps, TooltipState, TooltipTargetProps, TooltipTargetState } from './components/tooltip/types.js';
55
+ export { TreeClassNames, TreeGroupProps, TreeGroupRenderProps, TreeGroupState, TreeIndicatorRenderProps, TreeIndicatorState, TreeItemProps, TreeItemRenderProps, TreeItemState, TreeMapping, TreeProps, TreeRenderProps, TreeSizes, TreeState, TreeStateContextValue } from './components/tree/types.js';
56
+ export { DefaultsContext, DefaultsProviderProps } from './hooks/use-defaults/types.js';
57
+ export { ThemeContext, ThemeProviderProps, ThemeVars } from './hooks/use-theme/types.js';
57
58
  export { RGBA } from './types/deckgl.js';
58
59
  export { AsType } from './types/generic.js';
59
60
  export { ClassNames, OmitProtectedProps } from './types/props.js';
60
61
  export { ChildrenRenderProps, ClassNameRenderProps, ProviderValue, ProviderValues, RenderProps, RenderPropsChildren, RenderPropsClassName, RenderPropsStyle, StylePropRenderProps, StyleRenderProps } from './types/react-aria.js';
61
62
  export { TreeActions, TreeGroupNode, TreeItemNode, TreeNode, TreeNodes, UseTreeOptions, UseTreeResult } from './types/use-tree.js';
62
63
  export { Contract, CssVarFunction, MapLeafNodes, PartialMapLeafNodes, Primitive } from './types/vanilla-extract.js';
63
- export { applyThemeVars, assignPartialVars, computeContract, containerQueries, containerQuery, inlineVars, reduceContract, unwrapCssVar } from './utils/css/index.js';
64
+ import '@vanilla-extract/css';
64
65
  import 'react-aria-components';
65
66
  import '@react-types/shared';
66
67
  import 'type-fest';
@@ -72,5 +73,4 @@ import './components/date-field/types.js';
72
73
  import './components/date-input/types.js';
73
74
  import '@react-stately/datepicker';
74
75
  import './components/time-field/types.js';
75
- import '@vanilla-extract/css';
76
76
  import '@react-stately/data';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@accelint/design-system",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "private": false,
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -42,63 +42,63 @@
42
42
  }
43
43
  },
44
44
  "peerDependencies": {
45
- "@internationalized/date": "^3.8.0",
46
- "@react-aria/collections": "^3.0.0",
47
- "@react-aria/datepicker": "^3.14.5",
48
- "@react-aria/dnd": "^3.10.1",
49
- "@react-aria/focus": "^3.20.5",
50
- "@react-aria/i18n": "^3.12.10",
51
- "@react-aria/interactions": "^3.25.3",
52
- "@react-aria/menu": "^3.19.3",
53
- "@react-aria/overlays": "^3.27.3",
54
- "@react-aria/ssr": "^3.9.6",
55
- "@react-aria/utils": "^3.29.1",
56
- "@react-stately/data": "^3.13.1",
57
- "@react-stately/datepicker": "^3.14.2",
58
- "@react-stately/overlays": "^3.6.17",
59
- "@react-stately/utils": "^3.10.7",
60
- "@react-types/shared": "^3.31.0",
61
- "react": "19.1.1",
45
+ "@internationalized/date": "^3.9.0",
46
+ "@react-aria/collections": "~3.0.0",
47
+ "@react-aria/datepicker": "~3.14.5",
48
+ "@react-aria/dnd": "~3.11.2",
49
+ "@react-aria/focus": "~3.20.5",
50
+ "@react-aria/i18n": "~3.12.10",
51
+ "@react-aria/interactions": "~3.26.0",
52
+ "@react-aria/menu": "~3.19.3",
53
+ "@react-aria/overlays": "~3.29.1",
54
+ "@react-aria/ssr": "~3.9.10",
55
+ "@react-aria/utils": "~3.29.1",
56
+ "@react-stately/data": "~3.13.2",
57
+ "@react-stately/datepicker": "~3.14.2",
58
+ "@react-stately/overlays": "~3.6.17",
59
+ "@react-stately/utils": "~3.10.8",
60
+ "@react-types/shared": "~3.32.0",
62
61
  "react-aria-components": "1.12.1",
63
- "react-dom": "19.1.1",
64
- "react-querybuilder": "^8.8.1"
62
+ "react-dom": "~19.1.1",
63
+ "react": "~19.1.1",
64
+ "react-querybuilder": "^8.10.0"
65
65
  },
66
66
  "devDependencies": {
67
- "@accelint/biome-config": "0.1.2",
68
- "@accelint/typescript-config": "0.1.2",
69
- "@accelint/vitest-config": "0.1.3",
67
+ "@accelint/biome-config": "1.0.2",
68
+ "@accelint/typescript-config": "0.1.4",
69
+ "@accelint/vitest-config": "0.1.6",
70
70
  "@fontsource-variable/roboto-flex": "^5.2.8",
71
71
  "@fontsource-variable/roboto-mono": "^5.2.8",
72
- "@ladle/react": "^5.0.0",
73
- "@testing-library/dom": "10.4.0",
74
- "@testing-library/jest-dom": "6.6.3",
75
- "@testing-library/react": "16.3.0",
72
+ "@ladle/react": "^5.1.1",
73
+ "@testing-library/dom": "10.4.1",
74
+ "@testing-library/jest-dom": "6.9.1",
75
+ "@testing-library/react": "16.3.1",
76
76
  "@testing-library/user-event": "14.6.1",
77
77
  "@types/lodash": "4.17.10",
78
- "@types/react": "^19.1.9",
79
- "@types/react-dom": "^19.1.9",
80
- "@vanilla-extract/esbuild-plugin": "^2.3.18",
81
- "@vanilla-extract/vite-plugin": "^5.1.1",
82
- "autoprefixer": "10.4.20",
83
- "esbuild-plugin-file-path-extensions": "2.1.3",
78
+ "@types/react": "19.0.0",
79
+ "@types/react-dom": "19.0.0",
80
+ "@vanilla-extract/esbuild-plugin": "^2.3.21",
81
+ "@vanilla-extract/vite-plugin": "^5.1.4",
82
+ "autoprefixer": "10.4.23",
83
+ "esbuild-plugin-file-path-extensions": "2.1.4",
84
84
  "esbuild-plugin-lodash": "1.2.0",
85
85
  "jsdom": "25.0.1",
86
86
  "postcss": "8.4.47",
87
- "react-querybuilder": "^8.8.1",
88
- "tsup": "8.5.0",
89
- "vite": "^6.4.1",
90
- "vitest": "2.1.9"
87
+ "react-querybuilder": "^8.10.0",
88
+ "tsup": "8.5.1",
89
+ "vite": "~7.3.1",
90
+ "vitest": "4.0.16"
91
91
  },
92
92
  "dependencies": {
93
- "@accelint/converters": "0.3.2",
94
- "@accelint/core": "0.4.2",
95
- "@vanilla-extract/css": "1.16.0",
96
- "@vanilla-extract/dynamic": "2.1.2",
93
+ "@accelint/converters": "0.3.6",
94
+ "@accelint/core": "0.5.2",
95
+ "@vanilla-extract/css": "1.18.0",
96
+ "@vanilla-extract/dynamic": "2.1.5",
97
97
  "clsx": "2.1.1",
98
98
  "lodash": "4.17.21",
99
99
  "type-fest": "4.41.0",
100
- "typescript": "5.8.3",
101
- "zod": "4.0.15"
100
+ "typescript": "5.9.3",
101
+ "zod": "4.3.5"
102
102
  },
103
103
  "$schema": "https://json.schemastore.org/package",
104
104
  "author": "https://hypergiant.com",
@@ -107,12 +107,13 @@
107
107
  },
108
108
  "sideEffects": false,
109
109
  "scripts": {
110
- "bench": "pnpm vitest bench --run --dir src",
110
+ "bench": "vitest bench --run --dir src",
111
111
  "build": "rm -rf dist && pnpm tsup --config=tsup.css.config.ts && rm -f dist/index.js && pnpm tsup",
112
112
  "dev": "pnpm tsc --watch",
113
- "index": "pnpm zx ../scripts/indexer.mjs design-system --barrels",
114
- "lint": "pnpm biome lint",
115
- "preview": "pnpm ladle serve",
116
- "test": "pnpm vitest --dir=src"
113
+ "index": "zx ../scripts/indexer.mjs design-system --barrels && biome check src/index.ts --write",
114
+ "lint": "biome check .",
115
+ "lint:fix": "biome check . --write",
116
+ "preview": "ladle serve",
117
+ "test": "vitest --dir=src"
117
118
  }
118
119
  }