@accelint/design-toolkit 2.3.1 → 2.4.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 (115) hide show
  1. package/dist/components/accordion/index.js +1 -1
  2. package/dist/components/accordion/index.js.map +1 -1
  3. package/dist/components/accordion/styles.js +1 -1
  4. package/dist/components/accordion/styles.js.map +1 -1
  5. package/dist/components/avatar/index.d.ts +16 -24
  6. package/dist/components/avatar/index.js +1 -1
  7. package/dist/components/avatar/index.js.map +1 -1
  8. package/dist/components/avatar/styles.d.ts +47 -0
  9. package/dist/components/avatar/styles.js +2 -0
  10. package/dist/components/avatar/styles.js.map +1 -0
  11. package/dist/components/avatar/types.d.ts +19 -0
  12. package/dist/components/avatar/types.js +2 -0
  13. package/dist/components/avatar/types.js.map +1 -0
  14. package/dist/components/badge/index.d.ts +16 -16
  15. package/dist/components/badge/index.js +1 -1
  16. package/dist/components/badge/index.js.map +1 -1
  17. package/dist/components/badge/styles.d.ts +32 -0
  18. package/dist/components/badge/styles.js +2 -0
  19. package/dist/components/badge/styles.js.map +1 -0
  20. package/dist/components/badge/types.d.ts +16 -0
  21. package/dist/components/badge/types.js +2 -0
  22. package/dist/components/badge/types.js.map +1 -0
  23. package/dist/components/button/index.js +1 -1
  24. package/dist/components/button/index.js.map +1 -1
  25. package/dist/components/button/styles.d.ts +12 -103
  26. package/dist/components/button/styles.js +1 -1
  27. package/dist/components/button/styles.js.map +1 -1
  28. package/dist/components/button/types.d.ts +3 -1
  29. package/dist/components/checkbox/index.d.ts +13 -12
  30. package/dist/components/checkbox/index.js +1 -1
  31. package/dist/components/checkbox/index.js.map +1 -1
  32. package/dist/components/checkbox/styles.d.ts +53 -0
  33. package/dist/components/checkbox/styles.js +2 -0
  34. package/dist/components/checkbox/styles.js.map +1 -0
  35. package/dist/components/checkbox/types.d.ts +22 -0
  36. package/dist/components/checkbox/types.js +2 -0
  37. package/dist/components/checkbox/types.js.map +1 -0
  38. package/dist/components/chip/index.js +1 -1
  39. package/dist/components/chip/index.js.map +1 -1
  40. package/dist/components/chip/styles.d.ts +130 -134
  41. package/dist/components/chip/styles.js +1 -1
  42. package/dist/components/chip/styles.js.map +1 -1
  43. package/dist/components/chip/types.d.ts +7 -5
  44. package/dist/components/classification-badge/index.js +1 -1
  45. package/dist/components/classification-badge/index.js.map +1 -1
  46. package/dist/components/classification-badge/styles.d.ts +2 -15
  47. package/dist/components/classification-badge/styles.js +1 -1
  48. package/dist/components/classification-badge/styles.js.map +1 -1
  49. package/dist/components/classification-badge/types.d.ts +3 -1
  50. package/dist/components/icon/index.d.ts +0 -2
  51. package/dist/components/icon/index.js +1 -1
  52. package/dist/components/icon/index.js.map +1 -1
  53. package/dist/components/icon/styles.d.ts +2 -31
  54. package/dist/components/icon/styles.js +1 -1
  55. package/dist/components/icon/styles.js.map +1 -1
  56. package/dist/components/icon/types.d.ts +4 -4
  57. package/dist/components/input/index.d.ts +16 -0
  58. package/dist/components/input/index.js +2 -0
  59. package/dist/components/input/index.js.map +1 -0
  60. package/dist/components/input/styles.d.ts +152 -0
  61. package/dist/components/input/styles.js +2 -0
  62. package/dist/components/input/styles.js.map +1 -0
  63. package/dist/components/input/types.d.ts +20 -0
  64. package/dist/components/input/types.js +2 -0
  65. package/dist/components/input/types.js.map +1 -0
  66. package/dist/components/label/styles.js +1 -1
  67. package/dist/components/label/styles.js.map +1 -1
  68. package/dist/components/menu/index.d.ts +48 -0
  69. package/dist/components/menu/index.js +2 -0
  70. package/dist/components/menu/index.js.map +1 -0
  71. package/dist/components/menu/styles.d.ts +95 -0
  72. package/dist/components/menu/styles.js +2 -0
  73. package/dist/components/menu/styles.js.map +1 -0
  74. package/dist/components/menu/types.d.ts +30 -0
  75. package/dist/components/menu/types.js +2 -0
  76. package/dist/components/menu/types.js.map +1 -0
  77. package/dist/components/query-builder/value-editor.js +1 -1
  78. package/dist/components/query-builder/value-editor.js.map +1 -1
  79. package/dist/components/radio/index.js +1 -1
  80. package/dist/components/radio/index.js.map +1 -1
  81. package/dist/components/switch/styles.js +1 -1
  82. package/dist/components/switch/styles.js.map +1 -1
  83. package/dist/components/text-area-field/index.d.ts +0 -2
  84. package/dist/components/text-area-field/index.js +1 -1
  85. package/dist/components/text-area-field/index.js.map +1 -1
  86. package/dist/components/text-area-field/styles.d.ts +33 -93
  87. package/dist/components/text-area-field/styles.js +1 -1
  88. package/dist/components/text-area-field/styles.js.map +1 -1
  89. package/dist/components/text-area-field/types.d.ts +6 -9
  90. package/dist/components/text-field/index.d.ts +18 -24
  91. package/dist/components/text-field/index.js +1 -1
  92. package/dist/components/text-field/index.js.map +1 -1
  93. package/dist/components/text-field/styles.d.ts +53 -0
  94. package/dist/components/text-field/styles.js +2 -0
  95. package/dist/components/text-field/styles.js.map +1 -0
  96. package/dist/components/text-field/types.d.ts +26 -0
  97. package/dist/components/text-field/types.js +2 -0
  98. package/dist/components/text-field/types.js.map +1 -0
  99. package/dist/icons/catalog.js +1 -1
  100. package/dist/icons/catalog.js.map +1 -1
  101. package/dist/index.css +79 -69
  102. package/dist/index.d.ts +25 -9
  103. package/dist/index.js +1 -1
  104. package/dist/metafile-esm.json +1 -1
  105. package/dist/styles.css +876 -240
  106. package/dist/tokens/{generated/tokens.d.ts → index.d.ts} +19 -4
  107. package/dist/tokens/index.js +2 -0
  108. package/dist/tokens/index.js.map +1 -0
  109. package/dist/tokens/{generated/themes.css → themes.css} +19 -4
  110. package/dist/tokens/{generated/tokens.css → tokens.css} +18 -3
  111. package/dist/tokens/tokens.d.ts +2 -0
  112. package/package.json +7 -6
  113. package/dist/tokens/generated/tokens.js +0 -2
  114. package/dist/tokens/generated/tokens.js.map +0 -1
  115. /package/dist/tokens/{generated/themes.d.ts → themes.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/query-builder/value-editor.tsx"],"names":["name","rule","value","validator","c","jsx","d","h","values","m","option","defaultOptions","type","rest","P","y","valid","reasons","C","inputType","g","valueEditors","RadioGroupValueEditor","SelectValueEditor","SwitchValueEditor","TextValueEditor","ruleProp","props","V","useCallback","index","b","valueAsArray","handleRangeStartChange","multiValueHandler","handleRangeEndChange","valueEditorType","Editor","operator","multiValueOperators","D","term"],"mappings":"4eA6BA,oBAEE,CAAA,CAAA,CAAA,SAAaA,CAAM,CAAA,IAAA,CAAA,CAAA,CAAA,2BAEnBC,CAAAA,CACA,CAAA,IAAA,CAAAC,CACF,CAAA,KACQ,CAAE,CAAA,CAAA,CAAA,CAAA,GAAM,CAAA,KAA8BC,CAAS,CAAA,CAErD,CAAAC,mBAAA,CAAA,CAAA,CAAA,CAAA,CACEC,QACEC,GAAA,CAAAC,QAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,yBAEA,CAAA,CAAA,CAAA,CAAA,YAKN,CAAA,CAAA,CAAA,CAAA,CAAA,SACE,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,SAAaP,CAAM,CAAA,IAAA,CAAA,CAAA,CAAA,SACnB,CAAA,CAAA,CAAA,CAAA,cACAC,CAAAA,CACA,CAAA,IAAA,CAAAC,CAAAA,CACA,KAAA,CAAA,CAAAM,CACF,MACQ,CAAE,CAAA,CAAA,CAAA,CAAA,GAAM,CAAA,KAA8BL,CAAS,CAAA,CAErD,CAAAC,mBAAA,CAAA,CAAA,CAAA,CAAA,CACEC,CAAAA,OAAOC,GAAA,CAANG,KACC,CAAA,KAAOP,CAAAA,CACP,kBACA,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,cACA,CAAA,CAAA,CAAA,CAAA,gCAGC,CAAA,CAAA,CAAA,QAAaQ,CAAAA,CAAAA,EACZL,GAAC,CAAwB,YAAOK,CAAAA,CAAO,KAAA,CACpC,CAAA,CAAA,KAAA,CAAA,QAAO,CAAA,CADEA,CAAAA,KAEZ,CACD,EACH,CAEJ,IAEA,CAAMC,CAAAA,CAA4B,CAAC,CAAA,IAEnC,CAAA,CAAA,EAAA,CAAA,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A,CAAIyC,CAAI,EASzB,CACD,CAAA,CACH,EAKFpC,CAAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAC,GACC,CAAA,KAAA,CAAA,CAAA,QAAS,CAAGqB,GAAAA,CAAO,EACrB,CAEJ,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA","file":"value-editor.js","sourcesContent":["// __private-exports\n/*\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 { useCallback } from 'react';\nimport {\n type InputType,\n type ValueEditorProps,\n useValueEditor,\n} from 'react-querybuilder';\nimport { Checkbox } from '../checkbox';\nimport { Radio } from '../radio';\nimport { Switch } from '../switch';\nimport { TextAreaField } from '../text-area-field';\nimport { TextField } from '../text-field';\nimport type { QueryBuilderValueEditors } from './';\nimport { multiValueOperators } from './constants';\nimport { getValidationResult } from './utils';\nimport { ValueSelector } from './value-selector';\n\nfunction CheckboxValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Checkbox\n isDisabled={disabled}\n isSelected={value}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n />\n );\n}\n\nfunction RadioGroupValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n values,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Radio.Group\n value={value}\n isDisabled={disabled}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n >\n {values?.map((option) => (\n <Radio key={option.name} value={option.value}>\n {option.label}\n </Radio>\n ))}\n </Radio.Group>\n );\n}\n\nconst defaultOptions: unknown[] = [];\n\nfunction SelectValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n type,\n value,\n values = defaultOptions,\n ...rest\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <ValueSelector\n {...rest}\n disabled={disabled}\n multiple={type === 'multiselect'}\n options={values}\n title={name}\n validation={!valid}\n value={value}\n handleOnChange={handleOnChange}\n aria-labelledby={name}\n />\n );\n}\n\nfunction SwitchValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Switch\n isDisabled={disabled}\n isSelected={Boolean(value)}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n />\n );\n}\n\nfunction TextValueEditor({\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n inputType,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextField\n isDisabled={disabled}\n isInvalid={!valid}\n placeholder={placeholder}\n type={(inputType as InputType) ?? 'text'}\n size='small'\n value={value}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n errorMessage={reasons?.join('/n')}\n />\n );\n}\n\nfunction TextareaValueEditor({\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextAreaField\n size='small'\n errorMessage={reasons?.join('/n')}\n inputProps={{ placeholder }}\n value={value}\n isDisabled={disabled}\n isInvalid={!valid}\n onChange={handleOnChange}\n aria-label={name}\n aria-invalid={!valid}\n aria-labelledby={name}\n />\n );\n}\n\nconst valueEditors: QueryBuilderValueEditors = {\n checkbox: CheckboxValueEditor,\n radio: RadioGroupValueEditor,\n select: SelectValueEditor,\n switch: SwitchValueEditor,\n text: TextValueEditor,\n textarea: TextareaValueEditor,\n};\n\nexport function ValueEditor(props: ValueEditorProps) {\n const {\n fieldData: { name, valueEditorType },\n operator,\n rule: ruleProp,\n } = props;\n\n const { valueAsArray, multiValueHandler } = useValueEditor({\n ...props,\n skipHook: true,\n });\n\n const rule = useCallback(\n (index: number) => ({\n ...ruleProp,\n value: valueAsArray[index],\n }),\n [ruleProp, valueAsArray],\n );\n\n const handleRangeStartChange = useCallback(\n (value: string) => multiValueHandler(value, 0),\n [multiValueHandler],\n );\n\n const handleRangeEndChange = useCallback(\n (value: string) => multiValueHandler(value, 1),\n [multiValueHandler],\n );\n\n const type =\n (typeof valueEditorType === 'function'\n ? valueEditorType(operator)\n : valueEditorType) ?? 'text';\n\n const Editor = valueEditors?.[type];\n\n if (operator === 'null' || operator === 'notNull' || !Editor) {\n return null;\n }\n\n if (multiValueOperators.includes(operator)) {\n return (\n <>\n {['start', 'end'].map((term, index) => (\n <div key={`${name}-${term}`}>\n <Editor\n {...props}\n rule={rule(index)}\n value={valueAsArray[index]}\n handleOnChange={\n index ? handleRangeEndChange : handleRangeStartChange\n }\n />\n </div>\n ))}\n </>\n );\n }\n\n return (\n <div>\n <Editor {...props} />\n </div>\n );\n}\n"]}
1
+ {"version":3,"sources":["../../../src/components/query-builder/value-editor.tsx"],"names":["name","rule","value","validator","p","jsx","u","h","values","m","option","defaultOptions","type","rest","P","y","valid","reasons","C","inputType","g","valueEditors","RadioGroupValueEditor","SelectValueEditor","SwitchValueEditor","TextValueEditor","ruleProp","props","V","useCallback","b","valueAsArray","index","handleRangeStartChange","multiValueHandler","handleRangeEndChange","valueEditorType","operator","multiValueOperators","D","A","term"],"mappings":"4eA6BA,SACE,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,SAAaA,CAAM,CAAA,IAAA,CAAA,CAAA,CAAA,SACnB,CAAA,CAAA,CAAA,CAAA,cACAC,C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CAAA,CAAA,CAAIyC,CAAI,EASzB,CACD,EACH,EAKFpC,CAAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAC,GACC,CAAA,KAAA,CAAA,CAAA,QAAS,CAAGqB,GAAAA,CAAO,EACrB,CAEJ,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA","file":"value-editor.js","sourcesContent":["// __private-exports\n/*\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 { useCallback } from 'react';\nimport {\n type InputType,\n type ValueEditorProps,\n useValueEditor,\n} from 'react-querybuilder';\nimport { Checkbox } from '../checkbox';\nimport { Radio } from '../radio';\nimport { Switch } from '../switch';\nimport { TextAreaField } from '../text-area-field';\nimport { TextField } from '../text-field';\nimport type { QueryBuilderValueEditors } from './';\nimport { multiValueOperators } from './constants';\nimport { getValidationResult } from './utils';\nimport { ValueSelector } from './value-selector';\n\nfunction CheckboxValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Checkbox\n isDisabled={disabled}\n isSelected={value}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n />\n );\n}\n\nfunction RadioGroupValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n values,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Radio.Group\n value={value}\n isDisabled={disabled}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n >\n {values?.map((option) => (\n <Radio key={option.name} value={option.value}>\n {option.label}\n </Radio>\n ))}\n </Radio.Group>\n );\n}\n\nconst defaultOptions: unknown[] = [];\n\nfunction SelectValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n type,\n value,\n values = defaultOptions,\n ...rest\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <ValueSelector\n {...rest}\n disabled={disabled}\n multiple={type === 'multiselect'}\n options={values}\n title={name}\n validation={!valid}\n value={value}\n handleOnChange={handleOnChange}\n aria-labelledby={name}\n />\n );\n}\n\nfunction SwitchValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Switch\n isDisabled={disabled}\n isSelected={Boolean(value)}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n />\n );\n}\n\nfunction TextValueEditor({\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n inputType,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextField\n inputProps={{ placeholder }}\n type={(inputType as InputType) ?? 'text'}\n size='small'\n value={value}\n isDisabled={disabled}\n isInvalid={!valid}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n errorMessage={reasons?.join('/n')}\n />\n );\n}\n\nfunction TextareaValueEditor({\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextAreaField\n size='small'\n errorMessage={reasons?.join('/n')}\n inputProps={{ placeholder }}\n value={value}\n isDisabled={disabled}\n isInvalid={!valid}\n onChange={handleOnChange}\n aria-label={name}\n aria-invalid={!valid}\n aria-labelledby={name}\n />\n );\n}\n\nconst valueEditors: QueryBuilderValueEditors = {\n checkbox: CheckboxValueEditor,\n radio: RadioGroupValueEditor,\n select: SelectValueEditor,\n switch: SwitchValueEditor,\n text: TextValueEditor,\n textarea: TextareaValueEditor,\n};\n\nexport function ValueEditor(props: ValueEditorProps) {\n const {\n fieldData: { name, valueEditorType },\n operator,\n rule: ruleProp,\n } = props;\n\n const { valueAsArray, multiValueHandler } = useValueEditor({\n ...props,\n skipHook: true,\n });\n\n const rule = useCallback(\n (index: number) => ({\n ...ruleProp,\n value: valueAsArray[index],\n }),\n [ruleProp, valueAsArray],\n );\n\n const handleRangeStartChange = useCallback(\n (value: string) => multiValueHandler(value, 0),\n [multiValueHandler],\n );\n\n const handleRangeEndChange = useCallback(\n (value: string) => multiValueHandler(value, 1),\n [multiValueHandler],\n );\n\n const type =\n (typeof valueEditorType === 'function'\n ? valueEditorType(operator)\n : valueEditorType) ?? 'text';\n\n const Editor = valueEditors?.[type];\n\n if (operator === 'null' || operator === 'notNull' || !Editor) {\n return null;\n }\n\n if (multiValueOperators.includes(operator)) {\n return (\n <>\n {['start', 'end'].map((term, index) => (\n <div key={`${name}-${term}`}>\n <Editor\n {...props}\n rule={rule(index)}\n value={valueAsArray[index]}\n handleOnChange={\n index ? handleRangeEndChange : handleRangeStartChange\n }\n />\n </div>\n ))}\n </>\n );\n }\n\n return (\n <div>\n <Editor {...props} />\n </div>\n );\n}\n"]}
@@ -1,2 +1,2 @@
1
- import'client-only';import {createContext}from'react';import {Radio,composeRenderProps,useContextProps,RadioGroup}from'react-aria-components';import {Label}from'../label/index.js';import {RadioStyles}from'./styles.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var {group:y,groupLabel:C,radio:A,control:D,label:L}=RadioStyles(),g=createContext(null);function n({ref:o,...e}){[e,o]=useContextProps(e,o??null,g);let{children:s,classNames:a,label:t,isDisabled:p,isRequired:d,...c}=e;return jsx(RadioGroup,{...c,ref:o,className:composeRenderProps(a?.group,l=>y({className:l})),isDisabled:p,isRequired:d,children:composeRenderProps(s,l=>jsxs(Fragment,{children:[t&&jsx(Label,{className:C({className:a?.label}),isDisabled:p,isRequired:d,children:t}),l]}))})}n.displayName="Radio.Group";function u({classNames:o,children:e,...s}){return jsx(Radio,{...s,className:composeRenderProps(o?.radio,a=>A({className:a})),children:composeRenderProps(e,a=>jsxs(Fragment,{children:[jsx("span",{className:D({className:o?.control})}),jsx("span",{className:L({className:o?.label}),children:a})]}))})}u.displayName="Radio";u.Group=n;export{u as Radio,g as RadioContext};//# sourceMappingURL=index.js.map
1
+ import'client-only';import {createContext}from'react';import {Radio,composeRenderProps,useContextProps,RadioGroup}from'react-aria-components';import {Label}from'../label/index.js';import {RadioStyles}from'./styles.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var {group:y,groupLabel:C,radio:A,control:L,label:g}=RadioStyles(),D=createContext(null);function p({ref:o,...r}){[r,o]=useContextProps(r,o??null,D);let{children:s,classNames:a,label:t,...m}=r;return jsx(RadioGroup,{...m,ref:o,className:composeRenderProps(a?.group,l=>y({className:l})),children:composeRenderProps(s,(l,{isDisabled:R,isRequired:c})=>jsxs(Fragment,{children:[t&&jsx(Label,{className:C({className:a?.label}),isDisabled:R,isRequired:c,children:t}),l]}))})}p.displayName="Radio.Group";function d({classNames:o,children:r,...s}){return jsx(Radio,{...s,className:composeRenderProps(o?.radio,a=>A({className:a})),children:composeRenderProps(r,a=>jsxs(Fragment,{children:[jsx("span",{className:L({className:o?.control})}),jsx("span",{className:g({className:o?.label}),children:a})]}))})}d.displayName="Radio";d.Group=p;export{d as Radio,D as RadioContext};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/radio/index.tsx"],"names":["group","groupLabel","radio","control","RadioStyles","x","createContext","b","ref","props","useContextProps","children","classNames","label","isDisabled","AriaRadioGroup","N","composeRenderProps","className","isRequired","jsxs","Fragment","m","jsx","Label","f","RadioGroup","AriaRadio","G","i","Radio"],"mappings":"4QA0BQ,IAAA,CAAA,KAAAA,CAAO,C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AAC,KACE,CAAA,CAAA,GACD,WAAWX,CAAmBL,kBAAAA,CAAAA,CAAY,OAAQM,CAAAA,CAChDhB,EAAM,CAAE,CAAA,CAAA,SAAU,CAAC,CACrB,CAAA,CAEC,CAAA,CAAA,SAAmBS,kBAAAA,CAAWA,CAAAA,CAAAA,CAC7BS,EAAAC,IAAAA,CAAAC,QACE,CAAA,CAAA,QAAAC,EAACM,GAAA,CAAA,MAAK,CAAA,CAAA,SAAW1B,CAAQ,CAAE,CAAA,CAAA,SAAWS,CAAAA,CAAY,SAAS,CAAG,EAC9DW,CAAAA,CAACM,GAAA,CAAA,MAAK,WAAWhB,CAAM,CAAE,CAAA,CAAA,SAAWD,CAAAA,CAAY,EAAA,MAC7C,CAAA,CAAA,QAAAD,CACH,CAAA,CAAA,CACF,CACD,CAAA,CACH,CAEJ,CACAmB,CAAAA,CAAM,CAAA,CAAA,WAAc,CAAA,OACpBA,CAAM,CAAA,CAAA,KAAQJ,CAAAA,CAAAA","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'use client';\n\nimport 'client-only';\nimport { createContext } from 'react';\nimport {\n Radio as AriaRadio,\n RadioGroup as AriaRadioGroup,\n type ContextValue,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Label } from '../label';\nimport { RadioStyles } from './styles';\nimport type { RadioGroupProps, RadioProps } from './types';\n\nconst { group, groupLabel, radio, control, label } = RadioStyles();\n\nexport const RadioContext =\n createContext<ContextValue<RadioGroupProps, HTMLDivElement>>(null);\n\nfunction RadioGroup({ ref, ...props }: RadioGroupProps) {\n [props, ref] = useContextProps(props, ref ?? null, RadioContext);\n\n const { children, classNames, label, isDisabled, isRequired, ...rest } =\n props;\n\n return (\n <AriaRadioGroup\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.group, (className) =>\n group({ className }),\n )}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {composeRenderProps(children, (children) => (\n <>\n {label && (\n <Label\n className={groupLabel({ className: classNames?.label })}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {label}\n </Label>\n )}\n {children}\n </>\n ))}\n </AriaRadioGroup>\n );\n}\nRadioGroup.displayName = 'Radio.Group';\n\nexport function Radio({ classNames, children, ...rest }: RadioProps) {\n return (\n <AriaRadio\n {...rest}\n className={composeRenderProps(classNames?.radio, (className) =>\n radio({ className }),\n )}\n >\n {composeRenderProps(children, (children) => (\n <>\n <span className={control({ className: classNames?.control })} />\n <span className={label({ className: classNames?.label })}>\n {children}\n </span>\n </>\n ))}\n </AriaRadio>\n );\n}\nRadio.displayName = 'Radio';\nRadio.Group = RadioGroup;\n"]}
1
+ {"version":3,"sources":["../../../src/components/radio/index.tsx"],"names":["group","groupLabel","control","RadioStyles","x","RadioContext","createContext","G","ref","props","useContextProps","classNames","label","AriaRadioGroup","b","composeRenderProps","className","children","isDisabled","Fragment","n","jsx","Label","f","isRequired","RadioGroup","AriaRadio","N","radio","jsxs","e","Radio"],"mappings":"4QA0BQ,IAAA,CAAA,KAAAA,CAAO,CAAA,CAAA,UAAAC,CAAY,CAAA,CAAA,MAAO,CAAA,CAAA,OAAAC,CAAS,CAAA,CAAA,KAAM,CAAA,CAAIC,CAAAA,CAAYC,aAEpDC,CACXC,CAAAA,CAA6DC,aAAA,CAAA,IAE/D,EAAA,SAAoB,CAAE,CAAA,CAAA,GAAAC,CAAK,KAAS,CAAoB,CACtD,CAACC,CAAAA,CAAOD,CAAG,CAAA,CAAIE,CAAAA,CAAgBD,eAAAA,CAAOD,GAAO,EAAA,IAAk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AA,CAAY,SAAS,CAAG,EAC9DU,CAAAA,CAACS,GAAA,CAAA,MAAK,WAAWlB,CAAM,CAAE,CAAA,CAAA,SAAWD,CAAAA,CAAY,EAAA,MAC7C,CAAA,CAAA,QAAAM,CACH,CAAA,CAAA,CACF,CACD,CAAA,CACH,CAEJ,CACAc,CAAAA,CAAM,CAAA,CAAA,WAAc,CAAA,OACpBA,CAAM,CAAA,CAAA,KAAQN,CAAAA,CAAAA","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'use client';\n\nimport 'client-only';\nimport { createContext } from 'react';\nimport {\n Radio as AriaRadio,\n RadioGroup as AriaRadioGroup,\n type ContextValue,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Label } from '../label';\nimport { RadioStyles } from './styles';\nimport type { RadioGroupProps, RadioProps } from './types';\n\nconst { group, groupLabel, radio, control, label } = RadioStyles();\n\nexport const RadioContext =\n createContext<ContextValue<RadioGroupProps, HTMLDivElement>>(null);\n\nfunction RadioGroup({ ref, ...props }: RadioGroupProps) {\n [props, ref] = useContextProps(props, ref ?? null, RadioContext);\n\n const { children, classNames, label, ...rest } = props;\n\n return (\n <AriaRadioGroup\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.group, (className) =>\n group({ className }),\n )}\n >\n {composeRenderProps(children, (children, { isDisabled, isRequired }) => (\n <>\n {label && (\n <Label\n className={groupLabel({ className: classNames?.label })}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {label}\n </Label>\n )}\n {children}\n </>\n ))}\n </AriaRadioGroup>\n );\n}\nRadioGroup.displayName = 'Radio.Group';\n\nexport function Radio({ classNames, children, ...rest }: RadioProps) {\n return (\n <AriaRadio\n {...rest}\n className={composeRenderProps(classNames?.radio, (className) =>\n radio({ className }),\n )}\n >\n {composeRenderProps(children, (children) => (\n <>\n <span className={control({ className: classNames?.control })} />\n <span className={label({ className: classNames?.label })}>\n {children}\n </span>\n </>\n ))}\n </AriaRadio>\n );\n}\nRadio.displayName = 'Radio';\nRadio.Group = RadioGroup;\n"]}
@@ -1,2 +1,2 @@
1
- import {tv}from'./../../lib/utils.js';var o=tv({slots:{switch:"group flex cursor-pointer items-center gap-s disabled:cursor-not-allowed",control:["flex rounded-round bg-transparent p-xxs outline outline-interactive before:mr-l before:block before:size-m before:rounded-full before:bg-default-dark","group-enabled:group-focus:bg-interactive-hover-dark group-enabled:group-focus:outline-interactive-hover group-enabled:group-focus:before:bg-interactive-hover","group-enabled:group-hover:bg-interactive-hover-dark group-enabled:group-hover:outline-interactive-hover group-enabled:group-hover:before:bg-interactive-hover","group-enabled:group-selected:outline-highlight group-selected:before:mr-0 group-selected:before:ml-l group-enabled:group-selected:before:bg-highlight","group-enabled:group-selected:group-focus:bg-highlight-subtle group-enabled:group-selected:group-focus:outline-interactive-hover group-enabled:group-selected:group-focus:before:bg-highlight","group-enabled:group-selected:group-hover:bg-highlight-subtle group-enabled:group-selected:group-hover:outline-highlight group-enabled:group-selected:group-hover:before:bg-highlight","group-disabled:bg-interactive-disabled group-disabled:outline-interactive-disabled group-disabled:before:bg-disabled"],label:["text-body-s text-interactive-default","group-disabled:text-interactive-disabled"]}});export{o as SwitchStyles};//# sourceMappingURL=styles.js.map
1
+ import {tv}from'./../../lib/utils.js';var i=tv({slots:{switch:"group/switch flex cursor-pointer items-center gap-s disabled:cursor-not-allowed",control:["flex rounded-round bg-transparent p-xxs outline outline-interactive before:mr-l before:block before:size-m before:rounded-full before:bg-default-dark","group-enabled/switch:group-focus/switch:bg-interactive-hover-dark group-enabled/switch:group-focus/switch:outline-interactive-hover group-enabled/switch:group-focus/switch:before:bg-interactive-hover","group-enabled/switch:group-hover/switch:bg-interactive-hover-dark group-enabled/switch:group-hover/switch:outline-interactive-hover group-enabled/switch:group-hover/switch:before:bg-interactive-hover","group-enabled/switch:group-selected/switch:outline-highlight group-selected/switch:before:mr-0 group-selected/switch:before:ml-l group-enabled/switch:group-selected/switch:before:bg-highlight","group-enabled/switch:group-selected/switch:group-focus/switch:bg-highlight-subtle group-enabled/switch:group-selected/switch:group-focus/switch:outline-interactive-hover group-enabled/switch:group-selected/switch:group-focus/switch:before:bg-highlight","group-enabled/switch:group-selected/switch:group-hover/switch:bg-highlight-subtle group-enabled/switch:group-selected/switch:group-hover/switch:outline-highlight group-enabled/switch:group-selected/switch:group-hover/switch:before:bg-highlight","group-disabled/switch:bg-interactive-disabled group-disabled/switch:outline-interactive-disabled group-disabled/switch:before:bg-disabled"],label:["text-body-s text-interactive-default","group-disabled/switch:text-interactive-disabled"]}});export{i as SwitchStyles};//# sourceMappingURL=styles.js.map
2
2
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/switch/styles.ts"],"names":["e"],"mappings":"sCAeE,IAAA,CAAA,CAAAA,EAAA,CAAO,CACL,KAAA,CAAA,CACE,MAAA,CAAA,0EACF,CAAA,OACE,CAAA,CAAA,uJACA,CAAA,+JACA,CAAA,+JACA,CAAA,uJACA,CAAA,8LACA,CAAA,sLACA,CAAA,sHAEF,CAAO,CACL,KAAA,CAAA,CAAA,sCACA,CAAA,0CAGL,CAAA,CAAA,CAAA","file":"styles.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 { tv } from '@/lib/utils';\n\nexport const SwitchStyles = tv({\n slots: {\n switch:\n 'group flex cursor-pointer items-center gap-s disabled:cursor-not-allowed',\n control: [\n 'flex rounded-round bg-transparent p-xxs outline outline-interactive before:mr-l before:block before:size-m before:rounded-full before:bg-default-dark',\n 'group-enabled:group-focus:bg-interactive-hover-dark group-enabled:group-focus:outline-interactive-hover group-enabled:group-focus:before:bg-interactive-hover',\n 'group-enabled:group-hover:bg-interactive-hover-dark group-enabled:group-hover:outline-interactive-hover group-enabled:group-hover:before:bg-interactive-hover',\n 'group-enabled:group-selected:outline-highlight group-selected:before:mr-0 group-selected:before:ml-l group-enabled:group-selected:before:bg-highlight',\n 'group-enabled:group-selected:group-focus:bg-highlight-subtle group-enabled:group-selected:group-focus:outline-interactive-hover group-enabled:group-selected:group-focus:before:bg-highlight',\n 'group-enabled:group-selected:group-hover:bg-highlight-subtle group-enabled:group-selected:group-hover:outline-highlight group-enabled:group-selected:group-hover:before:bg-highlight',\n 'group-disabled:bg-interactive-disabled group-disabled:outline-interactive-disabled group-disabled:before:bg-disabled',\n ],\n label: [\n 'text-body-s text-interactive-default',\n 'group-disabled:text-interactive-disabled',\n ],\n },\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/switch/styles.ts"],"names":["e"],"mappings":"sCAeE,IAAA,CAAA,CAAAA,EAAA,CAAO,CACL,KAAA,CAAA,CACE,MAAA,CAAA,iFACF,CAAA,OACE,CAAA,CAAA,uJACA,CAAA,yMACA,CAAA,yMACA,CAAA,iMACA,CAAA,6PACA,CAAA,qPACA,CAAA,2IAEF,CAAO,CACL,KAAA,CAAA,CAAA,sCACA,CAAA,iDAGL,CAAA,CAAA,CAAA","file":"styles.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 { tv } from '@/lib/utils';\n\nexport const SwitchStyles = tv({\n slots: {\n switch:\n 'group/switch flex cursor-pointer items-center gap-s disabled:cursor-not-allowed',\n control: [\n 'flex rounded-round bg-transparent p-xxs outline outline-interactive before:mr-l before:block before:size-m before:rounded-full before:bg-default-dark',\n 'group-enabled/switch:group-focus/switch:bg-interactive-hover-dark group-enabled/switch:group-focus/switch:outline-interactive-hover group-enabled/switch:group-focus/switch:before:bg-interactive-hover',\n 'group-enabled/switch:group-hover/switch:bg-interactive-hover-dark group-enabled/switch:group-hover/switch:outline-interactive-hover group-enabled/switch:group-hover/switch:before:bg-interactive-hover',\n 'group-enabled/switch:group-selected/switch:outline-highlight group-selected/switch:before:mr-0 group-selected/switch:before:ml-l group-enabled/switch:group-selected/switch:before:bg-highlight',\n 'group-enabled/switch:group-selected/switch:group-focus/switch:bg-highlight-subtle group-enabled/switch:group-selected/switch:group-focus/switch:outline-interactive-hover group-enabled/switch:group-selected/switch:group-focus/switch:before:bg-highlight',\n 'group-enabled/switch:group-selected/switch:group-hover/switch:bg-highlight-subtle group-enabled/switch:group-selected/switch:group-hover/switch:outline-highlight group-enabled/switch:group-selected/switch:group-hover/switch:before:bg-highlight',\n 'group-disabled/switch:bg-interactive-disabled group-disabled/switch:outline-interactive-disabled group-disabled/switch:before:bg-disabled',\n ],\n label: [\n 'text-body-s text-interactive-default',\n 'group-disabled/switch:text-interactive-disabled',\n ],\n },\n});\n"]}
@@ -2,8 +2,6 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
3
  import { ContextValue } from 'react-aria-components';
4
4
  import { TextAreaFieldProps, TextAreaFieldProviderProps } from './types.js';
5
- import 'tailwind-variants';
6
- import './styles.js';
7
5
 
8
6
  declare const TextAreaFieldContext: react.Context<ContextValue<TextAreaFieldProviderProps, HTMLDivElement>>;
9
7
  declare function TextAreaFieldProvider({ children, ...props }: TextAreaFieldProviderProps): react_jsx_runtime.JSX.Element;
@@ -1,2 +1,2 @@
1
- import'client-only';import {createContext}from'react';import {useContextProps,TextField,composeRenderProps,TextArea,Text,FieldError}from'react-aria-components';import {Label}from'../label/index.js';import {TextAreaStyles,TextAreaStylesDefaults}from'./styles.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var {field:z,label:O,input:V,description:H,error:h}=TextAreaStyles(),P=createContext(null);function T({children:d,...l}){return jsx(P.Provider,{value:l,children:d})}T.displayName="TextAreaField.Provider";function F({ref:d,...l}){[l,d]=useContextProps(l,d??null,P);let{classNames:o,description:p,errorMessage:A,label:x,inputRef:f,inputProps:v,size:i=TextAreaStylesDefaults.size,isDisabled:e,isInvalid:N,isReadOnly:t,isRequired:m,...b}=l,c=A||null,y=N??(c?true:void 0),u=i==="small";return jsx(TextField,{...b,className:composeRenderProps(o?.field,(r,{isInvalid:a})=>z({className:r,size:i,isDisabled:e,isInvalid:a,isReadOnly:t})),isDisabled:e,isInvalid:y,isReadOnly:t,isRequired:m,children:({isInvalid:r})=>jsxs(Fragment,{children:[!u&&!!x&&jsx(Label,{className:O({className:o?.label,size:i,isDisabled:e,isInvalid:r,isReadOnly:t}),isDisabled:e,isRequired:m,children:x}),jsx(TextArea,{ref:f,...v,className:composeRenderProps(o?.input,a=>V({className:a,size:i,isDisabled:e,isInvalid:r,isReadOnly:t}))}),!(u||r)&&!!p&&jsx(Text,{slot:"description",className:H({className:o?.description,size:i,isDisabled:e,isInvalid:r,isReadOnly:t}),children:p}),jsx(FieldError,{className:composeRenderProps(o?.error,a=>h({className:a,size:i,isDisabled:e,isInvalid:r,isReadOnly:t})),children:c})]})})}F.displayName="TextAreaField";F.Provider=T;export{F as TextAreaField,P as TextAreaFieldContext};//# sourceMappingURL=index.js.map
1
+ import'client-only';import {createContext}from'react';import {useContextProps,TextField,composeRenderProps,TextArea,Text,FieldError}from'react-aria-components';import {Label}from'../label/index.js';import {TextAreaStyles}from'./styles.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var {field:I,label:z,input:D,description:R,error:S}=TextAreaStyles(),c=createContext(null);function x({children:r,...t}){return jsx(c.Provider,{value:t,children:r})}x.displayName="TextAreaField.Provider";function P({ref:r,...t}){[t,r]=useContextProps(t,r??null,c);let{classNames:i,description:a,errorMessage:u,label:d,inputProps:T,size:n="medium",isInvalid:v,...F}=t,p=u||null,m=n==="small";return jsx(TextField,{...F,ref:r,className:composeRenderProps(i?.field,o=>I({className:o})),isInvalid:v||(p?true:void 0),"data-size":n,children:({isDisabled:o,isInvalid:A,isRequired:f})=>jsxs(Fragment,{children:[!!d&&!m&&jsx(Label,{className:z({className:i?.label}),isDisabled:o,isRequired:f,children:d}),jsx(TextArea,{...T,className:composeRenderProps(i?.input,l=>D({className:l}))}),!!a&&!(m||A)&&jsx(Text,{slot:"description",className:R({className:i?.description}),children:a}),jsx(FieldError,{className:composeRenderProps(i?.error,l=>S({className:l})),children:p})]})})}P.displayName="TextAreaField";P.Provider=x;export{P as TextAreaField,c as TextAreaFieldContext};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/text-area-field/index.tsx"],"names":["field","label","input","description","TextAreaStyles","L","TextAreaFieldContext","createContext","R","children","props","TextAreaFieldProvider","ref","useContextProps","classNames","descriptionProp","errorMessageProp","inputRef","inputProps","size","TextAreaStylesDefaults","S","isDisabled","isInvalidProp","isRequired","errorMessage","isSmall","TextField","g","className","isInvalid","Fragment","k","labelProp","jsx","Label","E","TextArea","M","composeRenderProps","Text","D","FieldError","C","error","TextAreaField"],"mappings":"wTA6BQ,IAAA,CAAA,KAAAA,CAAO,CAAA,CAAA,KAAAC,CAA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,CACA,MAAAV,CACA,CAAA,CAAA,UAAAG,CACA,CAAA,CAAA,UACA,CAAA,CAAA,UACF,CAAC,CACH,EAEC,CAAA,CAAA,QAAAG,CACH,CAAA,CAAA,CACF,CAAA,CAEJ,CAEJ,CACAoB,CAAAA,CAAc,CAAA,CAAA,WAAc,CAAA,gBACd,CAAA,CAAA,QAAWlC,CAAAA,CAAAA","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\n'use client';\n\nimport 'client-only';\nimport { createContext } from 'react';\nimport {\n type ContextValue,\n FieldError,\n Text,\n TextArea,\n TextField,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Label } from '../label';\nimport { TextAreaStyles, TextAreaStylesDefaults } from './styles';\nimport type { TextAreaFieldProps, TextAreaFieldProviderProps } from './types';\n\nconst { field, label, input, description, error } = TextAreaStyles();\n\nexport const TextAreaFieldContext =\n createContext<ContextValue<TextAreaFieldProviderProps, HTMLDivElement>>(null);\n\nfunction TextAreaFieldProvider({\n children,\n ...props\n}: TextAreaFieldProviderProps) {\n return (\n <TextAreaFieldContext.Provider value={props}>\n {children}\n </TextAreaFieldContext.Provider>\n );\n}\nTextAreaFieldProvider.displayName = 'TextAreaField.Provider';\n\nexport function TextAreaField({ ref, ...props }: TextAreaFieldProps) {\n [props, ref] = useContextProps(props, ref ?? null, TextAreaFieldContext);\n\n const {\n classNames,\n description: descriptionProp,\n errorMessage: errorMessageProp,\n label: labelProp,\n inputRef,\n inputProps,\n size = TextAreaStylesDefaults.size,\n isDisabled,\n isInvalid: isInvalidProp,\n isReadOnly,\n isRequired,\n ...rest\n } = props;\n const errorMessage = errorMessageProp || null; // Protect against empty string\n const isInvalid = isInvalidProp ?? (errorMessage ? true : undefined); // Leave uncontrolled if possible to fallback to validation state\n const isSmall = size === 'small';\n\n return (\n <TextField\n {...rest}\n className={composeRenderProps(\n classNames?.field,\n (className, { isInvalid }) =>\n field({ className, size, isDisabled, isInvalid, isReadOnly }),\n )}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n isReadOnly={isReadOnly}\n isRequired={isRequired}\n >\n {(\n { isInvalid }, // Rely on internal state, not props, since validation result could differ from props\n ) => (\n <>\n {!isSmall && !!labelProp && (\n <Label\n className={label({\n className: classNames?.label,\n size,\n isDisabled,\n isInvalid,\n isReadOnly,\n })}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {labelProp}\n </Label>\n )}\n <TextArea\n ref={inputRef}\n {...inputProps}\n className={composeRenderProps(classNames?.input, (className) =>\n input({\n className,\n size,\n isDisabled,\n isInvalid,\n isReadOnly,\n }),\n )}\n />\n {!(isSmall || isInvalid) && !!descriptionProp && (\n <Text\n slot='description'\n className={description({\n className: classNames?.description,\n size,\n isDisabled,\n isInvalid,\n isReadOnly,\n })}\n >\n {descriptionProp}\n </Text>\n )}\n <FieldError\n className={composeRenderProps(classNames?.error, (className) =>\n error({\n className,\n size,\n isDisabled,\n isInvalid,\n isReadOnly,\n }),\n )}\n >\n {errorMessage}\n </FieldError>\n </>\n )}\n </TextField>\n );\n}\nTextAreaField.displayName = 'TextAreaField';\nTextAreaField.Provider = TextAreaFieldProvider;\n"]}
1
+ {"version":3,"sources":["../../../src/components/text-area-field/index.tsx"],"names":["field","label","input","description","TextAreaStyles","E","TextAreaFieldContext","createContext","N","children","props","TextAreaFieldProvider","ref","useContextProps","classNames","descriptionProp","errorMessageProp","labelProp","inputProps","size","isInvalidProp","errorMessage","isSmall","TextField","L","composeRenderProps","className","isDisabled","isInvalid","Fragment","V","jsx","Label","g","isRequ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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\n'use client';\n\nimport 'client-only';\nimport { createContext } from 'react';\nimport {\n type ContextValue,\n FieldError,\n Text,\n TextArea,\n TextField,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Label } from '../label';\nimport { TextAreaStyles } from './styles';\nimport type { TextAreaFieldProps, TextAreaFieldProviderProps } from './types';\n\nconst { field, label, input, description, error } = TextAreaStyles();\n\nexport const TextAreaFieldContext =\n createContext<ContextValue<TextAreaFieldProviderProps, HTMLDivElement>>(null);\n\nfunction TextAreaFieldProvider({\n children,\n ...props\n}: TextAreaFieldProviderProps) {\n return (\n <TextAreaFieldContext.Provider value={props}>\n {children}\n </TextAreaFieldContext.Provider>\n );\n}\nTextAreaFieldProvider.displayName = 'TextAreaField.Provider';\n\nexport function TextAreaField({ ref, ...props }: TextAreaFieldProps) {\n [props, ref] = useContextProps(props, ref ?? null, TextAreaFieldContext);\n\n const {\n classNames,\n description: descriptionProp,\n errorMessage: errorMessageProp,\n label: labelProp,\n inputProps,\n size = 'medium',\n isInvalid: isInvalidProp,\n ...rest\n } = props;\n const errorMessage = errorMessageProp || null; // Protect against empty string\n const isSmall = size === 'small';\n\n return (\n <TextField\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.field, (className) =>\n field({ className }),\n )}\n isInvalid={isInvalidProp || (errorMessage ? true : undefined)} // Leave uncontrolled if possible to fallback to validation state\n data-size={size}\n >\n {(\n { isDisabled, isInvalid, isRequired }, // Rely on internal state, not props, since state could differ from props\n ) => (\n <>\n {!!labelProp && !isSmall && (\n <Label\n className={label({ className: classNames?.label })}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {labelProp}\n </Label>\n )}\n <TextArea\n {...inputProps}\n className={composeRenderProps(classNames?.input, (className) =>\n input({ className }),\n )}\n />\n {!!descriptionProp && !(isSmall || isInvalid) && (\n <Text\n slot='description'\n className={description({ className: classNames?.description })}\n >\n {descriptionProp}\n </Text>\n )}\n <FieldError\n className={composeRenderProps(classNames?.error, (className) =>\n error({ className }),\n )}\n >\n {errorMessage}\n </FieldError>\n </>\n )}\n </TextField>\n );\n}\nTextAreaField.displayName = 'TextAreaField';\nTextAreaField.Provider = TextAreaFieldProvider;\n"]}
@@ -1,113 +1,53 @@
1
1
  import * as tailwind_variants from 'tailwind-variants';
2
2
 
3
- declare const TextAreaStylesDefaults: {
4
- readonly size: "medium";
5
- readonly isDisabled: false;
6
- readonly isInvalid: false;
7
- readonly isReadOnly: false;
8
- };
9
3
  declare const TextAreaStyles: tailwind_variants.TVReturnType<{
10
- size: {
11
- medium: {
12
- input: string;
13
- };
14
- small: {
15
- input: string;
16
- };
17
- };
18
- isInvalid: {
19
- false: string;
20
- true: {
21
- input: string;
22
- };
23
- };
24
- isReadOnly: {
25
- false: string;
26
- true: {
27
- input: string;
28
- };
29
- };
30
- isDisabled: {
31
- false: string;
32
- true: {
33
- input: string;
34
- description: string;
35
- };
36
- };
37
- }, {
4
+ [key: string]: {
5
+ [key: string]: tailwind_variants.ClassValue | {
6
+ input?: tailwind_variants.ClassValue;
7
+ label?: tailwind_variants.ClassValue;
8
+ error?: tailwind_variants.ClassValue;
9
+ description?: tailwind_variants.ClassValue;
10
+ field?: tailwind_variants.ClassValue;
11
+ };
12
+ };
13
+ } | {
14
+ [x: string]: {
15
+ [x: string]: tailwind_variants.ClassValue | {
16
+ input?: tailwind_variants.ClassValue;
17
+ label?: tailwind_variants.ClassValue;
18
+ error?: tailwind_variants.ClassValue;
19
+ description?: tailwind_variants.ClassValue;
20
+ field?: tailwind_variants.ClassValue;
21
+ };
22
+ };
23
+ } | {}, {
38
24
  field: string;
39
25
  label: string;
40
26
  input: string[];
41
- description: string;
27
+ description: string[];
42
28
  error: string;
43
29
  }, undefined, {
44
- size: {
45
- medium: {
46
- input: string;
47
- };
48
- small: {
49
- input: string;
30
+ [key: string]: {
31
+ [key: string]: tailwind_variants.ClassValue | {
32
+ input?: tailwind_variants.ClassValue;
33
+ label?: tailwind_variants.ClassValue;
34
+ error?: tailwind_variants.ClassValue;
35
+ description?: tailwind_variants.ClassValue;
36
+ field?: tailwind_variants.ClassValue;
50
37
  };
51
38
  };
52
- isInvalid: {
53
- false: string;
54
- true: {
55
- input: string;
56
- };
57
- };
58
- isReadOnly: {
59
- false: string;
60
- true: {
61
- input: string;
62
- };
63
- };
64
- isDisabled: {
65
- false: string;
66
- true: {
67
- input: string;
68
- description: string;
69
- };
70
- };
71
- }, {
39
+ } | {}, {
72
40
  field: string;
73
41
  label: string;
74
42
  input: string[];
75
- description: string;
43
+ description: string[];
76
44
  error: string;
77
- }, tailwind_variants.TVReturnType<{
78
- size: {
79
- medium: {
80
- input: string;
81
- };
82
- small: {
83
- input: string;
84
- };
85
- };
86
- isInvalid: {
87
- false: string;
88
- true: {
89
- input: string;
90
- };
91
- };
92
- isReadOnly: {
93
- false: string;
94
- true: {
95
- input: string;
96
- };
97
- };
98
- isDisabled: {
99
- false: string;
100
- true: {
101
- input: string;
102
- description: string;
103
- };
104
- };
105
- }, {
45
+ }, tailwind_variants.TVReturnType<unknown, {
106
46
  field: string;
107
47
  label: string;
108
48
  input: string[];
109
- description: string;
49
+ description: string[];
110
50
  error: string;
111
51
  }, undefined, unknown, unknown, undefined>>;
112
52
 
113
- export { TextAreaStyles, TextAreaStylesDefaults };
53
+ export { TextAreaStyles };
@@ -1,2 +1,2 @@
1
- import {tv}from'./../../lib/utils.js';var t={size:"medium",isDisabled:false,isInvalid:false,isReadOnly:false},l=tv({slots:{field:"flex flex-col gap-xs",label:"",input:["block w-full rounded-medium p-s font-display outline outline-interactive","text-default-light placeholder:text-default-dark hover:outline-interactive-hover focus:outline-highlight"],description:"fg-default-dark text-body-xs",error:"fg-serious text-body-xs"},variants:{size:{medium:{input:"text-body-s"},small:{input:"text-body-xs"}},isInvalid:{false:"",true:{input:"outline-serious"}},isReadOnly:{false:"",true:{input:"rounded-none p-0 outline-none"}},isDisabled:{false:"",true:{input:"text-disabled outline-interactive-disabled placeholder:text-disabled",description:"fg-disabled"}}},defaultVariants:t});export{l as TextAreaStyles,t as TextAreaStylesDefaults};//# sourceMappingURL=styles.js.map
1
+ import {tv}from'./../../lib/utils.js';var l=tv({slots:{field:"group/text-area-field flex flex-col gap-xs",label:"",input:["block w-full rounded-medium p-s font-display text-default-light outline outline-interactive placeholder:text-default-dark","group-size-medium/text-area-field:text-body-s group-size-small/text-area-field:text-body-xs","group-enabled/text-area-field:focus:outline-highlight","group-enabled/text-area-field:hover:outline-interactive-hover","group-enabled/text-area-field:group-invalid/text-area-field:outline-serious","group-disabled/text-area-field:text-disabled group-disabled/text-area-field:outline-interactive-disabled group-disabled/text-area-field:placeholder:text-disabled"],description:["fg-default-dark text-body-xs","group-disabled/text-area-field:fg-disabled"],error:"fg-serious text-body-xs"}});export{l as TextAreaStyles};//# sourceMappingURL=styles.js.map
2
2
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/text-area-field/styles.ts"],"names":["tv","e"],"mappings":"2CAeQ,CAAA,CAAA,IAAA,CAAA,QACN,CAAA,UACA,CAAA,KAAA,CAAA,SACA,CAAA,KAAA,CAAA,UAG4BA,CAAAA,KAC5B,CAAA,CAAA,CAAA,CAAAC,EAAA,CAAO,CACL,KAAA,CAAO,CAAA,KAAA,CAAA,sBACA,CAAA,KACP,CAAA,EAAO,CACL,KAAA,CAAA,CAAA,0EACA,CAAA,0GAEF,CAAA,CAAA,WAAa,CAAA,8BACN,CAAA,KAAA,CAAA,yBAET,CAAA,CAAA,QACQ,CACJ,CAAA,IAAA,CAAA,CAAQ,MACN,CAAO,CAAA,KAAA,CAAA,aAET,CAAO,CACL,KAAA,CAAO,CAAA,KAAA,CAAA,cAGX,CAAA,CAAA,CAAA,SACE,CAAO,CAAA,KACP,CAAA,EACE,MAAO,CAAA,KAAA,CAAA,iBAGX,CAAA,CAAA,CAAA,WACS,CAAA,KACP,CAAA,EACE,CAAA,IAAA,CAAO,mDAIT,CAAO,MACP,CAAA,EACE,CAAA,IAAA,CACE,CAAA,KAAA,CAAA,kFACW,CAAA,aAInB,CAAA,CAAA,CAAA,CAAA,eACD,CAAA,CAAA,CAAA","file":"styles.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 { tv } from '@/lib/utils';\n\nexport const TextAreaStylesDefaults = {\n size: 'medium',\n isDisabled: false,\n isInvalid: false,\n isReadOnly: false,\n} as const;\n\nexport const TextAreaStyles = tv({\n slots: {\n field: 'flex flex-col gap-xs',\n label: '',\n input: [\n 'block w-full rounded-medium p-s font-display outline outline-interactive',\n 'text-default-light placeholder:text-default-dark hover:outline-interactive-hover focus:outline-highlight',\n ],\n description: 'fg-default-dark text-body-xs',\n error: 'fg-serious text-body-xs',\n },\n variants: {\n size: {\n medium: {\n input: 'text-body-s',\n },\n small: {\n input: 'text-body-xs',\n },\n },\n isInvalid: {\n false: '',\n true: {\n input: 'outline-serious',\n },\n },\n isReadOnly: {\n false: '',\n true: {\n input: 'rounded-none p-0 outline-none',\n },\n },\n isDisabled: {\n false: '',\n true: {\n input:\n 'text-disabled outline-interactive-disabled placeholder:text-disabled',\n description: 'fg-disabled',\n },\n },\n },\n defaultVariants: TextAreaStylesDefaults,\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/text-area-field/styles.ts"],"names":["e"],"mappings":"sCAeE,IAAA,CAAA,CAAAA,EAAA,CAAO,CACL,KAAA,CAAO,CAAA,KAAA,CAAA,4CACA,MACP,CAAA,EAAO,CACL,KAAA,CAAA,CAAA,2HACA,CAAA,6FACA,CAAA,uDACA,CAAA,+DACA,CAAA,6EACA,CAAA,mKAEF,CAAA,CAAA,WACE,CAAA,CAAA,8BACA,CAAA,4CAEF,CAAO,CAAA,KAAA,CAAA,yBAEV,CAAA,CAAA","file":"styles.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 { tv } from '@/lib/utils';\n\nexport const TextAreaStyles = tv({\n slots: {\n field: 'group/text-area-field flex flex-col gap-xs',\n label: '',\n input: [\n 'block w-full rounded-medium p-s font-display text-default-light outline outline-interactive placeholder:text-default-dark',\n 'group-size-medium/text-area-field:text-body-s group-size-small/text-area-field:text-body-xs',\n 'group-enabled/text-area-field:focus:outline-highlight',\n 'group-enabled/text-area-field:hover:outline-interactive-hover',\n 'group-enabled/text-area-field:group-invalid/text-area-field:outline-serious',\n 'group-disabled/text-area-field:text-disabled group-disabled/text-area-field:outline-interactive-disabled group-disabled/text-area-field:placeholder:text-disabled',\n ],\n description: [\n 'fg-default-dark text-body-xs',\n 'group-disabled/text-area-field:fg-disabled',\n ],\n error: 'fg-serious text-body-xs',\n },\n});\n"]}
@@ -1,10 +1,7 @@
1
- import { RefAttributes, Ref, PropsWithChildren } from 'react';
1
+ import { RefAttributes, PropsWithChildren } from 'react';
2
2
  import { TextFieldProps, TextAreaProps, FieldErrorProps } from 'react-aria-components';
3
- import { VariantProps } from 'tailwind-variants';
4
- import { TextAreaStyles } from './styles.js';
5
3
 
6
- type TextAreaStyleVariants = VariantProps<typeof TextAreaStyles>;
7
- type TextAreaFieldProps = Omit<TextFieldProps, 'children'> & RefAttributes<HTMLDivElement> & TextAreaStyleVariants & {
4
+ type TextAreaFieldProps = Omit<TextFieldProps, 'children' | 'className'> & RefAttributes<HTMLDivElement> & {
8
5
  classNames?: {
9
6
  field?: TextFieldProps['className'];
10
7
  label?: string;
@@ -13,11 +10,11 @@ type TextAreaFieldProps = Omit<TextFieldProps, 'children'> & RefAttributes<HTMLD
13
10
  error?: FieldErrorProps['className'];
14
11
  };
15
12
  label?: string;
16
- inputRef?: Ref<HTMLTextAreaElement>;
17
- inputProps?: Omit<TextAreaProps, 'className'>;
13
+ inputProps?: Omit<TextAreaProps, 'className'> & RefAttributes<HTMLTextAreaElement>;
18
14
  description?: string;
19
15
  errorMessage?: FieldErrorProps['children'];
16
+ size?: 'medium' | 'small';
20
17
  };
21
- type TextAreaFieldProviderProps = PropsWithChildren<Omit<TextAreaFieldProps, 'ref'>>;
18
+ type TextAreaFieldProviderProps = PropsWithChildren<TextAreaFieldProps>;
22
19
 
23
- export type { TextAreaFieldProps, TextAreaFieldProviderProps, TextAreaStyleVariants };
20
+ export type { TextAreaFieldProps, TextAreaFieldProviderProps };
@@ -1,29 +1,23 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as cva_types from 'cva/types';
3
- import { TextFieldProps as TextFieldProps$1, InputProps as InputProps$1 } from 'react-aria-components';
4
- import { VariantProps } from 'cva';
5
- import { ForwardedRef } from 'react';
2
+ import * as react from 'react';
3
+ import { ContextValue } from 'react-aria-components';
4
+ import { TextFieldProps, TextFieldProviderProps } from './types.js';
5
+ import '../input/types.js';
6
+ import 'tailwind-variants';
7
+ import '../button/types.js';
8
+ import '../button/styles.js';
9
+ import '../input/styles.js';
10
+ import '../label/types.js';
6
11
 
7
- declare const textFieldStyles: (props?: ({
8
- isDisabled?: boolean | null | undefined;
9
- isInvalid?: boolean | null | undefined;
10
- isReadOnly?: boolean | null | undefined;
11
- size?: "small" | "medium" | null | undefined;
12
- isClearable?: boolean | null | undefined;
13
- } & cva_types.ClassProp) | undefined) => string;
14
- interface InputProps extends VariantProps<typeof textFieldStyles>, Omit<InputProps$1, 'size'> {
15
- isClearable?: boolean;
16
- selectOnFocus?: boolean;
17
- ref?: ForwardedRef<HTMLInputElement>;
12
+ declare const TextFieldContext: react.Context<ContextValue<TextFieldProps, HTMLDivElement>>;
13
+ declare function TextFieldProvider({ children, ...props }: TextFieldProviderProps): react_jsx_runtime.JSX.Element;
14
+ declare namespace TextFieldProvider {
15
+ var displayName: string;
18
16
  }
19
- interface TextFieldProps extends Omit<VariantProps<typeof textFieldStyles>, 'isDisabled' | 'isInvalid' | 'isReadOnly'>, Omit<TextFieldProps$1, 'className'>, Omit<InputProps, keyof TextFieldProps$1> {
20
- className?: string;
21
- isClearable?: boolean;
22
- description?: string;
23
- errorMessage?: string;
24
- label?: string;
25
- placeholder?: string;
17
+ declare function TextField({ ref, ...props }: TextFieldProps): react_jsx_runtime.JSX.Element;
18
+ declare namespace TextField {
19
+ var displayName: string;
20
+ var Provider: typeof TextFieldProvider;
26
21
  }
27
- declare function TextField({ className, isClearable, description, errorMessage, isDisabled, isInvalid, isReadOnly, label, placeholder, size, ...props }: TextFieldProps): react_jsx_runtime.JSX.Element;
28
22
 
29
- export { TextField, type TextFieldProps };
23
+ export { TextField, TextFieldContext };
@@ -1,2 +1,2 @@
1
- import'client-only';import {TextField,Text,useContextProps,InputContext,Input,Button}from'react-aria-components';import {cn}from'./../../lib/utils.js';import {CancelFill}from'@accelint/icons';import {cva}from'cva';import {useEffect}from'react';import {Icon}from'../icon/index.js';import {Label}from'../label/index.js';import {jsxs,jsx}from'react/jsx-runtime';var f=cva(["block w-full rounded-medium px-s py-xs font-display outline outline-interactive"],{variants:{isDisabled:{true:"text-disabled outline-interactive-disabled placeholder:text-disabled",false:"text-default-light placeholder:text-default-dark hover:outline-interactive-hover focus:outline-highlight"},isInvalid:{true:"outline-serious focus:outline-serious"},isReadOnly:{true:"rounded-none p-0 outline-none"},size:{medium:"text-body-s",small:"text-body-xs"},isClearable:{true:"",false:""}},compoundVariants:[{isDisabled:true,isInvalid:true,className:"outline-interactive-disabled"},{isClearable:true,isDisabled:false,size:"medium",className:"pr-xl"}],defaultVariants:{isClearable:false,size:"medium"}}),y={target:{value:""}},k=({className:r,isClearable:i=true,ref:t=null,selectOnFocus:o=false,size:a="medium",...e})=>{[e,t]=useContextProps(e,t,InputContext),useEffect(()=>{function l(n){i&&n.key==="Escape"&&e.onChange?.(y);}return t.current?.addEventListener("keydown",l),()=>t.current?.removeEventListener("keydown",l)},[i,e.onChange,t]);let d=!e.readOnly&&e.value&&a!=="small"&&i&&!e.disabled;return e.readOnly?jsx("span",{className:cn(f({isClearable:false,isDisabled:false,isReadOnly:e.readOnly,size:a,className:r})),children:e.value||"\xA0"}):jsxs("div",{className:"relative flex items-center",children:[jsx(Input,{onFocus:l=>{o&&t.current?.select(),e.onFocus?.(l);},ref:t,className:({isDisabled:l,isInvalid:n})=>cn(f({isClearable:i,isDisabled:l,isInvalid:n,isReadOnly:e.readOnly,size:a,className:r}))}),d&&jsx(Button,{className:"fg-default-dark hover:fg-interactive-hover absolute right-[5px] cursor-pointer",excludeFromTabOrder:true,onPress:()=>{e.onChange?.(y),t.current?.focus();},children:jsx(Icon,{size:"small",children:jsx(CancelFill,{})})})]})};function M({className:r,isClearable:i=true,description:t,errorMessage:o,isDisabled:a,isInvalid:e,isReadOnly:d,label:l,placeholder:n,size:m="medium",...u}){let x=m==="small",b=t&&(!(x||e)||a),v=o&&e&&!a&&!d;return jsxs(TextField,{...u,isDisabled:a,isInvalid:e,isReadOnly:d,className:"flex flex-col gap-xs",children:[!x&&jsx(Label,{className:"empty:hidden",isDisabled:a,isRequired:u.isRequired,children:l}),jsx(k,{className:r,isClearable:i,placeholder:n,size:m,...u}),b&&jsx(Text,{className:cn(["fg-default-dark text-body-xs empty:hidden",a&&"fg-disabled"]),slot:"description",children:t}),v&&jsx(Text,{className:"fg-serious text-body-xs empty:hidden",slot:"errorMessage",children:o})]})}export{M as TextField};//# sourceMappingURL=index.js.map
1
+ import'client-only';import {createContext}from'react';import {useContextProps,TextField,composeRenderProps,Text,FieldError}from'react-aria-components';import {Input}from'../input/index.js';import {Label}from'../label/index.js';import {TextFieldStyles}from'./styles.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var {field:E,label:A,description:S,error:V}=TextFieldStyles(),x=createContext(null);function u({children:r,...i}){return jsx(x.Provider,{value:i,children:r})}u.displayName="TextField.Provider";function P({ref:r,...i}){[i,r]=useContextProps(i,r??null,x);let{classNames:t,description:s,errorMessage:T,inputProps:F,label:a,size:o="medium",isInvalid:v,...f}=i,d=T||null,n=o==="small";return jsx(TextField,{...f,ref:r,className:composeRenderProps(t?.field,l=>E({className:l})),isInvalid:v||(d?true:void 0),"data-size":o,children:({isDisabled:l,isInvalid:p,isRequired:m})=>jsxs(Fragment,{children:[!!a&&!n&&jsx(Label,{className:A({className:t?.label}),isDisabled:l,isRequired:m,children:a}),jsx(Input,{...F,classNames:t?.input,disabled:l,required:m,size:o,isInvalid:p}),!!s&&!(n||p)&&jsx(Text,{slot:"description",className:S({className:t?.description}),children:s}),jsx(FieldError,{className:composeRenderProps(t?.error,N=>V({className:N})),children:d})]})})}P.displayName="TextField";P.Provider=u;export{P as TextField,x as TextFieldContext};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/text-field/index.tsx"],"names":["C","ref","size","props","InputContext","useEffect","I","A","handleKeyPressed","e","shouldShowClearButton","isClearable","jsx","s","c","jsxs","h","g","textFieldStyles","Button","P","N","O","TextField","label","isSmall","shouldShowDescription","isInvalid","isDisabled","shouldShowError","errorMessage","isReadOnly","AriaTextField","F","Label","E","AriaText","p","description"],"mappings":"uWAkCI,IAAA,CAAA,CAAAA,GAAA,CAAA,CAAA,iFAGA,CAAA,CAAA,CAAU,QACR,CAAA,CAAA,UACQ,CAAA,CAAA,IAAA,CAAA,uLAIR,CAAA,CAAA,SACQ,CAAA,CAAA,IAAA,CAAA,mDAGA,CAAA,CAAA,IAAA,CAAA,qCAGE,CAAA,CAAA,MAAA,CAAA,aACD,CAAA,KAAA,CAAA,cAET,CAAA,CAAA,WACQ,CACN,CAAA,IAAA,CAAO,EACT,CACF,KACA,CAAA,EAAA,CAAA,CAAA,CAAA,gBAEI,CAAA,CAAA,CAAA,UACA,CAAA,IAAA,CAAA,SACA,CAAA,IAAA,CAAA,wCAGA,CAAA,CAAA,CAAA,WACA,CAAA,IAAA,CAAA,UACM,CAAA,KAAA,CAAA,IAAA,CACN,QAAA,CAAA,SAEJ,CAAA,OACA,CAAA,CAAA,CAAA,eACE,CAAA,CAAA,WACM,CAAA,KAAA,CAAA,IACR,CACF,QAYA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,OAAU,CACtB,KAEe,CACb,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,WACA,CAAAC,CAAAA,CAAM,IAAA,CAAA,wBAEN,CAAA,CAAAC,CAAAA,KAAO,CAAA,IAAA,CAAA,CAAA,CACP,QACgB,CAChB,GAAQD,CAAG,CAAA,GAAoBE,CAAAA,CAAOF,CAAAA,CAAKG,CAAY,CAAA,CAEvDC,eAAAA,CAAU,CAAA,CAAA,CAAA,CAAMC,YACd,CAAA,CAAAC,SAAA,CAAA,IAAA,CAASC,SACYC,CAAE,OAAQ,CAAA,CAAA,GAAA,GAAA,oBAK/B,GAAA,CAAAR,EAAAA,CAAI,OAAA,CAAA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vB,EAAA,CAAA,CAAA,4DAGG,CAAA,CAAA,CAAA,IAAA,CAAA,aAEJ,CAAAwB,QAIH1B,CAACwB,CAAAA,CAAA,CACC,CAAA,CAAA,EAAAvB,GAAA,CAAAwB,IAAA,CAAA,CAAA,SAAU,CAAA,sCACL,CAAA,IAAA,CAAA,cAEJ,CAAAP,QAKX,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA","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\n'use client';\nimport 'client-only';\nimport {\n Input as AriaInput,\n type InputProps as AriaInputProps,\n Text as AriaText,\n TextField as AriaTextField,\n type TextFieldProps as AriaTextFieldProps,\n Button,\n InputContext,\n useContextProps,\n} from 'react-aria-components';\n\nimport { cn } from '@/lib/utils';\nimport { CancelFill } from '@accelint/icons';\nimport { type VariantProps, cva } from 'cva';\nimport { type ChangeEvent, type ForwardedRef, useEffect } from 'react';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\n\nconst textFieldStyles = cva(\n [\n 'block w-full rounded-medium px-s py-xs font-display outline outline-interactive',\n ],\n {\n variants: {\n isDisabled: {\n true: 'text-disabled outline-interactive-disabled placeholder:text-disabled',\n false:\n 'text-default-light placeholder:text-default-dark hover:outline-interactive-hover focus:outline-highlight',\n },\n isInvalid: {\n true: 'outline-serious focus:outline-serious',\n },\n isReadOnly: {\n true: 'rounded-none p-0 outline-none',\n },\n size: {\n medium: 'text-body-s',\n small: 'text-body-xs',\n },\n isClearable: {\n true: '',\n false: '',\n },\n },\n compoundVariants: [\n {\n isDisabled: true,\n isInvalid: true,\n className: 'outline-interactive-disabled',\n },\n {\n isClearable: true,\n isDisabled: false,\n size: 'medium',\n className: 'pr-xl',\n },\n ],\n defaultVariants: {\n isClearable: false,\n size: 'medium',\n },\n },\n);\n\ninterface InputProps\n extends VariantProps<typeof textFieldStyles>,\n Omit<AriaInputProps, 'size'> {\n isClearable?: boolean;\n selectOnFocus?: boolean;\n ref?: ForwardedRef<HTMLInputElement>;\n}\n\nconst clearInputEvent = {\n target: { value: '' },\n} as ChangeEvent<HTMLInputElement>;\n\nconst Input = ({\n className,\n isClearable = true,\n ref = null,\n selectOnFocus = false,\n size = 'medium',\n ...props\n}: InputProps) => {\n [props, ref] = useContextProps(props, ref, InputContext);\n\n useEffect(() => {\n function handleKeyPressed(e: KeyboardEvent) {\n if (isClearable && e.key === 'Escape') {\n props.onChange?.(clearInputEvent);\n }\n }\n\n ref.current?.addEventListener('keydown', handleKeyPressed);\n\n return () => ref.current?.removeEventListener('keydown', handleKeyPressed);\n }, [isClearable, props.onChange, ref]);\n\n const shouldShowClearButton =\n !props.readOnly &&\n props.value &&\n size !== 'small' &&\n isClearable &&\n !props.disabled;\n\n if (props.readOnly) {\n return (\n <span\n className={cn(\n textFieldStyles({\n isClearable: false,\n isDisabled: false,\n isReadOnly: props.readOnly,\n size,\n className,\n }),\n )}\n >\n {props.value || '\\u00A0'}\n </span>\n );\n }\n\n return (\n <div className='relative flex items-center'>\n <AriaInput\n onFocus={(e) => {\n if (selectOnFocus) {\n ref.current?.select();\n }\n\n props.onFocus?.(e);\n }}\n ref={ref}\n className={({ isDisabled, isInvalid }) =>\n cn(\n textFieldStyles({\n isClearable,\n isDisabled,\n isInvalid,\n isReadOnly: props.readOnly,\n size,\n className,\n }),\n )\n }\n />\n {shouldShowClearButton && (\n <Button\n className='fg-default-dark hover:fg-interactive-hover absolute right-[5px] cursor-pointer'\n excludeFromTabOrder\n onPress={() => {\n props.onChange?.(clearInputEvent);\n ref.current?.focus();\n }}\n >\n <Icon size='small'>\n <CancelFill />\n </Icon>\n </Button>\n )}\n </div>\n );\n};\n\nexport interface TextFieldProps\n extends Omit<\n VariantProps<typeof textFieldStyles>,\n 'isDisabled' | 'isInvalid' | 'isReadOnly'\n >,\n Omit<AriaTextFieldProps, 'className'>,\n Omit<InputProps, keyof AriaTextFieldProps> {\n className?: string;\n isClearable?: boolean;\n description?: string;\n errorMessage?: string;\n label?: string;\n placeholder?: string;\n}\n\nexport function TextField({\n className,\n isClearable = true,\n description,\n errorMessage,\n isDisabled,\n isInvalid,\n isReadOnly,\n label,\n placeholder,\n size = 'medium',\n ...props\n}: TextFieldProps) {\n const isSmall = size === 'small';\n const shouldShowDescription =\n description && (!(isSmall || isInvalid) || isDisabled);\n const shouldShowError =\n errorMessage && isInvalid && !isDisabled && !isReadOnly;\n\n return (\n <AriaTextField\n {...(props as TextFieldProps)}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n isReadOnly={isReadOnly}\n className={'flex flex-col gap-xs'}\n >\n {!isSmall && (\n <Label\n className='empty:hidden'\n isDisabled={isDisabled}\n isRequired={props.isRequired}\n >\n {label}\n </Label>\n )}\n <Input\n className={className}\n isClearable={isClearable}\n placeholder={placeholder}\n size={size}\n {...(props as InputProps)}\n />\n {shouldShowDescription && (\n <AriaText\n className={cn([\n 'fg-default-dark text-body-xs empty:hidden',\n isDisabled && 'fg-disabled',\n ])}\n slot='description'\n >\n {description}\n </AriaText>\n )}\n {shouldShowError && (\n <AriaText\n className='fg-serious text-body-xs empty:hidden'\n slot='errorMessage'\n >\n {errorMessage}\n </AriaText>\n )}\n </AriaTextField>\n );\n}\n"]}
1
+ {"version":3,"sources":["../../../src/components/text-field/index.tsx"],"names":["TextFieldStyles","z","TextFieldContext","createContext","b","props","TextFieldProvider","ref","useContextProps","rest","errorMessage","errorMessageProp","size","AriaTextField","y","classNames","className","field","isInvalidProp","jsxs","Fragment","k","labelProp","isSmall","jsx","Label","g","Input","M","inputProps","descriptionProp","isInvalid","Text","I","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,WAEC,CAAA,CAAA,CAAA,QACG,CAAA,CAAA,CAAA,UAAY,CAAA,CAAA,CAAA,SAAW,CAAA,CAAA,CAAA,UAAW,CAAA,CAAA,CAEpCS,GAAAC,IAAA,CACGC,QAAA,CAAA,CAAA,QAAC,CAACC,CAAAA,CAAAA,CAAa,CAACC,EAAAA,CACfC,CAAAA,EAACC,GAAA,CACCC,KAAA,CAAA,CAAA,SAAiB,CAAE,CAAA,CAAA,CAAA,SAAWX,CAAY,CAAA,EAAA,KAC1C,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,UAEC,CAAA,CAAA,CAAA,QACH,CAAA,CAEFS,CAAAA,CAACG,CAAAA,GAAA,CACEC,KAAA,CAAA,CAAGC,GACJ,CAAA,CAAA,UAAYd,CAAY,CAAA,EAAA,KACxB,CAAA,QACA,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,IACA,CAAA,CAAA,CAAA,SACF,CAAA,CACC,CAAC,CAACe,CAAAA,CAAAA,CAAmB,CAAA,EAAEP,EAAWQ,CAAAA,EAAAA,CACjCP,CAAAA,EAACQ,GAAA,CACCC,IAAA,CAAA,CAAA,IAAK,CAAA,aACL,CAAA,SAAuB,CAAE,CAAA,CAAA,CAAA,SAAWlB,CAAY,CAAA,EAAA,WAE/C,CAAA,CAAA,CAAA,QACH,CAAA,CAEFS,CAAAA,CAACU,CAAAA,GAAA,CACCC,UAAA,CAAA,CAAA,SAA8BpB,CAAAA,kBAAAA,CAAY,CAAA,EAAA,KAAQC,CAChDoB,CAAAA,EAAQ,CAAA,CAAA,CAAA,SAAW,CACrB,CAAA,CAEC,CAAA,CAAA,CAAA,QACH,CAAA,CAAA,CACF,CAAA,CAEJ,CAEJ,CACAC,CAAAA,CAAU,CAAA,CAAA,CAAA,WAAc,CAAA,WACd,CAAA,CAAA,CAAA,QAAW/B,CAAAA,CAAAA","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'use client';\n\nimport 'client-only';\nimport { createContext } from 'react';\nimport {\n TextField as AriaTextField,\n type ContextValue,\n FieldError,\n Text,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\n\nimport { Input } from '../input';\nimport { Label } from '../label';\nimport { TextFieldStyles } from './styles';\nimport type { TextFieldProps, TextFieldProviderProps } from './types';\n\nconst { field, label, description, error } = TextFieldStyles();\n\nexport const TextFieldContext =\n createContext<ContextValue<TextFieldProps, HTMLDivElement>>(null);\n\nfunction TextFieldProvider({ children, ...props }: TextFieldProviderProps) {\n return (\n <TextFieldContext.Provider value={props}>\n {children}\n </TextFieldContext.Provider>\n );\n}\nTextFieldProvider.displayName = 'TextField.Provider';\n\nexport function TextField({ ref, ...props }: TextFieldProps) {\n [props, ref] = useContextProps(props, ref ?? null, TextFieldContext);\n\n const {\n classNames,\n description: descriptionProp,\n errorMessage: errorMessageProp,\n inputProps,\n label: labelProp,\n size = 'medium',\n isInvalid: isInvalidProp,\n ...rest\n } = props;\n const errorMessage = errorMessageProp || null; // Protect against empty string\n const isSmall = size === 'small';\n\n return (\n <AriaTextField\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.field, (className) =>\n field({ className }),\n )}\n isInvalid={isInvalidProp || (errorMessage ? true : undefined)} // Leave uncontrolled if possible to fallback to validation state\n data-size={size}\n >\n {(\n { isDisabled, isInvalid, isRequired }, // Rely on internal state, not props, since state could differ from props\n ) => (\n <>\n {!!labelProp && !isSmall && (\n <Label\n className={label({ className: classNames?.label })}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {labelProp}\n </Label>\n )}\n <Input\n {...inputProps}\n classNames={classNames?.input}\n disabled={isDisabled}\n required={isRequired}\n size={size}\n isInvalid={isInvalid}\n />\n {!!descriptionProp && !(isSmall || isInvalid) && (\n <Text\n slot='description'\n className={description({ className: classNames?.description })}\n >\n {descriptionProp}\n </Text>\n )}\n <FieldError\n className={composeRenderProps(classNames?.error, (className) =>\n error({ className }),\n )}\n >\n {errorMessage}\n </FieldError>\n </>\n )}\n </AriaTextField>\n );\n}\nTextField.displayName = 'TextField';\nTextField.Provider = TextFieldProvider;\n"]}
@@ -0,0 +1,53 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+
3
+ declare const TextFieldStyles: tailwind_variants.TVReturnType<{
4
+ [key: string]: {
5
+ [key: string]: tailwind_variants.ClassValue | {
6
+ input?: tailwind_variants.ClassValue;
7
+ label?: tailwind_variants.ClassValue;
8
+ error?: tailwind_variants.ClassValue;
9
+ description?: tailwind_variants.ClassValue;
10
+ field?: tailwind_variants.ClassValue;
11
+ };
12
+ };
13
+ } | {
14
+ [x: string]: {
15
+ [x: string]: tailwind_variants.ClassValue | {
16
+ input?: tailwind_variants.ClassValue;
17
+ label?: tailwind_variants.ClassValue;
18
+ error?: tailwind_variants.ClassValue;
19
+ description?: tailwind_variants.ClassValue;
20
+ field?: tailwind_variants.ClassValue;
21
+ };
22
+ };
23
+ } | {}, {
24
+ field: string;
25
+ label: string;
26
+ input: string;
27
+ description: string[];
28
+ error: string;
29
+ }, undefined, {
30
+ [key: string]: {
31
+ [key: string]: tailwind_variants.ClassValue | {
32
+ input?: tailwind_variants.ClassValue;
33
+ label?: tailwind_variants.ClassValue;
34
+ error?: tailwind_variants.ClassValue;
35
+ description?: tailwind_variants.ClassValue;
36
+ field?: tailwind_variants.ClassValue;
37
+ };
38
+ };
39
+ } | {}, {
40
+ field: string;
41
+ label: string;
42
+ input: string;
43
+ description: string[];
44
+ error: string;
45
+ }, tailwind_variants.TVReturnType<unknown, {
46
+ field: string;
47
+ label: string;
48
+ input: string;
49
+ description: string[];
50
+ error: string;
51
+ }, undefined, unknown, unknown, undefined>>;
52
+
53
+ export { TextFieldStyles };
@@ -0,0 +1,2 @@
1
+ import {tv}from'./../../lib/utils.js';var l=tv({slots:{field:"group/text-field flex flex-col gap-xs",label:"",input:"",description:["fg-default-dark text-body-xs","group-disabled/text-field:fg-disabled"],error:"fg-serious text-body-xs"}});export{l as TextFieldStyles};//# sourceMappingURL=styles.js.map
2
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/text-field/styles.ts"],"names":["e"],"mappings":"sCAeE,IAAA,CAAA,CAAAA,EAAA,CAAO,CACL,KAAA,CAAO,CAAA,KAAA,CAAA,uCACA,CAAA,KACP,CAAA,EAAO,CAAA,KACP,CAAA,EAAA,CAAA,WACE,CAAA,CAAA,sEAGF,CAAO,CAAA,KAAA,CAAA,yBAEV,CAAA,CAAA","file":"styles.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 { tv } from '@/lib/utils';\n\nexport const TextFieldStyles = tv({\n slots: {\n field: 'group/text-field flex flex-col gap-xs',\n label: '',\n input: '',\n description: [\n 'fg-default-dark text-body-xs',\n 'group-disabled/text-field:fg-disabled',\n ],\n error: 'fg-serious text-body-xs',\n },\n});\n"]}