pixel-react 1.0.5 → 1.0.7

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 (95) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/lib/StyleGuide/ColorPalette/types.d.ts +2 -0
  3. package/lib/assets/utils/functionUtils.d.ts +3 -0
  4. package/lib/components/DatePicker/DatePicker.d.ts +5 -0
  5. package/lib/components/DatePicker/DatePicker.stories.d.ts +9 -0
  6. package/lib/components/DatePicker/Timepicker.d.ts +4 -0
  7. package/lib/components/DatePicker/index.d.ts +1 -0
  8. package/lib/components/DatePicker/types.d.ts +81 -0
  9. package/lib/components/DragAndDrop/DragAndDrop.d.ts +9 -0
  10. package/lib/components/DragAndDrop/DragAndDrop.stories.d.ts +6 -0
  11. package/lib/components/DragAndDrop/DragAndDropList.d.ts +20 -0
  12. package/lib/components/DragAndDrop/index.d.ts +1 -0
  13. package/lib/components/Drawer/Drawer.d.ts +2 -1
  14. package/lib/components/IconButton/IconButton.d.ts +5 -0
  15. package/lib/components/IconButton/IconButton.stories.d.ts +6 -0
  16. package/lib/components/IconButton/index.d.ts +1 -0
  17. package/lib/components/{AddButton → IconButton}/types.d.ts +3 -2
  18. package/lib/components/InputWithDropdown/InputWithDropdown.d.ts +1 -1
  19. package/lib/components/InputWithDropdown/types.d.ts +3 -7
  20. package/lib/components/Modal/Modal.d.ts +5 -0
  21. package/lib/components/Modal/Modal.stories.d.ts +7 -0
  22. package/lib/components/Modal/index.d.ts +1 -0
  23. package/lib/components/Modal/types.d.ts +26 -0
  24. package/lib/components/TableTree/TableTree.d.ts +2 -2
  25. package/lib/components/ThemeProvider/CustomThemeProvider.d.ts +8 -0
  26. package/lib/hooks/useCustomThemeProvider.d.ts +11 -0
  27. package/lib/index.d.ts +76 -16
  28. package/lib/index.esm.js +13365 -414
  29. package/lib/index.esm.js.map +1 -1
  30. package/lib/index.js +13368 -415
  31. package/lib/index.js.map +1 -1
  32. package/lib/tsconfig.tsbuildinfo +1 -1
  33. package/package.json +28 -23
  34. package/src/StyleGuide/ColorPalette/ColorPalette.scss +5 -0
  35. package/src/StyleGuide/ColorPalette/ColorPalette.tsx +10 -1
  36. package/src/StyleGuide/ColorPalette/colorPaletteList.ts +2 -2
  37. package/src/StyleGuide/ColorPalette/types.ts +2 -0
  38. package/src/assets/Themes/BaseTheme.scss +9 -1
  39. package/src/assets/Themes/DarkTheme.scss +8 -1
  40. package/src/assets/icons/add_variable_icon.svg +5 -0
  41. package/src/assets/icons/calendar_icon.svg +9 -0
  42. package/src/assets/icons/clock_icon.svg +11 -0
  43. package/src/assets/icons/collapse-icon.svg +6 -0
  44. package/src/assets/icons/copy-icon.svg +3 -0
  45. package/src/assets/icons/download-icon.svg +3 -0
  46. package/src/assets/icons/expand-icon.svg +6 -0
  47. package/src/assets/icons/info_icon.svg +4 -0
  48. package/src/assets/icons/left_arrow_icon.svg +3 -0
  49. package/src/assets/icons/license_info.svg +28 -0
  50. package/src/assets/icons/license_warning.svg +10 -0
  51. package/src/assets/icons/refresh-icon.svg +4 -0
  52. package/src/assets/icons/right_arrow_icon.svg +4 -0
  53. package/src/assets/styles/_mixins.scss +1 -0
  54. package/src/assets/utils/functionUtils.ts +37 -0
  55. package/src/components/DatePicker/DatePicker.scss +387 -0
  56. package/src/components/DatePicker/DatePicker.stories.tsx +161 -0
  57. package/src/components/DatePicker/DatePicker.tsx +438 -0
  58. package/src/components/DatePicker/Timepicker.tsx +372 -0
  59. package/src/components/DatePicker/index.ts +1 -0
  60. package/src/components/DatePicker/types.ts +100 -0
  61. package/src/components/DragAndDrop/DragAndDrop.d.ts +5 -0
  62. package/src/components/DragAndDrop/DragAndDrop.stories.tsx +25 -0
  63. package/src/components/DragAndDrop/DragAndDrop.ts +7 -0
  64. package/src/components/DragAndDrop/DragAndDropList.scss +69 -0
  65. package/src/components/DragAndDrop/DragAndDropList.tsx +150 -0
  66. package/src/components/DragAndDrop/index.ts +1 -0
  67. package/src/components/Drawer/Drawer.scss +0 -1
  68. package/src/components/Drawer/Drawer.tsx +7 -15
  69. package/src/components/Icon/iconList.ts +31 -9
  70. package/src/components/{AddButton/AddButton.scss → IconButton/IconButton.scss} +6 -2
  71. package/src/components/IconButton/IconButton.stories.tsx +25 -0
  72. package/src/components/{AddButton/AddButton.tsx → IconButton/IconButton.tsx} +10 -7
  73. package/src/components/IconButton/index.ts +1 -0
  74. package/src/components/{AddButton → IconButton}/types.ts +3 -2
  75. package/src/components/InputWithDropdown/InputWithDropdown.scss +1 -1
  76. package/src/components/InputWithDropdown/InputWithDropdown.stories.tsx +10 -13
  77. package/src/components/InputWithDropdown/InputWithDropdown.tsx +10 -8
  78. package/src/components/InputWithDropdown/types.ts +4 -7
  79. package/src/components/Modal/Modal.stories.tsx +63 -0
  80. package/src/components/Modal/Modal.tsx +71 -0
  81. package/src/components/Modal/index.tsx +1 -0
  82. package/src/components/Modal/modal.scss +37 -0
  83. package/src/components/Modal/types.ts +37 -0
  84. package/src/components/RadioButton/RadioButton.scss +3 -3
  85. package/src/components/Select/Select.scss +1 -1
  86. package/src/components/TableTree/TableTree.tsx +5 -1
  87. package/src/components/ThemeProvider/ThemeProvider.tsx +11 -8
  88. package/src/index.ts +6 -6
  89. package/lib/components/AddButton/AddButton.d.ts +0 -5
  90. package/lib/components/AddButton/AddButton.stories.d.ts +0 -6
  91. package/lib/components/AddButton/index.d.ts +0 -1
  92. package/src/assets/icons/expired_license_icon.svg +0 -3
  93. package/src/assets/icons/expiringSoon_license_icon.svg +0 -3
  94. package/src/components/AddButton/AddButton.stories.tsx +0 -24
  95. package/src/components/AddButton/index.ts +0 -1
@@ -0,0 +1,387 @@
1
+ @use '../../assets/styles/fonts';
2
+ @import 'react-day-picker/style.css';
3
+
4
+ /* Custom date picker styling */
5
+ .ff-date-picker {
6
+ // day-picker variable override
7
+ .rdp-root {
8
+ --rdp-accent-color: var(--brand-color);
9
+ --rdp-day-height: 24px;
10
+ --rdp-day-width: 36px;
11
+ @include fonts.fontPoppins(12px);
12
+ --rdp-font-family: 'Poppins', sans-serif;
13
+ }
14
+
15
+ .ff-cursor-pointer {
16
+ cursor: pointer;
17
+ }
18
+
19
+ position: relative;
20
+
21
+ .ff-datepicker-input-container {
22
+ display: flex;
23
+ gap: 10px;
24
+
25
+ .ff-input-with-icon {
26
+ position: relative;
27
+ display: flex;
28
+ flex-direction: column;
29
+ align-items: flex-start;
30
+
31
+ .ff-date-input,
32
+ .ff-time-input {
33
+ padding: 4px 8px;
34
+ padding-left: 2rem;
35
+ height: 32px;
36
+ border-radius: 5px;
37
+ border: 1px solid var(--border-color);
38
+ @extend .fontXs;
39
+ color: var(--status-skipped-text-color);
40
+ line-height: 15px;
41
+ box-sizing: border-box;
42
+
43
+ &:focus {
44
+ outline: none;
45
+ }
46
+ }
47
+
48
+ .ff-calendar-icon,
49
+ .ff-clock-icon {
50
+ position: absolute;
51
+ transform: translate(50%, 50%);
52
+ display: flex;
53
+ align-items: center;
54
+ pointer-events: none;
55
+ }
56
+ }
57
+
58
+ .ff-date-input-field {
59
+ flex: 1;
60
+ .ff-date-input {
61
+ width: 100%;
62
+ }
63
+
64
+ .ff-date-input-message {
65
+ @extend .font-size-8;
66
+ padding: 0px 4px;
67
+ margin-left: 8px;
68
+ line-height: 12px;
69
+ &--danger {
70
+ color: var(--input-error-text-color);
71
+ }
72
+ }
73
+ }
74
+
75
+ .ff-time-input-field {
76
+ flex: 0 0 120px;
77
+ .ff-time-input {
78
+ width: 100%;
79
+ }
80
+ }
81
+ }
82
+ .ff-date-picker-container {
83
+ display: flex;
84
+ flex-direction: column;
85
+ position: absolute;
86
+ border-radius: 8px;
87
+ padding: 4px;
88
+ box-sizing: border-box;
89
+ background-color: var(--tab-bg-color);
90
+ box-shadow: 0 0 12px 0 #00000033;
91
+ gap: 8px;
92
+ z-index: 10;
93
+
94
+ .ff-calendar-container {
95
+ display: flex;
96
+ align-items: flex-start;
97
+ gap: 4px;
98
+ height: 240px;
99
+ }
100
+
101
+ .ff-date-picker-controls {
102
+ padding: 4px;
103
+ display: flex;
104
+ justify-content: end;
105
+ gap: 8px;
106
+ border-top: 1px solid var(--border-color);
107
+
108
+ .ff-date-picker-button {
109
+ font-weight: 600;
110
+ line-height: 15px;
111
+ }
112
+ }
113
+ }
114
+
115
+ .ff-calendar {
116
+ .ff-calendar-nav-button {
117
+ margin: 0 5px;
118
+ border: 1px solid var(--border-color);
119
+ background-color: var(--toggle-button-bg-color);
120
+ box-shadow: 0 -2px 2px 0 var(--ff-mini-modal-box-shadow);
121
+ padding: 4px;
122
+ border-radius: 30%;
123
+ cursor: pointer;
124
+
125
+ &:disabled {
126
+ cursor: auto;
127
+ opacity: 0.5;
128
+ }
129
+ }
130
+
131
+ .ff-calendar-haeder {
132
+ display: flex;
133
+ align-items: center;
134
+ gap: 5px;
135
+ color: var(--text-color);
136
+ }
137
+
138
+ .ff-custom-year_grid,
139
+ .ff-custom-month_grid {
140
+ width: calc((var(--rdp-day-width) + 4px) * 7);
141
+ display: grid;
142
+ grid-template-columns: repeat(3, 1fr);
143
+ gap: 10px;
144
+ padding: 5px;
145
+ max-width: 100%;
146
+
147
+ .ff-custom-year,
148
+ .ff-custom-month {
149
+ padding: 10px 0;
150
+ text-align: center;
151
+ cursor: pointer;
152
+ border-radius: 8px;
153
+ background-color: #f9f9f9; // color need to be change
154
+
155
+ &--selected {
156
+ background-color: var(--brand-color);
157
+ color: var(--primary-button-text-color);
158
+ }
159
+ }
160
+ }
161
+
162
+ .rdp-weekdays {
163
+ th {
164
+ color: #6f7c8e; // color need to be change
165
+ font-weight: 400;
166
+ }
167
+ }
168
+
169
+ .rdp-day {
170
+ padding: 2px;
171
+ font-weight: 500;
172
+ }
173
+
174
+ .rdp-day_button {
175
+ border-radius: 4px;
176
+ padding: 3px 9px;
177
+
178
+ &:hover {
179
+ background-color: var(--hover-color);
180
+ }
181
+ }
182
+ .rdp-selected {
183
+ font: inherit;
184
+ .rdp-day_button {
185
+ background: var(--rdp-accent-color);
186
+ color: var(--drawer-footer-bg);
187
+ border: none;
188
+ }
189
+ }
190
+ .rdp-today:not(.rdp-outside) {
191
+ .rdp-day_button {
192
+ border: 2px solid var(--rdp-accent-color);
193
+ }
194
+ }
195
+ }
196
+
197
+ // Timepicker css ************************************************************************
198
+
199
+ .ff-time-picker-container {
200
+ position: relative;
201
+ width: 150px;
202
+ height: 100%;
203
+ overflow-y: hidden;
204
+ border-left: 1px solid #ccc;
205
+ padding: 10px 5px;
206
+ box-sizing: border-box;
207
+
208
+ &::-webkit-scrollbar {
209
+ display: none;
210
+ }
211
+
212
+ .ff-time-picker-fields {
213
+ display: flex;
214
+ height: 14%;
215
+ width: 100%;
216
+ margin-bottom: 5px;
217
+ box-sizing: border-box;
218
+
219
+ .ff-time-input-container {
220
+ display: flex;
221
+ border: 1px solid var(--border-color);
222
+ border-right: 0;
223
+ border-radius: 4px 0 0 4px;
224
+ width: 55%;
225
+ position: relative;
226
+
227
+ .ff-time-input {
228
+ border: none;
229
+ padding: 5px;
230
+ width: 100%;
231
+ text-align: center;
232
+ border-radius: 4px 0 0 4px;
233
+ @extend .fontSm;
234
+
235
+ &::placeholder {
236
+ opacity: 0;
237
+ line-height: 18px;
238
+ }
239
+ }
240
+
241
+ .ff-time-input-label {
242
+ position: absolute;
243
+ left: 10px;
244
+ top: 50%;
245
+ transform: translateY(-50%);
246
+ transition: 0.2s ease all;
247
+ color: var(--input-default-label-color);
248
+ pointer-events: none;
249
+ }
250
+
251
+ &--float .ff-time-input-label {
252
+ top: 0;
253
+ left: 5px;
254
+ color: var(--brand-color);
255
+ background-color: var(--input-label-bg-color);
256
+ line-height: 12px;
257
+ padding: 0 2px;
258
+ font-size: 8px !important;
259
+
260
+ &--danger {
261
+ color: var(--input-error-text-color);
262
+ }
263
+ }
264
+
265
+ &:hover {
266
+ border-color: var(--input-hover-border-color);
267
+ }
268
+
269
+ &:focus-within {
270
+ border-color: var(--brand-color);
271
+
272
+ .ff-time-input-label {
273
+ top: 0;
274
+ left: 5px;
275
+ color: var(--brand-color);
276
+ background-color: var(--input-label-bg-color);
277
+ line-height: 12px;
278
+ padding: 0 2px;
279
+ font-size: 8px !important;
280
+
281
+ &--danger {
282
+ color: var(--input-error-text-color);
283
+ }
284
+ }
285
+
286
+ .ff-time-input {
287
+ &::placeholder {
288
+ opacity: 1;
289
+ margin-bottom: 1px;
290
+ }
291
+ }
292
+ }
293
+
294
+ &--danger {
295
+ border-color: var(--input-error-text-color) !important;
296
+ }
297
+
298
+ .ff-time-input:focus {
299
+ outline: none;
300
+ }
301
+ }
302
+ .ff-time-period-container {
303
+ position: relative;
304
+ width: 45%;
305
+ display: flex;
306
+ border: 1px solid var(--border-color);
307
+ border-radius: 0 4px 4px 0;
308
+
309
+ .ff-time-period-select {
310
+ display: flex;
311
+ align-items: center;
312
+ padding: 0 5px;
313
+ width: 100%;
314
+ border-radius: 4px;
315
+ background-color: white;
316
+ cursor: pointer;
317
+ border: none;
318
+ }
319
+ &--active {
320
+ border-color: var(--brand-color) !important;
321
+ }
322
+ &:hover {
323
+ border-color: var(--input-hover-border-color);
324
+ }
325
+
326
+ .ff-time-period-icon {
327
+ margin-left: auto;
328
+ pointer-events: none;
329
+ }
330
+
331
+ .ff-time-period-options {
332
+ position: fixed;
333
+ z-index: 100;
334
+ min-width: 60px;
335
+ margin: 4px 0 0;
336
+ padding: 0;
337
+ list-style: none;
338
+ border: 1px solid var(--ff-select-background-color);
339
+ border-radius: 4px;
340
+ background-color: var(--primary-button-text-color);
341
+ box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
342
+ }
343
+
344
+ .ff-option-item {
345
+ padding: 8px;
346
+ color: var(--text-color);
347
+ border-radius: 4px;
348
+ cursor: pointer;
349
+ transition: background-color 0.2s ease;
350
+
351
+ &:hover {
352
+ background-color: var(--ff-select-option-hover-color);
353
+ }
354
+ }
355
+ }
356
+ }
357
+ .ff-time-picker-options {
358
+ height: 86%;
359
+ overflow-y: auto;
360
+ padding-right: 5px;
361
+
362
+ &::-webkit-scrollbar {
363
+ width: 4px;
364
+ height: 12px;
365
+
366
+ &-thumb {
367
+ background-color: var(--ff-select-scroll-thumb-color);
368
+ border-radius: 4px;
369
+ }
370
+
371
+ &-track {
372
+ background-color: var(--hover-color); // color need to be change
373
+ border-radius: 4px;
374
+ }
375
+ }
376
+
377
+ .ff-time-option {
378
+ padding: 10px 12px;
379
+ cursor: pointer;
380
+ text-align: center;
381
+ border-radius: 8px;
382
+ background-color: rgba(249, 249, 249); // color need to be change
383
+ margin: 10px 0;
384
+ }
385
+ }
386
+ }
387
+ }
@@ -0,0 +1,161 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import CustomDatePicker from './DatePicker';
3
+ import { useState } from 'react';
4
+
5
+ const meta: Meta<typeof CustomDatePicker> = {
6
+ title: 'Components/DatePicker',
7
+ component: CustomDatePicker,
8
+ parameters: {
9
+ layout: 'centered',
10
+ docs: {
11
+ description: {
12
+ component:
13
+ 'A custom date picker component with built-in calendar and input field.',
14
+ },
15
+ },
16
+ },
17
+ tags: ['autodocs'],
18
+ argTypes: {
19
+ minDate: {
20
+ description: 'The minimum selectable date',
21
+ control: {
22
+ type: 'date',
23
+ },
24
+ },
25
+ maxDate: {
26
+ description: 'The maximum selectable date',
27
+ control: {
28
+ type: 'date',
29
+ },
30
+ },
31
+ value: {
32
+ description: 'Selected date value',
33
+ control: {
34
+ type: 'date',
35
+ },
36
+ },
37
+ onChange: {
38
+ description: 'Function to handle date selection',
39
+ action: 'changed',
40
+ },
41
+ placeholder: {
42
+ description: 'Placeholder text for the input field',
43
+ control: 'text',
44
+ },
45
+ disabled: {
46
+ description: 'Disables the date picker',
47
+ control: 'boolean',
48
+ },
49
+ dateFormat: {
50
+ description: 'Date format to display',
51
+ control: 'text',
52
+ },
53
+ timeFormat: {
54
+ description: 'time format to display',
55
+ control: 'text',
56
+ },
57
+ timezone: {
58
+ description: 'Timezone for date formatting',
59
+ control: 'text',
60
+ },
61
+ calendarWidth: {
62
+ description: 'Custom width for the calendar in pixel',
63
+ control: "number"
64
+ },
65
+ error: {
66
+ description: 'Displays the input field in an error state',
67
+ control: 'boolean',
68
+ },
69
+ helperText: {
70
+ description: 'Helper text to show below the input, often used for error messages',
71
+ control: 'text',
72
+ },
73
+ },
74
+ };
75
+
76
+ export default meta;
77
+
78
+ type Story = StoryObj<typeof CustomDatePicker>;
79
+
80
+ // Default story for DatePicker
81
+ export const Default: Story = {
82
+ render: (args) => {
83
+ const [date, setDate] = useState<Date | undefined>();
84
+
85
+ return(
86
+ <CustomDatePicker
87
+ {...args}
88
+ value={date}
89
+ onChange={setDate}
90
+ />
91
+ )
92
+ }
93
+ };
94
+
95
+ // Start Date Filter story
96
+ export const StartDateFilter: Story = {
97
+ render: (args) => {
98
+ const [startDate, setStartDate] = useState<Date | undefined>();
99
+
100
+ return (
101
+ <CustomDatePicker
102
+ {...args}
103
+ value={startDate}
104
+ onChange={setStartDate}
105
+ calendarWidth = {240}
106
+ maxDate={new Date()} // Disable future dates for start date picker
107
+ />
108
+ );
109
+ },
110
+ };
111
+
112
+ // End Date Input story
113
+ export const EndDateInput: Story = {
114
+ render: (args) => {
115
+ const [startDate, setStartDate] = useState<Date | undefined>();
116
+ const [endDate, setEndDate] = useState<Date | undefined>();
117
+
118
+ return (
119
+ <>
120
+ <p>Select Start Date:</p>
121
+ <CustomDatePicker
122
+ {...args}
123
+ value={startDate}
124
+ onChange={setStartDate}
125
+ maxDate={new Date()} // Disable future dates for start date picker
126
+ />
127
+
128
+ <p>Select End Date:</p>
129
+ <CustomDatePicker
130
+ {...args}
131
+ value={endDate}
132
+ onChange={setEndDate}
133
+ disabled={!startDate}
134
+ minDate={startDate || undefined} // Restrict the end date based on selected start date
135
+ maxDate={new Date()} // Disable future dates for end date picker
136
+ />
137
+ </>
138
+ );
139
+ },
140
+ };
141
+
142
+ // Schedule Date Input story
143
+ export const ScheduleDateInput: Story = {
144
+ args: {
145
+ error: false,
146
+ helperText: "Error"
147
+ },
148
+
149
+ render: (args) => {
150
+ const [selectDate, setSelectDate] = useState<Date | undefined>(new Date());
151
+
152
+ return (
153
+ <CustomDatePicker
154
+ {...args}
155
+ value={selectDate}
156
+ onChange={setSelectDate}
157
+ minDate={new Date()} // Set minimum date to today
158
+ />
159
+ );
160
+ }
161
+ };