@tcn/ui 0.3.3 → 0.5.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 (131) hide show
  1. package/dist/Color-6BZIO3FS-CWWwv-fq.js +1004 -0
  2. package/dist/Color-6BZIO3FS-CWWwv-fq.js.map +1 -0
  3. package/dist/{WithTooltip-IO6J4KBT-B1oq93K5.js → WithTooltip-65CFNBJE-DvcUZizH.js} +4 -4
  4. package/dist/WithTooltip-65CFNBJE-DvcUZizH.js.map +1 -0
  5. package/dist/actions/__docs__/components/showcase.d.ts.map +1 -1
  6. package/dist/actions/__docs__/components/showcase.js +1 -1
  7. package/dist/actions/button/base_button/base_button.d.ts +2 -4
  8. package/dist/actions/button/base_button/base_button.d.ts.map +1 -1
  9. package/dist/actions/button/base_button/base_button.js +35 -35
  10. package/dist/actions/button/base_button/base_button.js.map +1 -1
  11. package/dist/actions/button/button/button.d.ts +7 -1
  12. package/dist/actions/button/button/button.d.ts.map +1 -1
  13. package/dist/actions/button/button/button.js +9 -7
  14. package/dist/actions/button/button/button.js.map +1 -1
  15. package/dist/actions/button/slim_button/slim_button.d.ts +6 -1
  16. package/dist/actions/button/slim_button/slim_button.d.ts.map +1 -1
  17. package/dist/actions/button/slim_button/slim_button.js +13 -14
  18. package/dist/actions/button/slim_button/slim_button.js.map +1 -1
  19. package/dist/actions/toggle/toggle.d.ts +9 -0
  20. package/dist/actions/toggle/toggle.d.ts.map +1 -0
  21. package/dist/actions/toggle/toggle.js +21 -0
  22. package/dist/actions/toggle/toggle.js.map +1 -0
  23. package/dist/feedback/lazy/lazy.js +3 -3
  24. package/dist/formatter-EIJCOSYU-D6nmx63h.js +6 -0
  25. package/dist/formatter-EIJCOSYU-D6nmx63h.js.map +1 -0
  26. package/dist/inputs/mask_input/mask.d.ts.map +1 -1
  27. package/dist/inputs/mask_input/mask.js.map +1 -1
  28. package/dist/inputs/multiselect/multiselect_inline_values.js +3 -2
  29. package/dist/inputs/multiselect/multiselect_inline_values.js.map +1 -1
  30. package/dist/inputs/multiselect/multiselect_values.js +3 -2
  31. package/dist/inputs/multiselect/multiselect_values.js.map +1 -1
  32. package/dist/layouts/index.d.ts +3 -1
  33. package/dist/layouts/index.d.ts.map +1 -1
  34. package/dist/layouts/index.js +22 -18
  35. package/dist/layouts/index.js.map +1 -1
  36. package/dist/layouts/row/row.d.ts +4 -0
  37. package/dist/layouts/row/row.d.ts.map +1 -0
  38. package/dist/layouts/row/row.js +11 -0
  39. package/dist/layouts/row/row.js.map +1 -0
  40. package/dist/layouts/section/heading.d.ts +7 -0
  41. package/dist/layouts/section/heading.d.ts.map +1 -0
  42. package/dist/layouts/section/heading.js +9 -0
  43. package/dist/layouts/section/heading.js.map +1 -0
  44. package/dist/layouts/section/section.d.ts +4 -0
  45. package/dist/layouts/section/section.d.ts.map +1 -0
  46. package/dist/layouts/section/section.js +22 -0
  47. package/dist/layouts/section/section.js.map +1 -0
  48. package/dist/navigation/tabs/primitives/tabs_list.d.ts.map +1 -1
  49. package/dist/navigation/tabs/primitives/tabs_list.js +17 -24
  50. package/dist/navigation/tabs/primitives/tabs_list.js.map +1 -1
  51. package/dist/overlay/carrot/base_carrot.d.ts +8 -0
  52. package/dist/overlay/carrot/base_carrot.d.ts.map +1 -0
  53. package/dist/overlay/carrot/base_carrot.js +21 -0
  54. package/dist/overlay/carrot/base_carrot.js.map +1 -0
  55. package/dist/row.css +1 -0
  56. package/dist/section.css +1 -0
  57. package/dist/section.module-0wyGkhDg.js +5 -0
  58. package/dist/section.module-0wyGkhDg.js.map +1 -0
  59. package/dist/{showcase-WfP6kBEb.js → showcase-DK557szS.js} +18018 -16269
  60. package/dist/showcase-DK557szS.js.map +1 -0
  61. package/dist/surfaces/pop_confirm/pop_confirm.js +6 -3
  62. package/dist/surfaces/pop_confirm/pop_confirm.js.map +1 -1
  63. package/dist/{syntaxhighlighter-IQDEPFLK-BX_eF8__.js → syntaxhighlighter-ED5Y7EFY-DaMS-2cF.js} +54 -54
  64. package/dist/syntaxhighlighter-ED5Y7EFY-DaMS-2cF.js.map +1 -0
  65. package/dist/themes/themes/ergo/ergo_theme.css +1 -1
  66. package/dist/themes/themes/ergo/ergo_theme.js +403 -263
  67. package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
  68. package/dist/themes/themes/windows_98/windows_98.css +1 -1
  69. package/dist/themes/themes/windows_98/windows_98_theme.js +108 -1
  70. package/dist/themes/themes/windows_98/windows_98_theme.js.map +1 -1
  71. package/dist/tokens/index.d.ts +2 -0
  72. package/dist/tokens/index.d.ts.map +1 -1
  73. package/dist/tokens/index.js +5 -1
  74. package/dist/tokens/index.js.map +1 -1
  75. package/dist/tokens/key/key.d.ts +3 -0
  76. package/dist/tokens/key/key.d.ts.map +1 -0
  77. package/dist/tokens/key/key.js +8 -0
  78. package/dist/tokens/key/key.js.map +1 -0
  79. package/dist/tokens/value/value.d.ts +3 -0
  80. package/dist/tokens/value/value.d.ts.map +1 -0
  81. package/dist/tokens/value/value.js +8 -0
  82. package/dist/tokens/value/value.js.map +1 -0
  83. package/package.json +1 -1
  84. package/src/actions/__docs__/actions.mdx +159 -34
  85. package/src/actions/__docs__/actions.stories.tsx +416 -101
  86. package/src/actions/__docs__/components/showcase.tsx +10 -6
  87. package/src/actions/button/__stories__/button.stories.tsx +10 -0
  88. package/src/actions/button/__stories__/toggle.stories.tsx +177 -0
  89. package/src/actions/button/base_button/base_button.tsx +8 -10
  90. package/src/actions/button/button/button.tsx +11 -2
  91. package/src/actions/button/slim_button/slim_button.tsx +20 -13
  92. package/src/actions/toggle/toggle.tsx +26 -0
  93. package/src/inputs/mask_input/mask.ts +7 -1
  94. package/src/layouts/index.ts +4 -2
  95. package/src/layouts/row/row.module.css +5 -0
  96. package/src/layouts/row/row.tsx +15 -0
  97. package/src/layouts/section/__stories__/section.stories.module.css +6 -0
  98. package/src/layouts/section/__stories__/section.stories.tsx +152 -0
  99. package/src/layouts/section/heading.tsx +16 -0
  100. package/src/layouts/section/section.module.css +41 -0
  101. package/src/layouts/section/section.tsx +21 -0
  102. package/src/navigation/tabs/primitives/tabs_list.tsx +5 -6
  103. package/src/overlay/carrot/base_carrot.tsx +24 -0
  104. package/src/overlay/carrot/carrot.stories.tsx +54 -0
  105. package/src/surfaces/card/card.stories.tsx +14 -14
  106. package/src/surfaces/modal/__stories__/modal.stories.tsx +16 -7
  107. package/src/surfaces/window/window.stories.tsx +16 -10
  108. package/src/themes/themes/ergo/__stories__/components/material_picker/sb_inverted_materials.module.css +4 -4
  109. package/src/themes/themes/ergo/__stories__/components/tone_picker/sb_tone_picker.module.css +3 -0
  110. package/src/themes/themes/ergo/__stories__/components/tone_picker/sb_tone_picker.tsx +5 -2
  111. package/src/themes/themes/ergo/__stories__/material.stories.tsx +2 -2
  112. package/src/themes/themes/ergo/__stories__/sb_materials.module.css +31 -26
  113. package/src/themes/themes/ergo/ergo_theme.css +400 -260
  114. package/src/themes/themes/windows_98/windows_98.css +108 -1
  115. package/src/tokens/index.ts +2 -0
  116. package/src/tokens/key/key.tsx +10 -0
  117. package/src/tokens/value/value.tsx +10 -0
  118. package/tsconfig.json +6 -0
  119. package/dist/Color-ASIRERSW-B4GaVKuQ.js +0 -990
  120. package/dist/Color-ASIRERSW-B4GaVKuQ.js.map +0 -1
  121. package/dist/WithTooltip-IO6J4KBT-B1oq93K5.js.map +0 -1
  122. package/dist/formatter-QJ4M4OGQ-DaIl2Wi_.js +0 -6
  123. package/dist/formatter-QJ4M4OGQ-DaIl2Wi_.js.map +0 -1
  124. package/dist/layouts/list/section_header.d.ts +0 -6
  125. package/dist/layouts/list/section_header.d.ts.map +0 -1
  126. package/dist/layouts/list/section_header.js +0 -22
  127. package/dist/layouts/list/section_header.js.map +0 -1
  128. package/dist/showcase-WfP6kBEb.js.map +0 -1
  129. package/dist/syntaxhighlighter-IQDEPFLK-BX_eF8__.js.map +0 -1
  130. package/src/layouts/list/section_header.module.css +0 -20
  131. package/src/layouts/list/section_header.tsx +0 -21
@@ -3,12 +3,14 @@ import { HStack } from '../../stacks/h_stack.js';
3
3
  import { VStack } from '../../stacks/v_stack.js';
4
4
  import { Spacer } from '../../stacks/spacer.js';
5
5
  import { Button } from '../button/button/button.js';
6
- import { SlimButton } from '../button/slim_button/slim_button.js';
7
6
  import { ButtonGroup } from '../button/button_group/button_group.js';
8
7
  import { SearchIcon } from '@tcn/icons/search_icon.js';
9
8
  import { PlusIcon } from '@tcn/icons/plus_icon.js';
10
9
  import { CrossIcon } from '@tcn/icons/cross_icon.js';
11
10
  import type { ActionSeverity } from '../types.js';
11
+ import { BodyText } from '../../typography/index.js';
12
+ import { Toggle, type ToggleProps } from '../toggle/toggle.js';
13
+ import { useState } from 'react';
12
14
 
13
15
  /**
14
16
  * These stories are used exclusively by the MDX documentation.
@@ -34,33 +36,6 @@ type Story = StoryObj<typeof Button>;
34
36
  // Utility Code
35
37
  // ============================================================================
36
38
 
37
- const tcnBrandedColors = [
38
- {
39
- name: 'Integrated Infrastructure',
40
- action: '27, 15%, 43%',
41
- },
42
- {
43
- name: 'Omnichannel Communications',
44
- action: '197, 34%, 40%',
45
- },
46
- {
47
- name: 'Workforce Engagement',
48
- action: '23, 65%, 42%',
49
- },
50
- {
51
- name: 'Integration and Automation',
52
- action: '139, 21%, 39%',
53
- },
54
- {
55
- name: 'Compliance and Data Management',
56
- action: '49, 50%, 34%',
57
- },
58
- {
59
- name: 'Intelligence, Reporting, and Analytics',
60
- action: '214, 14%, 45%',
61
- },
62
- ];
63
-
64
39
  const severityOptions: { name: string; severity: ActionSeverity }[] = [
65
40
  {
66
41
  name: 'Dangerous',
@@ -85,10 +60,10 @@ const severityOptions: { name: string; severity: ActionSeverity }[] = [
85
60
  ];
86
61
 
87
62
  // ============================================================================
88
- // BASELINE
63
+ // BUTTON EXAMPLES
89
64
  // ============================================================================
90
65
 
91
- export const ButtonBaselineShowcase: Story = {
66
+ export const ButtonBaseline: Story = {
92
67
  render: () => (
93
68
  <HStack gap="12px" vAlign="center">
94
69
  <Button>Baseline</Button>
@@ -96,11 +71,7 @@ export const ButtonBaselineShowcase: Story = {
96
71
  ),
97
72
  };
98
73
 
99
- // ============================================================================
100
- // HIERARCHY EXAMPLES
101
- // ============================================================================
102
-
103
- export const HierarchyShowcase: Story = {
74
+ export const ButtonHierarchy: Story = {
104
75
  render: () => (
105
76
  <HStack gap="12px" vAlign="center">
106
77
  <Button hierarchy="tertiary">Tertiary</Button>
@@ -110,11 +81,7 @@ export const HierarchyShowcase: Story = {
110
81
  ),
111
82
  };
112
83
 
113
- // ============================================================================
114
- // SIZE EXAMPLES
115
- // ============================================================================
116
-
117
- export const SizeShowcase: Story = {
84
+ export const ButtonSize: Story = {
118
85
  render: () => (
119
86
  <HStack gap="12px" vAlign="center">
120
87
  <Button size="sm">Small</Button>
@@ -124,11 +91,7 @@ export const SizeShowcase: Story = {
124
91
  ),
125
92
  };
126
93
 
127
- // ============================================================================
128
- // DISABLED EXAMPLES
129
- // ============================================================================
130
-
131
- export const DisabledShowcase: Story = {
94
+ export const ButtonDisabled: Story = {
132
95
  render: () => (
133
96
  <HStack gap="12px" vAlign="center">
134
97
  <VStack gap="12px" vAlign="center" width="200px">
@@ -146,11 +109,7 @@ export const DisabledShowcase: Story = {
146
109
  ),
147
110
  };
148
111
 
149
- // ============================================================================
150
- // WITH ICONS
151
- // ============================================================================
152
-
153
- export const IconShowcase: Story = {
112
+ export const ButtonWithIcons: Story = {
154
113
  render: () => (
155
114
  <VStack gap="12px" vAlign="center">
156
115
  <HStack gap="12px" vAlign="center">
@@ -191,29 +150,25 @@ export const IconShowcase: Story = {
191
150
  ),
192
151
  };
193
152
 
194
- // ============================================================================
195
- // CUSTOM COLORS
196
- // ============================================================================
197
-
198
- export const ColorShowcase: Story = {
153
+ export const ButtonCustomColors: Story = {
199
154
  render: () => (
200
155
  <HStack vAlign="center" gap="12px">
201
156
  <VStack gap="12px" vAlign="center" width="200px">
202
- {tcnBrandedColors.map(({ name, action }) => (
203
- <Button key={name} hierarchy="primary" color={action} width="100%">
204
- {name}
205
- </Button>
206
- ))}
157
+ <Button hierarchy="tertiary" color={'#82722B'} width="100%">
158
+ Compliance and Data Management
159
+ </Button>
160
+ <Button hierarchy="secondary" color={'#82722B'} width="100%">
161
+ Compliance and Data Management
162
+ </Button>
163
+ <Button hierarchy="primary" color={'#82722B'} width="100%">
164
+ Compliance and Data Management
165
+ </Button>
207
166
  </VStack>
208
167
  </HStack>
209
168
  ),
210
169
  };
211
170
 
212
- // ============================================================================
213
- // FULL WIDTH
214
- // ============================================================================
215
-
216
- export const FullWidth: Story = {
171
+ export const ButtonFullWidth: Story = {
217
172
  render: () => (
218
173
  <HStack vAlign="center">
219
174
  <VStack gap="12px" vAlign="center" width="200px">
@@ -231,7 +186,7 @@ export const FullWidth: Story = {
231
186
  ),
232
187
  };
233
188
 
234
- export const SeverityShowcase: Story = {
189
+ export const ButtonSeverity: Story = {
235
190
  render: () => (
236
191
  <HStack vAlign="center" gap="12px">
237
192
  <VStack gap="12px" vAlign="center" width="120px">
@@ -259,92 +214,452 @@ export const SeverityShowcase: Story = {
259
214
  ),
260
215
  };
261
216
 
217
+ export const ButtonInteractiveStates: Story = {
218
+ render: () => (
219
+ <HStack
220
+ gap="24px"
221
+ style={{
222
+ pointerEvents: 'none',
223
+ }}
224
+ >
225
+ <VStack gap="12px" vAlign="center" width="80px">
226
+ <BodyText>Tertiary</BodyText>
227
+ <Button hierarchy="tertiary" width="100%">
228
+ Baseline
229
+ </Button>
230
+ <Button hierarchy="tertiary" width="100%" data-focus-visible>
231
+ Focus
232
+ </Button>
233
+ <Button hierarchy="tertiary" width="100%" data-hover>
234
+ Hover
235
+ </Button>
236
+ <Button hierarchy="tertiary" width="100%" data-active>
237
+ Active
238
+ </Button>
239
+ </VStack>
240
+ <VStack gap="12px" vAlign="center" width="80px">
241
+ <BodyText>Secondary</BodyText>
242
+ <Button hierarchy="secondary" width="100%">
243
+ Baseline
244
+ </Button>
245
+ <Button hierarchy="secondary" width="100%" data-focus-visible>
246
+ Focus
247
+ </Button>
248
+ <Button hierarchy="secondary" width="100%" data-hover>
249
+ Hover
250
+ </Button>
251
+ <Button hierarchy="secondary" width="100%" data-active>
252
+ Active
253
+ </Button>
254
+ </VStack>
255
+ <VStack gap="12px" vAlign="center" width="80px">
256
+ <BodyText>Primary</BodyText>
257
+ <Button hierarchy="primary" width="100%">
258
+ Baseline
259
+ </Button>
260
+ <Button hierarchy="primary" width="100%" data-focus-visible>
261
+ Focus
262
+ </Button>
263
+ <Button hierarchy="primary" width="100%" data-hover>
264
+ Hover
265
+ </Button>
266
+ <Button hierarchy="primary" width="100%" data-active>
267
+ Active
268
+ </Button>
269
+ </VStack>
270
+ </HStack>
271
+ ),
272
+ };
273
+
262
274
  // ============================================================================
263
- // SLIM BUTTON EXAMPLES
275
+ // Utility Button EXAMPLES
264
276
  // ============================================================================
265
277
 
266
- export const SlimButtonBaselineShowcase: Story = {
278
+ export const UtilityButtonBaseline: Story = {
267
279
  render: () => (
268
280
  <HStack gap="12px" vAlign="center">
269
- <SlimButton>
281
+ <Button utility>
270
282
  <SearchIcon />
271
- </SlimButton>
283
+ </Button>
272
284
  </HStack>
273
285
  ),
274
286
  };
275
287
 
276
- export const SlimButtonHierarchy: Story = {
288
+ export const UtilityButtonHierarchy: Story = {
277
289
  render: () => (
278
290
  <HStack gap="12px" vAlign="center">
279
- <SlimButton hierarchy="tertiary">
291
+ <Button utility hierarchy="tertiary">
280
292
  <CrossIcon />
281
- </SlimButton>
282
- <SlimButton hierarchy="secondary">
293
+ </Button>
294
+ <Button utility hierarchy="secondary">
283
295
  <SearchIcon />
284
- </SlimButton>
285
- <SlimButton hierarchy="primary">
296
+ </Button>
297
+ <Button utility hierarchy="primary">
286
298
  <PlusIcon />
287
- </SlimButton>
299
+ </Button>
288
300
  </HStack>
289
301
  ),
290
302
  };
291
303
 
292
- export const SlimButtonSizes: Story = {
304
+ export const UtilityButtonSizes: Story = {
293
305
  render: () => (
294
306
  <HStack gap="12px" vAlign="center">
295
- <SlimButton size="sm" hierarchy="primary">
307
+ <Button utility size="sm" hierarchy="primary">
296
308
  <PlusIcon />
297
- </SlimButton>
298
- <SlimButton size="md" hierarchy="primary">
309
+ </Button>
310
+ <Button utility size="md" hierarchy="primary">
299
311
  <PlusIcon />
300
- </SlimButton>
301
- <SlimButton size="lg" hierarchy="primary">
312
+ </Button>
313
+ <Button utility size="lg" hierarchy="primary">
302
314
  <PlusIcon />
303
- </SlimButton>
315
+ </Button>
304
316
  </HStack>
305
317
  ),
306
318
  };
307
319
 
308
- export const SlimButtonDisabled: Story = {
320
+ export const UtilityButtonDisabled: Story = {
309
321
  render: () => (
310
322
  <HStack gap="12px" vAlign="center">
311
- <SlimButton hierarchy="tertiary" disabled>
323
+ <Button utility hierarchy="tertiary" disabled>
312
324
  <CrossIcon />
313
- </SlimButton>
314
- <SlimButton hierarchy="secondary" disabled>
325
+ </Button>
326
+ <Button utility hierarchy="secondary" disabled>
315
327
  <SearchIcon />
316
- </SlimButton>
317
- <SlimButton hierarchy="primary" disabled>
328
+ </Button>
329
+ <Button utility hierarchy="primary" disabled>
318
330
  <PlusIcon />
319
- </SlimButton>
331
+ </Button>
320
332
  </HStack>
321
333
  ),
322
334
  };
323
335
 
324
- export const SlimButtonColors: Story = {
336
+ export const UtilityButtonColors: Story = {
325
337
  render: () => (
326
- <HStack gap="12px" vAlign="center">
327
- {tcnBrandedColors.map(({ name, action }) => (
328
- <SlimButton key={name} hierarchy="primary" color={action}>
329
- <SearchIcon />
330
- </SlimButton>
331
- ))}
338
+ <HStack vAlign="center" gap="12px">
339
+ <Button hierarchy="tertiary" color={'#82722B'} utility>
340
+ <SearchIcon />
341
+ </Button>
342
+ <Button hierarchy="secondary" color={'#82722B'} utility>
343
+ <SearchIcon />
344
+ </Button>
345
+ <Button hierarchy="primary" color={'#82722B'} utility>
346
+ <SearchIcon />
347
+ </Button>
332
348
  </HStack>
333
349
  ),
334
350
  };
335
351
 
336
- export const SlimButtonSeverity: Story = {
352
+ export const UtilityButtonSeverity: Story = {
337
353
  render: () => (
338
354
  <HStack gap="12px" vAlign="center">
339
355
  {severityOptions.map(({ name, severity }) => (
340
- <SlimButton key={name} hierarchy="primary" severity={severity}>
356
+ <Button utility key={name} hierarchy="primary" severity={severity}>
341
357
  <CrossIcon />
342
- </SlimButton>
358
+ </Button>
343
359
  ))}
344
360
  </HStack>
345
361
  ),
346
362
  };
347
363
 
364
+ export const UtilityButtonInteractiveStates: Story = {
365
+ render: () => (
366
+ <HStack
367
+ gap="24px"
368
+ style={{
369
+ pointerEvents: 'none',
370
+ }}
371
+ >
372
+ <VStack gap="12px" vAlign="center">
373
+ <BodyText>Tertiary</BodyText>
374
+ <Button utility hierarchy="tertiary">
375
+ <SearchIcon />
376
+ </Button>
377
+ <Button utility hierarchy="tertiary" data-focus-visible>
378
+ <SearchIcon />
379
+ </Button>
380
+ <Button utility hierarchy="tertiary" data-hover>
381
+ <SearchIcon />
382
+ </Button>
383
+ <Button utility hierarchy="tertiary" data-active>
384
+ <SearchIcon />
385
+ </Button>
386
+ </VStack>
387
+ <VStack gap="12px" vAlign="center">
388
+ <BodyText>Secondary</BodyText>
389
+ <Button utility hierarchy="secondary">
390
+ <SearchIcon />
391
+ </Button>
392
+ <Button utility hierarchy="secondary" data-focus-visible>
393
+ <SearchIcon />
394
+ </Button>
395
+ <Button utility hierarchy="secondary" data-hover>
396
+ <SearchIcon />
397
+ </Button>
398
+ <Button utility hierarchy="secondary" data-active>
399
+ <SearchIcon />
400
+ </Button>
401
+ </VStack>
402
+ <VStack gap="12px" vAlign="center">
403
+ <BodyText>Primary</BodyText>
404
+ <Button utility hierarchy="primary">
405
+ <SearchIcon />
406
+ </Button>
407
+ <Button utility hierarchy="primary" data-focus-visible>
408
+ <SearchIcon />
409
+ </Button>
410
+ <Button utility hierarchy="primary" data-hover>
411
+ <SearchIcon />
412
+ </Button>
413
+ <Button utility hierarchy="primary" data-active>
414
+ <SearchIcon />
415
+ </Button>
416
+ </VStack>
417
+ </HStack>
418
+ ),
419
+ };
420
+
421
+ // ============================================================================
422
+ // TOGGLE EXAMPLES
423
+ // ============================================================================
424
+
425
+ export const ToggleBaseline: Story = {
426
+ render: () => {
427
+ const [selected, setSelected] = useState(false);
428
+ return (
429
+ <HStack gap="12px" vAlign="center">
430
+ <Toggle selected={selected} onClick={() => setSelected(!selected)}>
431
+ Baseline
432
+ </Toggle>
433
+ </HStack>
434
+ );
435
+ },
436
+ };
437
+
438
+ const ToggleWithState: React.FC<Omit<ToggleProps, 'selected' | 'onClick'>> = ({
439
+ ...props
440
+ }) => {
441
+ const [selected, setSelected] = useState(false);
442
+ return <Toggle selected={selected} onClick={() => setSelected(!selected)} {...props} />;
443
+ };
444
+
445
+ export const ToggleSize: Story = {
446
+ render: () => (
447
+ <HStack gap="12px" vAlign="center">
448
+ <ToggleWithState size="sm">Small</ToggleWithState>
449
+ <ToggleWithState size="md">Medium</ToggleWithState>
450
+ <ToggleWithState size="lg">Large</ToggleWithState>
451
+ </HStack>
452
+ ),
453
+ };
454
+
455
+ export const ToggleDisabled: Story = {
456
+ render: () => (
457
+ <HStack gap="12px" vAlign="center">
458
+ <VStack gap="12px" vAlign="center" width="200px">
459
+ <Toggle disabled width="100%">
460
+ Disabled
461
+ </Toggle>
462
+ <Toggle selected disabled width="100%">
463
+ Selected Disabled
464
+ </Toggle>
465
+ </VStack>
466
+ </HStack>
467
+ ),
468
+ };
469
+
470
+ export const ToggleWithIcons: Story = {
471
+ render: () => (
472
+ <VStack gap="12px" vAlign="center">
473
+ <ToggleWithState>
474
+ Icon End
475
+ <Spacer width="6px" />
476
+ <CrossIcon size="sm" />
477
+ </ToggleWithState>
478
+ <ToggleWithState>
479
+ <PlusIcon size="sm" />
480
+ <Spacer width="6px" />
481
+ Icon Start
482
+ </ToggleWithState>
483
+ </VStack>
484
+ ),
485
+ };
486
+
487
+ export const ToggleCustomColors: Story = {
488
+ render: () => (
489
+ <HStack vAlign="center" gap="12px">
490
+ <VStack gap="12px" vAlign="center" width="200px">
491
+ <ToggleWithState color={'#4F785C'} width="100%">
492
+ Integrated and Automation
493
+ </ToggleWithState>
494
+ </VStack>
495
+ </HStack>
496
+ ),
497
+ };
498
+
499
+ export const ToggleInteractiveStates: Story = {
500
+ render: () => (
501
+ <HStack
502
+ gap="24px"
503
+ style={{
504
+ pointerEvents: 'none',
505
+ }}
506
+ >
507
+ <VStack gap="12px" vAlign="center" width="100px">
508
+ <BodyText>Not Selected</BodyText>
509
+ <Toggle width="100%">Baseline</Toggle>
510
+ <Toggle width="100%" data-focus-visible>
511
+ Focus
512
+ </Toggle>
513
+ <Toggle width="100%" data-hover>
514
+ Hover
515
+ </Toggle>
516
+ <Toggle width="100%" data-active>
517
+ Active
518
+ </Toggle>
519
+ </VStack>
520
+ <VStack gap="12px" vAlign="center" width="100px">
521
+ <BodyText>Selected</BodyText>
522
+ <Toggle selected width="100%">
523
+ Baseline
524
+ </Toggle>
525
+ <Toggle selected width="100%" data-focus-visible>
526
+ Focus
527
+ </Toggle>
528
+ <Toggle selected width="100%" data-hover>
529
+ Hover
530
+ </Toggle>
531
+ <Toggle selected width="100%" data-active>
532
+ Active
533
+ </Toggle>
534
+ </VStack>
535
+ </HStack>
536
+ ),
537
+ };
538
+
539
+ // ============================================================================
540
+ // TOGGLE UTILITY EXAMPLES
541
+ // ============================================================================
542
+
543
+ const UtilityToggleWithState: React.FC<
544
+ Omit<ToggleProps, 'selected' | 'onClick' | 'utility'>
545
+ > = ({ ...props }) => {
546
+ const [selected, setSelected] = useState(false);
547
+ return (
548
+ <Toggle
549
+ utility
550
+ selected={selected}
551
+ onClick={() => setSelected(!selected)}
552
+ {...props}
553
+ />
554
+ );
555
+ };
556
+
557
+ export const UtilityToggleBaseline: Story = {
558
+ render: () => {
559
+ const [selected, setSelected] = useState(false);
560
+ return (
561
+ <HStack gap="12px" vAlign="center">
562
+ <Toggle utility selected={selected} onClick={() => setSelected(!selected)}>
563
+ <SearchIcon />
564
+ </Toggle>
565
+ </HStack>
566
+ );
567
+ },
568
+ };
569
+
570
+ export const UtilityToggleSize: Story = {
571
+ render: () => (
572
+ <HStack gap="12px" vAlign="center">
573
+ <UtilityToggleWithState size="sm">
574
+ <SearchIcon />
575
+ </UtilityToggleWithState>
576
+ <UtilityToggleWithState size="md">
577
+ <SearchIcon />
578
+ </UtilityToggleWithState>
579
+ <UtilityToggleWithState size="lg">
580
+ <SearchIcon />
581
+ </UtilityToggleWithState>
582
+ </HStack>
583
+ ),
584
+ };
585
+
586
+ export const UtilityToggleDisabled: Story = {
587
+ render: () => (
588
+ <HStack gap="12px" vAlign="center">
589
+ <Toggle utility disabled>
590
+ <SearchIcon />
591
+ </Toggle>
592
+ <Toggle utility selected disabled>
593
+ <SearchIcon />
594
+ </Toggle>
595
+ </HStack>
596
+ ),
597
+ };
598
+
599
+ export const UtilityToggleCustomColors: Story = {
600
+ render: () => (
601
+ <HStack vAlign="center" gap="12px">
602
+ <UtilityToggleWithState color={'#4F785C'}>
603
+ <SearchIcon />
604
+ </UtilityToggleWithState>
605
+ </HStack>
606
+ ),
607
+ };
608
+
609
+ export const UtilityToggleInteractiveStates: Story = {
610
+ render: () => (
611
+ <HStack
612
+ gap="24px"
613
+ style={{
614
+ pointerEvents: 'none',
615
+ }}
616
+ >
617
+ <VStack gap="24px" vAlign="center">
618
+ <HStack gap="16px" minWidth="150px">
619
+ <BodyText>Baseline</BodyText>
620
+ <Spacer />
621
+ <Toggle utility>
622
+ <SearchIcon />
623
+ </Toggle>
624
+ <Toggle utility selected>
625
+ <SearchIcon />
626
+ </Toggle>
627
+ </HStack>
628
+ <HStack gap="16px" minWidth="150px">
629
+ <BodyText>Focus</BodyText>
630
+ <Spacer />
631
+ <Toggle utility data-focus-visible>
632
+ <SearchIcon />
633
+ </Toggle>
634
+ <Toggle utility data-focus-visible selected>
635
+ <SearchIcon />
636
+ </Toggle>
637
+ </HStack>
638
+ <HStack gap="16px" minWidth="150px">
639
+ <BodyText>Hover</BodyText>
640
+ <Spacer />
641
+ <Toggle utility data-hover>
642
+ <SearchIcon />
643
+ </Toggle>
644
+ <Toggle utility data-hover selected>
645
+ <SearchIcon />
646
+ </Toggle>
647
+ </HStack>
648
+ <HStack gap="16px" vAlign="center">
649
+ <BodyText>Active</BodyText>
650
+ <Spacer />
651
+ <Toggle utility data-active>
652
+ <SearchIcon />
653
+ </Toggle>
654
+ <Toggle utility data-active selected>
655
+ <SearchIcon />
656
+ </Toggle>
657
+ </HStack>
658
+ </VStack>
659
+ </HStack>
660
+ ),
661
+ };
662
+
348
663
  // ============================================================================
349
664
  // BUTTON GROUP EXAMPLES
350
665
  // ============================================================================
@@ -41,12 +41,16 @@ export const Showcase: React.FC<ShowcaseProps> = ({
41
41
  <HStack className={clsx(styles.header, styles.toolbar)}>
42
42
  <h4 className={styles.title}>{title}</h4>
43
43
  </HStack>
44
- <HStack className={clsx(styles.subtitle, styles.toolbar)} vAlign="start">
45
- <div className={styles.description}>{description}</div>
46
- </HStack>
47
- <HStack className={clsx(styles.subtitle, styles.toolbar)} vAlign="start">
48
- <div className={styles.documentation}>{children}</div>
49
- </HStack>
44
+ {description && (
45
+ <HStack className={clsx(styles.subtitle, styles.toolbar)} vAlign="start">
46
+ <div className={styles.description}>{description}</div>
47
+ </HStack>
48
+ )}
49
+ {children && (
50
+ <HStack className={clsx(styles.subtitle, styles.toolbar)} vAlign="start">
51
+ <div className={styles.documentation}>{children}</div>
52
+ </HStack>
53
+ )}
50
54
  <Canvas
51
55
  className={styles.content}
52
56
  layout="centered"