@boxcustodia/library 2.0.0-alpha.12 → 2.0.0-alpha.14

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 (174) hide show
  1. package/dist/index.cjs.js +1 -138
  2. package/dist/index.d.ts +1087 -720
  3. package/dist/index.es.js +7011 -56097
  4. package/dist/theme.css +1 -1
  5. package/package.json +34 -26
  6. package/src/__doc__/Examples.tsx +1 -1
  7. package/src/__doc__/Intro.mdx +3 -3
  8. package/src/__doc__/Tabs.mdx +112 -0
  9. package/src/__doc__/V2.mdx +1246 -0
  10. package/src/components/accordion/accordion.stories.tsx +143 -0
  11. package/src/components/accordion/accordion.tsx +135 -0
  12. package/src/components/accordion/index.ts +1 -0
  13. package/src/components/alert/alert.stories.tsx +24 -4
  14. package/src/components/alert/alert.tsx +17 -9
  15. package/src/components/alert-dialog/alert-dialog.stories.tsx +24 -0
  16. package/src/components/alert-dialog/alert-dialog.test.tsx +1 -1
  17. package/src/components/alert-dialog/alert-dialog.tsx +58 -10
  18. package/src/components/auto-complete/auto-complete.stories.tsx +616 -200
  19. package/src/components/auto-complete/auto-complete.tsx +420 -68
  20. package/src/components/auto-complete/index.ts +0 -1
  21. package/src/components/avatar/avatar.stories.tsx +162 -21
  22. package/src/components/avatar/avatar.tsx +79 -20
  23. package/src/components/button/button.stories.tsx +219 -294
  24. package/src/components/button/button.test.tsx +10 -17
  25. package/src/components/button/button.tsx +78 -19
  26. package/src/components/button/components/base-button.tsx +30 -53
  27. package/src/components/button/index.ts +0 -1
  28. package/src/components/calendar/calendar.stories.tsx +1 -1
  29. package/src/components/calendar/calendar.tsx +4 -4
  30. package/src/components/card/card.stories.tsx +141 -69
  31. package/src/components/card/card.tsx +155 -54
  32. package/src/components/center/center.stories.tsx +22 -39
  33. package/src/components/checkbox/checkbox.stories.tsx +25 -5
  34. package/src/components/checkbox/checkbox.tsx +76 -15
  35. package/src/components/checkbox-group/checkbox-group.stories.tsx +116 -28
  36. package/src/components/checkbox-group/checkbox-group.tsx +84 -3
  37. package/src/components/combobox/combobox.stories.tsx +33 -23
  38. package/src/components/combobox/combobox.tsx +99 -77
  39. package/src/components/date-picker/date-input.stories.tsx +14 -6
  40. package/src/components/date-picker/date-input.tsx +2 -2
  41. package/src/components/date-picker/date-picker.model.ts +13 -4
  42. package/src/components/date-picker/date-picker.stories.tsx +38 -12
  43. package/src/components/date-picker/date-picker.tsx +28 -14
  44. package/src/components/dialog/dialog.stories.tsx +18 -0
  45. package/src/components/dialog/dialog.test.tsx +1 -1
  46. package/src/components/dialog/dialog.tsx +51 -20
  47. package/src/components/divider/divider.stories.tsx +126 -51
  48. package/src/components/divider/divider.tsx +16 -16
  49. package/src/components/dropzone/dropzone.stories.tsx +71 -90
  50. package/src/components/dropzone/dropzone.tsx +383 -105
  51. package/src/components/dropzone/index.ts +0 -1
  52. package/src/components/empty/empty.stories.tsx +165 -0
  53. package/src/components/empty/empty.tsx +156 -0
  54. package/src/components/empty/index.ts +1 -0
  55. package/src/components/field/field.stories.tsx +227 -4
  56. package/src/components/field/field.tsx +77 -42
  57. package/src/components/form/form.stories.tsx +320 -197
  58. package/src/components/form/form.tsx +3 -23
  59. package/src/components/index.ts +2 -6
  60. package/src/components/input/input.stories.tsx +5 -5
  61. package/src/components/input/input.tsx +4 -4
  62. package/src/components/kbd/kbd.stories.tsx +1 -0
  63. package/src/components/label/label.stories.tsx +16 -0
  64. package/src/components/label/label.tsx +13 -2
  65. package/src/components/loader/loader.stories.tsx +7 -5
  66. package/src/components/loader/loader.tsx +8 -3
  67. package/src/components/menu/menu-primitives.tsx +207 -196
  68. package/src/components/menu/menu.stories.tsx +276 -146
  69. package/src/components/menu/menu.tsx +146 -54
  70. package/src/components/number-input/number-input.stories.tsx +27 -4
  71. package/src/components/number-input/number-input.test.tsx +2 -2
  72. package/src/components/number-input/number-input.tsx +31 -33
  73. package/src/components/otp/index.ts +1 -0
  74. package/src/components/otp/otp.stories.tsx +209 -0
  75. package/src/components/otp/otp.tsx +100 -0
  76. package/src/components/pagination/index.ts +1 -0
  77. package/src/components/pagination/pagination.model.ts +2 -0
  78. package/src/components/pagination/pagination.stories.tsx +154 -59
  79. package/src/components/pagination/pagination.test.tsx +122 -57
  80. package/src/components/pagination/pagination.tsx +575 -77
  81. package/src/components/password/password.stories.tsx +18 -3
  82. package/src/components/password/password.tsx +29 -9
  83. package/src/components/popover/popover.stories.tsx +26 -5
  84. package/src/components/popover/popover.tsx +15 -23
  85. package/src/components/progress/progress.stories.tsx +1 -0
  86. package/src/components/radio-group/index.ts +1 -0
  87. package/src/components/radio-group/radio-group.stories.tsx +251 -0
  88. package/src/components/radio-group/radio-group.tsx +212 -0
  89. package/src/components/scroll-area/scroll-area.stories.tsx +1 -0
  90. package/src/components/select/select.stories.tsx +118 -19
  91. package/src/components/select/select.tsx +67 -62
  92. package/src/components/skeleton/skeleton.stories.tsx +1 -0
  93. package/src/components/stack/stack.stories.tsx +179 -89
  94. package/src/components/stack/stack.tsx +2 -2
  95. package/src/components/stepper/index.ts +1 -1
  96. package/src/components/stepper/stepper.stories.tsx +767 -83
  97. package/src/components/stepper/stepper.test.tsx +18 -18
  98. package/src/components/stepper/stepper.tsx +554 -0
  99. package/src/components/switch/switch.stories.tsx +15 -1
  100. package/src/components/switch/switch.tsx +17 -4
  101. package/src/components/table/index.ts +0 -2
  102. package/src/components/table/table.stories.tsx +131 -18
  103. package/src/components/table/table.test.tsx +1 -1
  104. package/src/components/table/table.tsx +183 -77
  105. package/src/components/tabs/tabs.stories.tsx +373 -155
  106. package/src/components/tabs/tabs.test.tsx +12 -12
  107. package/src/components/tabs/tabs.tsx +72 -149
  108. package/src/components/tag/index.ts +0 -1
  109. package/src/components/tag/tag.stories.tsx +155 -120
  110. package/src/components/tag/tag.tsx +47 -95
  111. package/src/components/textarea/textarea.stories.tsx +8 -22
  112. package/src/components/textarea/textarea.tsx +17 -79
  113. package/src/components/timeline/timeline.stories.tsx +323 -42
  114. package/src/components/timeline/timeline.tsx +359 -132
  115. package/src/components/toast/toast.stories.tsx +1 -0
  116. package/src/components/tooltip/tooltip.tsx +11 -9
  117. package/src/components/tree/index.ts +0 -1
  118. package/src/components/tree/tree.stories.tsx +365 -408
  119. package/src/components/tree/tree.test.tsx +163 -0
  120. package/src/components/tree/tree.tsx +212 -36
  121. package/src/hooks/useAsync/__doc__/useAsync.stories.tsx +5 -5
  122. package/src/hooks/useClipboard/__doc__/useClipboard.stories.tsx +1 -3
  123. package/src/hooks/useDebounceCallback/__doc__/useDebouncedCallback.stories.tsx +6 -6
  124. package/src/hooks/useDocumentTitle/__doc__/useDocumentTitle.stories.tsx +1 -1
  125. package/src/hooks/useEventListener/__test__/useEventListener.test.tsx +1 -1
  126. package/src/hooks/useLocalStorage/__doc__/useLocalStorage.stories.tsx +1 -1
  127. package/src/hooks/usePagination/usePagination.tsx +36 -24
  128. package/src/styles/theme.css +1 -1
  129. package/src/utils/form.tsx +67 -37
  130. package/src/utils/index.ts +1 -1
  131. package/src/__doc__/Migration.mdx +0 -475
  132. package/src/components/auto-complete/auto-complete-primitives.tsx +0 -155
  133. package/src/components/background-image/background-image.stories.tsx +0 -21
  134. package/src/components/background-image/background-image.test.tsx +0 -29
  135. package/src/components/background-image/background-image.tsx +0 -23
  136. package/src/components/background-image/index.ts +0 -1
  137. package/src/components/button/button.variants.ts +0 -44
  138. package/src/components/button/components/loader-overlay.tsx +0 -21
  139. package/src/components/button/components/loading-icon.tsx +0 -47
  140. package/src/components/dropzone/upload-primitives.tsx +0 -310
  141. package/src/components/dropzone/use-dropzone.ts +0 -122
  142. package/src/components/empty-state/empty-state.stories.tsx +0 -56
  143. package/src/components/empty-state/empty-state.tsx +0 -39
  144. package/src/components/empty-state/index.ts +0 -1
  145. package/src/components/heading/heading.stories.tsx +0 -74
  146. package/src/components/heading/heading.tsx +0 -28
  147. package/src/components/heading/heading.variants.ts +0 -27
  148. package/src/components/heading/index.ts +0 -1
  149. package/src/components/kbd/kbd.variants.ts +0 -26
  150. package/src/components/menu/util/render-menu-item.tsx +0 -54
  151. package/src/components/multi-select/hooks/use-multi-select.ts +0 -66
  152. package/src/components/multi-select/index.ts +0 -1
  153. package/src/components/multi-select/multi-select.stories.tsx +0 -294
  154. package/src/components/multi-select/multi-select.tsx +0 -300
  155. package/src/components/multi-select/multi-select.variants.ts +0 -22
  156. package/src/components/pagination/components/pagination-option.tsx +0 -27
  157. package/src/components/show/index.ts +0 -1
  158. package/src/components/show/show.stories.tsx +0 -197
  159. package/src/components/show/show.test.tsx +0 -41
  160. package/src/components/show/show.tsx +0 -16
  161. package/src/components/stepper/Stepper.tsx +0 -190
  162. package/src/components/stepper/context/stepper-context.tsx +0 -11
  163. package/src/components/table/table-primitives.tsx +0 -122
  164. package/src/components/table/table.model.ts +0 -20
  165. package/src/components/table-pagination/index.ts +0 -2
  166. package/src/components/table-pagination/table-pagination.model.ts +0 -2
  167. package/src/components/table-pagination/table-pagination.stories.tsx +0 -23
  168. package/src/components/table-pagination/table-pagination.test.tsx +0 -32
  169. package/src/components/table-pagination/table-pagination.tsx +0 -108
  170. package/src/components/tabs/context/tabs-context.tsx +0 -14
  171. package/src/components/tag/tag.variants.ts +0 -31
  172. package/src/components/timeline/timeline-status.ts +0 -5
  173. package/src/components/tree/hooks/use-controllable-tree-state.ts +0 -80
  174. package/src/components/tree/tree-primitives.tsx +0 -126
package/dist/theme.css CHANGED
@@ -29,7 +29,7 @@
29
29
  --color-success-foreground: oklch(98.42% 0.003 247.86);
30
30
 
31
31
  --color-warning: oklch(79.65% 0.16 70.08);
32
- --color-warning-foreground: oklch(17.97% 0.034 59.63);
32
+ --color-warning-foreground: oklch(98.42% 0.003 247.86);
33
33
 
34
34
  --color-info: oklch(62.8% 0.152 237.57);
35
35
  --color-info-foreground: oklch(98.42% 0.003 247.86);
package/package.json CHANGED
@@ -1,11 +1,20 @@
1
1
  {
2
2
  "name": "@boxcustodia/library",
3
- "version": "2.0.0-alpha.12",
3
+ "version": "2.0.0-alpha.14",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "style": "dist/index.css",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.es.js",
13
+ "require": "./dist/index.cjs.js"
14
+ },
15
+ "./styles": "./dist/index.css",
16
+ "./package.json": "./package.json"
17
+ },
9
18
  "sideEffects": false,
10
19
  "files": [
11
20
  "/dist",
@@ -54,24 +63,28 @@
54
63
  "description": "",
55
64
  "dependencies": {
56
65
  "@base-ui/react": "^1.4.0",
57
- "tw-animate-css": "^1.2.9",
58
- "@biomejs/biome": "^2.3.8",
59
- "@radix-ui/react-dialog": "^1.1.15",
60
- "@radix-ui/react-dropdown-menu": "^2.1.16",
61
- "@radix-ui/react-popover": "^1.1.15",
62
- "@radix-ui/react-presence": "^1.1.5",
63
- "@radix-ui/react-select": "^2.2.6",
64
- "@radix-ui/react-slot": "^1.2.4",
65
- "@radix-ui/react-tooltip": "1.2.8",
66
+ "@headless-tree/core": "^1.7.0",
67
+ "@hookform/resolvers": "^5.2.2",
66
68
  "@radix-ui/react-use-controllable-state": "^1.2.2",
67
- "react-aria-components": "^1.13.0",
69
+ "class-variance-authority": "^0.7.1",
70
+ "clsx": "^2.1.1",
71
+ "date-fns": "^4.1.0",
72
+ "lodash": "^4.17.21",
73
+ "lucide-react": "0.561.0",
68
74
  "react-day-picker": "^9.14.0",
69
- "vite-tsconfig-paths": "^6.0.1"
75
+ "react-dropzone": "^15.0.0",
76
+ "react-hook-form": "^7.68.0",
77
+ "tailwind-merge": "^3.4.0",
78
+ "tailwind-variants": "^3.2.2",
79
+ "tw-animate-css": "^1.2.9",
80
+ "zod": "^4.2.0",
81
+ "zustand": "^5.0.9"
70
82
  },
71
83
  "devDependencies": {
84
+ "@biomejs/biome": "^2.3.8",
72
85
  "@chromatic-com/storybook": "^5.1.2",
73
86
  "@faker-js/faker": "^10.1.0",
74
- "@hookform/resolvers": "^5.2.2",
87
+ "@headless-tree/react": "^1.7.0",
75
88
  "@storybook/addon-docs": "10.3.5",
76
89
  "@storybook/addon-links": "10.3.5",
77
90
  "@storybook/addon-mcp": "^0.6.0",
@@ -89,34 +102,25 @@
89
102
  "@types/react-transition-group": "^4.4.12",
90
103
  "@vitejs/plugin-react": "^5.1.2",
91
104
  "autoprefixer": "^10.4.23",
92
- "bunx": "^0.1.0",
93
105
  "chromatic": "^16.2.0",
94
- "class-variance-authority": "^0.7.1",
95
- "clsx": "^2.1.1",
96
- "cmdk": "^1.1.1",
97
106
  "commitizen": "^4.3.1",
98
107
  "cz-conventional-changelog": "^3.3.0",
99
- "date-fns": "^4.1.0",
100
108
  "husky": "^9.1.7",
101
109
  "jsdom": "^27.3.0",
102
110
  "lint-staged": "^16.2.7",
103
- "lucide-react": "0.561.0",
104
111
  "plop": "^4.0.4",
105
112
  "react-arborist": "^3.4.3",
106
- "react-hook-form": "^7.68.0",
107
113
  "react-markdown": "^10.1.0",
108
114
  "react-transition-group": "^4.4.5",
109
115
  "standard-version": "^9.5.0",
110
116
  "storybook": "10.3.5",
111
- "tailwind-merge": "^3.4.0",
112
- "tailwind-variants": "^3.2.2",
117
+ "storybook-addon-tag-badges": "^3.1.0",
113
118
  "tailwindcss": "^4.1.18",
114
119
  "typescript": "^5.9.3",
115
120
  "vite": "^7.3.0",
116
121
  "vite-plugin-dts": "^4.5.4",
117
- "vitest": "^4.0.15",
118
- "zod": "^4.2.0",
119
- "zustand": "^5.0.9"
122
+ "vite-tsconfig-paths": "^6.0.1",
123
+ "vitest": "^4.0.15"
120
124
  },
121
125
  "peerDependencies": {
122
126
  "react": "^19.0.0",
@@ -126,5 +130,9 @@
126
130
  "commitizen": {
127
131
  "path": "./node_modules/cz-conventional-changelog"
128
132
  }
129
- }
133
+ },
134
+ "trustedDependencies": [
135
+ "@parcel/watcher",
136
+ "esbuild"
137
+ ]
130
138
  }
@@ -37,7 +37,7 @@ export const ExampleProps = (props: InputProps) => {
37
37
  <Input
38
38
  {...props}
39
39
  value={value}
40
- onChange={setValue}
40
+ onValueChange={setValue}
41
41
  className={cn("pr-12", props.className)}
42
42
  />
43
43
  <Button
@@ -11,7 +11,7 @@ import { BorderRadius } from "./Examples";
11
11
 
12
12
  # Librería de componentes de 📦
13
13
 
14
- La librería te ofrece una colección de componentes de UI personalizables que se adaptan fácilmente a lo que necesites.
14
+ La librería te ofrece una colección de componentes de UI personalizables que se adaptan fácilmente a lo que necesites.
15
15
  Ya sea que estés buscando consistencia o flexibilidad, estos componentes te permiten construir interfaces rápidamente sin perder control sobre el estilo.
16
16
  Además, incluye hooks y utilidades que te facilitan la vida al manejar estados y otras tareas comunes, todo pensado para que desarrollar en frontend sea más sencillo y rápido.
17
17
 
@@ -29,7 +29,7 @@ Luego, agregá estas dos líneas en tu CSS principal:
29
29
 
30
30
  ```css filename="index.css"
31
31
  @import "tailwindcss";
32
- @import "@boxcustodia/library/dist/index.css";
32
+ @import "@boxcustodia/library/styles";
33
33
  ```
34
34
 
35
35
  Un solo import incluye el tema, las variantes y los estilos pre-compilados de todos los componentes. No hace falta `@source` apuntando a `node_modules`.
@@ -40,7 +40,7 @@ Para ajustar colores, radios u otras variables a la identidad visual de tu proye
40
40
 
41
41
  ```css filename="index.css"
42
42
  @import "tailwindcss";
43
- @import "@boxcustodia/library/dist/index.css";
43
+ @import "@boxcustodia/library/styles";
44
44
 
45
45
  @theme {
46
46
  --color-background: oklch(100% 0 0);
@@ -0,0 +1,112 @@
1
+ ---
2
+ title: Tabs
3
+ description: A component for toggling between related panels on the same page.
4
+
5
+ links:
6
+ doc: https://base-ui.com/react/components/tabs#api-reference
7
+ ---
8
+
9
+ <ComponentPreview name="p-tabs-1" />
10
+
11
+ ## Installation
12
+
13
+ <CodeTabs>
14
+
15
+ <TabsList>
16
+ <TabsTab value="cli">CLI</TabsTab>
17
+ <TabsTab value="manual">Manual</TabsTab>
18
+ </TabsList>
19
+ <TabsPanel value="cli">
20
+
21
+ ```bash
22
+ npx shadcn@latest add @coss/tabs
23
+ ```
24
+
25
+ </TabsPanel>
26
+
27
+ <TabsPanel value="manual">
28
+
29
+ <Steps>
30
+
31
+ <Step>Copy and paste the following code into your project.</Step>
32
+
33
+ <ComponentSource name="tabs" title="components/ui/tabs.tsx" />
34
+
35
+ <Step>Update the import paths to match your project setup.</Step>
36
+
37
+ </Steps>
38
+
39
+ </TabsPanel>
40
+
41
+ </CodeTabs>
42
+
43
+ ## Usage
44
+
45
+ ```tsx
46
+ import { Tabs, TabsList, TabsPanel, TabsTab } from "@/components/ui/tabs"
47
+ ```
48
+
49
+ ```tsx
50
+ <Tabs defaultValue="tab-1">
51
+ <TabsList>
52
+ <TabsTab value="tab-1">Tab 1</TabsTab>
53
+ <TabsTab value="tab-2">Tab 2</TabsTab>
54
+ <TabsTab value="tab-3">Tab 3</TabsTab>
55
+ </TabsList>
56
+ <TabsPanel value="tab-1">Tab 1 content</TabsPanel>
57
+ <TabsPanel value="tab-2">Tab 2 content</TabsPanel>
58
+ <TabsPanel value="tab-3">Tab 3 content</TabsPanel>
59
+ </Tabs>
60
+ ```
61
+
62
+ ## API Reference
63
+
64
+ ### Tabs
65
+
66
+ Root component. Styled wrapper for `Tabs.Root` from Base UI. Accepts all `Tabs.Root` props.
67
+
68
+ | Prop | Type | Default | Description |
69
+ | -------------- | -------------------------------- | -------------- | ------------------------------------ |
70
+ | `defaultValue` | `string` | — | Uncontrolled initial active tab |
71
+ | `value` | `string` | — | Controlled active tab value |
72
+ | `onValueChange`| `(value: string) => void` | — | Callback when active tab changes |
73
+ | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Layout direction |
74
+
75
+ ### TabsList
76
+
77
+ Container for tab triggers. Styled wrapper for `Tabs.List` from Base UI. Renders the animated indicator internally.
78
+
79
+ | Prop | Type | Default | Description |
80
+ | --------- | ---------------------------- | ----------- | ----------------------------- |
81
+ | `variant` | `"underline" \| "pill"` | `"underline"` | Underline indicator or pill background |
82
+
83
+ ### TabsTab
84
+
85
+ Individual tab trigger. Styled wrapper for `Tabs.Tab` from Base UI.
86
+
87
+ | Prop | Type | Default | Description |
88
+ | ---------- | --------- | ------- | ---------------------------- |
89
+ | `value` | `string` | — | Matches the panel to activate |
90
+ | `disabled` | `boolean` | `false` | Prevents interaction |
91
+
92
+ ### TabsPanel
93
+
94
+ Content panel for each tab. Styled wrapper for `Tabs.Panel` from Base UI.
95
+
96
+ | Prop | Type | Default | Description |
97
+ | ------- | -------- | ------- | ------------------------------- |
98
+ | `value` | `string` | — | Matches the trigger that shows this panel |
99
+
100
+ ## Examples
101
+
102
+ ### Underline Variant
103
+
104
+ <ComponentPreview name="p-tabs-2" />
105
+
106
+ ### Vertical Orientation
107
+
108
+ <ComponentPreview name="p-tabs-3" />
109
+
110
+ ### Underline with Vertical Orientation
111
+
112
+ <ComponentPreview name="p-tabs-4" />