@taiv/ui 1.7.0 → 1.9.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 (48) hide show
  1. package/dist/components/Inputs/Buttons/Button/Button.d.ts +2 -2
  2. package/dist/components/Inputs/Buttons/Button/Button.d.ts.map +1 -1
  3. package/dist/components/Inputs/Buttons/Button/Button.js +3 -3
  4. package/dist/components/Inputs/Buttons/Button/Button.stories.d.ts.map +1 -1
  5. package/dist/components/Inputs/Buttons/Button/Button.stories.js +10 -1
  6. package/dist/components/Inputs/Buttons/IconButton/IconButton.d.ts +18 -0
  7. package/dist/components/Inputs/Buttons/IconButton/IconButton.d.ts.map +1 -0
  8. package/dist/components/Inputs/Buttons/IconButton/IconButton.js +34 -0
  9. package/dist/components/Inputs/Buttons/IconButton/IconButton.stories.d.ts +14 -0
  10. package/dist/components/Inputs/Buttons/IconButton/IconButton.stories.d.ts.map +1 -0
  11. package/dist/components/Inputs/Buttons/IconButton/IconButton.stories.js +180 -0
  12. package/dist/components/Inputs/Buttons/IconButton/sizes.d.ts +19 -0
  13. package/dist/components/Inputs/Buttons/IconButton/sizes.d.ts.map +1 -0
  14. package/dist/components/Inputs/Buttons/IconButton/sizes.js +6 -0
  15. package/dist/components/Inputs/Buttons/shared/variants.d.ts +382 -0
  16. package/dist/components/Inputs/Buttons/shared/variants.d.ts.map +1 -0
  17. package/dist/components/Inputs/Buttons/{Button → shared}/variants.js +58 -1
  18. package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.d.ts.map +1 -1
  19. package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.js +8 -1
  20. package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.d.ts +12 -0
  21. package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.d.ts.map +1 -0
  22. package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.js +63 -0
  23. package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.stories.d.ts +12 -0
  24. package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.stories.d.ts.map +1 -0
  25. package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.stories.js +245 -0
  26. package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.d.ts.map +1 -1
  27. package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.js +14 -1
  28. package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.d.ts.map +1 -1
  29. package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.js +8 -1
  30. package/dist/components/Inputs/TextInputs/TextArea/TextArea.d.ts.map +1 -1
  31. package/dist/components/Inputs/TextInputs/TextArea/TextArea.js +9 -1
  32. package/dist/components/Inputs/TextInputs/TextInput/TextInput.d.ts.map +1 -1
  33. package/dist/components/Inputs/TextInputs/TextInput/TextInput.js +9 -1
  34. package/dist/components/Layout/Table/Table.d.ts +15 -0
  35. package/dist/components/Layout/Table/Table.d.ts.map +1 -0
  36. package/dist/components/Layout/Table/Table.js +48 -0
  37. package/dist/components/Layout/Table/Table.stories.d.ts +10 -0
  38. package/dist/components/Layout/Table/Table.stories.d.ts.map +1 -0
  39. package/dist/components/Layout/Table/Table.stories.js +257 -0
  40. package/dist/components/index.d.ts +4 -0
  41. package/dist/components/index.d.ts.map +1 -1
  42. package/dist/components/index.js +3 -0
  43. package/dist/constants/colors.d.ts +2 -0
  44. package/dist/constants/colors.d.ts.map +1 -1
  45. package/dist/constants/colors.js +2 -0
  46. package/package.json +5 -1
  47. package/dist/components/Inputs/Buttons/Button/variants.d.ts +0 -191
  48. package/dist/components/Inputs/Buttons/Button/variants.d.ts.map +0 -1
@@ -0,0 +1,245 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { NumberInput } from './NumberInput';
3
+ import { Group } from '../../../Layout/Group/Group';
4
+ const meta = {
5
+ title: 'Components/Inputs/TextInputs/NumberInput',
6
+ component: NumberInput,
7
+ parameters: {
8
+ layout: 'centered',
9
+ },
10
+ argTypes: {
11
+ size: {
12
+ control: { type: 'select' },
13
+ options: ['sm', 'md', 'lg'],
14
+ description: 'Controls the number input 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
+ },
26
+ },
27
+ label: {
28
+ control: { type: 'text' },
29
+ description: 'Number input label',
30
+ table: {
31
+ type: { summary: 'string' },
32
+ },
33
+ },
34
+ description: {
35
+ control: { type: 'text' },
36
+ description: 'Description text',
37
+ table: {
38
+ type: { summary: 'string' },
39
+ },
40
+ },
41
+ error: {
42
+ control: { type: 'text' },
43
+ description: 'Error message',
44
+ table: {
45
+ type: { summary: 'string' },
46
+ },
47
+ },
48
+ disabled: {
49
+ control: { type: 'boolean' },
50
+ description: 'Disabled state',
51
+ table: {
52
+ type: { summary: 'boolean' },
53
+ defaultValue: { summary: 'false' },
54
+ },
55
+ },
56
+ required: {
57
+ control: { type: 'boolean' },
58
+ description: 'Required field',
59
+ table: {
60
+ type: { summary: 'boolean' },
61
+ defaultValue: { summary: 'false' },
62
+ },
63
+ },
64
+ fullWidth: {
65
+ control: { type: 'boolean' },
66
+ description: 'Full width of container',
67
+ table: {
68
+ type: { summary: 'boolean' },
69
+ defaultValue: { summary: 'false' },
70
+ },
71
+ },
72
+ width: {
73
+ control: { type: 'text' },
74
+ description: 'Custom width',
75
+ table: {
76
+ type: { summary: 'string | number' },
77
+ },
78
+ },
79
+ min: {
80
+ control: { type: 'number' },
81
+ description: 'Minimum value',
82
+ table: {
83
+ type: { summary: 'number' },
84
+ },
85
+ },
86
+ max: {
87
+ control: { type: 'number' },
88
+ description: 'Maximum value',
89
+ table: {
90
+ type: { summary: 'number' },
91
+ },
92
+ },
93
+ step: {
94
+ control: { type: 'number' },
95
+ description: 'Step value for increment/decrement',
96
+ table: {
97
+ type: { summary: 'number' },
98
+ defaultValue: { summary: '1' },
99
+ },
100
+ },
101
+ precision: {
102
+ control: { type: 'number' },
103
+ description: 'Number of decimal places',
104
+ table: {
105
+ type: { summary: 'number' },
106
+ },
107
+ },
108
+ styles: {
109
+ control: { type: 'object' },
110
+ description: 'Custom styles object',
111
+ table: {
112
+ type: { summary: 'Record<string, CSSObject>' },
113
+ },
114
+ },
115
+ onChange: {
116
+ action: 'changed',
117
+ description: 'Change handler function',
118
+ table: {
119
+ type: { summary: '(value: number | string) => void' },
120
+ },
121
+ },
122
+ },
123
+ };
124
+ export default meta;
125
+ export const Default = {
126
+ args: {
127
+ label: 'Age',
128
+ placeholder: 'Enter your age',
129
+ size: 'md',
130
+ disabled: false,
131
+ required: false,
132
+ fullWidth: false,
133
+ step: 1,
134
+ min: 0,
135
+ max: 120,
136
+ },
137
+ parameters: {
138
+ docs: {
139
+ source: {
140
+ code: `<NumberInput
141
+ label="Age"
142
+ placeholder="Enter your age"
143
+ min={0}
144
+ max={120}
145
+ step={1}
146
+ value={age}
147
+ onChange={setAge}
148
+ />`,
149
+ },
150
+ },
151
+ },
152
+ };
153
+ export const Variants = {
154
+ render: () => (_jsxs(Group, { gap: "2rem", children: [_jsx(NumberInput, { label: "Basic Number Input" }), _jsx(NumberInput, { label: "With Placeholder", placeholder: "Enter a value" }), _jsx(NumberInput, { label: "With Description", description: "Enter a value between 0 and 100", min: 0, max: 100 })] })),
155
+ parameters: {
156
+ docs: {
157
+ source: {
158
+ code: false,
159
+ },
160
+ },
161
+ },
162
+ };
163
+ export const Sizes = {
164
+ render: () => (_jsxs(Group, { gap: "2rem", children: [_jsx(NumberInput, { size: "sm", label: "Small Number Input", placeholder: "Small value" }), _jsx(NumberInput, { size: "md", label: "Medium Number Input (Default)", placeholder: "Medium value" }), _jsx(NumberInput, { size: "lg", label: "Large Number Input", placeholder: "Large value" })] })),
165
+ parameters: {
166
+ docs: {
167
+ source: {
168
+ code: `<NumberInput size="sm" label="Small Number Input" placeholder="Small value" />
169
+ <NumberInput size="lg" label="Large Number Input" placeholder="Large value" />`,
170
+ },
171
+ },
172
+ },
173
+ };
174
+ export const States = {
175
+ render: () => (_jsxs(Group, { gap: "2rem", children: [_jsx(NumberInput, { label: "Normal Number Input" }), _jsx(NumberInput, { label: "Disabled Number Input", disabled: true }), _jsx(NumberInput, { label: "Required Number Input", required: true }), _jsx(NumberInput, { label: "Number Input with Description", description: "Please enter a numeric value" }), _jsx(NumberInput, { label: "Number Input with Error", error: "Value is required" })] })),
176
+ parameters: {
177
+ docs: {
178
+ source: {
179
+ code: false,
180
+ },
181
+ },
182
+ },
183
+ };
184
+ export const AdditionalFunctionality = {
185
+ render: () => (_jsxs(Group, { gap: "2rem", children: [_jsx(NumberInput, { label: "Step of 1", placeholder: "Integer values", step: 1 }), _jsx(NumberInput, { label: "Step of 0.5", placeholder: "Decimal values", step: 0.5, precision: 1 }), _jsx(NumberInput, { label: "With Min/Max", placeholder: "Between 0 and 10", min: 0, max: 10, step: 1 }), _jsx(NumberInput, { label: "Custom Width", placeholder: "Custom width", width: "300rem" })] })),
186
+ parameters: {
187
+ docs: {
188
+ source: {
189
+ code: `<NumberInput
190
+ label="Step of 0.5"
191
+ placeholder="Decimal values"
192
+ step={0.5}
193
+ precision={1}
194
+ value={amount}
195
+ onChange={setAmount}
196
+ />
197
+
198
+ <NumberInput
199
+ label="With Min/Max"
200
+ placeholder="Between 0 and 10"
201
+ min={0}
202
+ max={10}
203
+ step={1}
204
+ value={count}
205
+ onChange={setCount}
206
+ />`,
207
+ },
208
+ },
209
+ },
210
+ };
211
+ export const CustomStyling = {
212
+ render: () => (_jsxs(Group, { gap: "2rem", children: [_jsx(NumberInput, { label: "Custom Styled Number Input", styles: {
213
+ input: {
214
+ borderColor: '#ff6b6b',
215
+ '&:focus': {
216
+ borderColor: '#ff6b6b',
217
+ boxShadow: '0 0 0 2px rgba(255, 107, 107, 0.2)',
218
+ },
219
+ },
220
+ label: {
221
+ color: '#ff6b6b',
222
+ fontWeight: 600,
223
+ },
224
+ } }), _jsx(NumberInput, { label: "Another Custom Style", styles: {
225
+ input: {
226
+ backgroundColor: '#f8f9fa',
227
+ borderColor: '#4CAF50',
228
+ '&:focus': {
229
+ borderColor: '#4CAF50',
230
+ boxShadow: '0 0 0 2px rgba(76, 175, 80, 0.2)',
231
+ },
232
+ },
233
+ label: {
234
+ color: '#4CAF50',
235
+ fontSize: '16px',
236
+ },
237
+ } })] })),
238
+ parameters: {
239
+ docs: {
240
+ source: {
241
+ code: false,
242
+ },
243
+ },
244
+ },
245
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/TextInputs/PasswordInput/PasswordInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyC,kBAAkB,IAAI,yBAAyB,EAAE,MAAM,eAAe,CAAC;AACvH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AASjD,KAAK,kBAAkB,GAAG,yBAAyB,GAAG;IACpD,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpC,CAAC;AAEF,QAAA,MAAM,aAAa,GAAI,2DAA6F,kBAAkB,4CAyCrI,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"PasswordInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/TextInputs/PasswordInput/PasswordInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyC,kBAAkB,IAAI,yBAAyB,EAAE,MAAM,eAAe,CAAC;AACvH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AASjD,KAAK,kBAAkB,GAAG,yBAAyB,GAAG;IACpD,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpC,CAAC;AAEF,QAAA,MAAM,aAAa,GAAI,2DAA6F,kBAAkB,4CAsDrI,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { PasswordInput as MantinePasswordInput } from '@mantine/core';
3
- import { neutral } from '../../../../constants/colors';
3
+ import { neutral, red } from '../../../../constants/colors';
4
4
  import { fontBase } from '../../../../constants/font';
5
5
  import { componentSizes } from '../shared/sizes';
6
6
  // Workaround for Icon sizing since we dont have a Provider setup
@@ -21,6 +21,12 @@ const PasswordInput = ({ size = 'md', width, fullWidth = false, styles, placehol
21
21
  height: `${selectedSize.height}rem`,
22
22
  fontSize: selectedSize.fontSize,
23
23
  padding: '0 1rem',
24
+ '&[data-invalid]': {
25
+ borderColor: red[200],
26
+ '&::placeholder': {
27
+ color: red[200],
28
+ },
29
+ },
24
30
  },
25
31
  label: {
26
32
  ...fontBase,
@@ -30,6 +36,7 @@ const PasswordInput = ({ size = 'md', width, fullWidth = false, styles, placehol
30
36
  error: {
31
37
  ...fontBase,
32
38
  fontSize: `calc(${selectedSize.fontSize} - 0.05rem)`,
39
+ color: red[200],
33
40
  },
34
41
  innerInput: {
35
42
  ...fontBase,
@@ -37,6 +44,12 @@ const PasswordInput = ({ size = 'md', width, fullWidth = false, styles, placehol
37
44
  height: `${selectedSize.height}rem`,
38
45
  fontSize: selectedSize.fontSize,
39
46
  padding: '0 1rem',
47
+ '&[data-invalid]': {
48
+ color: neutral[200],
49
+ '&::placeholder': {
50
+ color: red[200],
51
+ },
52
+ },
40
53
  },
41
54
  visibilityToggle: {
42
55
  color: neutral[200],
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/TextInputs/SearchBar/SearchBar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAM/C,UAAU,cAAe,SAAQ,cAAc;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,QAAA,MAAM,SAAS,GAAI,8CAA6D,cAAc,4CA4B7F,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"SearchBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/TextInputs/SearchBar/SearchBar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAM/C,UAAU,cAAe,SAAQ,cAAc;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,QAAA,MAAM,SAAS,GAAI,8CAA6D,cAAc,4CAmC7F,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { TextInput } from '../TextInput/TextInput';
3
- import { neutral } from '../../../../constants/colors';
3
+ import { neutral, red } from '../../../../constants/colors';
4
4
  import { fontBase } from '../../../../constants/font';
5
5
  import { componentSizes } from '../shared/sizes';
6
6
  const SearchBar = ({ width, fullWidth = false, size = 'md', styles, ...props }) => {
@@ -15,6 +15,13 @@ const SearchBar = ({ width, fullWidth = false, size = 'md', styles, ...props })
15
15
  borderRadius: '8px',
16
16
  height: `${selectedSize.height}rem`,
17
17
  transition: 'all 200ms ease-in-out',
18
+ '&[data-invalid]': {
19
+ borderColor: red[200],
20
+ color: neutral[200],
21
+ '&::placeholder': {
22
+ color: red[200],
23
+ },
24
+ },
18
25
  },
19
26
  ...styles,
20
27
  };
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/TextInputs/TextArea/TextArea.tsx"],"names":[],"mappings":"AACA,OAAO,EAA+B,aAAa,IAAI,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,KAAK,aAAa,GAAG,oBAAoB,GAAG;IAC1C,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpC,CAAC;AAEF,QAAA,MAAM,QAAQ,GAAI,8CAA6D,aAAa,4CA4B3F,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/TextInputs/TextArea/TextArea.tsx"],"names":[],"mappings":"AACA,OAAO,EAA+B,aAAa,IAAI,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,KAAK,aAAa,GAAG,oBAAoB,GAAG;IAC1C,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpC,CAAC;AAEF,QAAA,MAAM,QAAQ,GAAI,8CAA6D,aAAa,4CAoC3F,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Textarea as MantineTextarea } from '@mantine/core';
3
- import { neutral } from '../../../../constants/colors';
3
+ import { neutral, red } from '../../../../constants/colors';
4
4
  import { fontBase } from '../../../../constants/font';
5
5
  import { componentSizes } from '../shared/sizes';
6
6
  const TextArea = ({ size = 'md', width, fullWidth = false, styles, ...props }) => {
@@ -16,6 +16,13 @@ const TextArea = ({ size = 'md', width, fullWidth = false, styles, ...props }) =
16
16
  transition: 'all 200ms ease-in-out',
17
17
  borderRadius: '8px',
18
18
  resize: 'vertical',
19
+ '&[data-invalid]': {
20
+ borderColor: red[200],
21
+ color: neutral[200],
22
+ '&::placeholder': {
23
+ color: red[200],
24
+ },
25
+ },
19
26
  },
20
27
  label: {
21
28
  ...fontBase,
@@ -25,6 +32,7 @@ const TextArea = ({ size = 'md', width, fullWidth = false, styles, ...props }) =
25
32
  error: {
26
33
  ...fontBase,
27
34
  fontSize: `calc(${selectedSize.fontSize} - 0.05rem)`,
35
+ color: red[200],
28
36
  },
29
37
  ...styles,
30
38
  };
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/TextInputs/TextInput/TextInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiC,cAAc,IAAI,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,KAAK,cAAc,GAAG,qBAAqB,GAAG;IAC5C,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpC,CAAC;AAEF,QAAA,MAAM,SAAS,GAAI,8CAA6D,cAAc,4CA2B7F,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/TextInputs/TextInput/TextInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiC,cAAc,IAAI,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,KAAK,cAAc,GAAG,qBAAqB,GAAG;IAC5C,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpC,CAAC;AAEF,QAAA,MAAM,SAAS,GAAI,8CAA6D,cAAc,4CAmC7F,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { TextInput as MantineTextInput } from '@mantine/core';
3
- import { neutral } from '../../../../constants/colors';
3
+ import { neutral, red } from '../../../../constants/colors';
4
4
  import { fontBase } from '../../../../constants/font';
5
5
  import { componentSizes } from '../shared/sizes';
6
6
  const TextInput = ({ size = 'md', width, fullWidth = false, styles, ...props }) => {
@@ -15,6 +15,13 @@ const TextInput = ({ size = 'md', width, fullWidth = false, styles, ...props })
15
15
  color: neutral[200],
16
16
  transition: 'all 200ms ease-in-out',
17
17
  borderRadius: '8px',
18
+ '&[data-invalid]': {
19
+ borderColor: red[200],
20
+ color: neutral[200],
21
+ '&::placeholder': {
22
+ color: red[200],
23
+ },
24
+ },
18
25
  },
19
26
  label: {
20
27
  ...fontBase,
@@ -24,6 +31,7 @@ const TextInput = ({ size = 'md', width, fullWidth = false, styles, ...props })
24
31
  error: {
25
32
  ...fontBase,
26
33
  fontSize: `calc(${selectedSize.fontSize} - 0.05rem)`,
34
+ color: red[200]
27
35
  },
28
36
  ...styles,
29
37
  };
@@ -0,0 +1,15 @@
1
+ import React, { CSSProperties } from 'react';
2
+ interface ColumnConfig {
3
+ heading?: string;
4
+ style?: CSSProperties;
5
+ }
6
+ interface TableProps<T> {
7
+ columnConfigs: ColumnConfig[];
8
+ data: T[];
9
+ ListItem: React.ComponentType<{
10
+ data: T;
11
+ }>;
12
+ }
13
+ declare const Table: <T>({ columnConfigs, data, ListItem }: TableProps<T>) => import("react/jsx-runtime").JSX.Element;
14
+ export { Table, type ColumnConfig, type TableProps };
15
+ //# sourceMappingURL=Table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAqB,MAAM,OAAO,CAAC;AAIhE,UAAU,YAAY;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,UAAU,UAAU,CAAC,CAAC;IACpB,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,CAAC,CAAC;CAC5C;AAED,QAAA,MAAM,KAAK,GAAI,CAAC,EAAG,mCAAmC,UAAU,CAAC,CAAC,CAAC,4CAsElE,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useRef } from 'react';
3
+ import { Box } from '../Box/Box';
4
+ import { fontWeight, neutral } from '../../../constants';
5
+ const Table = ({ columnConfigs, data, ListItem }) => {
6
+ const tableRef = useRef(null);
7
+ /**
8
+ * Apply column styles to the table cells.
9
+ */
10
+ useEffect(() => {
11
+ const table = tableRef.current;
12
+ if (!table)
13
+ return;
14
+ const tbody = table.querySelector('tbody');
15
+ if (!tbody)
16
+ return;
17
+ const rows = tbody.querySelectorAll('tr');
18
+ if (!rows || !rows.length)
19
+ return;
20
+ rows.forEach((row) => {
21
+ const cells = row.querySelectorAll('td');
22
+ cells.forEach((cell, columnIndex) => {
23
+ var _a;
24
+ const columnStyle = (_a = columnConfigs[columnIndex]) === null || _a === void 0 ? void 0 : _a.style;
25
+ if (columnStyle) {
26
+ Object.assign(cell.style, columnStyle);
27
+ }
28
+ });
29
+ });
30
+ }, [columnConfigs, data]);
31
+ return (_jsx(Box, { sx: {
32
+ borderTopLeftRadius: '8px',
33
+ borderTopRightRadius: '8px',
34
+ boxShadow: '0px 2px 6px -3px #AFAFAF',
35
+ overflow: 'hidden',
36
+ }, children: _jsxs("table", { ref: tableRef, style: {
37
+ width: '100%',
38
+ }, children: [_jsx("thead", { children: _jsx("tr", { children: columnConfigs.map((column, index) => (_jsx("th", { style: {
39
+ backgroundColor: neutral[50],
40
+ color: neutral[300],
41
+ fontSize: '14px',
42
+ fontWeight: fontWeight.bold,
43
+ paddingBottom: '9px',
44
+ paddingTop: '9px',
45
+ ...column.style,
46
+ }, children: column.heading }, column.heading || `column-${index}`))) }) }), _jsx("tbody", { children: data.map((item) => (_jsx(ListItem, { data: item }, String(item).slice(0, 10)))) })] }) }));
47
+ };
48
+ export { Table };
@@ -0,0 +1,10 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { Table } from './Table';
3
+ declare const meta: Meta<typeof Table>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof meta>;
6
+ export declare const BasicTable: Story;
7
+ export declare const TableWithCustomComponents: Story;
8
+ export declare const TableWithProgressBars: Story;
9
+ export declare const StyledColumns: Story;
10
+ //# sourceMappingURL=Table.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Table.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Table/Table.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAKhC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,KAAK,CAiB5B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAyPnC,eAAO,MAAM,UAAU,EAAE,KAmBxB,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KAqBvC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,KAoBnC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAmB3B,CAAC"}