@accelint/design-system 0.4.0 → 0.5.0

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 (130) hide show
  1. package/README.md +12 -12
  2. package/dist/components/aria/aria.js.map +1 -1
  3. package/dist/components/button/button.d.ts +1 -1
  4. package/dist/components/button/button.js +1 -1
  5. package/dist/components/button/button.js.map +1 -1
  6. package/dist/components/button/types.d.ts +1 -1
  7. package/dist/components/checkbox/checkbox.d.ts +1 -1
  8. package/dist/components/checkbox/checkbox.js.map +1 -1
  9. package/dist/components/chip/chip.d.ts +1 -1
  10. package/dist/components/chip/chip.js.map +1 -1
  11. package/dist/components/chip/types.d.ts +1 -1
  12. package/dist/components/collection/collection.js.map +1 -1
  13. package/dist/components/combo-box/combo-box.d.ts +1 -1
  14. package/dist/components/combo-box/combo-box.js.map +1 -1
  15. package/dist/components/combo-box/types.d.ts +1 -1
  16. package/dist/components/dialog/dialog.d.ts +1 -1
  17. package/dist/components/dialog/dialog.js.map +1 -1
  18. package/dist/components/dialog/types.d.ts +1 -1
  19. package/dist/components/drawer/drawer.d.ts +1 -1
  20. package/dist/components/drawer/drawer.js +4 -3
  21. package/dist/components/drawer/drawer.js.map +1 -1
  22. package/dist/components/drawer/types.d.ts +2 -2
  23. package/dist/components/element/element.js.map +1 -1
  24. package/dist/components/group/group.d.ts +1 -1
  25. package/dist/components/group/group.js.map +1 -1
  26. package/dist/components/group/types.d.ts +1 -1
  27. package/dist/components/icon/icon.d.ts +1 -1
  28. package/dist/components/icon/types.d.ts +1 -1
  29. package/dist/components/input/input.css.d.ts +1 -1
  30. package/dist/components/input/input.d.ts +4 -4
  31. package/dist/components/input/input.js +3 -3
  32. package/dist/components/input/input.js.map +1 -1
  33. package/dist/components/input/types.d.ts +1 -1
  34. package/dist/components/menu/index.d.ts +1 -1
  35. package/dist/components/menu/menu.css.d.ts +1 -1
  36. package/dist/components/menu/menu.d.ts +2 -2
  37. package/dist/components/menu/menu.js.map +1 -1
  38. package/dist/components/menu/types.d.ts +2 -2
  39. package/dist/components/merge-provider/merge-provider.js +2 -2
  40. package/dist/components/merge-provider/merge-provider.js.map +1 -1
  41. package/dist/components/number-field/number-field.d.ts +1 -1
  42. package/dist/components/number-field/types.d.ts +1 -1
  43. package/dist/components/options/index.d.ts +1 -1
  44. package/dist/components/options/options.css.d.ts +1 -1
  45. package/dist/components/options/options.d.ts +2 -2
  46. package/dist/components/options/options.js.map +1 -1
  47. package/dist/components/options/types.d.ts +2 -2
  48. package/dist/components/picker/picker.d.ts +1 -1
  49. package/dist/components/picker/picker.js +2 -2
  50. package/dist/components/picker/picker.js.map +1 -1
  51. package/dist/components/picker/types.d.ts +1 -1
  52. package/dist/components/popover/popover.d.ts +1 -1
  53. package/dist/components/popover/popover.js +2 -2
  54. package/dist/components/popover/popover.js.map +1 -1
  55. package/dist/components/query-builder/dataset-sample.js +8 -24
  56. package/dist/components/query-builder/dataset-sample.js.map +1 -1
  57. package/dist/components/query-builder/group.js +1 -1
  58. package/dist/components/query-builder/group.js.map +1 -1
  59. package/dist/components/query-builder/query-builder.js +2 -2
  60. package/dist/components/query-builder/query-builder.js.map +1 -1
  61. package/dist/components/query-builder/rule.js.map +1 -1
  62. package/dist/components/query-builder/types.d.ts +3 -3
  63. package/dist/components/query-builder/utils.d.ts +1 -1
  64. package/dist/components/query-builder/utils.js.map +1 -1
  65. package/dist/components/query-builder/value-editor.js +1 -1
  66. package/dist/components/query-builder/value-editor.js.map +1 -1
  67. package/dist/components/query-builder/value-selector.js.map +1 -1
  68. package/dist/components/radio/radio.d.ts +1 -1
  69. package/dist/components/radio/radio.js.map +1 -1
  70. package/dist/components/radio/types.d.ts +1 -1
  71. package/dist/components/search-field/index.d.ts +1 -1
  72. package/dist/components/search-field/search-field.d.ts +1 -1
  73. package/dist/components/search-field/types.d.ts +1 -1
  74. package/dist/components/select/select.d.ts +1 -1
  75. package/dist/components/select/select.js.map +1 -1
  76. package/dist/components/switch/switch.d.ts +1 -1
  77. package/dist/components/tabs/tabs.css.d.ts +2 -2
  78. package/dist/components/tabs/tabs.d.ts +1 -1
  79. package/dist/components/tabs/tabs.js +2 -2
  80. package/dist/components/tabs/tabs.js.map +1 -1
  81. package/dist/components/tabs/types.d.ts +3 -3
  82. package/dist/components/text-field/text-field.d.ts +5 -4
  83. package/dist/components/text-field/types.d.ts +1 -1
  84. package/dist/components/textarea/textarea.css.d.ts +1 -1
  85. package/dist/components/textarea/textarea.d.ts +4 -4
  86. package/dist/components/textarea/textarea.js +5 -5
  87. package/dist/components/textarea/textarea.js.map +1 -1
  88. package/dist/components/textarea/types.d.ts +2 -2
  89. package/dist/components/tooltip/tooltip.d.ts +1 -1
  90. package/dist/components/tooltip/tooltip.js +3 -3
  91. package/dist/components/tooltip/tooltip.js.map +1 -1
  92. package/dist/components/tree/tree.css.d.ts +1 -0
  93. package/dist/components/tree/tree.css.js +2 -2
  94. package/dist/components/tree/tree.css.js.map +1 -1
  95. package/dist/components/tree/tree.d.ts +1 -1
  96. package/dist/components/tree/tree.js +5 -2
  97. package/dist/components/tree/tree.js.map +1 -1
  98. package/dist/components/tree/types.d.ts +4 -4
  99. package/dist/components/tree/utils.js.map +1 -1
  100. package/dist/hooks/use-collection-render/use-collection-render.js +1 -0
  101. package/dist/hooks/use-collection-render/use-collection-render.js.map +1 -1
  102. package/dist/hooks/use-defaults/use-defaults.d.ts +1 -1
  103. package/dist/hooks/use-slot/use-slot.js +3 -3
  104. package/dist/hooks/use-slot/use-slot.js.map +1 -1
  105. package/dist/hooks/use-theme/types.d.ts +1 -1
  106. package/dist/hooks/use-theme/use-theme.d.ts +18 -1
  107. package/dist/hooks/use-theme/use-theme.js.map +1 -1
  108. package/dist/hooks/use-tree/index.d.ts +1 -1
  109. package/dist/hooks/use-tree/use-tree.d.ts +1 -1
  110. package/dist/hooks/use-tree/use-tree.js +10 -5
  111. package/dist/hooks/use-tree/use-tree.js.map +1 -1
  112. package/dist/hooks/use-tree/utils.d.ts +1 -1
  113. package/dist/hooks/use-tree/utils.js +3 -4
  114. package/dist/hooks/use-tree/utils.js.map +1 -1
  115. package/dist/index.css +34 -31
  116. package/dist/ladle/actions.js.map +1 -1
  117. package/dist/test/setup.js +347 -331
  118. package/dist/test/setup.js.map +1 -1
  119. package/dist/types/index.d.ts +1 -1
  120. package/dist/types/react-aria.d.ts +1 -1
  121. package/dist/types/react.d.d.ts +16 -0
  122. package/dist/types/use-tree.d.ts +2 -1
  123. package/dist/utils/css.d.ts +2 -2
  124. package/dist/utils/css.js +5 -5
  125. package/dist/utils/css.js.map +1 -1
  126. package/dist/utils/props.js +5 -6
  127. package/dist/utils/props.js.map +1 -1
  128. package/dist/utils/validators.d.ts +2 -2
  129. package/dist/utils/validators.js.map +1 -1
  130. package/package.json +60 -57
@@ -5,6 +5,6 @@ export { ChildrenRenderProps, ClassNameRenderProps, ProviderValue, ProviderValue
5
5
  export { TreeActions, TreeGroupNode, TreeItemNode, TreeNode, TreeNodes, UseTreeOptions, UseTreeResult } from './use-tree.js';
6
6
  export { Contract, CssVarFunction, MapLeafNodes, PartialMapLeafNodes, Primitive } from './vanilla-extract.js';
7
7
  import 'react';
8
- import '@react-types/shared';
9
8
  import '@react-stately/data';
9
+ import '@react-types/shared';
10
10
  import '@vanilla-extract/css';
@@ -1,4 +1,4 @@
1
- import { CSSProperties, ReactNode, Context } from 'react';
1
+ import { ReactNode, Context, CSSProperties } from 'react';
2
2
 
3
3
  /**
4
4
  * Re-export due to not being exported by library
@@ -1,3 +1,19 @@
1
+ import { ForwardedRef, ReactElement, RefAttributes } from 'react';
2
+
3
+ /*
4
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
5
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License. You may obtain a copy
7
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under
10
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
+ * OF ANY KIND, either express or implied. See the License for the specific language
12
+ * governing permissions and limitations under the License.
13
+ */
14
+
15
+
16
+
1
17
  declare module 'react' {
2
18
  // Redeclare to support generics being passed through component to props
3
19
  function forwardRef<T, P = object>(
@@ -1,5 +1,5 @@
1
- import { Key, Selection, SelectionMode } from '@react-types/shared';
2
1
  import { TreeData } from '@react-stately/data';
2
+ import { Key, SelectionMode, Selection } from '@react-types/shared';
3
3
 
4
4
  type TreeItemNode<T> = {
5
5
  id: Key;
@@ -8,6 +8,7 @@ type TreeItemNode<T> = {
8
8
  value?: T;
9
9
  isViewable?: boolean;
10
10
  isVisible?: boolean;
11
+ isReadOnly?: boolean;
11
12
  };
12
13
  type TreeGroupNode<T> = TreeItemNode<T> & {
13
14
  nodes: TreeNodes<T>[];
@@ -1,6 +1,6 @@
1
1
  import { StyleRule, GlobalStyleRule } from '@vanilla-extract/css';
2
2
  import { RGBA } from '../types/deckgl.js';
3
- import { Contract, PartialMapLeafNodes, Primitive, MapLeafNodes, CssVarFunction } from '../types/vanilla-extract.js';
3
+ import { Contract, MapLeafNodes, Primitive, CssVarFunction, PartialMapLeafNodes } from '../types/vanilla-extract.js';
4
4
 
5
5
  /**
6
6
  * Parse out CSS var name from CSS var implementation
@@ -64,7 +64,7 @@ type MultiContainerQuery<T extends CssVarValues> = {
64
64
  * To provide type safety and ease of use, this function accepts a generic and a contract
65
65
  * The generic type defines the possible values for the parameters defined within the contract
66
66
  *
67
- * Ex: containerQuery<{ foo: boolean }>({ foo: 'var(--foo)' }, { foo: true })
67
+ * Ex: `containerQuery<{ foo: boolean }>({ foo: 'var(--foo)' }, { foo: true })`
68
68
  *
69
69
  * By providing the type constraint and contract, the query parameters will have intellisense
70
70
  * on which parameters exist and what their possible values can be
package/dist/utils/css.js CHANGED
@@ -41,7 +41,7 @@ function reduceContract(contract, values) {
41
41
  { contract, values }
42
42
  ];
43
43
  const vars = {};
44
- for (let node of nodes) {
44
+ for (const node of nodes) {
45
45
  Object.entries(node.values).forEach(([key, value]) => {
46
46
  const cssVarOrSubContract = node.contract[key];
47
47
  if (cssVarOrSubContract == null || value == null) {
@@ -134,11 +134,11 @@ function containerQueries(contract, ...styles) {
134
134
  }
135
135
  function applyThemeVars(contract, styles, layer = layers.variables.l1) {
136
136
  const [style, ...rest] = styles;
137
- const stylesWithQueries = !style.query ? rest : styles;
137
+ const stylesWithQueries = style.query ? styles : rest;
138
138
  return {
139
139
  "@layer": {
140
140
  [layer]: {
141
- ...!style.query ? { vars: style.vars } : {},
141
+ ...style.query ? {} : { vars: style.vars },
142
142
  ...stylesWithQueries.length ? {
143
143
  "@container": containerQueries(contract, ...stylesWithQueries)
144
144
  } : {}
@@ -148,7 +148,7 @@ function applyThemeVars(contract, styles, layer = layers.variables.l1) {
148
148
  }
149
149
  function inlineVars(varsOrContract, values) {
150
150
  return assignInlineVars(
151
- !values ? Object.entries(varsOrContract).reduce(
151
+ values ? assignPartialVars(varsOrContract, values) : Object.entries(varsOrContract).reduce(
152
152
  (acc, [key, value]) => {
153
153
  if (value != null) {
154
154
  acc[key] = `${value}`;
@@ -156,7 +156,7 @@ function inlineVars(varsOrContract, values) {
156
156
  return acc;
157
157
  },
158
158
  {}
159
- ) : assignPartialVars(varsOrContract, values)
159
+ )
160
160
  );
161
161
  }
162
162
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/css.ts"],"names":[],"mappings":";;;;;;AAgCO,SAAS,aAAa,MAAgB,EAAA;AAC3C,EAAO,OAAA,MAAA,CAAO,OAAQ,CAAA,4BAAA,EAA8B,IAAI,CAAA;AAC1D;AAgBO,SAAS,eAAA,CACd,UACA,GACsB,EAAA;AACtB,EAAO,OAAA,MAAA,CAAO,OAAQ,CAAA,QAAQ,CAAE,CAAA,MAAA;AAAA,IAC9B,CAAC,GAAA,EAAK,CAAC,GAAA,EAAK,gBAAgB,CAAM,KAAA;AAChC,MAAA,IAAI,oBAAoB,IAAM,EAAA;AAC5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U,KAAK,CAAA;AAAA,MACjC;AAAA,KACD;AAAA,GACH;AACF;AAmBO,SAAS,eACd,QACA,EAAA,MAAA,EAGA,KAAQ,GAAA,MAAA,CAAO,UAAU,EACd,EAAA;AACX,EAAA,MAAM,CAAC,KAAA,EAAO,GAAG,IAAI,CAAI,GAAA,MAAA;AAEzB,EAAA,MAAM,iBACJ,GAAA,CAAC,KAAM,CAAA,KAAA,GAAQ,IAAO,GAAA,MAAA;AAGxB,EAAO,OAAA;AAAA,IACL,QAAU,EAAA;AAAA,MACR,CAAC,KAAK,GAAG;AAAA,QACP,GAAI,CAAC,KAAM,CAAA,KAAA,GAAQ,EAAE,IAAM,EAAA,KAAA,CAAM,IAAK,EAAA,GAAI,EAAC;AAAA,QAC3C,GAAI,kBAAkB,MAClB,GAAA;AAAA,UACE,YAAc,EAAA,gBAAA,CAAoB,QAAU,EAAA,GAAG,iBAAiB;AAAA,YAElE;AAAC;AACP;AACF,GACF;AACF;AAcO,SAAS,UAAA,CACd,gBACA,MACwB,EAAA;AACxB,EAAO,OAAA,gBAAA;AAAA,IACL,CAAC,MAAA,GACG,MAAO,CAAA,OAAA,CAAQ,cAAc,CAAE,CAAA,MAAA;AAAA,MAC7B,CAAC,GAAA,EAAK,CAAC,GAAA,EAAK,KAAK,CAAM,KAAA;AACrB,QAAA,IAAI,SAAS,IAAM,EAAA;AACjB,UAAI,GAAA,CAAA,GAAG,CAAI,GAAA,CAAA,EAAG,KAAK,CAAA,CAAA;AAAA;AAGrB,QAAO,OAAA,GAAA;AAAA,OACT;AAAA,MACA;AAAC,KACH,GACA,iBAAkB,CAAA,cAAA,EAAqB,MAAM;AAAA,GACnD;AACF","file":"css.js","sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport kebabCase from 'lodash/kebabCase';\nimport { layers } from '../styles';\nimport type { GlobalStyleRule, StyleRule } from '@vanilla-extract/css';\nimport type {\n Contract,\n CssVarFunction,\n MapLeafNodes,\n PartialMapLeafNodes,\n Primitive,\n RGBA,\n} from '../types';\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 (let 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 ? rest : styles\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 ? 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 : assignPartialVars(varsOrContract as T, values),\n );\n}\n"]}
1
+ {"version":3,"sources":["../../src/utils/css.ts"],"names":[],"mappings":";;;;;;AA4CO,SAAS,aAAa,MAAgB,EAAA;AAC3C,EAAO,OAAA,MAAA,CAAO,OAAQ,CAAA,4BAAA,EAA8B,IAAI,CAAA;AAC1D;AAgBO,SAAS,eAAA,CACd,UACA,GACsB,EAAA;AACtB,EAAO,OAAA,MAAA,CAAO,OAAQ,CAAA,QAAQ,CAAE,CAAA,MAAA;AAAA,IAC9B,CAAC,GAAA,EAAK,CAAC,GAAA,EAAK,gBAAgB,CAAM,KAAA;AAChC,MAAA,IAAI,oBAAoB,IAAM,EAAA;AAC5B,QAAA,GAAA,CAAI,GAAG,CAAI,GAAA,IAAA;AAEX,QAAO,OAAA,GAAA;AAAA;AAGT,MAAI,IAAA,OAAO,qBAAqB,QAAU,EAAA;AACxC,QAAA,GAAA,CAAI,GAAG,CAAA,GAAI,eAAgB,CAAA,gBAAA,EAAkB,GAAG,CAAA;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AAEzB,EAAM,MAAA,iBAAA,GACJ,KAAM,CAAA,KAAA,GAAQ,MAAS,GAAA,IAAA;AAGzB,EAAO,OAAA;AAAA,IACL,QAAU,EAAA;AAAA,MACR,CAAC,KAAK,GAAG;AAAA,QACP,GAAI,MAAM,KAAQ,GAAA,KAAK,EAAE,IAAA,EAAM,MAAM,IAAK,EAAA;AAAA,QAC1C,GAAI,kBAAkB,MAClB,GAAA;AAAA,UACE,YAAc,EAAA,gBAAA,CAAoB,QAAU,EAAA,GAAG,iBAAiB;AAAA,YAElE;AAAC;AACP;AACF,GACF;AACF;AAcO,SAAS,UAAA,CACd,gBACA,MACwB,EAAA;AACxB,EAAO,OAAA,gBAAA;AAAA,IACL,MAAA,GACI,kBAAkB,cAAqB,EAAA,MAAM,IAC7C,MAAO,CAAA,OAAA,CAAQ,cAAc,CAAE,CAAA,MAAA;AAAA,MAC7B,CAAC,GAAA,EAAK,CAAC,GAAA,EAAK,KAAK,CAAM,KAAA;AACrB,QAAA,IAAI,SAAS,IAAM,EAAA;AACjB,UAAI,GAAA,CAAA,GAAG,CAAI,GAAA,CAAA,EAAG,KAAK,CAAA,CAAA;AAAA;AAGrB,QAAO,OAAA,GAAA;AAAA,OACT;AAAA,MACA;AAAC;AACH,GACN;AACF","file":"css.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 type { GlobalStyleRule, StyleRule } from '@vanilla-extract/css';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport kebabCase from 'lodash/kebabCase';\nimport { layers } from '../styles';\nimport type {\n Contract,\n CssVarFunction,\n MapLeafNodes,\n PartialMapLeafNodes,\n Primitive,\n RGBA,\n} from '../types';\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"]}
@@ -1,7 +1,7 @@
1
1
  import '../chunk-PZ5AY32C.js';
2
+ import { mergeProps as mergeProps$1 } from '@react-aria/utils';
2
3
  import { clsx } from 'clsx';
3
4
  import mergeWith from 'lodash/mergeWith';
4
- import { mergeProps as mergeProps$1 } from '@react-aria/utils';
5
5
  import { composeRenderProps } from 'react-aria-components';
6
6
  import { z } from 'zod';
7
7
 
@@ -30,7 +30,8 @@ function mergeStaticClassName(...propsToMerge) {
30
30
  if (typeof props?.className !== "string") {
31
31
  return acc;
32
32
  }
33
- return [...acc, props.className];
33
+ acc.push(props.className);
34
+ return acc;
34
35
  }, [])
35
36
  );
36
37
  }
@@ -95,10 +96,8 @@ function mergeStaticStyle(...propsToMerge) {
95
96
  if (!props?.style) {
96
97
  return acc;
97
98
  }
98
- return {
99
- ...acc,
100
- ...props.style
101
- };
99
+ Object.assign(acc, props.style);
100
+ return acc;
102
101
  }, {});
103
102
  }
104
103
  function mergeStyleProps(...propsToMerge) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/props.ts"],"names":["mergePropsWithoutStyles"],"mappings":";;;;;;;AAmBA,SAAS,2BAAA,CACP,KACA,EAAA,WAAA,EAAA,GACG,YACK,EAAA;AACR,EAAI,IAAA,CAAC,aAAa,MAAQ,EAAA;AACxB,IAAO,OAAA,EAAA;AAAA;AAGT,EAAA,MAAM,CAAC,KAAA,EAAO,GAAG,IAAI,CAAI,GAAA,YAAA;AAEzB,EAAO,OAAA,IAAA;AAAA,IACL,KAAA;AAAA,IACA,kBAAA;AAAA,MACE,OAAO,SAAa,IAAA,EAAA;AAAA,MACpB,CAAC,IAAS,KAAA,2BAAA,CAA4B,IAAM,EAAA,WAAA,EAAa,GAAG,IAAI;AAAA,MAChE,WAAW;AAAA,GACf;AACF;AAKA,SAAS,wBACJ,YACH,EAAA;AACA,EAAO,OAAA,kBAAA;AAAA,IACL,CAAC,WAAgB,KAAA,WAAA,CAAY,gBAAoB,IAAA,EAAA;AAAA,IACjD,CAAC,IAAM,EAAA,WAAA,KACL,4BAA4B,IAAM,EAAA,WAAA,EAAa,GAAG,YAAY;AAAA,GAClE;AACF;AAKA,SAAS,wBACJ,YACH,EAAA;AACA,EAAO,OAAA,IAAA;AAAA,IACL,YAAa,CAAA,MAAA,CAAiB,CAAC,GAAA,EAAK,KAAU,KAAA;AAC5C,MAAI,IAAA,OAAO,KAAO,EAAA,SAAA,KAAc,QAAU,EAAA;AACxC,QAAO,OAAA,GAAA;AAAA;AAGT,MAAA,OAAO,CAAC,GAAG,GAAK,EAAA,KAAA,CAAM,SAAS,CAAA;AAAA,KACjC,EAAG,EAAE;AAAA,GACP;AACF;AAKA,SAAS,uBACJ,YACH,EAAA;AACA,EAAA,MAAM,eAAe,YAAa,CAAA,IAAA;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port mergeWith from 'lodash/mergeWith';\nimport type { CSSProperties } from 'react';\nimport { mergeProps as mergePropsWithoutStyles } from '@react-aria/utils';\nimport { composeRenderProps } from 'react-aria-components';\nimport { z } from 'zod';\nimport type {\n ClassNameRenderProps,\n ClassNames,\n RenderProps,\n StylePropRenderProps,\n AsType,\n} from '../types';\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 return [...acc, props.className];\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 {\n ...acc,\n ...props.style,\n };\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.ts"],"names":["mergePropsWithoutStyles"],"mappings":";;;;;;;AA+BA,SAAS,2BAAA,CACP,KACA,EAAA,WAAA,EAAA,GACG,YACK,EAAA;AACR,EAAI,IAAA,CAAC,aAAa,MAAQ,EAAA;AACxB,IAAO,OAAA,EAAA;AAAA;AAGT,EAAA,MAAM,CAAC,KAAA,EAAO,GAAG,IAAI,CAAI,GAAA,YAAA;AAEzB,EAAO,OAAA,IAAA;AAAA,IACL,KAAA;AAAA,IACA,kBAAA;AAAA,MACE,OAAO,SAAa,IAAA,EAAA;AAAA,MACpB,CAAC,IAAS,KAAA,2BAAA,CAA4B,IAAM,EAAA,WAAA,EAAa,GAAG,IAAI;AAAA,MAChE,WAAW;AAAA,GACf;AACF;AAKA,SAAS,wBACJ,YACH,EAAA;AACA,EAAO,OAAA,kBAAA;AAAA,IACL,CAAC,WAAgB,KAAA,WAAA,CAAY,gBAAoB,IAAA,EAAA;AAAA,IACjD,CAAC,IAAM,EAAA,WAAA,KACL,4BAA4B,IAAM,EAAA,WAAA,EAAa,GAAG,YAAY;AAAA,GAClE;AACF;AAKA,SAAS,wBACJ,YACH,EAAA;AACA,EAAO,OAAA,IAAA;AAAA,IACL,YAAa,CAAA,MAAA,CAAiB,CAAC,GAAA,EAAK,KAAU,KAAA;AAC5C,MAAI,IAAA,OAAO,KAAO,EAAA,SAAA,KAAc,QAAU,EAAA;AACxC,QAAO,OAAA,GAAA;AAAA;AAGT,MAAI,GAAA,CAAA,IAAA,CAAK,MAAM,SAAS,CAAA;AAExB,MAAO,OAAA,GAAA;AAAA,KACT,EAAG,EAAE;AAAA,GACP;AACF;AAKA,SAAS,uBACJ,YACH,EAAA;AACA,EAAA,MAAM,eAAe,YAAa,CAAA,IAAA;AAAA,IAChC,CAAC,KAAA,KAAU,OAAO,KAAA,EAAO,SAAc,KAAA;AAAA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IAAA;AAAA,IAC9B,CAAC,KAAU,KAAA,OAAO,OAAO,KAAU,KAAA,QAAA,IAAY,MAAM,KAAS,IAAA;AAAA,GAChE;AAEA,EAAI,IAAA,EAAE,gBAAgB,UAAa,CAAA,EAAA;AACjC,IAAO,OAAA,MAAA;AAAA;AAGT,EAAA,OAAO,eACH,gBAAiB,CAAA,GAAG,YAAY,CAChC,GAAA,gBAAA,CAAiB,GAAG,YAAY,CAAA;AACtC;AAKO,SAAS,cAAgC,YAA6B,EAAA;AAC3E,EAAM,MAAA,SAAA,GAAY,mBAAoB,CAAA,GAAG,YAAY,CAAA;AACrD,EAAM,MAAA,UAAA,GAAa,oBAAqB,CAAA,GAAG,YAAY,CAAA;AACvD,EAAM,MAAA,KAAA,GAAQ,eAAgB,CAAA,GAAG,YAAY,CAAA;AAE7C,EAAO,OAAA;AAAA,IACL,GAAIA,YAAwB,CAAA,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,MACA,EAAA;AACA,EAAI,IAAA,OAAO,UAAU,UAAY,EAAA;AAC/B,IAAA,OAAQ,MAAgC,MAAM,CAAA;AAAA;AAGhD,EAAO,OAAA,KAAA;AACT;AAWO,SAAS,eAAA,CACd,OACA,MACA,EAAA;AACA,EAAI,IAAA,OAAO,UAAU,UAAY,EAAA;AAC/B,IAAO,OAAA,CAAC,gBACL,KAAoC,CAAA;AAAA,MACnC,GAAG,WAAA;AAAA,MACH,GAAG;AAAA,KACK,CAAA;AAAA;AAGd,EAAO,OAAA,KAAA;AACT","file":"props.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 {\n AsType,\n ClassNameRenderProps,\n ClassNames,\n RenderProps,\n StylePropRenderProps,\n} from '../types';\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"]}
@@ -33,8 +33,8 @@ declare const alphaChannelAsNumberValidator: z.ZodNumber;
33
33
  declare const alphaChannelAsStringValidator: z.ZodEffects<z.ZodPipeline<z.ZodString, z.ZodNumber>, number, string>;
34
34
  /**
35
35
  * Test for and convert CSS RGB(A) values to numeric RGBA tuple
36
- * Will only allow for rgb with 3 valid numbers (0-255){3, intergers only}
37
- * Will only allow for rgba with 4 valid numbers (0-255){3, intergers only} + (0-1){1, decimals allowed}
36
+ * Will only allow for rgb with 3 valid numbers `(0-255){3, intergers only}`
37
+ * Will only allow for rgba with 4 valid numbers `(0-255){3, intergers only} + (0-1){1, decimals allowed}`
38
38
  * Will allow for whitespace spread throughout
39
39
  *
40
40
  * Examples:
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/validators.ts"],"names":[],"mappings":";;;;AAOO,IAAM,2BAA8B,GAAA,CAAA,CAAE,MAAO,EAAA,CAAE,IAAK;AAW9C,IAAA,2BAAA,GAA8B,EACxC,KAAM,CAAA;AAAA,EACL,CAAA,CAAE,QAAQ,GAAG,CAAA;AAAA,EACb,CACG,CAAA,MAAA,EACA,CAAA,QAAA,CAAS,IAAI,CAAA,CACb,SAAU,CAAA,CAAC,KAAU,KAAA,KAAA,CAAM,OAAQ,CAAA,KAAA,EAAO,EAAE,CAAC;AAClD,CAAC,CAAA,CACA,KAAK,CAAE,CAAA,MAAA,CAAO,QAAQ,CAAA,CACtB,KAAK,2BAA2B;AAK5B,IAAM,6BAAgC,GAAA,CAAA,C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AACH;AAOW,IAAA,oBAAA,GAAuB,EAAE,KAAM,CAAA;AAAA,EAC1C,EACG,KAAM,CAAA;AAAA,IACL,6BAAA;AAAA,IACA,6BAAA;AAAA,IACA;AAAA,GACD,EACA,SAAgB,CAAA,CAAC,QAAQ,CAAC,GAAG,GAAK,EAAA,GAAG,CAAC,CAAA;AAAA,EACzC,EAAE,KAAM,CAAA;AAAA,IACN,6BAAA;AAAA,IACA,6BAAA;AAAA,IACA,6BAAA;AAAA,IACA;AAAA,GACD;AACH,CAAC","file":"validators.js","sourcesContent":["import clamp from 'lodash/clamp';\nimport { z } from 'zod';\nimport type { RGBA } from '../types';\n\n/**\n * Test for any safe number that could represent a pixel value\n */\nexport const pixelValueAsNumberValidator = z.number().safe();\n\n/**\n * Test for and capture numeric pixel values\n * Will allow decimals and negative numbers\n *\n * Examples:\n * 0 -> 0\n * 1px -> 1\n * 20.5px -> 20.5\n */\nexport const pixelValueAsStringValidator = z\n .union([\n z.literal('0'),\n z\n .string()\n .endsWith('px')\n .transform((value) => value.replace(/px$/, '')),\n ])\n .pipe(z.coerce.number())\n .pipe(pixelValueAsNumberValidator);\n\n/**\n * Test for an integer in the range of 0-255 as a representation of an RGB color channel value\n */\nexport const colorChannelAsNumberValidator = z\n .number()\n .safe()\n .int()\n .min(0)\n .max(255);\n\n/**\n * Test for and convert CSS RGB color channel to numeric value (0-255)\n */\nexport const colorChannelAsStringValidator = z\n .string()\n .trim()\n .pipe(z.coerce.number())\n .pipe(colorChannelAsNumberValidator);\n\n/**\n * DeckGL treats alpha channel the same as color channels (0-255)\n */\nexport const alphaChannelAsNumberValidator = colorChannelAsNumberValidator;\n\n/**\n * Test for and convert CSS RGBA alpha channel to DeckGL numeric value\n */\nexport const alphaChannelAsStringValidator = z\n .string()\n .trim()\n .pipe(z.coerce.number().safe().min(0)) // CSS allows for values greater than 1\n .transform((value) => Math.round(clamp(value, 0, 1) * 255));\n\n/**\n * Test for and convert CSS RGB(A) values to numeric RGBA tuple\n * Will only allow for rgb with 3 valid numbers (0-255){3, intergers only}\n * Will only allow for rgba with 4 valid numbers (0-255){3, intergers only} + (0-1){1, decimals allowed}\n * Will allow for whitespace spread throughout\n *\n * Examples:\n * rgb( 0, 0, 0 ) -> [0, 0, 0, 255]\n * rgba(203,117,98,0.4) -> [203, 117, 98, 102]\n */\nexport const rgbaAsStringValidator = z\n .union([\n z\n .string()\n .startsWith('rgb(')\n .endsWith(')')\n .transform((value) => value.replace(/\\)$/, ',1')), // Add on 100% alpha channel\n z\n .string()\n .startsWith('rgba(')\n .endsWith(')')\n .transform((value) => value.replace(/\\)$/, '')),\n ])\n .transform((value) => value.replace(/^rgba?\\(/, '').split(','))\n .pipe(\n z.tuple([\n colorChannelAsStringValidator,\n colorChannelAsStringValidator,\n colorChannelAsStringValidator,\n alphaChannelAsStringValidator,\n ]),\n );\n\n/**\n * Test for numeric RGB(A) tuple\n *\n * Will return RGB as RGBA with 100% alpha channel\n */\nexport const rgbaAsTupleValidator = z.union([\n z\n .tuple([\n colorChannelAsNumberValidator,\n colorChannelAsNumberValidator,\n colorChannelAsNumberValidator,\n ])\n .transform<RGBA>((rgb) => [...rgb, 255]),\n z.tuple([\n colorChannelAsNumberValidator,\n colorChannelAsNumberValidator,\n colorChannelAsNumberValidator,\n alphaChannelAsNumberValidator,\n ]),\n]);\n"]}
1
+ {"version":3,"sources":["../../src/utils/validators.ts"],"names":[],"mappings":";;;;AAmBO,IAAM,2BAA8B,GAAA,CAAA,CAAE,MAAO,EAAA,CAAE,IAAK;AAW9C,IAAA,2BAAA,GAA8B,EACxC,KAAM,CAAA;AAAA,EACL,CAAA,CAAE,QAAQ,GAAG,CAAA;AAAA,EACb,CACG,CAAA,MAAA,EACA,CAAA,QAAA,CAAS,IAAI,CAAA,CACb,SAAU,CAAA,CAAC,KAAU,KAAA,KAAA,CAAM,OAAQ,CAAA,KAAA,EAAO,EAAE,CAAC;AAClD,CAAC,CAAA,CACA,KAAK,CAAE,CAAA,MAAA,CAAO,Q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N,6BAAA;AAAA,IACA,6BAAA;AAAA,IACA,6BAAA;AAAA,IACA;AAAA,GACD;AACH;AAOW,IAAA,oBAAA,GAAuB,EAAE,KAAM,CAAA;AAAA,EAC1C,EACG,KAAM,CAAA;AAAA,IACL,6BAAA;AAAA,IACA,6BAAA;AAAA,IACA;AAAA,GACD,EACA,SAAgB,CAAA,CAAC,QAAQ,CAAC,GAAG,GAAK,EAAA,GAAG,CAAC,CAAA;AAAA,EACzC,EAAE,KAAM,CAAA;AAAA,IACN,6BAAA;AAAA,IACA,6BAAA;AAAA,IACA,6BAAA;AAAA,IACA;AAAA,GACD;AACH,CAAC","file":"validators.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 clamp from 'lodash/clamp';\nimport { z } from 'zod';\nimport type { RGBA } from '../types';\n\n/**\n * Test for any safe number that could represent a pixel value\n */\nexport const pixelValueAsNumberValidator = z.number().safe();\n\n/**\n * Test for and capture numeric pixel values\n * Will allow decimals and negative numbers\n *\n * Examples:\n * 0 -> 0\n * 1px -> 1\n * 20.5px -> 20.5\n */\nexport const pixelValueAsStringValidator = z\n .union([\n z.literal('0'),\n z\n .string()\n .endsWith('px')\n .transform((value) => value.replace(/px$/, '')),\n ])\n .pipe(z.coerce.number())\n .pipe(pixelValueAsNumberValidator);\n\n/**\n * Test for an integer in the range of 0-255 as a representation of an RGB color channel value\n */\nexport const colorChannelAsNumberValidator = z\n .number()\n .safe()\n .int()\n .min(0)\n .max(255);\n\n/**\n * Test for and convert CSS RGB color channel to numeric value (0-255)\n */\nexport const colorChannelAsStringValidator = z\n .string()\n .trim()\n .pipe(z.coerce.number())\n .pipe(colorChannelAsNumberValidator);\n\n/**\n * DeckGL treats alpha channel the same as color channels (0-255)\n */\nexport const alphaChannelAsNumberValidator = colorChannelAsNumberValidator;\n\n/**\n * Test for and convert CSS RGBA alpha channel to DeckGL numeric value\n */\nexport const alphaChannelAsStringValidator = z\n .string()\n .trim()\n .pipe(z.coerce.number().safe().min(0)) // CSS allows for values greater than 1\n .transform((value) => Math.round(clamp(value, 0, 1) * 255));\n\n/**\n * Test for and convert CSS RGB(A) values to numeric RGBA tuple\n * Will only allow for rgb with 3 valid numbers `(0-255){3, intergers only}`\n * Will only allow for rgba with 4 valid numbers `(0-255){3, intergers only} + (0-1){1, decimals allowed}`\n * Will allow for whitespace spread throughout\n *\n * Examples:\n * rgb( 0, 0, 0 ) -> [0, 0, 0, 255]\n * rgba(203,117,98,0.4) -> [203, 117, 98, 102]\n */\nexport const rgbaAsStringValidator = z\n .union([\n z\n .string()\n .startsWith('rgb(')\n .endsWith(')')\n .transform((value) => value.replace(/\\)$/, ',1')), // Add on 100% alpha channel\n z\n .string()\n .startsWith('rgba(')\n .endsWith(')')\n .transform((value) => value.replace(/\\)$/, '')),\n ])\n .transform((value) => value.replace(/^rgba?\\(/, '').split(','))\n .pipe(\n z.tuple([\n colorChannelAsStringValidator,\n colorChannelAsStringValidator,\n colorChannelAsStringValidator,\n alphaChannelAsStringValidator,\n ]),\n );\n\n/**\n * Test for numeric RGB(A) tuple\n *\n * Will return RGB as RGBA with 100% alpha channel\n */\nexport const rgbaAsTupleValidator = z.union([\n z\n .tuple([\n colorChannelAsNumberValidator,\n colorChannelAsNumberValidator,\n colorChannelAsNumberValidator,\n ])\n .transform<RGBA>((rgb) => [...rgb, 255]),\n z.tuple([\n colorChannelAsNumberValidator,\n colorChannelAsNumberValidator,\n colorChannelAsNumberValidator,\n alphaChannelAsNumberValidator,\n ]),\n]);\n"]}
package/package.json CHANGED
@@ -1,14 +1,12 @@
1
1
  {
2
- "$schema": "https://json.schemastore.org/package",
3
2
  "name": "@accelint/design-system",
4
- "version": "0.4.0",
5
- "author": "https://hypergiant.com",
3
+ "version": "0.5.0",
4
+ "private": false,
6
5
  "license": "Apache-2.0",
7
- "publishConfig": {
8
- "access": "public"
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/gohypergiant/standard-toolkit"
9
9
  },
10
- "private": false,
11
- "sideEffects": false,
12
10
  "type": "module",
13
11
  "files": [
14
12
  "dist/**"
@@ -36,67 +34,72 @@
36
34
  "default": "./dist/vanilla.js"
37
35
  }
38
36
  },
37
+ "peerDependencies": {
38
+ "@react-aria/collections": "3.0.0-alpha.5",
39
+ "@react-aria/dnd": "3.7.4",
40
+ "@react-aria/focus": "3.18.4",
41
+ "@react-aria/interactions": "3.22.4",
42
+ "@react-aria/overlays": "3.23.4",
43
+ "@react-aria/ssr": "3.9.6",
44
+ "@react-aria/utils": "3.25.3",
45
+ "@react-stately/data": "3.11.7",
46
+ "@react-stately/overlays": "3.6.11",
47
+ "@react-stately/utils": "3.10.4",
48
+ "@react-types/shared": "3.25.0",
49
+ "react": "18.3.1",
50
+ "react-aria-components": "1.4.1",
51
+ "react-dom": "18.3.1",
52
+ "react-querybuilder": "7.7.0"
53
+ },
39
54
  "devDependencies": {
40
- "@fontsource/roboto-flex": "^5.1.0",
41
- "@fontsource/roboto-mono": "^5.1.0",
42
- "@ladle/react": "^4.1.2",
43
- "@testing-library/dom": "^10.4.0",
44
- "@testing-library/jest-dom": "^6.5.0",
45
- "@testing-library/react": "^16.0.1",
46
- "@testing-library/user-event": "^14.5.2",
47
- "@types/lodash": "^4.17.10",
48
- "@types/react": "^18.3.11",
49
- "@types/react-dom": "^18.3.1",
50
- "@vanilla-extract/esbuild-plugin": "^2.3.11",
51
- "@vanilla-extract/vite-plugin": "^4.0.16",
52
- "@vitest/coverage-istanbul": "^2.1.3",
53
- "autoprefixer": "^10.4.20",
54
- "esbuild-plugin-file-path-extensions": "^2.1.3",
55
- "esbuild-plugin-lodash": "^1.2.0",
56
- "jsdom": "^25.0.1",
57
- "react-test-renderer": "^18.3.1",
58
- "postcss": "^8.4.47",
59
- "tsup": "^8.3.0",
60
- "vite": "^5.4.9",
61
- "vitest": "^2.1.3",
55
+ "@fontsource/roboto-flex": "5.1.0",
56
+ "@fontsource/roboto-mono": "5.1.0",
57
+ "@ladle/react": "4.1.2",
58
+ "@testing-library/dom": "10.4.0",
59
+ "@testing-library/jest-dom": "6.5.0",
60
+ "@testing-library/react": "16.0.1",
61
+ "@testing-library/user-event": "14.5.2",
62
+ "@types/lodash": "4.17.10",
63
+ "@types/react": "18.3.11",
64
+ "@types/react-dom": "18.3.1",
65
+ "@vanilla-extract/esbuild-plugin": "2.3.11",
66
+ "@vanilla-extract/vite-plugin": "4.0.16",
67
+ "autoprefixer": "10.4.20",
68
+ "esbuild-plugin-file-path-extensions": "2.1.3",
69
+ "esbuild-plugin-lodash": "1.2.0",
70
+ "jsdom": "25.0.1",
71
+ "postcss": "8.4.47",
72
+ "react-test-renderer": "18.3.1",
73
+ "tsup": "8.3.0",
74
+ "vite": "5.4.9",
75
+ "vitest": "2.1.3",
62
76
  "@accelint/typescript-config": "0.1.2",
63
- "@accelint/biome-config": "0.1.2",
64
- "@accelint/vitest-config": "0.1.3"
77
+ "@accelint/vitest-config": "0.1.3",
78
+ "@accelint/biome-config": "0.1.2"
65
79
  },
66
80
  "dependencies": {
67
- "@vanilla-extract/css": "^1.16.0",
68
- "@vanilla-extract/dynamic": "^2.1.2",
69
- "clsx": "^2.1.1",
70
- "lodash": "^4.17.21",
71
- "type-fest": "^4.26.1",
72
- "typescript": "^5.6.3",
73
- "zod": "^3.23.8",
74
- "@accelint/converters": "0.1.3",
75
- "@accelint/core": "0.1.3"
81
+ "@vanilla-extract/css": "1.16.0",
82
+ "@vanilla-extract/dynamic": "2.1.2",
83
+ "clsx": "2.1.1",
84
+ "lodash": "4.17.21",
85
+ "type-fest": "4.26.1",
86
+ "typescript": "5.6.3",
87
+ "zod": "3.23.8",
88
+ "@accelint/core": "0.1.3",
89
+ "@accelint/converters": "0.2.0"
76
90
  },
77
- "peerDependencies": {
78
- "@react-aria/collections": "^3.0.0-alpha.5",
79
- "@react-aria/dnd": "^3.7.4",
80
- "@react-aria/focus": "^3.18.4",
81
- "@react-aria/interactions": "^3.22.4",
82
- "@react-aria/overlays": "^3.23.4",
83
- "@react-aria/ssr": "^3.9.6",
84
- "@react-aria/utils": "^3.25.3",
85
- "@react-stately/data": "^3.11.7",
86
- "@react-stately/overlays": "^3.6.11",
87
- "@react-stately/utils": "^3.10.4",
88
- "@react-types/shared": "^3.25.0",
89
- "react": "^18.3.1 || ^19.0.0-rc-69d4b800-20241021",
90
- "react-aria-components": "^1.4.1",
91
- "react-dom": "^18.3.1 || ^19.0.0-rc-69d4b800-20241021",
92
- "react-querybuilder": "^7.7.0"
91
+ "$schema": "https://json.schemastore.org/package",
92
+ "author": "https://hypergiant.com",
93
+ "publishConfig": {
94
+ "access": "public"
93
95
  },
96
+ "sideEffects": false,
94
97
  "scripts": {
95
98
  "bench": "pnpm vitest bench --run --dir src",
96
99
  "build": "rm -rf dist && pnpm tsup --config=tsup.css.config.ts && rm -f dist/index.js && NODE_OPTIONS=--max_old_space_size=8192 pnpm tsup",
97
100
  "dev": "pnpm tsc --watch",
98
101
  "index": "pnpm zx ../../scripts/indexer.mjs packages/design-system --barrels",
99
- "lint:todo": "pnpm biome lint ./",
102
+ "lint": "pnpm biome lint ./",
100
103
  "preview": "pnpm ladle serve",
101
104
  "test": "pnpm vitest --dir=src"
102
105
  }