ctc-component-library 0.3.0 → 1.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/DESIGN.md +408 -0
  2. package/MIGRATION.md +301 -0
  3. package/README.md +41 -72
  4. package/dist/components/Alert/Alert.d.ts +14 -0
  5. package/dist/components/Alert/Alert.js +73 -0
  6. package/dist/components/Alert/index.d.ts +1 -0
  7. package/dist/components/Alert/index.js +2 -0
  8. package/dist/components/Avatar/Avatar.d.ts +5 -0
  9. package/dist/components/Avatar/Avatar.js +25 -0
  10. package/dist/components/Avatar/index.d.ts +1 -0
  11. package/dist/components/Avatar/index.js +2 -0
  12. package/dist/components/Badge/Badge.d.ts +23 -0
  13. package/dist/components/Badge/Badge.js +159 -0
  14. package/dist/components/Badge/index.d.ts +2 -0
  15. package/dist/components/Badge/index.js +2 -0
  16. package/dist/components/Button/Button.d.ts +7 -0
  17. package/dist/components/Button/Button.js +44 -0
  18. package/dist/components/Button/button.variants.d.ts +22 -0
  19. package/dist/components/Button/button.variants.js +62 -0
  20. package/dist/components/Button/index.d.ts +2 -0
  21. package/dist/components/Button/index.js +3 -0
  22. package/dist/components/Checkbox/Checkbox.d.ts +7 -0
  23. package/dist/components/Checkbox/Checkbox.js +23 -0
  24. package/dist/components/Checkbox/index.d.ts +1 -0
  25. package/dist/components/Checkbox/index.js +2 -0
  26. package/dist/components/Chip/Chip.d.ts +17 -0
  27. package/dist/components/Chip/Chip.js +59 -0
  28. package/dist/components/Chip/index.d.ts +2 -0
  29. package/dist/components/Chip/index.js +2 -0
  30. package/dist/components/Combobox/Combobox.d.ts +31 -0
  31. package/dist/components/Combobox/Combobox.js +98 -0
  32. package/dist/components/Combobox/index.d.ts +1 -0
  33. package/dist/components/Combobox/index.js +2 -0
  34. package/dist/components/DataTable/DataTable.d.ts +24 -0
  35. package/dist/components/DataTable/DataTable.js +74 -0
  36. package/dist/components/DataTable/Table.d.ts +9 -0
  37. package/dist/components/DataTable/Table.js +57 -0
  38. package/dist/components/DataTable/index.d.ts +3 -0
  39. package/dist/components/DataTable/index.js +3 -0
  40. package/dist/components/DatePicker/DatePicker.d.ts +20 -0
  41. package/dist/components/DatePicker/DatePicker.js +74 -0
  42. package/dist/components/DatePicker/index.d.ts +1 -0
  43. package/dist/components/DatePicker/index.js +2 -0
  44. package/dist/components/Dialog/Dialog.d.ts +21 -0
  45. package/dist/components/Dialog/Dialog.js +50 -0
  46. package/dist/components/Dialog/index.d.ts +1 -0
  47. package/dist/components/Dialog/index.js +2 -0
  48. package/dist/components/Field/Field.d.ts +22 -0
  49. package/dist/components/Field/Field.js +43 -0
  50. package/dist/components/Field/index.d.ts +1 -0
  51. package/dist/components/Field/index.js +2 -0
  52. package/dist/components/Icon/Icon.d.ts +7 -0
  53. package/dist/components/Icon/Icon.js +13 -0
  54. package/dist/components/Icon/index.d.ts +13 -0
  55. package/dist/components/Icon/index.js +2 -0
  56. package/dist/components/Input/Input.d.ts +41 -0
  57. package/dist/components/Input/Input.js +87 -0
  58. package/dist/components/Input/index.d.ts +1 -0
  59. package/dist/components/Input/index.js +2 -0
  60. package/dist/components/Label/Label.d.ts +3 -0
  61. package/dist/components/Label/Label.js +13 -0
  62. package/dist/components/Label/index.js +2 -0
  63. package/dist/components/MultiSelect/MultiSelect.d.ts +23 -0
  64. package/dist/components/MultiSelect/MultiSelect.js +99 -0
  65. package/dist/components/MultiSelect/index.d.ts +1 -0
  66. package/dist/components/MultiSelect/index.js +2 -0
  67. package/dist/components/NumberInput/NumberInput.d.ts +11 -0
  68. package/dist/components/NumberInput/NumberInput.js +58 -0
  69. package/dist/components/NumberInput/index.d.ts +1 -0
  70. package/dist/components/NumberInput/index.js +2 -0
  71. package/dist/components/Popover/Popover.d.ts +12 -0
  72. package/dist/components/Popover/Popover.js +20 -0
  73. package/dist/components/Popover/index.d.ts +1 -0
  74. package/dist/components/Popover/index.js +2 -0
  75. package/dist/components/RadioGroup/RadioGroup.d.ts +8 -0
  76. package/dist/components/RadioGroup/RadioGroup.js +30 -0
  77. package/dist/components/RadioGroup/index.d.ts +1 -0
  78. package/dist/components/RadioGroup/index.js +2 -0
  79. package/dist/components/Select/Select.d.ts +15 -0
  80. package/dist/components/Select/Select.js +83 -0
  81. package/dist/components/Select/index.d.ts +1 -0
  82. package/dist/components/Select/index.js +2 -0
  83. package/dist/components/Spinner/Spinner.d.ts +9 -0
  84. package/dist/components/Spinner/Spinner.js +24 -0
  85. package/dist/components/Spinner/index.d.ts +1 -0
  86. package/dist/components/Spinner/index.js +2 -0
  87. package/dist/components/Switch/Switch.d.ts +7 -0
  88. package/dist/components/Switch/Switch.js +23 -0
  89. package/dist/components/Switch/index.d.ts +1 -0
  90. package/dist/components/Switch/index.js +2 -0
  91. package/dist/components/Tabs/Tabs.d.ts +17 -0
  92. package/dist/components/Tabs/Tabs.js +78 -0
  93. package/dist/components/Tabs/index.d.ts +1 -0
  94. package/dist/components/Tabs/index.js +2 -0
  95. package/dist/components/TimePicker/TimePicker.d.ts +20 -0
  96. package/dist/components/TimePicker/TimePicker.js +62 -0
  97. package/dist/components/TimePicker/index.d.ts +1 -0
  98. package/dist/components/TimePicker/index.js +2 -0
  99. package/dist/components/Toast/Toast.d.ts +57 -0
  100. package/dist/components/Toast/Toast.js +40 -0
  101. package/dist/components/Toast/index.d.ts +1 -0
  102. package/dist/components/Toast/index.js +2 -0
  103. package/dist/components/Tooltip/Tooltip.d.ts +12 -0
  104. package/dist/components/Tooltip/Tooltip.js +23 -0
  105. package/dist/components/Tooltip/index.d.ts +1 -0
  106. package/dist/components/Tooltip/index.js +2 -0
  107. package/dist/components/Typography/Typography.d.ts +13 -0
  108. package/dist/components/Typography/Typography.js +63 -0
  109. package/dist/components/Typography/index.d.ts +1 -0
  110. package/dist/components/Typography/index.js +2 -0
  111. package/dist/lib/cn.d.ts +2 -0
  112. package/dist/lib/cn.js +6 -0
  113. package/dist/presets/SelectCountry/SelectCountry.d.ts +16 -0
  114. package/dist/presets/SelectCountry/SelectCountry.js +21 -0
  115. package/dist/presets/SelectCountry/countries.d.ts +11 -0
  116. package/dist/presets/SelectCountry/countries.js +120 -0
  117. package/dist/presets/SelectCountry/index.d.ts +2 -0
  118. package/dist/presets/SelectCountry/index.js +3 -0
  119. package/dist/presets/SelectPhone/SelectPhone.d.ts +15 -0
  120. package/dist/presets/SelectPhone/SelectPhone.js +21 -0
  121. package/dist/presets/SelectPhone/index.d.ts +2 -0
  122. package/dist/presets/SelectPhone/index.js +3 -0
  123. package/dist/presets/SelectPhone/phoneCodes.d.ts +7 -0
  124. package/dist/presets/SelectPhone/phoneCodes.js +131 -0
  125. package/dist/tailwind-preset.d.ts +10 -0
  126. package/dist/tailwind-preset.js +4 -0
  127. package/dist/test-setup.d.ts +0 -0
  128. package/dist/theme/colors.d.ts +57 -0
  129. package/dist/theme/colors.js +59 -0
  130. package/dist/theme/index.d.ts +3 -0
  131. package/dist/theme/index.js +4 -0
  132. package/dist/theme/shapes.d.ts +17 -0
  133. package/dist/theme/shapes.js +18 -0
  134. package/dist/theme/spacing.d.ts +18 -0
  135. package/dist/theme/spacing.js +19 -0
  136. package/dist/theme.css +2 -0
  137. package/llms.txt +296 -736
  138. package/package.json +193 -69
  139. package/dist/index.css +0 -1
  140. package/dist/index.d.ts +0 -9
  141. package/dist/index.es.js +0 -45363
  142. package/dist/src/commons/colors.d.ts +0 -47
  143. package/dist/src/commons/colors.es.js +0 -50
  144. package/dist/src/commons/shapes.d.ts +0 -15
  145. package/dist/src/commons/shapes.es.js +0 -18
  146. package/dist/src/commons/spacing.d.ts +0 -15
  147. package/dist/src/commons/spacing.es.js +0 -18
  148. package/dist/src/components/atoms/Avatar/Avatar.d.ts +0 -2
  149. package/dist/src/components/atoms/Avatar/index.d.ts +0 -2
  150. package/dist/src/components/atoms/Avatar/types.d.ts +0 -7
  151. package/dist/src/components/atoms/Badge/Badge.d.ts +0 -3
  152. package/dist/src/components/atoms/Badge/index.d.ts +0 -2
  153. package/dist/src/components/atoms/Badge/types.d.ts +0 -18
  154. package/dist/src/components/atoms/Button/Button.d.ts +0 -3
  155. package/dist/src/components/atoms/Button/ButtonV2.d.ts +0 -4
  156. package/dist/src/components/atoms/Button/index.d.ts +0 -4
  157. package/dist/src/components/atoms/Button/types.d.ts +0 -35
  158. package/dist/src/components/atoms/Checkbox/Checkbox.d.ts +0 -3
  159. package/dist/src/components/atoms/Checkbox/index.d.ts +0 -2
  160. package/dist/src/components/atoms/Checkbox/types.d.ts +0 -18
  161. package/dist/src/components/atoms/Datepicker/Datepicker.d.ts +0 -3
  162. package/dist/src/components/atoms/Datepicker/index.d.ts +0 -2
  163. package/dist/src/components/atoms/Datepicker/types.d.ts +0 -9
  164. package/dist/src/components/atoms/Icon/Icon.d.ts +0 -3
  165. package/dist/src/components/atoms/Icon/index.d.ts +0 -3
  166. package/dist/src/components/atoms/Icon/types.d.ts +0 -11
  167. package/dist/src/components/atoms/InputNumber/InputNumber.d.ts +0 -3
  168. package/dist/src/components/atoms/InputNumber/index.d.ts +0 -2
  169. package/dist/src/components/atoms/InputNumber/types.d.ts +0 -7
  170. package/dist/src/components/atoms/Label/Label.d.ts +0 -9
  171. package/dist/src/components/atoms/Popover/Popover.d.ts +0 -2
  172. package/dist/src/components/atoms/Popover/index.d.ts +0 -2
  173. package/dist/src/components/atoms/Popover/types.d.ts +0 -8
  174. package/dist/src/components/atoms/RadioButton/RadioButton.d.ts +0 -3
  175. package/dist/src/components/atoms/RadioButton/index.d.ts +0 -2
  176. package/dist/src/components/atoms/RadioButton/types.d.ts +0 -20
  177. package/dist/src/components/atoms/TextInput/TextInput.d.ts +0 -12
  178. package/dist/src/components/atoms/TextInput/index.d.ts +0 -1
  179. package/dist/src/components/atoms/TextInput/types.d.ts +0 -5
  180. package/dist/src/components/atoms/Timepicker/TimePicker.d.ts +0 -3
  181. package/dist/src/components/atoms/Timepicker/index.d.ts +0 -2
  182. package/dist/src/components/atoms/Timepicker/types.d.ts +0 -15
  183. package/dist/src/components/atoms/Toast/Toast.d.ts +0 -20
  184. package/dist/src/components/atoms/Toast/index.d.ts +0 -1
  185. package/dist/src/components/atoms/Toggle/Toggle.d.ts +0 -3
  186. package/dist/src/components/atoms/Toggle/index.d.ts +0 -2
  187. package/dist/src/components/atoms/Toggle/types.d.ts +0 -6
  188. package/dist/src/components/atoms/Typography/Typography.d.ts +0 -7
  189. package/dist/src/components/atoms/Typography/index.d.ts +0 -2
  190. package/dist/src/components/atoms/Typography/types.d.ts +0 -38
  191. package/dist/src/components/atoms/index.d.ts +0 -16
  192. package/dist/src/components/atoms/tooltips/Tooltip/Tooltip.d.ts +0 -2
  193. package/dist/src/components/atoms/tooltips/Tooltip/index.d.ts +0 -2
  194. package/dist/src/components/atoms/tooltips/Tooltip/types.d.ts +0 -10
  195. package/dist/src/components/atoms/tooltips/TooltipWrapper/TooltipWrapper.d.ts +0 -2
  196. package/dist/src/components/atoms/tooltips/TooltipWrapper/index.d.ts +0 -2
  197. package/dist/src/components/atoms/tooltips/TooltipWrapper/types.d.ts +0 -11
  198. package/dist/src/components/atoms/tooltips/index.d.ts +0 -2
  199. package/dist/src/components/index.d.ts +0 -3
  200. package/dist/src/components/molecules/Table/Table.d.ts +0 -3
  201. package/dist/src/components/molecules/Table/index.d.ts +0 -2
  202. package/dist/src/components/molecules/Table/types.d.ts +0 -28
  203. package/dist/src/components/molecules/alert/Alert.d.ts +0 -15
  204. package/dist/src/components/molecules/alert/index.d.ts +0 -1
  205. package/dist/src/components/molecules/dropdowns/Dropdown/Dropdown.d.ts +0 -3
  206. package/dist/src/components/molecules/dropdowns/Dropdown/index.d.ts +0 -2
  207. package/dist/src/components/molecules/dropdowns/Dropdown/types.d.ts +0 -33
  208. package/dist/src/components/molecules/dropdowns/DropdownCountry/DropdownCountry.d.ts +0 -5
  209. package/dist/src/components/molecules/dropdowns/DropdownCountry/index.d.ts +0 -1
  210. package/dist/src/components/molecules/dropdowns/DropdownFilter/DropdownFilter.d.ts +0 -3
  211. package/dist/src/components/molecules/dropdowns/DropdownFilter/index.d.ts +0 -1
  212. package/dist/src/components/molecules/dropdowns/DropdownFilter/types.d.ts +0 -38
  213. package/dist/src/components/molecules/dropdowns/DropdownMultiple/DropdownMultiple.d.ts +0 -3
  214. package/dist/src/components/molecules/dropdowns/DropdownMultiple/index.d.ts +0 -2
  215. package/dist/src/components/molecules/dropdowns/DropdownMultiple/types.d.ts +0 -11
  216. package/dist/src/components/molecules/dropdowns/DropdownPhone/DropdownPhone.d.ts +0 -6
  217. package/dist/src/components/molecules/dropdowns/DropdownPhone/index.d.ts +0 -1
  218. package/dist/src/components/molecules/dropdowns/index.d.ts +0 -5
  219. package/dist/src/components/molecules/index.d.ts +0 -4
  220. package/dist/src/components/molecules/tabs/Tab/Tab.d.ts +0 -3
  221. package/dist/src/components/molecules/tabs/Tab/index.d.ts +0 -2
  222. package/dist/src/components/molecules/tabs/Tab/types.d.ts +0 -16
  223. package/dist/src/components/molecules/tabs/TabButton/TabButton.d.ts +0 -3
  224. package/dist/src/components/molecules/tabs/TabButton/index.d.ts +0 -2
  225. package/dist/src/components/molecules/tabs/TabButton/types.d.ts +0 -15
  226. package/dist/src/components/molecules/tabs/index.d.ts +0 -2
  227. package/dist/src/components/organisms/Modal/Modal.d.ts +0 -3
  228. package/dist/src/components/organisms/Modal/ModalV2.d.ts +0 -53
  229. package/dist/src/components/organisms/Modal/index.d.ts +0 -3
  230. package/dist/src/components/organisms/Modal/types.d.ts +0 -24
  231. package/dist/src/components/organisms/index.d.ts +0 -1
  232. package/dist/src/constants/countries.d.ts +0 -7
  233. package/dist/src/hooks/useClickOutside.d.ts +0 -2
  234. package/dist/src/vite-env.d.ts +0 -1
  235. /package/dist/{src/components/atoms → components}/Label/index.d.ts +0 -0
@@ -0,0 +1,159 @@
1
+ import { cn as e } from "../../lib/cn.js";
2
+ import * as t from "react";
3
+ import { cva as n } from "class-variance-authority";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ //#region src/components/Badge/Badge.tsx
6
+ var a = n(["inline-flex items-center justify-center font-sans tracking-[-0.5px] whitespace-nowrap", "px-x4 gap-x1"].join(" "), {
7
+ variants: {
8
+ variant: {
9
+ success: "",
10
+ destructive: "",
11
+ alert: "",
12
+ purple: "",
13
+ brand: "",
14
+ skyblue: "",
15
+ neutral: "",
16
+ outline: ""
17
+ },
18
+ tone: {
19
+ quiet: "",
20
+ loud: ""
21
+ },
22
+ size: {
23
+ sm: "h-[16px] rounded-x1 text-[12px] leading-[16px] [&_svg]:size-3",
24
+ md: "h-[24px] rounded-x2 text-[14px] leading-[20px] [&_svg]:size-4",
25
+ lg: "h-[32px] rounded-x3 text-[16px] leading-[24px] font-medium [&_svg]:size-4"
26
+ }
27
+ },
28
+ compoundVariants: [
29
+ {
30
+ tone: "quiet",
31
+ variant: "success",
32
+ class: "bg-success-light text-success"
33
+ },
34
+ {
35
+ tone: "quiet",
36
+ variant: "destructive",
37
+ class: "bg-error-light text-error"
38
+ },
39
+ {
40
+ tone: "quiet",
41
+ variant: "alert",
42
+ class: "bg-alert-light text-alert"
43
+ },
44
+ {
45
+ tone: "quiet",
46
+ variant: "purple",
47
+ class: "bg-purple-lighter text-purple-dark"
48
+ },
49
+ {
50
+ tone: "quiet",
51
+ variant: "brand",
52
+ class: "bg-primary-lighter text-primary"
53
+ },
54
+ {
55
+ tone: "quiet",
56
+ variant: "skyblue",
57
+ class: "bg-skyblue-lighter text-skyblue"
58
+ },
59
+ {
60
+ tone: "quiet",
61
+ variant: "neutral",
62
+ class: "bg-gray-20 text-gray-80"
63
+ },
64
+ {
65
+ tone: "quiet",
66
+ variant: "outline",
67
+ class: "bg-transparent text-gray-80 border border-gray-40"
68
+ },
69
+ {
70
+ tone: "loud",
71
+ variant: "success",
72
+ class: "bg-success text-gray-00"
73
+ },
74
+ {
75
+ tone: "loud",
76
+ variant: "destructive",
77
+ class: "bg-error text-gray-00"
78
+ },
79
+ {
80
+ tone: "loud",
81
+ variant: "alert",
82
+ class: "bg-alert text-gray-00"
83
+ },
84
+ {
85
+ tone: "loud",
86
+ variant: "purple",
87
+ class: "bg-purple text-gray-00"
88
+ },
89
+ {
90
+ tone: "loud",
91
+ variant: "brand",
92
+ class: "bg-primary text-gray-00"
93
+ },
94
+ {
95
+ tone: "loud",
96
+ variant: "skyblue",
97
+ class: "bg-skyblue text-gray-00"
98
+ },
99
+ {
100
+ tone: "loud",
101
+ variant: "neutral",
102
+ class: "bg-gray-80 text-gray-00"
103
+ },
104
+ {
105
+ tone: "loud",
106
+ variant: "outline",
107
+ class: "bg-gray-00 text-gray-80 border border-gray-80"
108
+ }
109
+ ],
110
+ defaultVariants: {
111
+ variant: "neutral",
112
+ tone: "quiet",
113
+ size: "md"
114
+ }
115
+ }), o = t.forwardRef(({ className: t, variant: n, tone: r, size: o, icon: s, children: c, ...l }, u) => /* @__PURE__ */ i("span", {
116
+ ref: u,
117
+ className: e(a({
118
+ variant: n,
119
+ tone: r,
120
+ size: o
121
+ }), t),
122
+ ...l,
123
+ children: [s, c]
124
+ }));
125
+ o.displayName = "Badge";
126
+ var s = {
127
+ success: "bg-success",
128
+ destructive: "bg-error",
129
+ alert: "bg-alert",
130
+ purple: "bg-purple",
131
+ brand: "bg-primary",
132
+ skyblue: "bg-skyblue",
133
+ neutral: "bg-gray-60",
134
+ outline: "bg-gray-60"
135
+ }, c = t.forwardRef(({ className: t, variant: n = "success", size: i = "md", ...a }, o) => /* @__PURE__ */ r("span", {
136
+ ref: o,
137
+ role: "status",
138
+ className: e("inline-block rounded-full shrink-0", s[n], i === "sm" && "size-1", i === "md" && "size-2", t),
139
+ ...a
140
+ }));
141
+ c.displayName = "BadgeDot";
142
+ var l = {
143
+ success: "bg-success",
144
+ destructive: "bg-error",
145
+ alert: "bg-alert",
146
+ purple: "bg-purple",
147
+ brand: "bg-primary",
148
+ skyblue: "bg-skyblue",
149
+ neutral: "bg-gray-80",
150
+ outline: "bg-gray-00 border border-gray-80 text-gray-80"
151
+ }, u = t.forwardRef(({ className: t, variant: n = "success", size: i = "md", children: a, ...o }, s) => /* @__PURE__ */ r("span", {
152
+ ref: s,
153
+ className: e("inline-flex items-center justify-center rounded-full font-sans tracking-[-0.5px] shrink-0", n !== "outline" && "text-gray-00", l[n], i === "sm" && "size-4 text-[12px] leading-[16px]", i === "md" && "size-6 text-[18px] leading-[24px]", t),
154
+ ...o,
155
+ children: a
156
+ }));
157
+ u.displayName = "BadgeMinimal";
158
+ //#endregion
159
+ export { o as Badge, c as BadgeDot, u as BadgeMinimal };
@@ -0,0 +1,2 @@
1
+ export { Badge, BadgeDot, BadgeMinimal } from './Badge';
2
+ export type { BadgeProps, BadgeDotProps, BadgeMinimalProps } from './Badge';
@@ -0,0 +1,2 @@
1
+ import { Badge as e, BadgeDot as t, BadgeMinimal as n } from "./Badge.js";
2
+ export { e as Badge, t as BadgeDot, n as BadgeMinimal };
@@ -0,0 +1,7 @@
1
+ import { ButtonVariants } from './button.variants';
2
+ import * as React from 'react';
3
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, ButtonVariants {
4
+ asChild?: boolean;
5
+ loading?: boolean;
6
+ }
7
+ export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,44 @@
1
+ import { cn as e } from "../../lib/cn.js";
2
+ import { buttonVariants as t } from "./button.variants.js";
3
+ import * as n from "react";
4
+ import { Slot as r } from "@radix-ui/react-slot";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ import { CircleNotch as o } from "@phosphor-icons/react";
7
+ //#region src/components/Button/Button.tsx
8
+ var s = n.forwardRef(({ className: n, variant: s, size: c, iconOnly: l, fullWidth: u, asChild: d = !1, loading: f = !1, disabled: p, children: m, type: h = "button", ...g }, _) => {
9
+ let v = d ? r : "button", y = p || f;
10
+ return d ? /* @__PURE__ */ i(v, {
11
+ ref: _,
12
+ className: e(t({
13
+ variant: s,
14
+ size: c,
15
+ iconOnly: l,
16
+ fullWidth: u
17
+ }), n),
18
+ "aria-busy": f || void 0,
19
+ "aria-disabled": y || void 0,
20
+ ...g,
21
+ children: m
22
+ }) : /* @__PURE__ */ a(v, {
23
+ ref: _,
24
+ type: h,
25
+ className: e(t({
26
+ variant: s,
27
+ size: c,
28
+ iconOnly: l,
29
+ fullWidth: u
30
+ }), n),
31
+ disabled: y,
32
+ "aria-busy": f || void 0,
33
+ ...g,
34
+ children: [f ? /* @__PURE__ */ i(o, {
35
+ "data-icon": "inline-start",
36
+ weight: "bold",
37
+ className: "[animation:ctc-spin_700ms_linear_infinite]",
38
+ "aria-hidden": "true"
39
+ }) : null, m]
40
+ });
41
+ });
42
+ s.displayName = "Button";
43
+ //#endregion
44
+ export { s as Button };
@@ -0,0 +1,22 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ /**
3
+ * Button — pixel-perfect to Figma spec.
4
+ *
5
+ * Size matrix (per Figma):
6
+ * sm → h-8 (32px), text 16px (Body4/Md), px-x4 (16), icon child 24, icon-only 24×24
7
+ * md → h-12 (48px), text 18px (Body3/Md), px-x6 (24), icon child 24, icon-only 32×32
8
+ * lg → h-14 (56px), text 18px (Body3/Md), px-x8 (32), icon child 32, icon-only 40×40
9
+ *
10
+ * Border radius is constant at 32px (rounded-x8) across all sizes.
11
+ *
12
+ * Note: NT Bau only ships Regular (400) and Bold (700). The Figma "Md"
13
+ * weight resolves to font-weight: 500 which browsers synthesize from the
14
+ * Regular face.
15
+ */
16
+ export declare const buttonVariants: (props?: ({
17
+ variant?: "default" | "success" | "destructive" | "brand" | "skyblue" | "outline" | "outline-skyblue" | "ghost" | null | undefined;
18
+ size?: "sm" | "lg" | "md" | null | undefined;
19
+ iconOnly?: boolean | null | undefined;
20
+ fullWidth?: boolean | null | undefined;
21
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
22
+ export type ButtonVariants = VariantProps<typeof buttonVariants>;
@@ -0,0 +1,62 @@
1
+ import { cva as e } from "class-variance-authority";
2
+ //#region src/components/Button/button.variants.ts
3
+ var t = e([
4
+ "inline-flex items-center justify-center gap-x2",
5
+ "rounded-x8 font-sans select-none",
6
+ "[transition:transform_var(--duration-fast)_var(--ease-out),background-color_var(--duration-fast)_var(--ease-out),border-color_var(--duration-fast)_var(--ease-out),color_var(--duration-fast)_var(--ease-out)]",
7
+ "active:[transform:scale(var(--press-scale))]",
8
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
9
+ "disabled:cursor-not-allowed disabled:bg-gray-20 disabled:text-gray-40 disabled:border-transparent disabled:active:transform-none",
10
+ "[&_[data-icon='inline-start']]:-ml-1 [&_[data-icon='inline-end']]:-mr-1"
11
+ ], {
12
+ variants: {
13
+ variant: {
14
+ brand: "bg-primary-light text-gray-80 hover:bg-primary-lighter hover:text-gray-60",
15
+ skyblue: "bg-skyblue text-gray-00 hover:bg-skyblue-hover",
16
+ default: "bg-gray-80 text-gray-00 hover:bg-gray-60 hover:text-gray-20",
17
+ success: "bg-success text-gray-00 hover:bg-success-hover",
18
+ destructive: "bg-error text-gray-00 hover:bg-error-hover",
19
+ outline: "bg-transparent text-gray-80 border border-gray-80 hover:bg-gray-20 hover:border-gray-60 disabled:border-gray-40",
20
+ "outline-skyblue": "bg-transparent text-skyblue border border-skyblue hover:bg-skyblue-lighter disabled:border-gray-40 disabled:text-gray-40",
21
+ ghost: "bg-transparent text-gray-80 hover:bg-gray-20"
22
+ },
23
+ size: {
24
+ sm: "h-8 px-x4 text-[16px] leading-[20px] font-medium [&_[data-icon]]:size-6",
25
+ md: "h-12 px-x6 text-[18px] leading-[24px] font-medium [&_[data-icon]]:size-6",
26
+ lg: "h-14 px-x8 text-[18px] leading-[24px] font-medium [&_[data-icon]]:size-8"
27
+ },
28
+ iconOnly: {
29
+ true: "p-0",
30
+ false: ""
31
+ },
32
+ fullWidth: {
33
+ true: "w-full",
34
+ false: "w-fit"
35
+ }
36
+ },
37
+ compoundVariants: [
38
+ {
39
+ iconOnly: !0,
40
+ size: "sm",
41
+ class: "size-6 h-6 px-0"
42
+ },
43
+ {
44
+ iconOnly: !0,
45
+ size: "md",
46
+ class: "size-8 h-8 px-0"
47
+ },
48
+ {
49
+ iconOnly: !0,
50
+ size: "lg",
51
+ class: "size-10 h-10 px-0"
52
+ }
53
+ ],
54
+ defaultVariants: {
55
+ variant: "brand",
56
+ size: "md",
57
+ iconOnly: !1,
58
+ fullWidth: !1
59
+ }
60
+ });
61
+ //#endregion
62
+ export { t as buttonVariants };
@@ -0,0 +1,2 @@
1
+ export { Button, type ButtonProps } from './Button';
2
+ export { buttonVariants, type ButtonVariants } from './button.variants';
@@ -0,0 +1,3 @@
1
+ import { buttonVariants as e } from "./button.variants.js";
2
+ import { Button as t } from "./Button.js";
3
+ export { t as Button, e as buttonVariants };
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
3
+ export interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
4
+ /** lg=22px (default), sm=16px */
5
+ size?: 'sm' | 'lg';
6
+ }
7
+ export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,23 @@
1
+ import { cn as e } from "../../lib/cn.js";
2
+ import * as t from "react";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ import { Check as r, Minus as i } from "@phosphor-icons/react";
5
+ import * as a from "@radix-ui/react-checkbox";
6
+ //#region src/components/Checkbox/Checkbox.tsx
7
+ var o = t.forwardRef(({ className: t, size: o = "lg", checked: s, ...c }, l) => /* @__PURE__ */ n(a.Root, {
8
+ ref: l,
9
+ checked: s,
10
+ "data-pressable": "",
11
+ className: e("peer shrink-0 rounded-[2px] border bg-gray-00", "inline-flex items-center justify-center", "[transition:background-color_var(--duration-fast)_var(--ease-out),border-color_var(--duration-fast)_var(--ease-out),transform_var(--duration-fast)_var(--ease-out)]", "active:scale-[0.92]", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", "border-gray-80", "hover:border-gray-100", "data-[state=checked]:bg-gray-80 data-[state=checked]:border-gray-80 data-[state=checked]:text-gray-00", "hover:data-[state=checked]:bg-gray-100 hover:data-[state=checked]:border-gray-100", "data-[state=indeterminate]:bg-gray-80 data-[state=indeterminate]:border-gray-80 data-[state=indeterminate]:text-gray-00", "hover:data-[state=indeterminate]:bg-gray-100 hover:data-[state=indeterminate]:border-gray-100", "disabled:cursor-not-allowed disabled:bg-gray-20 disabled:border-gray-40 disabled:active:transform-none", "disabled:data-[state=checked]:bg-gray-20 disabled:data-[state=checked]:border-gray-40 disabled:data-[state=checked]:text-gray-40", "disabled:data-[state=indeterminate]:bg-gray-20 disabled:data-[state=indeterminate]:border-gray-40 disabled:data-[state=indeterminate]:text-gray-40", "aria-invalid:border-error", o === "lg" && "size-[22px]", o === "sm" && "size-[16px]", t),
12
+ ...c,
13
+ children: /* @__PURE__ */ n(a.Indicator, {
14
+ className: e("flex items-center justify-center text-current", "[animation:ctc-scale-in_var(--duration-fast)_var(--ease-out)]"),
15
+ children: n(s === "indeterminate" ? i : r, {
16
+ weight: "bold",
17
+ className: e(o === "lg" ? "size-4" : "size-3")
18
+ })
19
+ })
20
+ }));
21
+ o.displayName = "Checkbox";
22
+ //#endregion
23
+ export { o as Checkbox };
@@ -0,0 +1 @@
1
+ export { Checkbox, type CheckboxProps } from './Checkbox';
@@ -0,0 +1,2 @@
1
+ import { Checkbox as e } from "./Checkbox.js";
2
+ export { e as Checkbox };
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ export interface DismissibleChipProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ variant: 'dismissible';
4
+ disabled?: boolean;
5
+ onDismiss?: () => void;
6
+ }
7
+ export interface SelectableChipProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
8
+ variant?: 'choice' | 'multi';
9
+ selected?: boolean;
10
+ }
11
+ export type ChipProps = DismissibleChipProps | SelectableChipProps;
12
+ export declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLElement>>;
13
+ export interface ChipGroupProps extends React.HTMLAttributes<HTMLDivElement> {
14
+ /** Apply staggered mount animation (35ms step, max 12 children). Default false. */
15
+ stagger?: boolean;
16
+ }
17
+ export declare const ChipGroup: React.ForwardRefExoticComponent<ChipGroupProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,59 @@
1
+ import { cn as e } from "../../lib/cn.js";
2
+ import * as t from "react";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ import { Check as i, X as a } from "@phosphor-icons/react";
5
+ //#region src/components/Chip/Chip.tsx
6
+ var o = [
7
+ "inline-flex items-center gap-x1 py-x1 px-x4 rounded-x3",
8
+ "font-sans font-medium text-[16px] leading-[24px] tracking-[-0.5px]",
9
+ "[transition:background-color_var(--duration-fast)_var(--ease-out),border-color_var(--duration-fast)_var(--ease-out),color_var(--duration-fast)_var(--ease-out)]"
10
+ ].join(" "), s = ["bg-gray-00 border border-gray-40 text-gray-80", "hover:border-gray-60"].join(" "), c = ["bg-gray-80 text-gray-00 border border-transparent", "hover:bg-gray-100"].join(" "), l = "border-gray-40 text-gray-40 cursor-not-allowed", u = "bg-gray-20 text-gray-40 border-transparent cursor-not-allowed", d = (e, t) => e ? t ? u : l : t ? c : s, f = t.forwardRef((t, c) => {
11
+ if (t.variant === "dismissible") {
12
+ let { variant: i, className: u, disabled: d, onDismiss: f, children: p, ...m } = t;
13
+ return /* @__PURE__ */ r("div", {
14
+ ref: c,
15
+ className: e(o, d ? l : s, "cursor-default select-none", "[animation:ctc-fade-rise_var(--duration-base)_var(--ease-out)]", u),
16
+ "aria-disabled": d,
17
+ ...m,
18
+ children: [/* @__PURE__ */ n("span", {
19
+ className: "shrink-0",
20
+ children: p
21
+ }), /* @__PURE__ */ n("button", {
22
+ type: "button",
23
+ onClick: d ? void 0 : f,
24
+ disabled: d,
25
+ "aria-label": "Quitar",
26
+ "data-pressable": "",
27
+ className: e("inline-flex items-center justify-center shrink-0 size-6", "rounded-x1 opacity-60 hover:opacity-100", "active:scale-[var(--press-scale)]", "[transition:opacity_var(--duration-fast)_var(--ease-out),transform_var(--duration-fast)_var(--ease-out)]", d && "pointer-events-none opacity-40 active:transform-none"),
28
+ children: /* @__PURE__ */ n(a, { className: "size-6" })
29
+ })]
30
+ });
31
+ }
32
+ let { variant: u = "choice", selected: f = !1, disabled: p, className: m, children: h, onClick: g, ..._ } = t;
33
+ return /* @__PURE__ */ r("button", {
34
+ ref: c,
35
+ type: "button",
36
+ disabled: p,
37
+ "aria-pressed": f,
38
+ onClick: g,
39
+ "data-pressable": "",
40
+ className: e(o, d(p, f), !p && "active:[transform:scale(var(--press-scale))]", m),
41
+ ..._,
42
+ children: [u === "multi" && f && /* @__PURE__ */ n(i, {
43
+ weight: "bold",
44
+ className: "size-6 shrink-0"
45
+ }), /* @__PURE__ */ n("span", {
46
+ className: "shrink-0",
47
+ children: h
48
+ })]
49
+ });
50
+ });
51
+ f.displayName = "Chip";
52
+ var p = t.forwardRef(({ className: t, stagger: r = !1, ...i }, a) => /* @__PURE__ */ n("div", {
53
+ ref: a,
54
+ className: e("flex flex-wrap gap-x2", r && "ctc-stagger", t),
55
+ ...i
56
+ }));
57
+ p.displayName = "ChipGroup";
58
+ //#endregion
59
+ export { f as Chip, p as ChipGroup };
@@ -0,0 +1,2 @@
1
+ export { Chip, ChipGroup } from './Chip';
2
+ export type { ChipProps, DismissibleChipProps, SelectableChipProps } from './Chip';
@@ -0,0 +1,2 @@
1
+ import { Chip as e, ChipGroup as t } from "./Chip.js";
2
+ export { e as Chip, t as ChipGroup };
@@ -0,0 +1,31 @@
1
+ export interface ComboboxOption {
2
+ value: string;
3
+ label: string;
4
+ disabled?: boolean;
5
+ }
6
+ export interface ComboboxProps {
7
+ options: ComboboxOption[];
8
+ value?: string;
9
+ defaultValue?: string;
10
+ onValueChange?: (value: string) => void;
11
+ placeholder?: string;
12
+ searchPlaceholder?: string;
13
+ emptyText?: string;
14
+ disabled?: boolean;
15
+ size?: 'sm' | 'lg';
16
+ className?: string;
17
+ /** Async search: invoked when the user types in the search input. */
18
+ onSearch?: (query: string) => void;
19
+ /** Set when an async search is in flight. */
20
+ searching?: boolean;
21
+ /** Set when the consumer has more pages it can load. */
22
+ hasMore?: boolean;
23
+ /** Invoked when the user scrolls near the bottom of the option list. */
24
+ onEndReached?: () => void;
25
+ /** Set when the consumer is currently fetching the next page. */
26
+ loading?: boolean;
27
+ }
28
+ export declare const Combobox: {
29
+ ({ options, value, defaultValue, onValueChange, placeholder, searchPlaceholder, emptyText, disabled, size, className, onSearch, searching, hasMore, onEndReached, loading }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
30
+ displayName: string;
31
+ };
@@ -0,0 +1,98 @@
1
+ import { cn as e } from "../../lib/cn.js";
2
+ import { inputVariants as t } from "../Input/Input.js";
3
+ import { Spinner as n } from "../Spinner/Spinner.js";
4
+ import { Popover as r, PopoverContent as i, PopoverTrigger as a } from "../Popover/Popover.js";
5
+ import * as o from "react";
6
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
+ import { CaretUpDownIcon as l, CheckIcon as u, MagnifyingGlassIcon as d } from "@phosphor-icons/react";
8
+ import { Command as f } from "cmdk";
9
+ //#region src/components/Combobox/Combobox.tsx
10
+ var p = ({ options: p, value: m, defaultValue: h, onValueChange: g, placeholder: _ = "Seleccionar opción", searchPlaceholder: v = "Buscar...", emptyText: y = "Sin resultados", disabled: b, size: x = "sm", className: S, onSearch: C, searching: w, hasMore: T, onEndReached: E, loading: D }) => {
11
+ let [O, k] = o.useState(!1), [A, j] = o.useState(h), M = m !== void 0, N = M ? m : A, P = p.find((e) => e.value === N), F = (e) => {
12
+ M || j(e), g?.(e), k(!1);
13
+ }, I = o.useRef(null);
14
+ return /* @__PURE__ */ c(r, {
15
+ open: O,
16
+ onOpenChange: k,
17
+ children: [/* @__PURE__ */ s(a, {
18
+ asChild: !0,
19
+ children: /* @__PURE__ */ c("button", {
20
+ type: "button",
21
+ role: "combobox",
22
+ "data-pressable": "",
23
+ "aria-expanded": O,
24
+ disabled: b,
25
+ className: e(t({ size: x }), "inline-flex items-center justify-between text-left", "active:scale-[var(--press-scale)] disabled:active:transform-none", !P && "text-gray-40", S),
26
+ children: [/* @__PURE__ */ s("span", {
27
+ className: "truncate",
28
+ children: P ? P.label : _
29
+ }), /* @__PURE__ */ s(l, {
30
+ weight: "bold",
31
+ className: "size-4 text-gray-60 shrink-0 ml-x2"
32
+ })]
33
+ })
34
+ }), /* @__PURE__ */ s(i, {
35
+ className: "w-[var(--radix-popover-trigger-width)] p-0",
36
+ align: "start",
37
+ children: /* @__PURE__ */ c(f, {
38
+ shouldFilter: !C,
39
+ className: "flex flex-col",
40
+ children: [/* @__PURE__ */ c("div", {
41
+ className: "flex items-center border-b border-gray-20 px-x3",
42
+ children: [
43
+ /* @__PURE__ */ s(d, {
44
+ weight: "regular",
45
+ className: "size-4 text-gray-60 mr-x2 shrink-0"
46
+ }),
47
+ /* @__PURE__ */ s(f.Input, {
48
+ placeholder: v,
49
+ onValueChange: C,
50
+ className: e("flex h-10 w-full bg-transparent py-x2 font-sans text-[14px] text-gray-80 outline-none", "placeholder:text-gray-40 disabled:cursor-not-allowed disabled:opacity-50")
51
+ }),
52
+ w && /* @__PURE__ */ s(n, {
53
+ size: "sm",
54
+ className: "text-gray-60"
55
+ })
56
+ ]
57
+ }), /* @__PURE__ */ c(f.List, {
58
+ ref: I,
59
+ onScroll: (e) => {
60
+ if (!T || D) return;
61
+ let t = e.currentTarget;
62
+ t.scrollTop + t.clientHeight >= t.scrollHeight - 32 && E?.();
63
+ },
64
+ className: "max-h-64 overflow-y-auto p-x1",
65
+ children: [
66
+ /* @__PURE__ */ s(f.Empty, {
67
+ className: "py-x6 text-center text-[14px] text-gray-60",
68
+ children: y
69
+ }),
70
+ p.map((t) => /* @__PURE__ */ c(f.Item, {
71
+ value: t.value,
72
+ disabled: t.disabled,
73
+ onSelect: F,
74
+ className: e("relative flex cursor-default select-none items-center rounded-x1 py-x2 pl-x3 pr-x8", "text-[14px] text-gray-80 outline-none", "[transition:background-color_var(--duration-fast)_var(--ease-out)]", "data-[selected=true]:bg-gray-20 data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50"),
75
+ children: [/* @__PURE__ */ s("span", {
76
+ className: "truncate",
77
+ children: t.label
78
+ }), N === t.value && /* @__PURE__ */ s(u, {
79
+ weight: "bold",
80
+ className: "absolute right-x3 size-4 text-primary"
81
+ })]
82
+ }, t.value)),
83
+ D && /* @__PURE__ */ s("div", {
84
+ className: "flex items-center justify-center py-x3",
85
+ children: /* @__PURE__ */ s(n, {
86
+ size: "sm",
87
+ className: "text-gray-60"
88
+ })
89
+ })
90
+ ]
91
+ })]
92
+ })
93
+ })]
94
+ });
95
+ };
96
+ p.displayName = "Combobox";
97
+ //#endregion
98
+ export { p as Combobox };
@@ -0,0 +1 @@
1
+ export { Combobox, type ComboboxProps, type ComboboxOption } from './Combobox';
@@ -0,0 +1,2 @@
1
+ import { Combobox as e } from "./Combobox.js";
2
+ export { e as Combobox };
@@ -0,0 +1,24 @@
1
+ import { ColumnDef } from '@tanstack/react-table';
2
+ import * as React from 'react';
3
+ export interface ExpandableConfig<T> {
4
+ /** Sub-rows to render under an expanded row. */
5
+ expandedRowData: (record: T) => T[];
6
+ /** Custom columns for sub-rows. Defaults to the parent columns. */
7
+ expandedRowColumns?: ColumnDef<T>[];
8
+ /** When true (default), inserts a leading spacer column to align nested rows. */
9
+ alignSubRowsWithParent?: boolean;
10
+ /** Optional override for the entire expanded row render. */
11
+ expandedRowRender?: (record: T) => React.ReactNode;
12
+ expandedRowNestedClassName?: string;
13
+ }
14
+ export interface DataTableProps<T> {
15
+ columns: ColumnDef<T>[];
16
+ data: T[];
17
+ expandable?: ExpandableConfig<T>;
18
+ className?: string;
19
+ emptyText?: string;
20
+ loading?: boolean;
21
+ /** Forwarded as `data-testid` to the root. */
22
+ 'data-testid'?: string;
23
+ }
24
+ export declare function DataTable<T>({ columns, data, expandable, className, emptyText, loading, ...props }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;