@whity/ui 0.0.0-stage → 1.0.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 (205) hide show
  1. package/README.md +106 -2
  2. package/package.json +219 -4
  3. package/src/access-denied.stories.tsx +179 -0
  4. package/src/access-denied.tsx +305 -0
  5. package/src/action-proposal.tsx +338 -0
  6. package/src/actor-chip.tsx +71 -0
  7. package/src/agent-activity.tsx +163 -0
  8. package/src/agent-collaboration.stories.tsx +156 -0
  9. package/src/agent-run-status.tsx +196 -0
  10. package/src/alert-dialog.stories.tsx +45 -0
  11. package/src/alert-dialog.tsx +147 -0
  12. package/src/alert.stories.tsx +91 -0
  13. package/src/alert.tsx +89 -0
  14. package/src/app-sidebar.stories.tsx +195 -0
  15. package/src/app-sidebar.tsx +604 -0
  16. package/src/approval-queue.tsx +109 -0
  17. package/src/audience-group-picker.stories.tsx +198 -0
  18. package/src/audience-group-picker.tsx +362 -0
  19. package/src/audience-people-picker.stories.tsx +102 -0
  20. package/src/audience-people-picker.tsx +279 -0
  21. package/src/avatar-pattern.ts +138 -0
  22. package/src/avatar.tsx +125 -0
  23. package/src/badge.stories.tsx +105 -0
  24. package/src/badge.tsx +68 -0
  25. package/src/beta-warning.stories.tsx +79 -0
  26. package/src/beta-warning.tsx +189 -0
  27. package/src/bilingual-input.stories.tsx +82 -0
  28. package/src/bilingual-input.tsx +188 -0
  29. package/src/board.tsx +216 -0
  30. package/src/breadcrumb.stories.tsx +51 -0
  31. package/src/breadcrumb.tsx +90 -0
  32. package/src/built-on-whity.tsx +52 -0
  33. package/src/button.stories.tsx +87 -0
  34. package/src/button.tsx +123 -0
  35. package/src/card.stories.tsx +423 -0
  36. package/src/card.tsx +180 -0
  37. package/src/chart.stories.tsx +66 -0
  38. package/src/chart.tsx +228 -0
  39. package/src/checkbox.stories.tsx +62 -0
  40. package/src/checkbox.tsx +54 -0
  41. package/src/collapsible.stories.tsx +48 -0
  42. package/src/collapsible.tsx +34 -0
  43. package/src/color-card.stories.tsx +61 -0
  44. package/src/color-card.tsx +270 -0
  45. package/src/color-picker.stories.tsx +65 -0
  46. package/src/color-picker.tsx +425 -0
  47. package/src/column-matcher.tsx +84 -0
  48. package/src/command-palette.tsx +398 -0
  49. package/src/confirm-action.tsx +98 -0
  50. package/src/copy-block.stories.tsx +38 -0
  51. package/src/copy-block.tsx +85 -0
  52. package/src/data-table.stories.tsx +200 -0
  53. package/src/data-table.tsx +1686 -0
  54. package/src/date-picker.stories.tsx +61 -0
  55. package/src/date-picker.tsx +456 -0
  56. package/src/design-cards.stories.tsx +551 -0
  57. package/src/dialog.stories.tsx +48 -0
  58. package/src/dialog.tsx +179 -0
  59. package/src/display-preferences.tsx +50 -0
  60. package/src/documents/barcode-svg.stories.tsx +72 -0
  61. package/src/documents/barcode-svg.tsx +79 -0
  62. package/src/dropdown-menu.stories.tsx +77 -0
  63. package/src/dropdown-menu.tsx +271 -0
  64. package/src/editor/agent-panel.tsx +222 -0
  65. package/src/editor/agents.stories.tsx +81 -0
  66. package/src/editor/agents.ts +55 -0
  67. package/src/editor/behaviour.ts +279 -0
  68. package/src/editor/block-ids.ts +44 -0
  69. package/src/editor/block-list.tsx +104 -0
  70. package/src/editor/block-toolbar.tsx +490 -0
  71. package/src/editor/bubble.tsx +119 -0
  72. package/src/editor/catalogue.ts +169 -0
  73. package/src/editor/collab-rail.tsx +746 -0
  74. package/src/editor/collab.stories.tsx +207 -0
  75. package/src/editor/collab.ts +87 -0
  76. package/src/editor/contract.ts +476 -0
  77. package/src/editor/convert.ts +414 -0
  78. package/src/editor/doc-editor.stories.tsx +98 -0
  79. package/src/editor/doc-editor.tsx +1492 -0
  80. package/src/editor/editor.css +636 -0
  81. package/src/editor/extensions.ts +86 -0
  82. package/src/editor/field-bar.tsx +154 -0
  83. package/src/editor/field-picker.tsx +109 -0
  84. package/src/editor/fields.ts +100 -0
  85. package/src/editor/gutter.tsx +443 -0
  86. package/src/editor/index.ts +23 -0
  87. package/src/editor/label-sheet.tsx +289 -0
  88. package/src/editor/labels.ts +394 -0
  89. package/src/editor/link-tools.tsx +141 -0
  90. package/src/editor/node-views.tsx +461 -0
  91. package/src/editor/page-view.tsx +372 -0
  92. package/src/editor/phone.tsx +310 -0
  93. package/src/editor/plugin-block-view.tsx +230 -0
  94. package/src/editor/plugin-blocks.stories.tsx +96 -0
  95. package/src/editor/plugin-blocks.ts +52 -0
  96. package/src/editor/publish-check.tsx +201 -0
  97. package/src/editor/rich-blocks.stories.tsx +146 -0
  98. package/src/editor/sample.ts +40 -0
  99. package/src/editor/save-block-dialog.tsx +141 -0
  100. package/src/editor/saved-block-view.tsx +205 -0
  101. package/src/editor/saved-blocks.stories.tsx +105 -0
  102. package/src/editor/saved-parts.ts +192 -0
  103. package/src/editor/schema-rich.ts +156 -0
  104. package/src/editor/schema.ts +368 -0
  105. package/src/editor/services.tsx +205 -0
  106. package/src/editor/slash.ts +64 -0
  107. package/src/editor/suggesting.ts +372 -0
  108. package/src/editor/suggestions.ts +763 -0
  109. package/src/editor/table-keys.ts +66 -0
  110. package/src/editor/templates.stories.tsx +324 -0
  111. package/src/editor/toolbar.tsx +364 -0
  112. package/src/empty-state.stories.tsx +51 -0
  113. package/src/empty-state.tsx +126 -0
  114. package/src/empty-state.usage-notes.md +30 -0
  115. package/src/form.stories.tsx +112 -0
  116. package/src/form.tsx +176 -0
  117. package/src/globals.css +20 -0
  118. package/src/icon-button.tsx +85 -0
  119. package/src/icon-map.ts +335 -0
  120. package/src/icon.tsx +41 -0
  121. package/src/index.ts +90 -0
  122. package/src/input.stories.tsx +157 -0
  123. package/src/input.tsx +768 -0
  124. package/src/kpi-strip.tsx +47 -0
  125. package/src/localized-text.ts +76 -0
  126. package/src/locked-screen.stories.tsx +29 -0
  127. package/src/locked-screen.tsx +75 -0
  128. package/src/lockup.tsx +42 -0
  129. package/src/lottie.tsx +441 -0
  130. package/src/mark.tsx +62 -0
  131. package/src/math-text.stories.tsx +33 -0
  132. package/src/math-text.tsx +43 -0
  133. package/src/menu-bar.stories.tsx +198 -0
  134. package/src/menu-bar.tsx +373 -0
  135. package/src/message-thread.tsx +181 -0
  136. package/src/money/currency.ts +244 -0
  137. package/src/money/money-input.tsx +131 -0
  138. package/src/money/money.tsx +33 -0
  139. package/src/open-on-computer.tsx +150 -0
  140. package/src/otp-input.tsx +161 -0
  141. package/src/page-header.stories.tsx +95 -0
  142. package/src/page-header.tsx +122 -0
  143. package/src/page-shell.stories.tsx +42 -0
  144. package/src/page-shell.tsx +32 -0
  145. package/src/page-states.tsx +277 -0
  146. package/src/pagination.stories.tsx +45 -0
  147. package/src/pagination.tsx +98 -0
  148. package/src/paper-sheet.stories.tsx +88 -0
  149. package/src/paper-sheet.tsx +85 -0
  150. package/src/phone-tab-bar.tsx +152 -0
  151. package/src/plugin-card.stories.tsx +208 -0
  152. package/src/plugin-card.tsx +931 -0
  153. package/src/popover.stories.tsx +48 -0
  154. package/src/popover.tsx +55 -0
  155. package/src/radio-group.stories.tsx +26 -0
  156. package/src/radio-group.tsx +44 -0
  157. package/src/route-flow/editor.tsx +1087 -0
  158. package/src/route-flow/model.ts +771 -0
  159. package/src/save-bar.tsx +94 -0
  160. package/src/scope-grant.tsx +139 -0
  161. package/src/screen-too-small.stories.tsx +61 -0
  162. package/src/screen-too-small.tsx +104 -0
  163. package/src/search-field.tsx +65 -0
  164. package/src/select.stories.tsx +44 -0
  165. package/src/select.tsx +197 -0
  166. package/src/separator.stories.tsx +34 -0
  167. package/src/separator.tsx +34 -0
  168. package/src/sheet.stories.tsx +49 -0
  169. package/src/sheet.tsx +168 -0
  170. package/src/skeleton.stories.tsx +28 -0
  171. package/src/skeleton.tsx +19 -0
  172. package/src/slider.stories.tsx +78 -0
  173. package/src/slider.tsx +300 -0
  174. package/src/spinner.stories.tsx +33 -0
  175. package/src/spinner.tsx +55 -0
  176. package/src/stepper.tsx +85 -0
  177. package/src/switch.stories.tsx +42 -0
  178. package/src/switch.tsx +41 -0
  179. package/src/switcher.stories.tsx +111 -0
  180. package/src/switcher.tsx +131 -0
  181. package/src/system-state.tsx +55 -0
  182. package/src/table.stories.tsx +48 -0
  183. package/src/table.tsx +121 -0
  184. package/src/tabs.stories.tsx +74 -0
  185. package/src/tabs.tsx +90 -0
  186. package/src/tag-input.stories.tsx +67 -0
  187. package/src/tag-input.tsx +117 -0
  188. package/src/tenant-logo.tsx +63 -0
  189. package/src/tenant-switcher.stories.tsx +38 -0
  190. package/src/tenant-switcher.tsx +164 -0
  191. package/src/textarea.stories.tsx +27 -0
  192. package/src/textarea.tsx +18 -0
  193. package/src/theme-mode.ts +52 -0
  194. package/src/time-grid.tsx +163 -0
  195. package/src/time-picker.stories.tsx +62 -0
  196. package/src/time-picker.tsx +615 -0
  197. package/src/toggle-group.tsx +138 -0
  198. package/src/tooltip.stories.tsx +43 -0
  199. package/src/tooltip.tsx +73 -0
  200. package/src/top-nav.stories.tsx +58 -0
  201. package/src/top-nav.tsx +324 -0
  202. package/src/undo-bar.tsx +107 -0
  203. package/src/utils.ts +45 -0
  204. package/src/view-toggle.stories.tsx +84 -0
  205. package/src/view-toggle.tsx +110 -0
package/src/index.ts ADDED
@@ -0,0 +1,90 @@
1
+ export * from "./access-denied"
2
+ export * from "./actor-chip"
3
+ export * from "./agent-run-status"
4
+ export * from "./alert"
5
+ export * from "./alert-dialog"
6
+ export * from "./app-sidebar"
7
+ export * from "./audience-group-picker"
8
+ export * from "./audience-people-picker"
9
+ export * from "./avatar"
10
+ export * from "./avatar-pattern"
11
+ export * from "./board"
12
+ export * from "./column-matcher"
13
+ export * from "./kpi-strip"
14
+ export * from "./message-thread"
15
+ export * from "./time-grid"
16
+ export * from "./badge"
17
+ export * from "./beta-warning"
18
+ export * from "./bilingual-input"
19
+ export * from "./localized-text"
20
+ export * from "./breadcrumb"
21
+ export * from "./button"
22
+ export * from "./card"
23
+ export * from "./chart"
24
+ export * from "./checkbox"
25
+ export * from "./collapsible"
26
+ export * from "./color-card"
27
+ export * from "./color-picker"
28
+ export * from "./copy-block"
29
+ export * from "./data-table"
30
+ export * from "./date-picker"
31
+ export * from "./dialog"
32
+ export * from "./dropdown-menu"
33
+ export * from "./empty-state"
34
+ export * from "./form"
35
+ export * from "./icon"
36
+ export * from "./icon-button"
37
+ export * from "./input"
38
+ export * from "./locked-screen"
39
+ export * from "./lottie"
40
+ export * from "./mark"
41
+ export * from "./math-text"
42
+ export * from "./menu-bar"
43
+ export * from "./page-header"
44
+ export * from "./page-shell"
45
+ export * from "./phone-tab-bar"
46
+ export * from "./open-on-computer"
47
+ export * from "./pagination"
48
+ export * from "./plugin-card"
49
+ export * from "./popover"
50
+ export * from "./radio-group"
51
+ export * from "./screen-too-small"
52
+ export * from "./select"
53
+ export * from "./separator"
54
+ export * from "./sheet"
55
+ export * from "./skeleton"
56
+ export * from "./slider"
57
+ export * from "./spinner"
58
+ export * from "./switch"
59
+ export * from "./switcher"
60
+ export * from "./table"
61
+ export * from "./tabs"
62
+ export * from "./tag-input"
63
+ export * from "./tenant-logo"
64
+ export * from "./built-on-whity"
65
+ export * from "./paper-sheet"
66
+ export * from "./lockup"
67
+ export * from "./tenant-switcher"
68
+ export * from "./textarea"
69
+ export * from "./theme-mode"
70
+ export * from "./time-picker"
71
+ export * from "./toggle-group"
72
+ export * from "./tooltip"
73
+ export * from "./top-nav"
74
+ export * from "./utils"
75
+ export * from "./view-toggle"
76
+ export * from "./action-proposal"
77
+ export * from "./agent-activity"
78
+ export * from "./approval-queue"
79
+ export * from "./scope-grant"
80
+ export * from "./undo-bar"
81
+ export * from "./confirm-action"
82
+ export * from "./display-preferences"
83
+ export * from "./money/money-input"
84
+ export * from "./money/money"
85
+ export * from "./page-states"
86
+ export * from "./save-bar"
87
+ export * from "./search-field"
88
+ export * from "./stepper"
89
+ export * from "./otp-input"
90
+ export * from "./system-state"
@@ -0,0 +1,157 @@
1
+ import type { Meta, StoryObj } from "@storybook/react-vite"
2
+
3
+ import { Input } from "./input"
4
+
5
+ const meta = {
6
+ title: "Primitives/Input",
7
+ component: Input,
8
+ tags: ["autodocs"],
9
+ args: { placeholder: "you@example.com" },
10
+ } satisfies Meta<typeof Input>
11
+
12
+ export default meta
13
+ type Story = StoryObj<typeof meta>
14
+
15
+ export const Playground: Story = {}
16
+
17
+ export const Types: Story = {
18
+ render: () => (
19
+ <div className="flex w-80 flex-col gap-4">
20
+ <Input placeholder="Text" />
21
+ <Input type="email" placeholder="Email" />
22
+ <Input type="password" placeholder="Password" />
23
+ <Input type="number" placeholder="42" />
24
+ <Input type="search" placeholder="Search components..." />
25
+ <Input type="date" />
26
+ <Input type="time" />
27
+ <Input type="range" defaultValue={65} min={0} max={100} label="Volume Slider Input" />
28
+ </div>
29
+ ),
30
+ }
31
+
32
+ export const DateTimeAndSearch: Story = {
33
+ render: () => (
34
+ <div className="flex w-80 flex-col gap-4">
35
+ <Input
36
+ type="search"
37
+ label="Search Database"
38
+ placeholder="Type to filter records..."
39
+ tooltip="Performs instant client and server side search."
40
+ helperText="Includes search icon and clear trigger."
41
+ />
42
+ <Input
43
+ type="date"
44
+ label="Start Date"
45
+ required
46
+ tooltip="Select event start date."
47
+ helperText="Native date picker with custom calendar icon."
48
+ />
49
+ <Input
50
+ type="time"
51
+ label="Shift Start Time"
52
+ required
53
+ tooltip="Select shift time with 1-minute granularity and direct wheel scroll."
54
+ helperText="Direct wheel scroll over columns ticks hours and minutes seamlessly."
55
+ />
56
+ <Input
57
+ type="range"
58
+ label="Brightness Control"
59
+ defaultValue={75}
60
+ tooltip="Adjust brightness level from 0 to 100%."
61
+ helperText="Input type='range' renders custom Radix slider with value badge."
62
+ />
63
+ </div>
64
+ ),
65
+ }
66
+
67
+ export const OutsideLabelAndTooltip: Story = {
68
+ render: () => (
69
+ <div className="flex w-80 flex-col gap-4">
70
+ <Input
71
+ label="Email"
72
+ required
73
+ tooltip="Enter your primary work email address."
74
+ placeholder="alex@company.com"
75
+ helperText="Clean static title positioned outside above the field."
76
+ />
77
+ <Input
78
+ type="password"
79
+ label="Password"
80
+ required
81
+ tooltip="Must contain at least 8 characters."
82
+ placeholder="••••••••"
83
+ helperText="Includes show/hide password toggle button."
84
+ />
85
+ </div>
86
+ ),
87
+ }
88
+
89
+ export const ErrorAndNotes: Story = {
90
+ render: () => (
91
+ <div className="flex w-80 flex-col gap-4">
92
+ <Input
93
+ label="Username"
94
+ required
95
+ defaultValue="invalid_user_#99"
96
+ aria-invalid
97
+ errorText="Usernames can only contain letters, numbers, and underscores."
98
+ />
99
+ <Input
100
+ label="Max Users"
101
+ type="number"
102
+ defaultValue={5}
103
+ tooltip="Maximum seats allowed in team subscription."
104
+ helperText="Includes custom stepper buttons."
105
+ />
106
+ </div>
107
+ ),
108
+ }
109
+
110
+ export const DropzoneFileDefault: Story = {
111
+ render: () => (
112
+ <div className="flex w-96 flex-col gap-4">
113
+ <Input
114
+ type="file"
115
+ multiple
116
+ label="Attachment Uploads (Default Dropzone)"
117
+ required
118
+ tooltip="Drag files directly into the box or click to select."
119
+ helperText="Default file upload style is now the prominent drag-and-drop box with larger file cards."
120
+ />
121
+ </div>
122
+ ),
123
+ }
124
+
125
+ export const CompactFileInputAlternative: Story = {
126
+ render: () => (
127
+ <div className="flex w-96 flex-col gap-4">
128
+ <div>
129
+ <Input
130
+ type="file"
131
+ fileVariant="compact"
132
+ label="Single File (Compact Variant)"
133
+ helperText="Inline compact alternative file picker with pill badges."
134
+ />
135
+ </div>
136
+ <div>
137
+ <Input
138
+ type="file"
139
+ fileVariant="compact"
140
+ multiple
141
+ label="Multiple Files (Compact Variant)"
142
+ helperText="Compact inline multi-file picker with interactive pills and remove buttons."
143
+ />
144
+ </div>
145
+ </div>
146
+ ),
147
+ }
148
+
149
+ export const States: Story = {
150
+ render: () => (
151
+ <div className="flex w-72 flex-col gap-3">
152
+ <Input placeholder="Default" />
153
+ <Input placeholder="Disabled" disabled />
154
+ <Input placeholder="Invalid" aria-invalid defaultValue="not-an-email" />
155
+ </div>
156
+ ),
157
+ }