@taiv/ui 1.3.2 → 1.4.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/dist/components/Data/Cards/ChartCard.d.ts +2 -1
  2. package/dist/components/Data/Cards/ChartCard.d.ts.map +1 -1
  3. package/dist/components/Data/Cards/ChartCard.js +6 -4
  4. package/dist/components/Data/Cards/PieChartCard.d.ts +2 -1
  5. package/dist/components/Data/Cards/PieChartCard.d.ts.map +1 -1
  6. package/dist/components/Data/Cards/PieChartCard.js +6 -4
  7. package/dist/components/Data/Cards/StatsCard.d.ts +1 -1
  8. package/dist/components/Data/Cards/StatsCard.d.ts.map +1 -1
  9. package/dist/components/Data/Cards/StatsCard.js +4 -4
  10. package/dist/components/Data/Chart.js +4 -4
  11. package/dist/components/Data/CheckboxTable.d.ts +1 -1
  12. package/dist/components/Data/CheckboxTable.d.ts.map +1 -1
  13. package/dist/components/Data/CheckboxTable.js +6 -6
  14. package/dist/components/Data/PieChart.js +4 -4
  15. package/dist/components/Info/InfoCard.d.ts +1 -1
  16. package/dist/components/Info/InfoCard.d.ts.map +1 -1
  17. package/dist/components/Info/InfoCard.js +2 -2
  18. package/dist/components/Info/Modals/Modal.js +2 -2
  19. package/dist/components/Info/Notifications/variants.js +1 -1
  20. package/dist/components/Info/Tooltips/FormulaTooltip.js +3 -3
  21. package/dist/components/Info/Tooltips/InfoTooltip.d.ts +16 -1
  22. package/dist/components/Info/Tooltips/InfoTooltip.d.ts.map +1 -1
  23. package/dist/components/Info/Tooltips/InfoTooltip.js +18 -4
  24. package/dist/components/Inputs/Buttons/Button/Button.d.ts +12 -0
  25. package/dist/components/Inputs/Buttons/Button/Button.d.ts.map +1 -0
  26. package/dist/components/Inputs/Buttons/Button/Button.js +37 -0
  27. package/dist/components/Inputs/Buttons/Button/Button.stories.d.ts +11 -0
  28. package/dist/components/Inputs/Buttons/Button/Button.stories.d.ts.map +1 -0
  29. package/dist/components/Inputs/Buttons/Button/Button.stories.js +176 -0
  30. package/dist/components/Inputs/Buttons/Button/sizes.d.ts +25 -0
  31. package/dist/components/Inputs/Buttons/Button/sizes.d.ts.map +1 -0
  32. package/dist/components/Inputs/Buttons/Button/sizes.js +7 -0
  33. package/dist/components/Inputs/Buttons/Button/variants.d.ts +191 -0
  34. package/dist/components/Inputs/Buttons/Button/variants.d.ts.map +1 -0
  35. package/dist/components/Inputs/Buttons/Button/variants.js +191 -0
  36. package/dist/components/Inputs/Buttons/UnstyledButton/UnstyledButton.d.ts +10 -0
  37. package/dist/components/Inputs/Buttons/UnstyledButton/UnstyledButton.d.ts.map +1 -0
  38. package/dist/components/Inputs/Buttons/UnstyledButton/UnstyledButton.js +6 -0
  39. package/dist/components/Inputs/Buttons/UnstyledButton/UnstyledButton.stories.d.ts +8 -0
  40. package/dist/components/Inputs/Buttons/UnstyledButton/UnstyledButton.stories.d.ts.map +1 -0
  41. package/dist/components/Inputs/Buttons/UnstyledButton/UnstyledButton.stories.js +97 -0
  42. package/dist/components/Inputs/Controls/Checkbox/Checkbox.d.ts +27 -0
  43. package/dist/components/Inputs/Controls/Checkbox/Checkbox.d.ts.map +1 -0
  44. package/dist/components/Inputs/Controls/Checkbox/Checkbox.js +55 -0
  45. package/dist/components/Inputs/Controls/Checkbox/Checkbox.stories.d.ts +10 -0
  46. package/dist/components/Inputs/Controls/Checkbox/Checkbox.stories.d.ts.map +1 -0
  47. package/dist/components/Inputs/Controls/Checkbox/Checkbox.stories.js +154 -0
  48. package/dist/components/Inputs/Controls/Radio/Radio.d.ts +8 -0
  49. package/dist/components/Inputs/Controls/Radio/Radio.d.ts.map +1 -0
  50. package/dist/components/Inputs/Controls/Radio/Radio.js +43 -0
  51. package/dist/components/Inputs/Controls/Radio/Radio.stories.d.ts +10 -0
  52. package/dist/components/Inputs/Controls/Radio/Radio.stories.d.ts.map +1 -0
  53. package/dist/components/Inputs/Controls/Radio/Radio.stories.js +143 -0
  54. package/dist/components/Inputs/Controls/RadioList/RadioList.d.ts +16 -0
  55. package/dist/components/Inputs/Controls/RadioList/RadioList.d.ts.map +1 -0
  56. package/dist/components/Inputs/Controls/RadioList/RadioList.js +24 -0
  57. package/dist/components/Inputs/Controls/RadioList/RadioList.stories.d.ts +11 -0
  58. package/dist/components/Inputs/Controls/RadioList/RadioList.stories.d.ts.map +1 -0
  59. package/dist/components/Inputs/Controls/RadioList/RadioList.stories.js +138 -0
  60. package/dist/components/Inputs/Controls/Toggle/Toggle.d.ts +29 -0
  61. package/dist/components/Inputs/Controls/Toggle/Toggle.d.ts.map +1 -0
  62. package/dist/components/Inputs/Controls/Toggle/Toggle.js +40 -0
  63. package/dist/components/Inputs/Controls/Toggle/Toggle.stories.d.ts +11 -0
  64. package/dist/components/Inputs/Controls/Toggle/Toggle.stories.d.ts.map +1 -0
  65. package/dist/components/Inputs/Controls/Toggle/Toggle.stories.js +179 -0
  66. package/dist/components/Inputs/Dates/DatePicker/DatePicker.d.ts +12 -0
  67. package/dist/components/Inputs/Dates/DatePicker/DatePicker.d.ts.map +1 -0
  68. package/dist/components/Inputs/Dates/DatePicker/DatePicker.js +74 -0
  69. package/dist/components/Inputs/Dates/DatePicker/DatePicker.stories.d.ts +12 -0
  70. package/dist/components/Inputs/Dates/DatePicker/DatePicker.stories.d.ts.map +1 -0
  71. package/dist/components/Inputs/Dates/DatePicker/DatePicker.stories.js +203 -0
  72. package/dist/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.d.ts +17 -0
  73. package/dist/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.d.ts.map +1 -0
  74. package/dist/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.js +70 -0
  75. package/dist/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.stories.d.ts +14 -0
  76. package/dist/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.stories.d.ts.map +1 -0
  77. package/dist/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.stories.js +362 -0
  78. package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.d.ts +11 -0
  79. package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.d.ts.map +1 -0
  80. package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.js +48 -0
  81. package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.stories.d.ts +12 -0
  82. package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.stories.d.ts.map +1 -0
  83. package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.stories.js +215 -0
  84. package/dist/components/Inputs/Dropdowns/FontSelect/font-options.d.ts +9 -0
  85. package/dist/components/Inputs/Dropdowns/FontSelect/font-options.d.ts.map +1 -0
  86. package/dist/components/Inputs/Dropdowns/FontSelect/font-options.js +65 -0
  87. package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.d.ts +12 -0
  88. package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.d.ts.map +1 -0
  89. package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.js +94 -0
  90. package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.stories.d.ts +12 -0
  91. package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.stories.d.ts.map +1 -0
  92. package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.stories.js +260 -0
  93. package/dist/components/Inputs/Dropdowns/Select/Select.d.ts +11 -0
  94. package/dist/components/Inputs/Dropdowns/Select/Select.d.ts.map +1 -0
  95. package/dist/components/Inputs/Dropdowns/Select/Select.js +62 -0
  96. package/dist/components/Inputs/Dropdowns/Select/Select.stories.d.ts +12 -0
  97. package/dist/components/Inputs/Dropdowns/Select/Select.stories.d.ts.map +1 -0
  98. package/dist/components/Inputs/Dropdowns/Select/Select.stories.js +242 -0
  99. package/dist/components/Inputs/Sliders/Slider/Slider.d.ts +16 -0
  100. package/dist/components/Inputs/Sliders/Slider/Slider.d.ts.map +1 -0
  101. package/dist/components/Inputs/Sliders/Slider/Slider.js +91 -0
  102. package/dist/components/Inputs/Sliders/VolumeSlider/VolumeSlider.d.ts +6 -0
  103. package/dist/components/Inputs/Sliders/VolumeSlider/VolumeSlider.d.ts.map +1 -0
  104. package/dist/components/Inputs/Sliders/VolumeSlider/VolumeSlider.js +37 -0
  105. package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.d.ts +11 -0
  106. package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.d.ts.map +1 -0
  107. package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.js +57 -0
  108. package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.stories.d.ts +12 -0
  109. package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.stories.d.ts.map +1 -0
  110. package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.stories.js +218 -0
  111. package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.d.ts +12 -0
  112. package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.d.ts.map +1 -0
  113. package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.js +52 -0
  114. package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.stories.d.ts +12 -0
  115. package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.stories.d.ts.map +1 -0
  116. package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.stories.js +235 -0
  117. package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.d.ts +7 -0
  118. package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.d.ts.map +1 -0
  119. package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.js +23 -0
  120. package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.stories.d.ts +12 -0
  121. package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.stories.d.ts.map +1 -0
  122. package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.stories.js +202 -0
  123. package/dist/components/Inputs/TextInputs/TextArea/TextArea.d.ts +12 -0
  124. package/dist/components/Inputs/TextInputs/TextArea/TextArea.d.ts.map +1 -0
  125. package/dist/components/Inputs/TextInputs/TextArea/TextArea.js +33 -0
  126. package/dist/components/Inputs/TextInputs/TextArea/TextArea.stories.d.ts +12 -0
  127. package/dist/components/Inputs/TextInputs/TextArea/TextArea.stories.d.ts.map +1 -0
  128. package/dist/components/Inputs/TextInputs/TextArea/TextArea.stories.js +231 -0
  129. package/dist/components/Inputs/TextInputs/TextInput/TextInput.d.ts +12 -0
  130. package/dist/components/Inputs/TextInputs/TextInput/TextInput.d.ts.map +1 -0
  131. package/dist/components/Inputs/TextInputs/TextInput/TextInput.js +32 -0
  132. package/dist/components/Inputs/TextInputs/TextInput/TextInput.stories.d.ts +12 -0
  133. package/dist/components/Inputs/TextInputs/TextInput/TextInput.stories.d.ts.map +1 -0
  134. package/dist/components/Inputs/TextInputs/TextInput/TextInput.stories.js +219 -0
  135. package/dist/components/Layout/AutoGrid/AutoGrid.d.ts +8 -0
  136. package/dist/components/Layout/AutoGrid/AutoGrid.d.ts.map +1 -0
  137. package/dist/components/Layout/AutoGrid/AutoGrid.js +6 -0
  138. package/dist/components/Layout/Box/Box.d.ts +10 -0
  139. package/dist/components/Layout/Box/Box.d.ts.map +1 -0
  140. package/dist/components/Layout/Box/Box.js +6 -0
  141. package/dist/components/Layout/Box/Box.stories.d.ts +9 -0
  142. package/dist/components/Layout/Box/Box.stories.d.ts.map +1 -0
  143. package/dist/components/Layout/Box/Box.stories.js +121 -0
  144. package/dist/components/Layout/Card/Card.d.ts +8 -0
  145. package/dist/components/Layout/Card/Card.d.ts.map +1 -0
  146. package/dist/components/Layout/Card/Card.js +16 -0
  147. package/dist/components/Layout/Center/Center.d.ts +9 -0
  148. package/dist/components/Layout/Center/Center.d.ts.map +1 -0
  149. package/dist/components/Layout/Center/Center.js +6 -0
  150. package/dist/components/Layout/Divider/Divider.d.ts +10 -0
  151. package/dist/components/Layout/Divider/Divider.d.ts.map +1 -0
  152. package/dist/components/Layout/Divider/Divider.js +7 -0
  153. package/dist/components/Layout/Frame/Frame.d.ts +12 -0
  154. package/dist/components/Layout/Frame/Frame.d.ts.map +1 -0
  155. package/dist/components/Layout/Frame/Frame.js +7 -0
  156. package/dist/components/Layout/Grid/Grid.d.ts +10 -0
  157. package/dist/components/Layout/Grid/Grid.d.ts.map +1 -0
  158. package/dist/components/Layout/Grid/Grid.js +9 -0
  159. package/dist/components/Layout/Group/Group.d.ts +10 -0
  160. package/dist/components/Layout/Group/Group.d.ts.map +1 -0
  161. package/dist/components/Layout/Group/Group.js +6 -0
  162. package/dist/components/Layout/Loader/Loader.d.ts +8 -0
  163. package/dist/components/Layout/Loader/Loader.d.ts.map +1 -0
  164. package/dist/components/Layout/Loader/Loader.js +6 -0
  165. package/dist/components/Layout/SectionCard/SectionCard.d.ts +11 -0
  166. package/dist/components/Layout/SectionCard/SectionCard.d.ts.map +1 -0
  167. package/dist/components/Layout/SectionCard/SectionCard.js +13 -0
  168. package/dist/components/Layout/Stack/Stack.d.ts +10 -0
  169. package/dist/components/Layout/Stack/Stack.d.ts.map +1 -0
  170. package/dist/components/Layout/Stack/Stack.js +6 -0
  171. package/dist/components/Layout/Stack/Stack.stories.d.ts +9 -0
  172. package/dist/components/Layout/Stack/Stack.stories.d.ts.map +1 -0
  173. package/dist/components/Layout/Stack/Stack.stories.js +108 -0
  174. package/dist/components/Layout/Tabs/Tabs.d.ts +17 -0
  175. package/dist/components/Layout/Tabs/Tabs.d.ts.map +1 -0
  176. package/dist/components/Layout/Tabs/Tabs.js +48 -0
  177. package/dist/components/Misc/IconBadge/IconBadge.d.ts +8 -0
  178. package/dist/components/Misc/IconBadge/IconBadge.d.ts.map +1 -0
  179. package/dist/components/Misc/IconBadge/IconBadge.js +28 -0
  180. package/dist/components/Misc/Transition/Transition.d.ts +4 -0
  181. package/dist/components/Misc/Transition/Transition.d.ts.map +1 -0
  182. package/dist/components/Misc/Transition/Transition.js +6 -0
  183. package/dist/components/Typography/CollapsibleText.js +4 -4
  184. package/dist/components/Typography/Formula.d.ts.map +1 -1
  185. package/dist/components/Typography/Formula.js +2 -6
  186. package/dist/components/Typography/Fraction.js +2 -2
  187. package/dist/components/Typography/Text.d.ts.map +1 -1
  188. package/dist/components/Typography/Text.js +0 -2
  189. package/dist/components/index.d.ts +32 -32
  190. package/dist/components/index.d.ts.map +1 -1
  191. package/dist/components/index.js +32 -32
  192. package/dist/constants/index.d.ts +1 -0
  193. package/dist/constants/index.d.ts.map +1 -1
  194. package/dist/constants/index.js +1 -0
  195. package/dist/hooks/useConfirmationModal.d.ts.map +1 -1
  196. package/dist/hooks/useConfirmationModal.js +6 -6
  197. package/dist/hooks/useInfoModal.d.ts.map +1 -1
  198. package/dist/hooks/useInfoModal.js +4 -4
  199. package/dist/utils/index.d.ts +1 -1
  200. package/dist/utils/index.d.ts.map +1 -1
  201. package/dist/utils/index.js +1 -1
  202. package/dist/utils/select.d.ts +1 -0
  203. package/dist/utils/select.d.ts.map +1 -1
  204. package/dist/utils/select.js +18 -0
  205. package/package.json +10 -2
@@ -0,0 +1,362 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { CascadingSelect } from './CascadingSelect';
3
+ import { Group } from '../../../Layout/Group/Group';
4
+ const meta = {
5
+ title: 'Components/Inputs/Dropdowns/CascadingSelect',
6
+ component: CascadingSelect,
7
+ parameters: {
8
+ layout: 'centered',
9
+ },
10
+ argTypes: {
11
+ size: {
12
+ control: { type: 'select' },
13
+ options: ['sm', 'md', 'lg'],
14
+ description: 'Controls the cascading select size',
15
+ table: {
16
+ type: { summary: "'sm' | 'md' | 'lg'" },
17
+ defaultValue: { summary: "'md'" },
18
+ },
19
+ },
20
+ placeholder: {
21
+ control: { type: 'text' },
22
+ description: 'Placeholder text',
23
+ table: {
24
+ type: { summary: 'string' },
25
+ defaultValue: { summary: "'Select an option'" },
26
+ },
27
+ },
28
+ label: {
29
+ control: { type: 'text' },
30
+ description: 'Select label',
31
+ table: {
32
+ type: { summary: 'string' },
33
+ },
34
+ },
35
+ description: {
36
+ control: { type: 'text' },
37
+ description: 'Description text',
38
+ table: {
39
+ type: { summary: 'string' },
40
+ },
41
+ },
42
+ error: {
43
+ control: { type: 'text' },
44
+ description: 'Error message',
45
+ table: {
46
+ type: { summary: 'string' },
47
+ },
48
+ },
49
+ disabled: {
50
+ control: { type: 'boolean' },
51
+ description: 'Disabled state',
52
+ table: {
53
+ type: { summary: 'boolean' },
54
+ defaultValue: { summary: 'false' },
55
+ },
56
+ },
57
+ required: {
58
+ control: { type: 'boolean' },
59
+ description: 'Required field',
60
+ table: {
61
+ type: { summary: 'boolean' },
62
+ defaultValue: { summary: 'false' },
63
+ },
64
+ },
65
+ fullWidth: {
66
+ control: { type: 'boolean' },
67
+ description: 'Full width of container',
68
+ table: {
69
+ type: { summary: 'boolean' },
70
+ defaultValue: { summary: 'false' },
71
+ },
72
+ },
73
+ width: {
74
+ control: { type: 'text' },
75
+ description: 'Custom width',
76
+ table: {
77
+ type: { summary: 'string | number' },
78
+ },
79
+ },
80
+ clearable: {
81
+ control: { type: 'boolean' },
82
+ description: 'Allow clearing selection',
83
+ table: {
84
+ type: { summary: 'boolean' },
85
+ defaultValue: { summary: 'false' },
86
+ },
87
+ },
88
+ searchable: {
89
+ control: { type: 'boolean' },
90
+ description: 'Allow searching options',
91
+ table: {
92
+ type: { summary: 'boolean' },
93
+ defaultValue: { summary: 'false' },
94
+ },
95
+ },
96
+ styles: {
97
+ control: { type: 'object' },
98
+ description: 'Custom styles object',
99
+ table: {
100
+ type: { summary: 'Record<string, CSSObject>' },
101
+ },
102
+ },
103
+ onChange: {
104
+ action: 'changed',
105
+ description: 'Change handler function',
106
+ table: {
107
+ type: { summary: '(value: string | null) => void' },
108
+ },
109
+ },
110
+ },
111
+ };
112
+ export default meta;
113
+ // Sample hierarchical data
114
+ const categoryData = [
115
+ {
116
+ option: { value: 'electronics', label: 'Electronics' },
117
+ icon: '📱',
118
+ children: [
119
+ {
120
+ option: { value: 'phones', label: 'Smartphones' },
121
+ icon: '📱',
122
+ children: [
123
+ { option: { value: 'iphone', label: 'iPhone' }, icon: '🍎' },
124
+ { option: { value: 'samsung', label: 'Samsung Galaxy' }, icon: '📱' },
125
+ { option: { value: 'google', label: 'Google Pixel' }, icon: '🔍' },
126
+ ],
127
+ },
128
+ {
129
+ option: { value: 'laptops', label: 'Laptops' },
130
+ icon: '💻',
131
+ children: [
132
+ { option: { value: 'macbook', label: 'MacBook' }, icon: '🍎' },
133
+ { option: { value: 'thinkpad', label: 'ThinkPad' }, icon: '💻' },
134
+ { option: { value: 'surface', label: 'Surface' }, icon: '🖥️' },
135
+ ],
136
+ },
137
+ ],
138
+ },
139
+ {
140
+ option: { value: 'clothing', label: 'Clothing' },
141
+ icon: '👕',
142
+ children: [
143
+ {
144
+ option: { value: 'mens', label: "Men's Clothing" },
145
+ icon: '👔',
146
+ children: [
147
+ { option: { value: 'shirts', label: 'Shirts' }, icon: '👕' },
148
+ { option: { value: 'pants', label: 'Pants' }, icon: '👖' },
149
+ { option: { value: 'shoes', label: 'Shoes' }, icon: '👟' },
150
+ ],
151
+ },
152
+ {
153
+ option: { value: 'womens', label: "Women's Clothing" },
154
+ icon: '👗',
155
+ children: [
156
+ { option: { value: 'dresses', label: 'Dresses' }, icon: '👗' },
157
+ { option: { value: 'tops', label: 'Tops' }, icon: '👚' },
158
+ { option: { value: 'accessories', label: 'Accessories' }, icon: '👜' },
159
+ ],
160
+ },
161
+ ],
162
+ },
163
+ {
164
+ option: { value: 'home', label: 'Home & Garden' },
165
+ icon: '🏠',
166
+ children: [
167
+ {
168
+ option: { value: 'furniture', label: 'Furniture' },
169
+ icon: '🪑',
170
+ children: [
171
+ { option: { value: 'sofas', label: 'Sofas' }, icon: '🛋️' },
172
+ { option: { value: 'tables', label: 'Tables' }, icon: '🪑' },
173
+ { option: { value: 'chairs', label: 'Chairs' }, icon: '🪑' },
174
+ ],
175
+ },
176
+ ],
177
+ },
178
+ ];
179
+ const simpleHierarchyData = [
180
+ {
181
+ option: { value: 'level1', label: 'Level 1 Item' },
182
+ children: [{ option: { value: 'level2a', label: 'Level 2 Item A' } }, { option: { value: 'level2b', label: 'Level 2 Item B' } }],
183
+ },
184
+ {
185
+ option: { value: 'another-level1', label: 'Another Level 1 Item' },
186
+ children: [{ option: { value: 'another-level2', label: 'Another Level 2 Item' } }],
187
+ },
188
+ ];
189
+ export const Default = {
190
+ args: {
191
+ data: categoryData,
192
+ placeholder: 'Select a category',
193
+ size: 'md',
194
+ disabled: false,
195
+ required: false,
196
+ fullWidth: false,
197
+ clearable: false,
198
+ searchable: false,
199
+ },
200
+ decorators: [
201
+ (Story) => (_jsx("div", { style: { height: '220px' }, children: _jsx(Story, {}) })),
202
+ ],
203
+ parameters: {
204
+ docs: {
205
+ source: {
206
+ code: `<CascadingSelect
207
+ data={[
208
+ {
209
+ option: { value: 'electronics', label: 'Electronics' },
210
+ icon: '📱',
211
+ children: [
212
+ {
213
+ option: { value: 'phones', label: 'Smartphones' },
214
+ children: [
215
+ { option: { value: 'iphone', label: 'iPhone' } },
216
+ { option: { value: 'samsung', label: 'Samsung Galaxy' } },
217
+ ],
218
+ },
219
+ ],
220
+ },
221
+ ]}
222
+ placeholder="Select a category"
223
+ value={selectedValue}
224
+ onChange={(value) => setSelectedValue(value)}
225
+ />`,
226
+ },
227
+ },
228
+ },
229
+ };
230
+ export const Sizes = {
231
+ render: () => (_jsxs(Group, { gap: "2rem", children: [_jsx(CascadingSelect, { size: "sm", data: simpleHierarchyData, placeholder: "Small Cascading Select" }), _jsx(CascadingSelect, { size: "md", data: simpleHierarchyData, placeholder: "Medium Cascading Select (Default)" }), _jsx(CascadingSelect, { size: "lg", data: simpleHierarchyData, placeholder: "Large Cascading Select" })] })),
232
+ parameters: {
233
+ docs: {
234
+ source: {
235
+ code: false,
236
+ },
237
+ },
238
+ },
239
+ };
240
+ export const WithIcons = {
241
+ render: () => (_jsxs(Group, { gap: "2rem", children: [_jsx(CascadingSelect, { label: "Categories with Icons", data: categoryData, placeholder: "Select with icons" }), _jsx(CascadingSelect, { label: "Simple Hierarchy", data: simpleHierarchyData, placeholder: "Select without icons" })] })),
242
+ parameters: {
243
+ docs: {
244
+ source: {
245
+ code: false,
246
+ },
247
+ },
248
+ },
249
+ };
250
+ export const States = {
251
+ render: () => (_jsxs(Group, { gap: "2rem", children: [_jsx(CascadingSelect, { label: "Normal Cascading Select", data: simpleHierarchyData, placeholder: "Select option" }), _jsx(CascadingSelect, { label: "Disabled Cascading Select", data: simpleHierarchyData, placeholder: "Select option", disabled: true }), _jsx(CascadingSelect, { label: "Required Cascading Select", data: simpleHierarchyData, placeholder: "Select option", required: true }), _jsx(CascadingSelect, { label: "Cascading Select with Description", description: "Please choose an option from the hierarchy", data: simpleHierarchyData, placeholder: "Select option" }), _jsx(CascadingSelect, { label: "Cascading Select with Error", error: "This field is required", data: simpleHierarchyData, placeholder: "Select option" })] })),
252
+ parameters: {
253
+ docs: {
254
+ source: {
255
+ code: false,
256
+ },
257
+ },
258
+ },
259
+ };
260
+ export const WithFeatures = {
261
+ render: () => (_jsxs(Group, { gap: "2rem", children: [_jsx(CascadingSelect, { label: "Clearable Cascading Select", data: simpleHierarchyData, placeholder: "Select option", clearable: true, value: "level2a" }), _jsx(CascadingSelect, { label: "Searchable Cascading Select", data: categoryData, placeholder: "Search categories", searchable: true })] })),
262
+ parameters: {
263
+ docs: {
264
+ source: {
265
+ code: false,
266
+ },
267
+ },
268
+ },
269
+ };
270
+ export const FullWidth = {
271
+ render: () => (_jsx("div", { style: { width: '400px' }, children: _jsx(CascadingSelect, { label: "Full Width Cascading Select", data: simpleHierarchyData, placeholder: "Select option", fullWidth: true }) })),
272
+ parameters: {
273
+ docs: {
274
+ source: {
275
+ code: false,
276
+ },
277
+ },
278
+ },
279
+ };
280
+ export const DeepHierarchy = {
281
+ render: () => {
282
+ const deepData = [
283
+ {
284
+ option: { value: 'company', label: 'Company' },
285
+ icon: '🏢',
286
+ children: [
287
+ {
288
+ option: { value: 'departments', label: 'Departments' },
289
+ icon: '🏛️',
290
+ children: [
291
+ {
292
+ option: { value: 'engineering', label: 'Engineering' },
293
+ icon: '⚙️',
294
+ children: [
295
+ {
296
+ option: { value: 'frontend', label: 'Frontend' },
297
+ icon: '💻',
298
+ children: [
299
+ { option: { value: 'react', label: 'React Team' }, icon: '⚛️' },
300
+ { option: { value: 'vue', label: 'Vue Team' }, icon: '💚' },
301
+ ],
302
+ },
303
+ {
304
+ option: { value: 'backend', label: 'Backend' },
305
+ icon: '🔧',
306
+ children: [
307
+ { option: { value: 'node', label: 'Node.js Team' }, icon: '🟢' },
308
+ { option: { value: 'python', label: 'Python Team' }, icon: '🐍' },
309
+ ],
310
+ },
311
+ ],
312
+ },
313
+ ],
314
+ },
315
+ ],
316
+ },
317
+ ];
318
+ return _jsx(CascadingSelect, { label: "Deep Hierarchy Example", data: deepData, placeholder: "Navigate through company structure", searchable: true });
319
+ },
320
+ parameters: {
321
+ docs: {
322
+ source: {
323
+ code: false,
324
+ },
325
+ },
326
+ },
327
+ };
328
+ export const CustomStyles = {
329
+ render: () => (_jsxs(Group, { gap: "2rem", children: [_jsx(CascadingSelect, { label: "Custom Styled Cascading Select", data: simpleHierarchyData, placeholder: "Select option", styles: {
330
+ input: {
331
+ borderColor: '#ff6b6b',
332
+ '&:focus': {
333
+ borderColor: '#ff6b6b',
334
+ boxShadow: '0 0 0 2px rgba(255, 107, 107, 0.2)',
335
+ },
336
+ },
337
+ label: {
338
+ color: '#ff6b6b',
339
+ fontWeight: 600,
340
+ },
341
+ } }), _jsx(CascadingSelect, { label: "Another Custom Style", data: simpleHierarchyData, placeholder: "Select option", styles: {
342
+ input: {
343
+ backgroundColor: '#f8f9fa',
344
+ borderColor: '#4CAF50',
345
+ '&:focus': {
346
+ borderColor: '#4CAF50',
347
+ boxShadow: '0 0 0 2px rgba(76, 175, 80, 0.2)',
348
+ },
349
+ },
350
+ label: {
351
+ color: '#4CAF50',
352
+ fontSize: '16px',
353
+ },
354
+ } })] })),
355
+ parameters: {
356
+ docs: {
357
+ source: {
358
+ code: false,
359
+ },
360
+ },
361
+ },
362
+ };
@@ -0,0 +1,11 @@
1
+ import { SelectProps } from '../Select/Select';
2
+ import { SelectOption } from '../../../../utils/select';
3
+ export interface FontSelectProps extends Omit<SelectProps, 'value' | 'data'> {
4
+ data?: SelectOption[];
5
+ value?: string | null;
6
+ width?: string | number;
7
+ fullWidth?: boolean;
8
+ }
9
+ declare const FontSelect: ({ data, value, placeholder, size, width, fullWidth, styles, ...props }: FontSelectProps) => import("react/jsx-runtime").JSX.Element;
10
+ export { FontSelect };
11
+ //# sourceMappingURL=FontSelect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FontSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Dropdowns/FontSelect/FontSelect.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAU,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1E,IAAI,CAAC,EAAE,YAAY,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,QAAA,MAAM,UAAU,GAAI,wEAAyG,eAAe,4CAoD3I,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Box } from '@mantine/core';
3
+ import { neutral } from '../../../../constants/colors';
4
+ import { componentSizes } from '../shared/sizes';
5
+ import { Select } from '../Select/Select';
6
+ import Fonts from './font-options';
7
+ const FontSelect = ({ data, value, placeholder = 'Select a font', size = 'md', width, fullWidth = false, styles, ...props }) => {
8
+ const selectedSize = componentSizes[size];
9
+ const computedWidth = fullWidth ? '100%' : width || `${selectedSize.minWidth}rem`;
10
+ const DropdownItem = ({ value, label, ...others }) => (_jsx(Box, { title: label, children: _jsx("div", { style: {
11
+ fontFamily: value,
12
+ fontSize: selectedSize.fontSize,
13
+ color: neutral[200],
14
+ padding: selectedSize.dropdownPadding,
15
+ borderRadius: '0.5rem',
16
+ transition: 'background-color 200ms ease-in-out',
17
+ }, ...others, children: label }) }));
18
+ const style = {
19
+ input: {
20
+ fontFamily: value || 'Poppins, sans-serif',
21
+ color: neutral[200],
22
+ border: `1px solid ${neutral[100]}`,
23
+ borderRadius: '8px',
24
+ transition: 'all 200ms ease-in-out',
25
+ height: `${selectedSize.height}rem`,
26
+ fontSize: selectedSize.fontSize,
27
+ padding: selectedSize.inputPadding,
28
+ },
29
+ item: {
30
+ fontFamily: 'Poppins, sans-serif',
31
+ color: neutral[200],
32
+ borderRadius: '8px',
33
+ transition: 'background-color 200ms ease-in-out',
34
+ padding: selectedSize.dropdownPadding,
35
+ fontSize: selectedSize.fontSize,
36
+ '&[data-selected]': {
37
+ backgroundColor: neutral[50],
38
+ color: neutral[200],
39
+ },
40
+ '&[data-hovered]': {
41
+ backgroundColor: neutral[50],
42
+ },
43
+ ...styles,
44
+ },
45
+ };
46
+ return _jsx(Select, { placeholder: placeholder, width: computedWidth, value: value, size: size, styles: style, itemComponent: DropdownItem, data: data || Fonts.FONTS, ...props });
47
+ };
48
+ export { FontSelect };
@@ -0,0 +1,12 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { FontSelect } from './FontSelect';
3
+ declare const meta: Meta<typeof FontSelect>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof meta>;
6
+ export declare const Default: Story;
7
+ export declare const Variants: Story;
8
+ export declare const Sizes: Story;
9
+ export declare const States: Story;
10
+ export declare const AdditionalFunctionality: Story;
11
+ export declare const CustomStyling: Story;
12
+ //# sourceMappingURL=FontSelect.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FontSelect.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Dropdowns/FontSelect/FontSelect.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CA2GjC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KA0BrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAsBtB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAenB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAiBpB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,KAcrC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KA6C3B,CAAC"}
@@ -0,0 +1,215 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { FontSelect } from './FontSelect';
3
+ import { Group } from '../../../Layout/Group/Group';
4
+ const meta = {
5
+ title: 'Components/Inputs/Dropdowns/FontSelect',
6
+ component: FontSelect,
7
+ parameters: {
8
+ layout: 'centered',
9
+ },
10
+ argTypes: {
11
+ size: {
12
+ control: { type: 'select' },
13
+ options: ['sm', 'md', 'lg'],
14
+ description: 'Controls the font select size',
15
+ table: {
16
+ type: { summary: "'sm' | 'md' | 'lg'" },
17
+ defaultValue: { summary: "'md'" },
18
+ },
19
+ },
20
+ placeholder: {
21
+ control: { type: 'text' },
22
+ description: 'Placeholder text',
23
+ table: {
24
+ type: { summary: 'string' },
25
+ defaultValue: { summary: "'Select a font'" },
26
+ },
27
+ },
28
+ label: {
29
+ control: { type: 'text' },
30
+ description: 'Font select label',
31
+ table: {
32
+ type: { summary: 'string' },
33
+ },
34
+ },
35
+ description: {
36
+ control: { type: 'text' },
37
+ description: 'Description text',
38
+ table: {
39
+ type: { summary: 'string' },
40
+ },
41
+ },
42
+ error: {
43
+ control: { type: 'text' },
44
+ description: 'Error message',
45
+ table: {
46
+ type: { summary: 'string' },
47
+ },
48
+ },
49
+ disabled: {
50
+ control: { type: 'boolean' },
51
+ description: 'Disabled state',
52
+ table: {
53
+ type: { summary: 'boolean' },
54
+ defaultValue: { summary: 'false' },
55
+ },
56
+ },
57
+ required: {
58
+ control: { type: 'boolean' },
59
+ description: 'Required field',
60
+ table: {
61
+ type: { summary: 'boolean' },
62
+ defaultValue: { summary: 'false' },
63
+ },
64
+ },
65
+ fullWidth: {
66
+ control: { type: 'boolean' },
67
+ description: 'Full width of container',
68
+ table: {
69
+ type: { summary: 'boolean' },
70
+ defaultValue: { summary: 'false' },
71
+ },
72
+ },
73
+ width: {
74
+ control: { type: 'text' },
75
+ description: 'Custom width',
76
+ table: {
77
+ type: { summary: 'string | number' },
78
+ },
79
+ },
80
+ clearable: {
81
+ control: { type: 'boolean' },
82
+ description: 'Allow clearing selection',
83
+ table: {
84
+ type: { summary: 'boolean' },
85
+ defaultValue: { summary: 'false' },
86
+ },
87
+ },
88
+ searchable: {
89
+ control: { type: 'boolean' },
90
+ description: 'Allow searching fonts',
91
+ table: {
92
+ type: { summary: 'boolean' },
93
+ defaultValue: { summary: 'false' },
94
+ },
95
+ },
96
+ styles: {
97
+ control: { type: 'object' },
98
+ description: 'Custom styles object',
99
+ table: {
100
+ type: { summary: 'Record<string, CSSObject>' },
101
+ },
102
+ },
103
+ onChange: {
104
+ action: 'changed',
105
+ description: 'Change handler function',
106
+ table: {
107
+ type: { summary: '(value: string | null) => void' },
108
+ },
109
+ },
110
+ },
111
+ };
112
+ export default meta;
113
+ export const Default = {
114
+ args: {
115
+ size: 'md',
116
+ disabled: false,
117
+ required: false,
118
+ fullWidth: false,
119
+ clearable: false,
120
+ searchable: false,
121
+ },
122
+ decorators: [
123
+ (Story) => (_jsx("div", { style: { height: '220px' }, children: _jsx(Story, {}) })),
124
+ ],
125
+ parameters: {
126
+ docs: {
127
+ source: {
128
+ code: `<FontSelect
129
+ value={selectedFont}
130
+ onChange={(value) => setSelectedFont(value)}
131
+ />`,
132
+ },
133
+ },
134
+ },
135
+ };
136
+ export const Variants = {
137
+ render: () => (_jsxs(Group, { gap: "2rem", children: [_jsx(FontSelect, { label: "Default Font Select" }), _jsx(FontSelect, { label: "With Custom Data", data: [
138
+ { value: 'Arial', label: 'Arial' },
139
+ { value: 'Helvetica', label: 'Helvetica' },
140
+ { value: 'Times New Roman', label: 'Times New Roman' },
141
+ { value: 'Georgia', label: 'Georgia' },
142
+ ] })] })),
143
+ parameters: {
144
+ docs: {
145
+ source: {
146
+ code: false,
147
+ },
148
+ },
149
+ },
150
+ };
151
+ export const Sizes = {
152
+ render: () => (_jsxs(Group, { gap: "2rem", children: [_jsx(FontSelect, { size: "sm" }), _jsx(FontSelect, { size: "md" }), _jsx(FontSelect, { size: "lg" })] })),
153
+ parameters: {
154
+ docs: {
155
+ source: {
156
+ code: false,
157
+ },
158
+ },
159
+ },
160
+ };
161
+ export const States = {
162
+ render: () => (_jsxs(Group, { gap: "2rem", children: [_jsx(FontSelect, { label: "Normal Font Select" }), _jsx(FontSelect, { label: "Disabled Font Select", disabled: true }), _jsx(FontSelect, { label: "Required Font Select", required: true }), _jsx(FontSelect, { label: "Font Select with Description", description: "Choose your preferred font" }), _jsx(FontSelect, { label: "Font Select with Error", error: "Please select a font" })] })),
163
+ parameters: {
164
+ docs: {
165
+ source: {
166
+ code: false,
167
+ },
168
+ },
169
+ },
170
+ };
171
+ export const AdditionalFunctionality = {
172
+ render: () => (_jsxs(Group, { gap: "2rem", children: [_jsx(FontSelect, { label: "Clearable Font Select", clearable: true, value: "Poppins" }), _jsx(FontSelect, { label: "Searchable Font Select", searchable: true })] })),
173
+ parameters: {
174
+ docs: {
175
+ source: {
176
+ code: false,
177
+ },
178
+ },
179
+ },
180
+ };
181
+ export const CustomStyling = {
182
+ render: () => (_jsxs(Group, { gap: "2rem", children: [_jsx(FontSelect, { label: "Custom Styled Font Select", styles: {
183
+ input: {
184
+ borderColor: '#ff6b6b',
185
+ '&:focus': {
186
+ borderColor: '#ff6b6b',
187
+ boxShadow: '0 0 0 2px rgba(255, 107, 107, 0.2)',
188
+ },
189
+ },
190
+ label: {
191
+ color: '#ff6b6b',
192
+ fontWeight: 600,
193
+ },
194
+ } }), _jsx(FontSelect, { label: "Another Custom Style", styles: {
195
+ input: {
196
+ backgroundColor: '#f8f9fa',
197
+ borderColor: '#4CAF50',
198
+ '&:focus': {
199
+ borderColor: '#4CAF50',
200
+ boxShadow: '0 0 0 2px rgba(76, 175, 80, 0.2)',
201
+ },
202
+ },
203
+ label: {
204
+ color: '#4CAF50',
205
+ fontSize: '16px',
206
+ },
207
+ } })] })),
208
+ parameters: {
209
+ docs: {
210
+ source: {
211
+ code: false,
212
+ },
213
+ },
214
+ },
215
+ };
@@ -0,0 +1,9 @@
1
+ import { SelectOption } from '../../../../utils/select';
2
+ export declare const FONTS: SelectOption[];
3
+ export declare const FONT_SIZES: SelectOption[];
4
+ declare const _default: {
5
+ FONTS: SelectOption[];
6
+ FONT_SIZES: SelectOption[];
7
+ };
8
+ export default _default;
9
+ //# sourceMappingURL=font-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"font-options.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Dropdowns/FontSelect/font-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,eAAO,MAAM,KAAK,EAAE,YAAY,EAoC/B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,YAAY,EA0BpC,CAAC;;;;;AAEF,wBAAqC"}