@accelint/design-toolkit 2.2.1 → 2.3.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 (136) hide show
  1. package/README.md +1 -0
  2. package/dist/components/accordion/index.d.ts +2 -2
  3. package/dist/components/accordion/index.js +1 -1
  4. package/dist/components/accordion/index.js.map +1 -1
  5. package/dist/components/accordion/styles.d.ts +3 -39
  6. package/dist/components/accordion/styles.js +1 -1
  7. package/dist/components/accordion/styles.js.map +1 -1
  8. package/dist/components/avatar/index.d.ts +4 -4
  9. package/dist/components/badge/index.d.ts +2 -2
  10. package/dist/components/box/index.d.ts +3 -3
  11. package/dist/components/button/index.d.ts +35 -23
  12. package/dist/components/button/index.js +1 -1
  13. package/dist/components/button/index.js.map +1 -1
  14. package/dist/components/button/styles.d.ts +297 -0
  15. package/dist/components/button/styles.js +2 -0
  16. package/dist/components/button/styles.js.map +1 -0
  17. package/dist/components/button/types.d.ts +14 -0
  18. package/dist/components/button/types.js +2 -0
  19. package/dist/components/button/types.js.map +1 -0
  20. package/dist/components/checkbox/index.d.ts +2 -2
  21. package/dist/components/checkbox/index.js +1 -1
  22. package/dist/components/checkbox/index.js.map +1 -1
  23. package/dist/components/chip/index.d.ts +25 -48
  24. package/dist/components/chip/index.js +1 -1
  25. package/dist/components/chip/index.js.map +1 -1
  26. package/dist/components/chip/styles.d.ts +250 -0
  27. package/dist/components/chip/styles.js +2 -0
  28. package/dist/components/chip/styles.js.map +1 -0
  29. package/dist/components/chip/types.d.ts +20 -0
  30. package/dist/components/chip/types.js +2 -0
  31. package/dist/components/chip/types.js.map +1 -0
  32. package/dist/components/classification-badge/index.d.ts +15 -16
  33. package/dist/components/classification-badge/index.js +1 -1
  34. package/dist/components/classification-badge/index.js.map +1 -1
  35. package/dist/components/classification-badge/styles.d.ts +51 -0
  36. package/dist/components/classification-badge/styles.js +2 -0
  37. package/dist/components/classification-badge/styles.js.map +1 -0
  38. package/dist/components/classification-badge/types.d.ts +9 -0
  39. package/dist/components/classification-badge/types.js +2 -0
  40. package/dist/components/classification-badge/types.js.map +1 -0
  41. package/dist/components/classification-banner/index.d.ts +15 -16
  42. package/dist/components/classification-banner/index.js +1 -2
  43. package/dist/components/classification-banner/index.js.map +1 -1
  44. package/dist/components/classification-banner/styles.d.ts +38 -0
  45. package/dist/components/classification-banner/styles.js +2 -0
  46. package/dist/components/classification-banner/styles.js.map +1 -0
  47. package/dist/components/classification-banner/types.d.ts +9 -0
  48. package/dist/components/classification-banner/types.js +2 -0
  49. package/dist/components/classification-banner/types.js.map +1 -0
  50. package/dist/components/combobox/index.js +1 -1
  51. package/dist/components/combobox/index.js.map +1 -1
  52. package/dist/components/date-field/index.js +1 -1
  53. package/dist/components/date-field/index.js.map +1 -1
  54. package/dist/components/dialog/index.d.ts +5 -5
  55. package/dist/components/dialog/index.js +1 -1
  56. package/dist/components/dialog/index.js.map +1 -1
  57. package/dist/components/icon/index.d.ts +2 -2
  58. package/dist/components/icon/types.d.ts +3 -5
  59. package/dist/components/label/index.d.ts +10 -7
  60. package/dist/components/label/index.js +1 -1
  61. package/dist/components/label/index.js.map +1 -1
  62. package/dist/components/label/styles.d.ts +5 -0
  63. package/dist/components/label/styles.js +2 -0
  64. package/dist/components/label/styles.js.map +1 -0
  65. package/dist/components/label/types.d.ts +10 -0
  66. package/dist/components/label/types.js +2 -0
  67. package/dist/components/label/types.js.map +1 -0
  68. package/dist/components/options/index.d.ts +2 -2
  69. package/dist/components/options-item/index.js +1 -1
  70. package/dist/components/options-item/index.js.map +1 -1
  71. package/dist/components/popover/styles.d.ts +3 -3
  72. package/dist/components/query-builder/index.js +1 -1
  73. package/dist/components/query-builder/index.js.map +1 -1
  74. package/dist/components/query-builder/value-editor.js +1 -1
  75. package/dist/components/query-builder/value-editor.js.map +1 -1
  76. package/dist/components/radio/index.d.ts +11 -9
  77. package/dist/components/radio/index.js +1 -1
  78. package/dist/components/radio/index.js.map +1 -1
  79. package/dist/components/radio/styles.d.ts +53 -0
  80. package/dist/components/radio/styles.js +2 -0
  81. package/dist/components/radio/styles.js.map +1 -0
  82. package/dist/components/radio/types.d.ts +21 -0
  83. package/dist/components/radio/types.js +2 -0
  84. package/dist/components/radio/types.js.map +1 -0
  85. package/dist/components/search-field/index.js +1 -1
  86. package/dist/components/search-field/index.js.map +1 -1
  87. package/dist/components/switch/index.d.ts +10 -7
  88. package/dist/components/switch/index.js +1 -1
  89. package/dist/components/switch/index.js.map +1 -1
  90. package/dist/components/switch/styles.d.ts +41 -0
  91. package/dist/components/switch/styles.js +2 -0
  92. package/dist/components/switch/styles.js.map +1 -0
  93. package/dist/components/switch/types.d.ts +13 -0
  94. package/dist/components/switch/types.js +2 -0
  95. package/dist/components/switch/types.js.map +1 -0
  96. package/dist/components/tabs/index.js +1 -1
  97. package/dist/components/tabs/index.js.map +1 -1
  98. package/dist/components/text-area-field/index.d.ts +19 -0
  99. package/dist/components/text-area-field/index.js +2 -0
  100. package/dist/components/text-area-field/index.js.map +1 -0
  101. package/dist/components/text-area-field/styles.d.ts +113 -0
  102. package/dist/components/text-area-field/styles.js +2 -0
  103. package/dist/components/text-area-field/styles.js.map +1 -0
  104. package/dist/components/text-area-field/types.d.ts +23 -0
  105. package/dist/components/text-area-field/types.js +2 -0
  106. package/dist/components/text-area-field/types.js.map +1 -0
  107. package/dist/components/text-field/index.js +1 -1
  108. package/dist/components/text-field/index.js.map +1 -1
  109. package/dist/components/tooltip/index.d.ts +2 -2
  110. package/dist/index.css +122 -252
  111. package/dist/index.d.ts +25 -11
  112. package/dist/index.js +1 -1
  113. package/dist/lib/react.js.map +1 -1
  114. package/dist/lib/utils.js +1 -1
  115. package/dist/lib/utils.js.map +1 -1
  116. package/dist/metafile-esm.json +1 -1
  117. package/dist/styles.css +873 -754
  118. package/dist/tokens/generated/themes.css +147 -0
  119. package/dist/tokens/generated/themes.d.ts +2 -0
  120. package/dist/tokens/generated/tokens.css +119 -0
  121. package/dist/tokens/generated/tokens.d.ts +108 -0
  122. package/dist/tokens/generated/tokens.js +2 -0
  123. package/dist/tokens/generated/tokens.js.map +1 -0
  124. package/package.json +6 -6
  125. package/dist/components/floating-button/index.d.ts +0 -18
  126. package/dist/components/floating-button/index.js +0 -2
  127. package/dist/components/floating-button/index.js.map +0 -1
  128. package/dist/components/icon-button/index.d.ts +0 -20
  129. package/dist/components/icon-button/index.js +0 -2
  130. package/dist/components/icon-button/index.js.map +0 -1
  131. package/dist/components/text-area/index.d.ts +0 -30
  132. package/dist/components/text-area/index.js +0 -2
  133. package/dist/components/text-area/index.js.map +0 -1
  134. package/dist/components/toggle-icon-button/index.d.ts +0 -20
  135. package/dist/components/toggle-icon-button/index.js +0 -2
  136. package/dist/components/toggle-icon-button/index.js.map +0 -1
@@ -0,0 +1,113 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+
3
+ declare const TextAreaStylesDefaults: {
4
+ readonly size: "medium";
5
+ readonly isDisabled: false;
6
+ readonly isInvalid: false;
7
+ readonly isReadOnly: false;
8
+ };
9
+ 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
+ }, {
38
+ field: string;
39
+ label: string;
40
+ input: string[];
41
+ description: string;
42
+ error: string;
43
+ }, undefined, {
44
+ size: {
45
+ medium: {
46
+ input: string;
47
+ };
48
+ small: {
49
+ input: string;
50
+ };
51
+ };
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
+ }, {
72
+ field: string;
73
+ label: string;
74
+ input: string[];
75
+ description: string;
76
+ 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
+ }, {
106
+ field: string;
107
+ label: string;
108
+ input: string[];
109
+ description: string;
110
+ error: string;
111
+ }, undefined, unknown, unknown, undefined>>;
112
+
113
+ export { TextAreaStyles, TextAreaStylesDefaults };
@@ -0,0 +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
2
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +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"]}
@@ -0,0 +1,23 @@
1
+ import { RefAttributes, Ref, PropsWithChildren } from 'react';
2
+ import { TextFieldProps, TextAreaProps, FieldErrorProps } from 'react-aria-components';
3
+ import { VariantProps } from 'tailwind-variants';
4
+ import { TextAreaStyles } from './styles.js';
5
+
6
+ type TextAreaStyleVariants = VariantProps<typeof TextAreaStyles>;
7
+ type TextAreaFieldProps = Omit<TextFieldProps, 'children'> & RefAttributes<HTMLDivElement> & TextAreaStyleVariants & {
8
+ classNames?: {
9
+ field?: TextFieldProps['className'];
10
+ label?: string;
11
+ input?: TextAreaProps['className'];
12
+ description?: string;
13
+ error?: FieldErrorProps['className'];
14
+ };
15
+ label?: string;
16
+ inputRef?: Ref<HTMLTextAreaElement>;
17
+ inputProps?: Omit<TextAreaProps, 'className'>;
18
+ description?: string;
19
+ errorMessage?: FieldErrorProps['children'];
20
+ };
21
+ type TextAreaFieldProviderProps = PropsWithChildren<Omit<TextAreaFieldProps, 'ref'>>;
22
+
23
+ export type { TextAreaFieldProps, TextAreaFieldProviderProps, TextAreaStyleVariants };
@@ -0,0 +1,2 @@
1
+ //# sourceMappingURL=types.js.map
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
@@ -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 p=m==="small",b=t&&(!(p||e)||a),v=o&&e&&!a&&!d;return jsxs(TextField,{...u,isDisabled:a,isInvalid:e,isReadOnly:d,className:"flex flex-col gap-xs",children:[!p&&jsx(Label,{className:"empty:hidden",isDisabled:a,isOptional:!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 {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
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","handleKeyPressed","e","shouldShowClearButton","isClearable","jsx","s","c","jsxs","h","g","textFieldStyles","Button","P","N","O","TextField","label","shouldShowDescription","isSmall","isInvalid","isDisabled","shouldShowError","errorMessage","isReadOnly","AriaTextField","F","Label","AriaText","x","description"],"mappings":"uWAkCI,IAAA,CAAA,CAAAA,GAAA,CAAA,CAAA,iFAGA,CAAA,CAAA,CAAU,iGAIJ,CAAA,KAAA,CAAA,0GAEJ,CAAA,CAAA,SACQ,CAAA,CAAA,IAAA,CAAA,uCAER,CAAA,CAAA,UACQ,CAAA,CAA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AAA,CAAA,sBAEAC,CAAAA,CACA,CAAA,KAAA,CAAA,CAAA,CAAA,YACO,CAAA,CAAA,IAAA,CAAA,CAAA,CACP,QAEA,CAAA,IAAgBrB,CAAAA,CAAAA,CAAAA,IAAS,CAAA,CAAA,CAAA,GACnBsB,OACcC,CAAAA,CAAAA,CAAWC,IAAcC,EAAAA,CACvCC,EACJC,CAAAA,CAAAA,EAAgBH,CAAAA,CAAa,CAACC,CAAAA,CAAAA,CAAc,EAACG,CAE/C,EAAA,CAAA,CAAA,EAAA,CACEhB,CAAAA,CAACiB,WAEC,CAAAC,SAAA,CAAA,CAAA,GAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,sBACW,CAAA,sBAEV,CAAA,QACEC,CAAA,CACC,wBAAU,CAAA,cACV,CAAA,UACA,CAAA,CAAA,CAAA,UAAmB,CAAA,CAAA,CAAA,CAAA,UAElB,CAAAV,QAGJ,CACC,CAAA,CAAA,CAAA,CAAAX,GAAA,CAAA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,WACA,CAAA,CAAA,CAAA,WACMV,CACL,CAAA,CAAA,IACH,CACCsB,CAAAA,CAAAA,GACEU,EAAA,CACC,CAAA,CAAA,EAAAtB,GAAA,CAAAuB,IAAA,CAAA,CAAA,SACE,CAAAtB,EAAA,CAAA,CAAA,4DAGG,CAAA,CAAA,CAAA,IAAA,CAAA,aAEJ,CAAAuB,QAIHzB,CAACuB,CAAAA,CAAA,CACC,CAAA,CAAA,EAAAtB,GAAA,CAAAuB,IAAA,CAAA,CAAA,SAAU,CAAA,sCACL,CAAA,IAAA,CAAA,cAEJ,CAAAN,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 isOptional={!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":["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,C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,CAAA,GACnBwB,OACcD,GAAWE,CAAAA,GAAcC,EAAAA,CACvCC,EACJC,CAAAA,CAAAA,EAAgBH,CAAAA,CAAa,CAACC,GAAc,EAACG,CAE/C,EAAA,CAAA,CAAA,EAAA,CACEhB,CAAAA,CAACiB,OACM7B,IACL,CAAA8B,SAAA,CAAA,CAAA,GAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,SAAW,CAAA,sBAEV,CAAA,QACEC,CAAA,CACC,CAAA,CAAA,EAAArB,GAAA,CAAAsB,KAAA,CAAA,CAAA,SAAU,CAAA,yBAEV,CAAA,CAAA,CAAA,UAAkB,CAAA,CAAA,CAAA,UAEjB,CAAAX,QAGJ,CACC,CAAA,CAAA,CAAA,CAAAX,GAAA,CAAA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,WACA,CAAA,CAAA,CAAA,WACMX,CACL,CAAA,CAAA,IACH,CACCwB,CAAAA,CAAAA,GACEU,EAAA,CACC,CAAA,CAAA,EAAAvB,GAAA,CAAAwB,IAAA,CAAA,CAAA,SACE,CAAAvB,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,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as cva_types from 'cva/types';
3
3
  import { VariantProps } from 'cva';
4
- import React__default from 'react';
4
+ import react__default from 'react';
5
5
  import { TooltipTriggerComponentProps, Focusable, TooltipProps as TooltipProps$1 } from 'react-aria-components';
6
6
 
7
7
  declare const tooltipStyles: (props?: cva_types.ClassProp | undefined) => string;
@@ -20,7 +20,7 @@ declare namespace Tooltip {
20
20
  displayName: string;
21
21
  };
22
22
  }
23
- interface TooltipTriggerProps extends React__default.ComponentProps<typeof Focusable> {
23
+ interface TooltipTriggerProps extends react__default.ComponentProps<typeof Focusable> {
24
24
  }
25
25
  declare const TooltipTrigger: {
26
26
  ({ children, ...props }: TooltipTriggerProps): react_jsx_runtime.JSX.Element;