@tribepad/themis 1.0.15 → 1.0.17

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 (45) hide show
  1. package/dist/elements/ColorPicker/ColorPicker.d.ts +20 -0
  2. package/dist/elements/ColorPicker/ColorPicker.d.ts.map +1 -0
  3. package/dist/elements/ColorPicker/ColorPicker.styles.d.ts +72 -0
  4. package/dist/elements/ColorPicker/ColorPicker.styles.d.ts.map +1 -0
  5. package/dist/elements/ColorPicker/ColorPicker.types.d.ts +113 -0
  6. package/dist/elements/ColorPicker/ColorPicker.types.d.ts.map +1 -0
  7. package/dist/elements/ColorPicker/index.d.ts +5 -0
  8. package/dist/elements/ColorPicker/index.d.ts.map +1 -0
  9. package/dist/elements/ColorPicker/index.js +3 -0
  10. package/dist/elements/ColorPicker/index.js.map +1 -0
  11. package/dist/elements/ColorPicker/index.mjs +3 -0
  12. package/dist/elements/ColorPicker/index.mjs.map +1 -0
  13. package/dist/elements/DatePicker/DatePicker.types.d.ts +6 -6
  14. package/dist/elements/OTPInput/OTPInput.d.ts +1 -1
  15. package/dist/elements/PasswordField/index.js +1 -1
  16. package/dist/elements/PasswordField/index.js.map +1 -1
  17. package/dist/elements/PasswordField/index.mjs +1 -1
  18. package/dist/elements/PasswordField/index.mjs.map +1 -1
  19. package/dist/elements/SearchField/index.js +1 -1
  20. package/dist/elements/SearchField/index.js.map +1 -1
  21. package/dist/elements/SearchField/index.mjs +1 -1
  22. package/dist/elements/SearchField/index.mjs.map +1 -1
  23. package/dist/elements/TextField/TextField.d.ts.map +1 -1
  24. package/dist/elements/TextField/TextField.types.d.ts +2 -0
  25. package/dist/elements/TextField/TextField.types.d.ts.map +1 -1
  26. package/dist/elements/TextField/index.js +1 -1
  27. package/dist/elements/TextField/index.js.map +1 -1
  28. package/dist/elements/TextField/index.mjs +1 -1
  29. package/dist/elements/TextField/index.mjs.map +1 -1
  30. package/dist/elements/index.d.ts +2 -0
  31. package/dist/elements/index.d.ts.map +1 -1
  32. package/dist/elements/index.js +1 -1
  33. package/dist/elements/index.js.map +1 -1
  34. package/dist/elements/index.mjs +1 -1
  35. package/dist/elements/index.mjs.map +1 -1
  36. package/dist/index.js +2 -2
  37. package/dist/index.js.map +1 -1
  38. package/dist/index.mjs +2 -2
  39. package/dist/index.mjs.map +1 -1
  40. package/package.json +9 -7
  41. package/src/elements/ColorPicker/ColorPicker.stories.tsx +289 -0
  42. package/src/elements/Combobox/Combobox.stories.tsx +1 -1
  43. package/src/elements/MatrixGrid/MatrixGrid.stories.tsx +1 -1
  44. package/src/elements/RatingScale/RatingScale.stories.tsx +1 -1
  45. package/src/elements/SituationalJudgement/SituationalJudgement.stories.tsx +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tribepad/themis",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "Accessible React component library built on React Aria primitives",
5
5
  "author": "Tribepad <mbasford@tribepad.com>",
6
6
  "license": "MIT",
@@ -128,11 +128,11 @@
128
128
  },
129
129
  "peerDependencies": {
130
130
  "lucide-react": ">=0.400.0",
131
+ "motion": ">=11.0.0",
131
132
  "react": "^18.0.0 || ^19.0.0",
132
133
  "react-dom": "^18.0.0 || ^19.0.0",
133
134
  "tailwindcss": "^3.4.0 || ^4.0.0",
134
- "zod": "^3.0.0 || ^4.0.0",
135
- "motion": ">=11.0.0"
135
+ "zod": "^3.0.0 || ^4.0.0"
136
136
  },
137
137
  "peerDependenciesMeta": {
138
138
  "tailwindcss": {
@@ -160,8 +160,9 @@
160
160
  "devDependencies": {
161
161
  "@eslint/js": "^9.39.3",
162
162
  "@size-limit/preset-small-lib": "^11.0.0",
163
- "@storybook/addon-a11y": "^10.2.10",
164
- "@storybook/react-vite": "^10.2.10",
163
+ "@storybook/addon-a11y": "^10.3.3",
164
+ "@storybook/addon-mcp": "^0.4.2",
165
+ "@storybook/react-vite": "^10.3.3",
165
166
  "@tailwindcss/vite": "^4.2.0",
166
167
  "@testing-library/jest-dom": "^6.0.0",
167
168
  "@testing-library/react": "^16.0.0",
@@ -175,19 +176,20 @@
175
176
  "@vitest/coverage-v8": "^4.0.0",
176
177
  "eslint": "^9.0.0",
177
178
  "eslint-plugin-jsx-a11y": "^6.10.2",
179
+ "eslint-plugin-storybook": "10.3.3",
178
180
  "globals": "^17.3.0",
179
181
  "happy-dom": "^20.7.0",
180
182
  "jest-axe": "^10.0.0",
181
183
  "jsdom": "^28.1.0",
182
184
  "lucide-react": ">=0.400.0",
185
+ "motion": "^12.35.0",
183
186
  "react": "^19.0.0",
184
187
  "react-dom": "^19.0.0",
185
188
  "size-limit": "^11.0.0",
186
- "storybook": "^10.2.10",
189
+ "storybook": "^10.3.3",
187
190
  "tsup": "^8.0.0",
188
191
  "tsx": "^4.0.0",
189
192
  "typescript": "^5.9.3",
190
- "motion": "^12.35.0",
191
193
  "vitest": "^4.0.18",
192
194
  "zod": "^4.3.6"
193
195
  },
@@ -0,0 +1,289 @@
1
+ /**
2
+ * ColorPicker Component Stories
3
+ *
4
+ * Storybook stories demonstrating all modes, variants, sizes, and states.
5
+ */
6
+
7
+ import { useState } from 'react';
8
+ import type { Meta, StoryObj } from '@storybook/react-vite';
9
+ import { ColorPicker } from './ColorPicker';
10
+ import type { Color } from 'react-aria-components';
11
+
12
+ const meta = {
13
+ title: 'Elements/ColorPicker',
14
+ component: ColorPicker,
15
+ parameters: {
16
+ layout: 'centered',
17
+ docs: {
18
+ description: {
19
+ component:
20
+ 'Accessible color picker with swatch presets, advanced picker, or both. Built on React Aria ColorPicker and ColorSwatchPicker primitives for WCAG 2.2 AAA compliance.',
21
+ },
22
+ },
23
+ },
24
+ tags: ['autodocs'],
25
+ argTypes: {
26
+ mode: {
27
+ control: 'select',
28
+ options: ['swatch', 'advanced', 'both'],
29
+ description: 'Which picker UI to display',
30
+ table: { defaultValue: { summary: 'both' } },
31
+ },
32
+ size: {
33
+ control: 'select',
34
+ options: ['sm', 'default', 'lg'],
35
+ description: 'Size variant',
36
+ table: { defaultValue: { summary: 'default' } },
37
+ },
38
+ label: {
39
+ control: 'text',
40
+ description: 'Label text',
41
+ },
42
+ description: {
43
+ control: 'text',
44
+ description: 'Helper text below the label',
45
+ },
46
+ errorMessage: {
47
+ control: 'text',
48
+ description: 'Error message when isInvalid is true',
49
+ },
50
+ isDisabled: {
51
+ control: 'boolean',
52
+ description: 'Whether the picker is disabled',
53
+ },
54
+ isRequired: {
55
+ control: 'boolean',
56
+ description: 'Whether a value is required',
57
+ },
58
+ isInvalid: {
59
+ control: 'boolean',
60
+ description: 'Whether the field is in an invalid state',
61
+ },
62
+ isReadOnly: {
63
+ control: 'boolean',
64
+ description: 'Whether the field is read-only',
65
+ },
66
+ },
67
+ } satisfies Meta<typeof ColorPicker>;
68
+
69
+ export default meta;
70
+ type Story = StoryObj<typeof meta>;
71
+
72
+ // =============================================================================
73
+ // Default (Both Mode)
74
+ // =============================================================================
75
+
76
+ export const Default: Story = {
77
+ args: {
78
+ label: 'Brand Color',
79
+ defaultValue: '#7c3aed',
80
+ },
81
+ };
82
+
83
+ // =============================================================================
84
+ // Swatch Only
85
+ // =============================================================================
86
+
87
+ export const SwatchOnly: Story = {
88
+ args: {
89
+ label: 'Pick a color',
90
+ mode: 'swatch',
91
+ defaultValue: '#ff0000',
92
+ },
93
+ };
94
+
95
+ // =============================================================================
96
+ // Advanced Only
97
+ // =============================================================================
98
+
99
+ export const AdvancedOnly: Story = {
100
+ args: {
101
+ label: 'Custom Color',
102
+ mode: 'advanced',
103
+ defaultValue: '#4a86e8',
104
+ },
105
+ };
106
+
107
+ // =============================================================================
108
+ // Custom Swatch Colors
109
+ // =============================================================================
110
+
111
+ export const CustomColors: Story = {
112
+ args: {
113
+ label: 'Theme Color',
114
+ mode: 'swatch',
115
+ colors: [
116
+ '#ef4444', '#f97316', '#eab308', '#22c55e',
117
+ '#06b6d4', '#3b82f6', '#8b5cf6', '#ec4899',
118
+ ],
119
+ defaultValue: '#3b82f6',
120
+ },
121
+ };
122
+
123
+ // =============================================================================
124
+ // With Description
125
+ // =============================================================================
126
+
127
+ export const WithDescription: Story = {
128
+ args: {
129
+ label: 'Brand Color',
130
+ description: 'Choose the primary color for your brand. This will be used across all marketing materials.',
131
+ defaultValue: '#7c3aed',
132
+ },
133
+ };
134
+
135
+ // =============================================================================
136
+ // Required
137
+ // =============================================================================
138
+
139
+ export const Required: Story = {
140
+ args: {
141
+ label: 'Primary Color',
142
+ isRequired: true,
143
+ defaultValue: '#000000',
144
+ },
145
+ };
146
+
147
+ // =============================================================================
148
+ // Invalid State
149
+ // =============================================================================
150
+
151
+ export const Invalid: Story = {
152
+ args: {
153
+ label: 'Color',
154
+ isInvalid: true,
155
+ errorMessage: 'Please select a valid brand color',
156
+ defaultValue: '#000000',
157
+ },
158
+ };
159
+
160
+ // =============================================================================
161
+ // Disabled
162
+ // =============================================================================
163
+
164
+ export const Disabled: Story = {
165
+ args: {
166
+ label: 'Color',
167
+ isDisabled: true,
168
+ defaultValue: '#7c3aed',
169
+ },
170
+ };
171
+
172
+ // =============================================================================
173
+ // Read Only
174
+ // =============================================================================
175
+
176
+ export const ReadOnly: Story = {
177
+ args: {
178
+ label: 'Assigned Color',
179
+ isReadOnly: true,
180
+ defaultValue: '#22c55e',
181
+ },
182
+ };
183
+
184
+ // =============================================================================
185
+ // Size: Small
186
+ // =============================================================================
187
+
188
+ export const SizeSmall: Story = {
189
+ args: {
190
+ label: 'Color',
191
+ size: 'sm',
192
+ defaultValue: '#ff0000',
193
+ },
194
+ };
195
+
196
+ // =============================================================================
197
+ // Size: Large
198
+ // =============================================================================
199
+
200
+ export const SizeLarge: Story = {
201
+ args: {
202
+ label: 'Color',
203
+ size: 'lg',
204
+ defaultValue: '#0000ff',
205
+ },
206
+ };
207
+
208
+ // =============================================================================
209
+ // Controlled
210
+ // =============================================================================
211
+
212
+ function ControlledExample() {
213
+ const [hex, setHex] = useState('#7c3aed');
214
+
215
+ return (
216
+ <div className="flex flex-col gap-4">
217
+ <ColorPicker
218
+ label="Controlled Color"
219
+ value={hex}
220
+ onChange={(color: Color) => setHex(color.toString('hex'))}
221
+ />
222
+ <p className="text-sm text-[var(--muted-foreground)]">
223
+ Selected: <code className="font-mono">{hex}</code>
224
+ </p>
225
+ </div>
226
+ );
227
+ }
228
+
229
+ export const Controlled: Story = {
230
+ render: () => <ControlledExample />,
231
+ };
232
+
233
+ // =============================================================================
234
+ // With Form Name
235
+ // =============================================================================
236
+
237
+ export const WithFormName: Story = {
238
+ args: {
239
+ label: 'Brand Color',
240
+ name: 'brand_color',
241
+ defaultValue: '#7c3aed',
242
+ description: 'This color will be submitted as a hidden form field named "brand_color".',
243
+ },
244
+ };
245
+
246
+ // =============================================================================
247
+ // All Sizes Comparison
248
+ // =============================================================================
249
+
250
+ function AllSizesExample() {
251
+ return (
252
+ <div className="flex flex-col gap-6">
253
+ <ColorPicker label="Small" size="sm" mode="advanced" defaultValue="#ef4444" />
254
+ <ColorPicker label="Default" size="default" mode="advanced" defaultValue="#3b82f6" />
255
+ <ColorPicker label="Large" size="lg" mode="advanced" defaultValue="#22c55e" />
256
+ </div>
257
+ );
258
+ }
259
+
260
+ export const AllSizes: Story = {
261
+ render: () => <AllSizesExample />,
262
+ };
263
+
264
+ // =============================================================================
265
+ // All Modes Comparison
266
+ // =============================================================================
267
+
268
+ function AllModesExample() {
269
+ return (
270
+ <div className="flex flex-col gap-8">
271
+ <div>
272
+ <h3 className="text-sm font-medium mb-2 text-[var(--content-foreground)]">Swatch Only</h3>
273
+ <ColorPicker mode="swatch" defaultValue="#ff0000" />
274
+ </div>
275
+ <div>
276
+ <h3 className="text-sm font-medium mb-2 text-[var(--content-foreground)]">Advanced Only</h3>
277
+ <ColorPicker mode="advanced" defaultValue="#3b82f6" />
278
+ </div>
279
+ <div>
280
+ <h3 className="text-sm font-medium mb-2 text-[var(--content-foreground)]">Both (Default)</h3>
281
+ <ColorPicker mode="both" defaultValue="#7c3aed" />
282
+ </div>
283
+ </div>
284
+ );
285
+ }
286
+
287
+ export const AllModes: Story = {
288
+ render: () => <AllModesExample />,
289
+ };
@@ -1,4 +1,4 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import { fn } from 'storybook/test';
3
3
  import { Combobox, ComboboxItem, ComboboxSection } from './Combobox';
4
4
 
@@ -1,5 +1,5 @@
1
1
  import { useState } from 'react';
2
- import type { Meta, StoryObj } from '@storybook/react';
2
+ import type { Meta, StoryObj } from '@storybook/react-vite';
3
3
  import { MatrixGrid } from './MatrixGrid';
4
4
 
5
5
  const LIKERT_COLUMNS = [
@@ -1,5 +1,5 @@
1
1
  import { useState } from 'react';
2
- import type { Meta, StoryObj } from '@storybook/react';
2
+ import type { Meta, StoryObj } from '@storybook/react-vite';
3
3
  import { RatingScale } from './RatingScale';
4
4
 
5
5
  const meta = {
@@ -1,5 +1,5 @@
1
1
  import { useState } from 'react';
2
- import type { Meta, StoryObj } from '@storybook/react';
2
+ import type { Meta, StoryObj } from '@storybook/react-vite';
3
3
  import { SituationalJudgement } from './SituationalJudgement';
4
4
 
5
5
  const SAMPLE_RESPONSES = [