@drivenets/design-system 0.7.3 → 0.8.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 (79) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/index.cjs +4445 -3769
  3. package/dist/index.d.cts +1224 -945
  4. package/dist/index.d.cts.map +1 -1
  5. package/dist/index.d.ts +1224 -945
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +4446 -3776
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.min.css +1 -1
  10. package/package.json +7 -8
  11. package/src/components/ds-autocomplete/ds-autocomplete.module.scss +1 -1
  12. package/src/components/ds-autocomplete/ds-autocomplete.tsx +13 -8
  13. package/src/components/ds-autocomplete/ds-autocomplete.types.ts +2 -1
  14. package/src/components/ds-comment-bubble/ds-comment-bubble.module.scss +6 -2
  15. package/src/components/ds-comment-bubble/ds-comment-bubble.tsx +22 -15
  16. package/src/components/ds-comment-bubble/ds-comment-bubble.types.ts +1 -0
  17. package/src/components/ds-date-input/ds-date-input.tsx +3 -4
  18. package/src/components/ds-date-input/ds-date-input.types.ts +3 -1
  19. package/src/components/ds-date-input/index.ts +10 -0
  20. package/src/components/ds-date-picker/components/calendar-table.module.scss +93 -0
  21. package/src/components/ds-date-picker/components/calendar-view-control/calendar-view-control.module.scss +48 -0
  22. package/src/components/ds-date-picker/components/calendar-view-control/calendar-view-control.tsx +20 -0
  23. package/src/components/ds-date-picker/components/calendar-view-control/index.ts +1 -0
  24. package/src/components/ds-date-picker/components/day-view/day-view.module.scss +12 -0
  25. package/src/components/ds-date-picker/components/day-view/day-view.tsx +45 -0
  26. package/src/components/ds-date-picker/components/day-view/index.ts +1 -0
  27. package/src/components/ds-date-picker/components/month-view/index.ts +1 -0
  28. package/src/components/ds-date-picker/components/month-view/month-view.module.scss +4 -0
  29. package/src/components/ds-date-picker/components/month-view/month-view.tsx +35 -0
  30. package/src/components/ds-date-picker/components/year-view/index.ts +1 -0
  31. package/src/components/ds-date-picker/components/year-view/year-view.module.scss +4 -0
  32. package/src/components/ds-date-picker/components/year-view/year-view.tsx +35 -0
  33. package/src/components/ds-date-picker/ds-date-picker.module.scss +19 -0
  34. package/src/components/ds-date-picker/ds-date-picker.tsx +209 -0
  35. package/src/components/ds-date-picker/ds-date-picker.types.ts +94 -0
  36. package/src/components/ds-date-picker/ds-date-picker.utils.ts +87 -0
  37. package/src/components/ds-date-picker/ds-date-picker.utils.unit.test.ts +226 -0
  38. package/src/components/ds-date-picker/index.ts +2 -0
  39. package/src/components/ds-date-range-picker/ds-date-range-picker.module.scss +20 -0
  40. package/src/components/ds-date-range-picker/ds-date-range-picker.tsx +101 -0
  41. package/src/components/ds-date-range-picker/ds-date-range-picker.types.ts +95 -0
  42. package/src/components/ds-date-range-picker/ds-date-range-picker.utils.ts +19 -0
  43. package/src/components/ds-date-range-picker/ds-date-range-picker.utils.unit.test.ts +48 -0
  44. package/src/components/ds-date-range-picker/index.ts +9 -0
  45. package/src/components/ds-file-upload/ds-file-upload-api.types.ts +1 -0
  46. package/src/components/ds-file-upload/hooks/use-file-upload.ts +1 -1
  47. package/src/components/ds-file-upload/index.ts +6 -1
  48. package/src/components/ds-file-upload/utils/file-factory.ts +1 -0
  49. package/src/components/ds-file-upload/utils/file-factory.unit.test.ts +37 -0
  50. package/src/components/ds-form-control/ds-form-control.tsx +5 -0
  51. package/src/components/ds-key-value-pair/ds-key-value-pair.module.scss +72 -0
  52. package/src/components/ds-key-value-pair/ds-key-value-pair.tsx +47 -0
  53. package/src/components/ds-key-value-pair/ds-key-value-pair.types.ts +24 -0
  54. package/src/components/ds-key-value-pair/index.ts +3 -0
  55. package/src/components/ds-loader/ds-loader.tsx +1 -1
  56. package/src/components/ds-status-badge/ds-status-badge.module.scss +1 -1
  57. package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.tsx +4 -2
  58. package/src/components/ds-time-picker/components/time-item/index.ts +1 -0
  59. package/src/components/ds-time-picker/components/time-item/time-item.module.scss +37 -0
  60. package/src/components/ds-time-picker/components/time-item/time-item.tsx +26 -0
  61. package/src/components/ds-time-picker/components/time-item/time-item.types.ts +10 -0
  62. package/src/components/ds-time-picker/components/time-scroller/index.ts +2 -0
  63. package/src/components/ds-time-picker/components/time-scroller/time-scroller.module.scss +25 -0
  64. package/src/components/ds-time-picker/components/time-scroller/time-scroller.tsx +61 -0
  65. package/src/components/ds-time-picker/components/time-scroller/time-scroller.types.ts +17 -0
  66. package/src/components/ds-time-picker/components/time-scroller/time-scroller.utils.ts +44 -0
  67. package/src/components/ds-time-picker/ds-time-picker.tsx +158 -0
  68. package/src/components/ds-time-picker/ds-time-picker.types.ts +48 -0
  69. package/src/components/ds-time-picker/ds-time-picker.utils.ts +176 -0
  70. package/src/components/ds-time-picker/ds-time-picker.utils.unit.test.ts +316 -0
  71. package/src/components/ds-time-picker/index.ts +3 -0
  72. package/src/components/ds-tooltip/ds-tooltip.module.scss +1 -7
  73. package/src/components/ds-tooltip/ds-tooltip.tsx +9 -9
  74. package/src/components/ds-tooltip/ds-tooltip.types.ts +7 -1
  75. package/src/index.ts +4 -0
  76. package/src/styles/_root_updated.scss +593 -0
  77. package/src/styles/shared/_dropdown.scss +4 -1
  78. package/src/utils/use-controlled.browser.test.ts +79 -0
  79. package/src/utils/use-controlled.ts +18 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drivenets/design-system",
3
- "version": "0.7.3",
3
+ "version": "0.8.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.cts",
@@ -51,9 +51,9 @@
51
51
  "@radix-ui/react-tooltip": "^1.2.8",
52
52
  "@radix-ui/react-visually-hidden": "^1.2.4",
53
53
  "@tanstack/react-table": "^8.21.3",
54
- "@tanstack/react-virtual": "^3.13.21",
55
- "@zag-js/react": "^1.35.3",
56
- "@zag-js/steps": "^1.35.3",
54
+ "@tanstack/react-virtual": "^3.13.23",
55
+ "@zag-js/react": "^1.37.0",
56
+ "@zag-js/steps": "^1.37.0",
57
57
  "classnames": "^2.5.1"
58
58
  },
59
59
  "peerDependencies": {
@@ -67,11 +67,10 @@
67
67
  "@eslint/compat": "^2.0.3",
68
68
  "@faker-js/faker": "^10.3.0",
69
69
  "@hookform/resolvers": "^5.2.2",
70
- "@rollup/plugin-babel": "^7.0.0",
70
+ "@rolldown/plugin-babel": "^0.2.1",
71
71
  "@storybook/addon-a11y": "^10.2.19",
72
72
  "@storybook/addon-docs": "^10.2.19",
73
73
  "@storybook/addon-vitest": "^10.2.19",
74
- "@storybook/builder-vite": "^10.2.19",
75
74
  "@storybook/react-vite": "^10.2.19",
76
75
  "@tanstack/react-query": "^5.90.21",
77
76
  "@tanstack/react-router": "^1.166.2",
@@ -106,8 +105,8 @@
106
105
  "vitest": "^4.1.0",
107
106
  "vitest-browser-react": "^2.1.0",
108
107
  "zod": "^4.3.6",
109
- "@drivenets/eslint-plugin-internal": "0.0.0",
110
- "@drivenets/vite-plugin-design-system": "0.0.6"
108
+ "@drivenets/vite-plugin-design-system": "0.0.6",
109
+ "@drivenets/eslint-plugin-internal": "0.0.0"
111
110
  },
112
111
  "scripts": {
113
112
  "install:playwright": "pnpm exec playwright install chromium --with-deps",
@@ -49,7 +49,7 @@ $autocomplete-opacity-visible: 1;
49
49
  outline: none;
50
50
 
51
51
  &::placeholder {
52
- color: var(--color-font-placeholder);
52
+ color: var(--color-font-disabled);
53
53
  }
54
54
  }
55
55
 
@@ -45,10 +45,7 @@ export const DsAutocomplete = ({
45
45
 
46
46
  const handleValueChange = (details: Combobox.ValueChangeDetails<DsAutocompleteOption>) => {
47
47
  const selectedItem = details.items[0];
48
-
49
- if (selectedItem) {
50
- onValueChange?.(selectedItem.value);
51
- }
48
+ onValueChange?.(selectedItem?.value ?? '');
52
49
  };
53
50
 
54
51
  const handleOpenChange = (details: Combobox.OpenChangeDetails) => {
@@ -83,12 +80,20 @@ export const DsAutocomplete = ({
83
80
  <Combobox.Input className={styles.input} placeholder={placeholder} />
84
81
 
85
82
  <Combobox.Context>
86
- {(context) => (
83
+ {(combobox) => (
87
84
  <div className={styles.iconContainer}>
88
- {context.inputValue && !disabled && (
89
- <Combobox.ClearTrigger className={styles.clearButton} aria-label="Clear">
85
+ {combobox.inputValue && !disabled && (
86
+ <button
87
+ type="button"
88
+ className={styles.clearButton}
89
+ aria-label="Clear"
90
+ onClick={() => {
91
+ combobox.setValue([]);
92
+ combobox.setInputValue('');
93
+ }}
94
+ >
90
95
  <DsIcon icon="close" size="medium" />
91
- </Combobox.ClearTrigger>
96
+ </button>
92
97
  )}
93
98
 
94
99
  {showTrigger && (
@@ -85,7 +85,8 @@ export interface DsAutocompleteProps {
85
85
  startAdornment?: React.ReactNode;
86
86
 
87
87
  /**
88
- * Event handler called when the value changes (when an option is selected)
88
+ * Event handler called when the value changes.
89
+ * Fires with the selected option's value, or an empty string when cleared.
89
90
  */
90
91
  onValueChange?: (value: string) => void;
91
92
  /**
@@ -62,7 +62,7 @@ $transition-duration: 0.2s;
62
62
  resize: none;
63
63
 
64
64
  &::placeholder {
65
- color: var(--color-font-placeholder);
65
+ color: var(--color-font-disabled);
66
66
  }
67
67
  }
68
68
  }
@@ -199,7 +199,7 @@ $transition-duration: 0.2s;
199
199
  overflow-y: auto;
200
200
 
201
201
  &::placeholder {
202
- color: var(--color-font-placeholder);
202
+ color: var(--color-font-disabled);
203
203
  }
204
204
 
205
205
  &:focus {
@@ -225,6 +225,10 @@ $transition-duration: 0.2s;
225
225
  align-items: center;
226
226
  justify-content: space-between;
227
227
  padding: var(--spacing-xs) 0;
228
+
229
+ > :last-child {
230
+ margin-left: auto;
231
+ }
228
232
  }
229
233
 
230
234
  .sendButton {
@@ -15,6 +15,7 @@ export const DsCommentBubble = ({
15
15
  ref,
16
16
  comment,
17
17
  currentUser,
18
+ hideActionRequired = false,
18
19
  actionRequired = false,
19
20
  onActionRequiredChange,
20
21
  value = '',
@@ -96,7 +97,7 @@ export const DsCommentBubble = ({
96
97
  className={classNames(
97
98
  styles.bubble,
98
99
  {
99
- [styles.actionRequired]: actionRequired,
100
+ [styles.actionRequired]: !hideActionRequired && actionRequired,
100
101
  [styles.initial]: isInitialMode,
101
102
  [styles.typing]: isTypingMode,
102
103
  [styles.thread]: hasThread,
@@ -117,7 +118,9 @@ export const DsCommentBubble = ({
117
118
  <div className={styles.headerInfo}>
118
119
  <span className={styles.commentId}>#{comment.numericId}</span>
119
120
  {renderReferenceTag()}
120
- {actionRequired && <span className={styles.actionRequiredBadge}>Action required</span>}
121
+ {!hideActionRequired && actionRequired && (
122
+ <span className={styles.actionRequiredBadge}>Action required</span>
123
+ )}
121
124
  </div>
122
125
  </div>
123
126
 
@@ -130,9 +133,11 @@ export const DsCommentBubble = ({
130
133
  </DsButton>
131
134
  </DsDropdownMenu.Trigger>
132
135
  <DsDropdownMenu.Content className={styles.dropdownContent}>
133
- <DsDropdownMenu.Item value="toggle-action" onClick={onToggleActionRequired}>
134
- {actionRequired ? 'Remove action requirement' : 'Require action'}
135
- </DsDropdownMenu.Item>
136
+ {!hideActionRequired && (
137
+ <DsDropdownMenu.Item value="toggle-action" onClick={onToggleActionRequired}>
138
+ {actionRequired ? 'Remove action requirement' : 'Require action'}
139
+ </DsDropdownMenu.Item>
140
+ )}
136
141
  <DsDropdownMenu.Item value="forward" onClick={onForward}>
137
142
  Forward
138
143
  </DsDropdownMenu.Item>
@@ -205,8 +210,8 @@ export const DsCommentBubble = ({
205
210
  {(isInitialMode || hasThread) && (
206
211
  <DsButton
207
212
  design="v1.2"
208
- buttonType="tertiary"
209
- size="tiny"
213
+ buttonType="primary"
214
+ size="small"
210
215
  disabled={!hasContent}
211
216
  onClick={handleSend}
212
217
  aria-label="Send"
@@ -218,17 +223,19 @@ export const DsCommentBubble = ({
218
223
 
219
224
  {showFooter && (
220
225
  <div className={styles.footer}>
221
- <DsCheckbox
222
- variant="warning"
223
- label="Action required"
224
- checked={actionRequired}
225
- onCheckedChange={(checked) => onActionRequiredChange?.(checked === true)}
226
- />
226
+ {!hideActionRequired && (
227
+ <DsCheckbox
228
+ variant="warning"
229
+ label="Action required"
230
+ checked={actionRequired}
231
+ onCheckedChange={(checked) => onActionRequiredChange?.(checked === true)}
232
+ />
233
+ )}
227
234
 
228
235
  <DsButton
229
236
  design="v1.2"
230
- buttonType="tertiary"
231
- size="tiny"
237
+ buttonType="primary"
238
+ size="small"
232
239
  disabled={!hasContent}
233
240
  onClick={handleSend}
234
241
  aria-label="Send"
@@ -5,6 +5,7 @@ export interface DsCommentBubbleProps {
5
5
  ref?: Ref<HTMLDivElement>;
6
6
  comment?: CommentData;
7
7
  currentUser?: CommentAuthor;
8
+ hideActionRequired?: boolean;
8
9
  actionRequired?: boolean;
9
10
  onActionRequiredChange?: (checked: boolean) => void;
10
11
  value?: string;
@@ -16,10 +16,9 @@ import { DsTypography } from '../ds-typography';
16
16
  import styles from './ds-date-input.module.scss';
17
17
 
18
18
  /**
19
- * Design system date input component with integrated calendar picker.
20
- *
21
- * Supports both single date and date range selection with a single text input field.
22
- * Features built-in validation, manual text entry, and calendar selection.
19
+ * @deprecated DsDateInput is deprecated. Use DsDatePicker or DsDateRangePicker instead.
20
+ * @see {@link ../ds-date-picker} for single date selection.
21
+ * @see {@link ../ds-date-range-picker} for date range selection.
23
22
  */
24
23
  const DsDateInput = ({
25
24
  range = false,
@@ -105,6 +105,8 @@ type DsDateInputBaseProps = Pick<
105
105
  };
106
106
 
107
107
  /**
108
- * Props for the DsDateInput component
108
+ * @deprecated DsDateInput is deprecated. Use DsDatePicker or DsDateRangePicker instead.
109
+ * @see {@link ../ds-date-picker} for single date selection.
110
+ * @see {@link ../ds-date-range-picker} for date range selection.
109
111
  */
110
112
  export type DsDateInputProps = DsDateInputBaseProps & DsDateInputRangeProps;
@@ -1,2 +1,12 @@
1
+ /**
2
+ * @deprecated DsDateInput is deprecated. Use DsDatePicker or DsDateRangePicker instead.
3
+ * @see {@link ../ds-date-picker} for single date selection.
4
+ * @see {@link ../ds-date-range-picker} for date range selection.
5
+ */
1
6
  export { default as DsDateInput } from './ds-date-input';
7
+ /**
8
+ * @deprecated These types are deprecated. Use DsDatePicker or DsDateRangePicker types instead.
9
+ * @see {@link ../ds-date-picker} for single date selection.
10
+ * @see {@link ../ds-date-range-picker} for date range selection.
11
+ */
2
12
  export type { DsDateInputProps } from './ds-date-input.types';
@@ -0,0 +1,93 @@
1
+ .table {
2
+ width: 100%;
3
+ border-collapse: collapse;
4
+
5
+ .tableBody .tableRow .tableCellTrigger:focus-visible {
6
+ .tableCellTrigger {
7
+ outline: 2px solid var(--color-background-action-hover);
8
+ border-radius: var(--spacing-2xs);
9
+ border-width: 0;
10
+ }
11
+ }
12
+ }
13
+
14
+ .tableHeader {
15
+ text-align: center;
16
+ padding: var(--spacing-2xs);
17
+ color: var(--color-font-secondary);
18
+ font-weight: var(--font-weight-medium);
19
+ }
20
+
21
+ .tableRow {
22
+ &:first-child {
23
+ .tableCellTrigger {
24
+ margin-top: var(--spacing-xs);
25
+ }
26
+ }
27
+ }
28
+
29
+ .tableCellTrigger {
30
+ display: flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+ cursor: pointer;
34
+ user-select: none;
35
+ -webkit-tap-highlight-color: transparent;
36
+ outline: none;
37
+ border-radius: var(--spacing-xs);
38
+ color: var(--color-font-main);
39
+ margin: var(--spacing-3xs);
40
+
41
+ &:hover:not([data-disabled], [data-selected]) {
42
+ outline: 1px solid var(--color-border);
43
+ background: var(--color-background-action-hover-weak);
44
+ }
45
+
46
+ &[data-outside-range] {
47
+ color: var(--color-font-disabled);
48
+ }
49
+
50
+ &[data-selected] {
51
+ background: var(--color-background-selected);
52
+ color: var(--color-font-on-action);
53
+ }
54
+
55
+ &[data-today]:not([data-selected]):hover {
56
+ border-radius: var(--spacing-xs);
57
+ }
58
+
59
+ &[data-today]:not([data-selected]) {
60
+ position: relative;
61
+
62
+ &::after {
63
+ content: '';
64
+ position: absolute;
65
+ width: 75%;
66
+ bottom: 4px;
67
+ border-bottom: 1px solid var(--color-background-brand);
68
+ }
69
+ }
70
+
71
+ &[data-today][data-selected] {
72
+ position: relative;
73
+
74
+ &::after {
75
+ content: '';
76
+ position: absolute;
77
+ width: 75%;
78
+ bottom: 4px;
79
+ border-bottom: 1px solid var(--color-background);
80
+ }
81
+ }
82
+
83
+ &[data-disabled] {
84
+ color: var(--color-font-disabled);
85
+ cursor: not-allowed;
86
+ opacity: 0.5;
87
+ }
88
+
89
+ &[data-unavailable] {
90
+ text-decoration: line-through;
91
+ opacity: 0.4;
92
+ }
93
+ }
@@ -0,0 +1,48 @@
1
+ .viewControl {
2
+ display: flex;
3
+ justify-content: space-between;
4
+ align-items: center;
5
+ margin-bottom: var(--spacing-sm);
6
+ }
7
+
8
+ .viewTrigger {
9
+ flex: 1;
10
+ display: flex;
11
+ align-items: center;
12
+ justify-content: center;
13
+ background: transparent;
14
+ border: none;
15
+ cursor: pointer;
16
+ padding: var(--spacing-2xs) var(--spacing-xs);
17
+ border-radius: var(--spacing-2xs);
18
+ color: var(--color-font-main);
19
+ transition: background-color 0.2s;
20
+
21
+ &:hover {
22
+ background: var(--color-background-hover);
23
+ }
24
+ }
25
+
26
+ .prevTrigger,
27
+ .nextTrigger {
28
+ display: flex;
29
+ align-items: center;
30
+ justify-content: center;
31
+ background: transparent;
32
+ border: none;
33
+ cursor: pointer;
34
+ padding: var(--spacing-2xs);
35
+ border-radius: var(--spacing-2xs);
36
+ color: var(--color-font-secondary);
37
+ transition: all 0.2s;
38
+
39
+ &:hover {
40
+ background: var(--color-background-hover);
41
+ color: var(--color-font-main);
42
+ }
43
+
44
+ &:disabled {
45
+ cursor: not-allowed;
46
+ opacity: 0.5;
47
+ }
48
+ }
@@ -0,0 +1,20 @@
1
+ import { DatePicker } from '@ark-ui/react/date-picker';
2
+ import { DsIcon } from '../../../ds-icon';
3
+ import { DsTypography } from '../../../ds-typography';
4
+ import styles from './calendar-view-control.module.scss';
5
+
6
+ export const CalendarViewControl = () => (
7
+ <DatePicker.ViewControl className={styles.viewControl}>
8
+ <DatePicker.PrevTrigger className={styles.prevTrigger}>
9
+ <DsIcon icon="chevron_left" size="small" />
10
+ </DatePicker.PrevTrigger>
11
+ <DatePicker.ViewTrigger className={styles.viewTrigger}>
12
+ <DsTypography variant="body-md-md" asChild>
13
+ <DatePicker.RangeText />
14
+ </DsTypography>
15
+ </DatePicker.ViewTrigger>
16
+ <DatePicker.NextTrigger className={styles.nextTrigger}>
17
+ <DsIcon icon="chevron_right" size="small" />
18
+ </DatePicker.NextTrigger>
19
+ </DatePicker.ViewControl>
20
+ );
@@ -0,0 +1 @@
1
+ export * from './calendar-view-control';
@@ -0,0 +1,12 @@
1
+ $trigger-size: 32px;
2
+
3
+ .dayView {
4
+ display: flex;
5
+ flex-direction: column;
6
+ gap: var(--spacing-xs);
7
+ }
8
+
9
+ .trigger {
10
+ width: $trigger-size;
11
+ height: $trigger-size;
12
+ }
@@ -0,0 +1,45 @@
1
+ import { DatePicker } from '@ark-ui/react/date-picker';
2
+ import classNames from 'classnames';
3
+ import { DsTypography } from '../../../ds-typography';
4
+ import styles from './day-view.module.scss';
5
+ import tableStyles from '../calendar-table.module.scss';
6
+ import { CalendarViewControl } from '../calendar-view-control';
7
+
8
+ export const DayView = ({ children }: { children?: React.ReactNode }) => (
9
+ <DatePicker.View view="day">
10
+ <DatePicker.Context>
11
+ {(datePicker) => (
12
+ <div className={styles.dayView}>
13
+ <CalendarViewControl />
14
+ <DatePicker.Table className={tableStyles.table}>
15
+ <DatePicker.TableHead>
16
+ <DatePicker.TableRow className={tableStyles.tableRow}>
17
+ {datePicker.weekDays.map((weekDay, idx) => (
18
+ <DatePicker.TableHeader key={idx} className={tableStyles.tableHeader}>
19
+ <DsTypography variant="body-md-md">{weekDay.narrow}</DsTypography>
20
+ </DatePicker.TableHeader>
21
+ ))}
22
+ </DatePicker.TableRow>
23
+ </DatePicker.TableHead>
24
+ <DatePicker.TableBody className={tableStyles.tableBody}>
25
+ {datePicker.weeks.map((week, weekIdx) => (
26
+ <DatePicker.TableRow key={weekIdx} className={tableStyles.tableRow}>
27
+ {week.map((day, dayIdx) => (
28
+ <DatePicker.TableCell key={dayIdx} value={day}>
29
+ <DatePicker.TableCellTrigger
30
+ className={classNames(tableStyles.tableCellTrigger, styles.trigger)}
31
+ >
32
+ <DsTypography variant="body-md-md">{day.day}</DsTypography>
33
+ </DatePicker.TableCellTrigger>
34
+ </DatePicker.TableCell>
35
+ ))}
36
+ </DatePicker.TableRow>
37
+ ))}
38
+ </DatePicker.TableBody>
39
+ </DatePicker.Table>
40
+ {children}
41
+ </div>
42
+ )}
43
+ </DatePicker.Context>
44
+ </DatePicker.View>
45
+ );
@@ -0,0 +1 @@
1
+ export * from './day-view';
@@ -0,0 +1 @@
1
+ export { MonthView } from './month-view';
@@ -0,0 +1,4 @@
1
+ .trigger {
2
+ width: 72px;
3
+ height: 40px;
4
+ }
@@ -0,0 +1,35 @@
1
+ import { DatePicker } from '@ark-ui/react/date-picker';
2
+ import classNames from 'classnames';
3
+ import { DsTypography } from '../../../ds-typography';
4
+ import styles from './month-view.module.scss';
5
+ import tableStyles from '../calendar-table.module.scss';
6
+ import { CalendarViewControl } from '../calendar-view-control';
7
+
8
+ export const MonthView = () => (
9
+ <DatePicker.View view="month">
10
+ <DatePicker.Context>
11
+ {(datePicker) => (
12
+ <>
13
+ <CalendarViewControl />
14
+ <DatePicker.Table className={tableStyles.table}>
15
+ <DatePicker.TableBody className={tableStyles.tableBody}>
16
+ {datePicker.getMonthsGrid({ columns: 4, format: 'short' }).map((months, rowIdx) => (
17
+ <DatePicker.TableRow key={rowIdx} className={tableStyles.tableRow}>
18
+ {months.map((month, monthIdx) => (
19
+ <DatePicker.TableCell key={monthIdx} value={month.value}>
20
+ <DatePicker.TableCellTrigger
21
+ className={classNames(tableStyles.tableCellTrigger, styles.trigger)}
22
+ >
23
+ <DsTypography variant="body-md-md">{month.label}</DsTypography>
24
+ </DatePicker.TableCellTrigger>
25
+ </DatePicker.TableCell>
26
+ ))}
27
+ </DatePicker.TableRow>
28
+ ))}
29
+ </DatePicker.TableBody>
30
+ </DatePicker.Table>
31
+ </>
32
+ )}
33
+ </DatePicker.Context>
34
+ </DatePicker.View>
35
+ );
@@ -0,0 +1 @@
1
+ export { YearView } from './year-view';
@@ -0,0 +1,4 @@
1
+ .trigger {
2
+ width: 72px;
3
+ height: 40px;
4
+ }
@@ -0,0 +1,35 @@
1
+ import { DatePicker } from '@ark-ui/react/date-picker';
2
+ import classNames from 'classnames';
3
+ import { DsTypography } from '../../../ds-typography';
4
+ import styles from './year-view.module.scss';
5
+ import tableStyles from '../calendar-table.module.scss';
6
+ import { CalendarViewControl } from '../calendar-view-control';
7
+
8
+ export const YearView = () => (
9
+ <DatePicker.View view="year">
10
+ <DatePicker.Context>
11
+ {(datePicker) => (
12
+ <>
13
+ <CalendarViewControl />
14
+ <DatePicker.Table className={tableStyles.table}>
15
+ <DatePicker.TableBody className={tableStyles.tableBody}>
16
+ {datePicker.getYearsGrid({ columns: 4 }).map((years, rowIdx) => (
17
+ <DatePicker.TableRow key={rowIdx} className={tableStyles.tableRow}>
18
+ {years.map((year, yearIdx) => (
19
+ <DatePicker.TableCell key={yearIdx} value={year.value}>
20
+ <DatePicker.TableCellTrigger
21
+ className={classNames(tableStyles.tableCellTrigger, styles.trigger)}
22
+ >
23
+ <DsTypography variant="body-md-md">{year.label}</DsTypography>
24
+ </DatePicker.TableCellTrigger>
25
+ </DatePicker.TableCell>
26
+ ))}
27
+ </DatePicker.TableRow>
28
+ ))}
29
+ </DatePicker.TableBody>
30
+ </DatePicker.Table>
31
+ </>
32
+ )}
33
+ </DatePicker.Context>
34
+ </DatePicker.View>
35
+ );
@@ -0,0 +1,19 @@
1
+ @use '../../styles/shared/dropdown';
2
+
3
+ .control {
4
+ display: flex;
5
+ }
6
+
7
+ .positioner {
8
+ @include dropdown.dropdown-viewport;
9
+ }
10
+
11
+ .content {
12
+ @include dropdown.dropdown-content;
13
+ padding: var(--spacing-standard);
14
+ min-width: fit-content;
15
+ }
16
+
17
+ .timePickerPopoverContent {
18
+ z-index: dropdown.$dropdown-z-index + 1;
19
+ }