draft-components 3.3.0 → 3.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 (28) hide show
  1. package/css/draft-components.css +79 -56
  2. package/dist/components/button/icon-button.d.ts +0 -1
  3. package/dist/components/color-picker/color-picker.css +1 -2
  4. package/dist/components/filtered-search/string-set-filter-item.d.ts +1 -1
  5. package/dist/components/hero-icons/24/outline/arrow-small-down-icon.d.ts +1 -2
  6. package/dist/components/hero-icons/24/outline/arrow-small-up-icon.d.ts +1 -2
  7. package/dist/components/hero-icons/24/outline/arrows-up-down-icon.d.ts +1 -2
  8. package/dist/components/hero-icons/24/outline/chevron-left-icon.d.ts +1 -2
  9. package/dist/components/hero-icons/24/outline/chevron-right-icon.d.ts +1 -2
  10. package/dist/components/hero-icons/24/outline/eye-icon.d.ts +1 -2
  11. package/dist/components/hero-icons/24/outline/eye-slash-icon.d.ts +1 -2
  12. package/dist/components/hero-icons/24/outline/magnifying-glass-icon.d.ts +1 -2
  13. package/dist/components/hero-icons/24/outline/trash-icon.d.ts +1 -2
  14. package/dist/components/hero-icons/24/outline/x-mark-icon.d.ts +1 -2
  15. package/dist/components/hero-icons/24/solid/exclamation-triangle-icon.d.ts +1 -2
  16. package/dist/components/popover/popover.d.ts +9 -9
  17. package/dist/components/search-select/search-select.css +78 -54
  18. package/dist/components/search-select/search-select.d.ts +11 -4
  19. package/dist/components/search-select/search-select.js +15 -10
  20. package/dist/components/select/select.d.ts +19 -19
  21. package/dist/components/selection-control/selection-control.d.ts +1 -1
  22. package/dist/components/slide-over/slide-over.d.ts +4 -4
  23. package/dist/components/spinner/spinner.d.ts +1 -1
  24. package/dist/components/table/table-body.d.ts +1 -1
  25. package/dist/components/table/table-cell.d.ts +1 -1
  26. package/dist/components/toast/toast-button.d.ts +1 -1
  27. package/dist/components/toaster/toaster.js +1 -1
  28. package/package.json +41 -39
@@ -2056,6 +2056,75 @@
2056
2056
  color-scheme: dark;
2057
2057
  }
2058
2058
 
2059
+ .dc-search-select-button-label {
2060
+ display: inline-flex;
2061
+ gap: 0.5em;
2062
+ align-items: center;
2063
+ }
2064
+
2065
+ .dc-search-select-button-label > b {
2066
+ font-weight: 700;
2067
+ }
2068
+
2069
+ .dc-search-select-option {
2070
+ box-sizing: border-box;
2071
+ display: flex;
2072
+ flex-direction: column;
2073
+ justify-content: center;
2074
+ min-height: 28px;
2075
+ padding: 4px 8px;
2076
+ font-size: 14px;
2077
+ line-height: 1.25;
2078
+ color: inherit;
2079
+ cursor: default;
2080
+ border-radius: 5px;
2081
+ }
2082
+
2083
+ .dc-search-select-option_highlighted {
2084
+ color: var(--dc-control-primary-text-color);
2085
+ background: var(--dc-control-bg-inset);
2086
+ }
2087
+
2088
+ .dc-search-select-option_selected {
2089
+ color: var(--dc-control-on-primary-color);
2090
+ background: var(--dc-control-primary-color);
2091
+ }
2092
+
2093
+ .dc-search-select-option__caption {
2094
+ font-size: 80%;
2095
+ opacity: 0.75;
2096
+ }
2097
+
2098
+ .dc-search-select-separator {
2099
+ display: flex;
2100
+ align-items: center;
2101
+ width: 100%;
2102
+ padding: 8px 0;
2103
+ }
2104
+
2105
+ .dc-search-select-separator::before,
2106
+ .dc-search-select-separator::after {
2107
+ display: block;
2108
+ height: 1px;
2109
+ content: '';
2110
+ background: var(--dc-control-bg-inset);
2111
+ }
2112
+
2113
+ .dc-search-select-separator::before {
2114
+ flex-shrink: 0;
2115
+ width: 12px;
2116
+ }
2117
+
2118
+ .dc-search-select-separator::after {
2119
+ flex-grow: 1;
2120
+ }
2121
+
2122
+ .dc-search-select-separator__label {
2123
+ padding: 0 8px;
2124
+ font-size: 12px;
2125
+ color: var(--dc-control-secondary-text-color);
2126
+ }
2127
+
2059
2128
  .dc-search-select {
2060
2129
  --dc-search-select-font-size: 14px;
2061
2130
  --dc-search-select-text-color: var(--dc-control-primary-text-color);
@@ -2124,7 +2193,7 @@
2124
2193
  --dc-search-select-radius: 8px;
2125
2194
  }
2126
2195
 
2127
- .dc-search-select__slot-left {
2196
+ .dc-search-select__slot-right {
2128
2197
  position: absolute;
2129
2198
  top: 0;
2130
2199
  right: 0;
@@ -2142,18 +2211,21 @@
2142
2211
  }
2143
2212
 
2144
2213
  .dc-search-select__popover {
2214
+ --dc-search-select-popover-padding: 8px;
2215
+ --dc-search-select-popover-radius: 8px;
2216
+
2145
2217
  padding: 0;
2146
- padding-bottom: 8px;
2147
- border-radius: 8px;
2218
+ padding-bottom: var(--dc-search-select-popover-padding);
2219
+ border-radius: var(--dc-search-select-popover-radius);
2148
2220
  }
2149
2221
 
2150
2222
  .dc-search-select__textbox {
2151
- padding: 8px;
2223
+ padding: var(--dc-search-select-popover-padding);
2152
2224
  }
2153
2225
 
2154
2226
  .dc-search-select__listbox {
2155
2227
  max-height: 352px;
2156
- padding: 0 8px;
2228
+ padding: 0 var(--dc-search-select-popover-padding);
2157
2229
  margin: 0;
2158
2230
  overflow-y: auto;
2159
2231
  list-style: none;
@@ -2161,58 +2233,10 @@
2161
2233
  border-bottom-left-radius: inherit;
2162
2234
  }
2163
2235
 
2164
- .dc-search-select__option {
2165
- padding: 4px;
2166
- font-size: 14px;
2167
- color: inherit;
2168
- cursor: default;
2169
- border-radius: 4px;
2170
- }
2171
-
2172
- .dc-search-select__option_highlighted {
2173
- color: var(--dc-control-primary-text-color);
2174
- background: var(--dc-control-bg-inset);
2175
- }
2176
-
2177
- .dc-search-select__option_selected {
2178
- color: var(--dc-control-on-primary-color);
2179
- background: var(--dc-control-primary-color);
2180
- }
2181
-
2182
- .dc-search-select__listbox > .dc-search-select__option + .dc-search-select__option {
2236
+ .dc-search-select__listbox > [role="option"] + [role="option"] {
2183
2237
  margin-top: 2px;
2184
2238
  }
2185
2239
 
2186
- .dc-search-select__separator {
2187
- display: flex;
2188
- align-items: center;
2189
- width: 100%;
2190
- padding: 8px 0;
2191
- }
2192
-
2193
- .dc-search-select__separator::before,
2194
- .dc-search-select__separator::after {
2195
- display: block;
2196
- height: 1px;
2197
- content: '';
2198
- background: var(--dc-control-bg-inset);
2199
- }
2200
-
2201
- .dc-search-select__separator::before {
2202
- flex-shrink: 0;
2203
- width: 12px;
2204
- }
2205
-
2206
- .dc-search-select__separator::after {
2207
- flex-grow: 1;
2208
- }
2209
-
2210
- .dc-search-select__separator-label {
2211
- padding: 0 8px;
2212
- font-size: 12px;
2213
- color: var(--dc-control-secondary-text-color);
2214
- }
2215
-
2216
2240
  .dark .dc-search-select,
2217
2241
  .dark.dc-search-select {
2218
2242
  color-scheme: dark;
@@ -3340,8 +3364,7 @@
3340
3364
  height: 1px;
3341
3365
  overflow: hidden;
3342
3366
  clip: rect(0 0 0 0);
3343
- -webkit-clip-path: inset(50%);
3344
- clip-path: inset(50%);
3367
+ clip-path: inset(50%);
3345
3368
  white-space: nowrap;
3346
3369
  }
3347
3370
 
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ButtonProps } from './button.js';
3
2
  export type IconButtonProps = Omit<ButtonProps, 'caption' | 'iconLeft' | 'iconRight'>;
4
3
  export declare const IconButton: import("react").ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -45,8 +45,7 @@
45
45
  height: 1px;
46
46
  overflow: hidden;
47
47
  clip: rect(0 0 0 0);
48
- -webkit-clip-path: inset(50%);
49
- clip-path: inset(50%);
48
+ clip-path: inset(50%);
50
49
  white-space: nowrap;
51
50
  }
52
51
 
@@ -10,6 +10,6 @@ export type StringSetFilterItemProps = {
10
10
  export declare function StringSetFilterItem({ filter, isEditing, onEditStart, onEditCancel, onRemove, onChange, }: StringSetFilterItemProps): import("react/jsx-runtime").JSX.Element;
11
11
  export declare namespace StringSetFilterItem {
12
12
  var defaultValueFormatter: (value: string) => string;
13
- var defaultValuesFormatter: (values: string[]) => string;
13
+ var defaultValuesFormatter: (values: StringSetFilter["value"]) => string;
14
14
  var defaultOperatorFormatter: (operator: StringSetFilterOperator) => string;
15
15
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const ArrowSmallDownIcon: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & {
3
- ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
2
+ ref?: ((instance: SVGSVGElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<SVGSVGElement> | null | undefined;
4
3
  }, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const ArrowSmallUpIcon: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & {
3
- ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
2
+ ref?: ((instance: SVGSVGElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<SVGSVGElement> | null | undefined;
4
3
  }, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const ArrowsUpDownIcon: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & {
3
- ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
2
+ ref?: ((instance: SVGSVGElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<SVGSVGElement> | null | undefined;
4
3
  }, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const ChevronLeftIcon: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & {
3
- ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
2
+ ref?: ((instance: SVGSVGElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<SVGSVGElement> | null | undefined;
4
3
  }, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const ChevronRightIcon: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & {
3
- ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
2
+ ref?: ((instance: SVGSVGElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<SVGSVGElement> | null | undefined;
4
3
  }, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const EyeIcon: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & {
3
- ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
2
+ ref?: ((instance: SVGSVGElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<SVGSVGElement> | null | undefined;
4
3
  }, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const EyeSlashIcon: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & {
3
- ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
2
+ ref?: ((instance: SVGSVGElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<SVGSVGElement> | null | undefined;
4
3
  }, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const MagnifyingGlassIcon: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & {
3
- ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
2
+ ref?: ((instance: SVGSVGElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<SVGSVGElement> | null | undefined;
4
3
  }, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const TrashIcon: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & {
3
- ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
2
+ ref?: ((instance: SVGSVGElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<SVGSVGElement> | null | undefined;
4
3
  }, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const XMarkIcon: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & {
3
- ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
2
+ ref?: ((instance: SVGSVGElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<SVGSVGElement> | null | undefined;
4
3
  }, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const ExclamationTriangleIcon: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & {
3
- ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
2
+ ref?: ((instance: SVGSVGElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<SVGSVGElement> | null | undefined;
4
3
  }, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
@@ -34,18 +34,18 @@ export type PopoverProps = {
34
34
  onClose?: PopoverCloseCallback;
35
35
  } & PopoverHTMLProps;
36
36
  export declare const Popover: import("react").ForwardRefExoticComponent<{
37
- defaultIsOpen?: boolean | undefined;
38
- isOpen?: boolean | undefined;
39
- shouldTrapFocus?: boolean | undefined;
40
- shouldFocusAnchorAfterEscPress?: boolean | undefined;
41
- transitionDurationMs?: number | undefined;
42
- anchorGap?: number | undefined;
43
- viewportGap?: number | undefined;
37
+ defaultIsOpen?: boolean;
38
+ isOpen?: boolean;
39
+ shouldTrapFocus?: boolean;
40
+ shouldFocusAnchorAfterEscPress?: boolean;
41
+ transitionDurationMs?: number;
42
+ anchorGap?: number;
43
+ viewportGap?: number;
44
44
  placement?: PopoverPlacement;
45
45
  alignment?: PopoverAlignment;
46
46
  anchor: ReactNode | PopoverAnchorRenderFn;
47
47
  children: ReactNode;
48
- onOpen?: PopoverOpenCallback | undefined;
49
- onClose?: PopoverCloseCallback | undefined;
48
+ onOpen?: PopoverOpenCallback;
49
+ onClose?: PopoverCloseCallback;
50
50
  } & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<PopoverRef>>;
51
51
  export {};
@@ -1,3 +1,72 @@
1
+ .dc-search-select-button-label {
2
+ display: inline-flex;
3
+ gap: 0.5em;
4
+ align-items: center;
5
+ }
6
+
7
+ .dc-search-select-button-label > b {
8
+ font-weight: 700;
9
+ }
10
+
11
+ .dc-search-select-option {
12
+ box-sizing: border-box;
13
+ display: flex;
14
+ flex-direction: column;
15
+ justify-content: center;
16
+ min-height: 28px;
17
+ padding: 4px 8px;
18
+ font-size: 14px;
19
+ line-height: 1.25;
20
+ color: inherit;
21
+ cursor: default;
22
+ border-radius: 5px;
23
+ }
24
+
25
+ .dc-search-select-option_highlighted {
26
+ color: var(--dc-control-primary-text-color);
27
+ background: var(--dc-control-bg-inset);
28
+ }
29
+
30
+ .dc-search-select-option_selected {
31
+ color: var(--dc-control-on-primary-color);
32
+ background: var(--dc-control-primary-color);
33
+ }
34
+
35
+ .dc-search-select-option__caption {
36
+ font-size: 80%;
37
+ opacity: 0.75;
38
+ }
39
+
40
+ .dc-search-select-separator {
41
+ display: flex;
42
+ align-items: center;
43
+ width: 100%;
44
+ padding: 8px 0;
45
+ }
46
+
47
+ .dc-search-select-separator::before,
48
+ .dc-search-select-separator::after {
49
+ display: block;
50
+ height: 1px;
51
+ content: '';
52
+ background: var(--dc-control-bg-inset);
53
+ }
54
+
55
+ .dc-search-select-separator::before {
56
+ flex-shrink: 0;
57
+ width: 12px;
58
+ }
59
+
60
+ .dc-search-select-separator::after {
61
+ flex-grow: 1;
62
+ }
63
+
64
+ .dc-search-select-separator__label {
65
+ padding: 0 8px;
66
+ font-size: 12px;
67
+ color: var(--dc-control-secondary-text-color);
68
+ }
69
+
1
70
  .dc-search-select {
2
71
  --dc-search-select-font-size: 14px;
3
72
  --dc-search-select-text-color: var(--dc-control-primary-text-color);
@@ -66,7 +135,7 @@
66
135
  --dc-search-select-radius: 8px;
67
136
  }
68
137
 
69
- .dc-search-select__slot-left {
138
+ .dc-search-select__slot-right {
70
139
  position: absolute;
71
140
  top: 0;
72
141
  right: 0;
@@ -84,18 +153,21 @@
84
153
  }
85
154
 
86
155
  .dc-search-select__popover {
156
+ --dc-search-select-popover-padding: 8px;
157
+ --dc-search-select-popover-radius: 8px;
158
+
87
159
  padding: 0;
88
- padding-bottom: 8px;
89
- border-radius: 8px;
160
+ padding-bottom: var(--dc-search-select-popover-padding);
161
+ border-radius: var(--dc-search-select-popover-radius);
90
162
  }
91
163
 
92
164
  .dc-search-select__textbox {
93
- padding: 8px;
165
+ padding: var(--dc-search-select-popover-padding);
94
166
  }
95
167
 
96
168
  .dc-search-select__listbox {
97
169
  max-height: 352px;
98
- padding: 0 8px;
170
+ padding: 0 var(--dc-search-select-popover-padding);
99
171
  margin: 0;
100
172
  overflow-y: auto;
101
173
  list-style: none;
@@ -103,58 +175,10 @@
103
175
  border-bottom-left-radius: inherit;
104
176
  }
105
177
 
106
- .dc-search-select__option {
107
- padding: 4px;
108
- font-size: 14px;
109
- color: inherit;
110
- cursor: default;
111
- border-radius: 4px;
112
- }
113
-
114
- .dc-search-select__option_highlighted {
115
- color: var(--dc-control-primary-text-color);
116
- background: var(--dc-control-bg-inset);
117
- }
118
-
119
- .dc-search-select__option_selected {
120
- color: var(--dc-control-on-primary-color);
121
- background: var(--dc-control-primary-color);
122
- }
123
-
124
- .dc-search-select__listbox > .dc-search-select__option + .dc-search-select__option {
178
+ .dc-search-select__listbox > [role="option"] + [role="option"] {
125
179
  margin-top: 2px;
126
180
  }
127
181
 
128
- .dc-search-select__separator {
129
- display: flex;
130
- align-items: center;
131
- width: 100%;
132
- padding: 8px 0;
133
- }
134
-
135
- .dc-search-select__separator::before,
136
- .dc-search-select__separator::after {
137
- display: block;
138
- height: 1px;
139
- content: '';
140
- background: var(--dc-control-bg-inset);
141
- }
142
-
143
- .dc-search-select__separator::before {
144
- flex-shrink: 0;
145
- width: 12px;
146
- }
147
-
148
- .dc-search-select__separator::after {
149
- flex-grow: 1;
150
- }
151
-
152
- .dc-search-select__separator-label {
153
- padding: 0 8px;
154
- font-size: 12px;
155
- color: var(--dc-control-secondary-text-color);
156
- }
157
-
158
182
  .dark .dc-search-select,
159
183
  .dark.dc-search-select {
160
184
  color-scheme: dark;
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
2
2
  type RenderLabelFn<Value> = (value: Value) => ReactNode;
3
3
  type RenderOptionsFn = (props: {
4
4
  searchQuery: string;
5
- searchQueryLowercased: string;
5
+ searchQueryLowerCased: string;
6
6
  }) => ReactNode;
7
7
  export type SearchSelectSize = 'sm' | 'md' | 'lg';
8
8
  export type SearchSelectProps<Value> = {
@@ -23,14 +23,21 @@ export type SearchSelectProps<Value> = {
23
23
  };
24
24
  export declare function SearchSelect<Value>({ className, size, fullWidth, invalid, loading, disabled, textboxIcon, textboxAriaLabel, textboxPlaceholder, labelledBy, displayedValue, children, value: selectedValue, onChange: onSelectedValueChange, }: SearchSelectProps<Value>): import("react/jsx-runtime").JSX.Element;
25
25
  export declare namespace SearchSelect {
26
- var Option: <T>({ className, value, children, }: {
27
- className?: string | undefined;
26
+ var Option: <T>({ className, value, children, caption, }: {
27
+ className?: string;
28
28
  value: T;
29
29
  children: ReactNode;
30
+ caption?: ReactNode;
30
31
  }) => import("react/jsx-runtime").JSX.Element;
31
32
  var Separator: ({ className, children, }: {
32
- className?: string | undefined;
33
+ className?: string;
33
34
  children?: ReactNode;
34
35
  }) => import("react/jsx-runtime").JSX.Element;
36
+ var ButtonLabel: ({ className, icon, value, children, }: {
37
+ className?: string;
38
+ icon?: ReactNode;
39
+ value: ReactNode;
40
+ children: ReactNode;
41
+ }) => import("react/jsx-runtime").JSX.Element;
35
42
  }
36
43
  export {};
@@ -146,30 +146,35 @@ export function SearchSelect({ className, size = 'md', fullWidth, invalid, loadi
146
146
  [`dc-search-select_size_${size}`]: size,
147
147
  }), id: buttonId, "aria-expanded": isOpen, "aria-controls": listboxId, "aria-labelledby": labelledBy, tabIndex: disabled || loading ? -1 : undefined, type: "button", onClick: handleButtonClick, onKeyDown: handleButtonKeyDown, children: [typeof displayedValue === 'function'
148
148
  ? displayedValue(selectedValue)
149
- : displayedValue, _jsx("span", { className: "dc-search-select__slot-left", children: loading
149
+ : displayedValue, _jsx("span", { className: "dc-search-select__slot-right", children: loading
150
150
  ? (_jsx(Spinner, { className: "dc-search-select__spinner", width: "1.05em", height: "1.05em" }))
151
151
  : (_jsx(ChevronDown, { className: "dc-search-select__arrow", width: "1.05em", height: "1.05em", strokeWidth: 2 })) })] })), alignment: "start", placement: "bottom", children: _jsxs(_Fragment, { children: [_jsx("div", { className: "dc-search-select__textbox", children: _jsx(TextInput, { id: textboxId, fullWidth: true, slotLeft: textboxIcon || _jsx(MagnifyingGlass, { width: 16, height: 16 }), placeholder: textboxPlaceholder, size: "sm", type: "text", role: "combobox", "aria-controls": listboxId, "aria-expanded": "true", "aria-autocomplete": "list", "aria-activedescendant": options.idOf(highlightedValue), "aria-label": textboxAriaLabel, value: searchQuery, onChange: handleTextboxChange, onKeyDown: handleTextboxKeyDown }) }), _jsx(SearchSelectContextProvider, { value: ctx, children: _jsx("ul", { className: "dc-search-select__listbox", id: listboxId, role: "listbox", children: typeof children === 'function'
152
152
  ? children({
153
153
  searchQuery,
154
- searchQueryLowercased: searchQuery.toLowerCase(),
154
+ searchQueryLowerCased: searchQuery.toLowerCase(),
155
155
  })
156
156
  : children }) })] }) }));
157
157
  }
158
- SearchSelect.Option = function SearchSelectOption({ className, value, children, }) {
158
+ SearchSelect.Option = function SearchSelectOption({ className, value, children, caption, }) {
159
159
  const { options, selectedValue, highlightedValue, setSelectedValue, setHighlightedValue, } = useSearchSelectContext();
160
160
  const id = options.append(value);
161
161
  const selected = value === selectedValue;
162
162
  const highlighted = value === highlightedValue;
163
163
  return (
164
164
  /* eslint-disable jsx-a11y/click-events-have-key-events */
165
- _jsx("li", { className: classNames(className, {
166
- 'dc-search-select__option': true,
167
- 'dc-search-select__option_selected': selected,
168
- 'dc-search-select__option_highlighted': highlighted,
169
- }), id: id, role: "option", "aria-selected": highlighted, onClick: () => setSelectedValue(value), onMouseEnter: () => setHighlightedValue(value), children: children }));
165
+ _jsxs("li", { className: classNames(className, {
166
+ 'dc-search-select-option': true,
167
+ 'dc-search-select-option_selected': selected,
168
+ 'dc-search-select-option_highlighted': highlighted,
169
+ }), id: id, role: "option", "aria-selected": highlighted, onClick: () => setSelectedValue(value), onMouseEnter: () => setHighlightedValue(value), children: [_jsx("div", { className: "dc-search-select-option__label", children: children }), caption
170
+ ? _jsx("div", { className: "dc-search-select-option__caption", children: caption })
171
+ : null] }));
170
172
  };
171
173
  SearchSelect.Separator = function SearchSelectSeparator({ className, children, }) {
172
- return (_jsx("li", { className: classNames('dc-search-select__separator', className), role: "separator", children: children
173
- ? _jsx("div", { className: "dc-search-select__separator-label", children: children })
174
+ return (_jsx("li", { className: classNames('dc-search-select-separator', className), role: "separator", children: children
175
+ ? _jsx("div", { className: "dc-search-select-separator__label", children: children })
174
176
  : null }));
175
177
  };
178
+ SearchSelect.ButtonLabel = function SearchSelectButtonLabel({ className, icon, value, children, }) {
179
+ return (_jsxs("div", { className: classNames('dc-search-select-button-label', className), children: [icon, _jsxs("span", { children: [children, " ", _jsx("b", { children: value })] })] }));
180
+ };
@@ -20,30 +20,30 @@ export type SelectProps = SelectBaseProps & ({
20
20
  onChangeValue?: (value: string[]) => void;
21
21
  });
22
22
  export declare const Select: import("react").ForwardRefExoticComponent<(Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref"> & {
23
- ref?: ((instance: HTMLSelectElement | null) => void) | import("react").RefObject<HTMLSelectElement> | null | undefined;
23
+ ref?: ((instance: HTMLSelectElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLSelectElement> | null | undefined;
24
24
  }, "defaultValue" | "size" | "value" | "multiple"> & {
25
- fullWidth?: boolean | undefined;
26
- invalid?: boolean | undefined;
27
- loading?: boolean | undefined;
28
- size?: SelectSize | undefined;
29
- displayedOptionsCount?: number | undefined;
25
+ fullWidth?: boolean;
26
+ invalid?: boolean;
27
+ loading?: boolean;
28
+ size?: SelectSize;
29
+ displayedOptionsCount?: number;
30
30
  } & {
31
- multiple?: false | undefined;
32
- value?: string | number | undefined;
33
- defaultValue?: string | number | undefined;
34
- onChangeValue?: ((value: string) => void) | undefined;
31
+ multiple?: false;
32
+ value?: string | number;
33
+ defaultValue?: string | number;
34
+ onChangeValue?: (value: string) => void;
35
35
  }, "ref"> | Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref"> & {
36
- ref?: ((instance: HTMLSelectElement | null) => void) | import("react").RefObject<HTMLSelectElement> | null | undefined;
36
+ ref?: ((instance: HTMLSelectElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLSelectElement> | null | undefined;
37
37
  }, "defaultValue" | "size" | "value" | "multiple"> & {
38
- fullWidth?: boolean | undefined;
39
- invalid?: boolean | undefined;
40
- loading?: boolean | undefined;
41
- size?: SelectSize | undefined;
42
- displayedOptionsCount?: number | undefined;
38
+ fullWidth?: boolean;
39
+ invalid?: boolean;
40
+ loading?: boolean;
41
+ size?: SelectSize;
42
+ displayedOptionsCount?: number;
43
43
  } & {
44
44
  multiple: true;
45
- value?: string[] | undefined;
46
- defaultValue?: string[] | undefined;
47
- onChangeValue?: ((value: string[]) => void) | undefined;
45
+ value?: string[];
46
+ defaultValue?: string[];
47
+ onChangeValue?: (value: string[]) => void;
48
48
  }, "ref">) & import("react").RefAttributes<HTMLSelectElement>>;
49
49
  export {};
@@ -11,7 +11,7 @@ export type SelectionControlProps = {
11
11
  children: JSX.Element | SelectionControlRenderFn;
12
12
  } & SelectionControlBaseProps;
13
13
  export declare const SelectionControl: import("react").ForwardRefExoticComponent<{
14
- labelFor?: string | undefined;
14
+ labelFor?: string;
15
15
  caption?: ReactNode;
16
16
  label: ReactNode;
17
17
  children: JSX.Element | SelectionControlRenderFn;
@@ -14,10 +14,10 @@ export type SlideOverRef = {
14
14
  close: () => void;
15
15
  };
16
16
  export declare const SlideOver: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
17
- animationDurationMs?: number | undefined;
18
- animationDisabled?: boolean | undefined;
19
- shouldCloseOnEscKeyPress?: boolean | undefined;
20
- shouldCloseOnBackdropClick?: boolean | undefined;
17
+ animationDurationMs?: number;
18
+ animationDisabled?: boolean;
19
+ shouldCloseOnEscKeyPress?: boolean;
20
+ shouldCloseOnBackdropClick?: boolean;
21
21
  onClose: SlideOverCloseCallback;
22
22
  } & import("react").RefAttributes<SlideOverRef>> & {
23
23
  Header: typeof SlideOverHeader;
@@ -3,5 +3,5 @@ export type SpinnerProps = ComponentPropsWithoutRef<'svg'> & {
3
3
  size?: number | string;
4
4
  };
5
5
  export declare const Spinner: import("react").ForwardRefExoticComponent<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & {
6
- size?: string | number | undefined;
6
+ size?: number | string;
7
7
  } & import("react").RefAttributes<SVGSVGElement>>;
@@ -1,5 +1,5 @@
1
1
  import { ComponentPropsWithRef } from 'react';
2
2
  export type TableBodyProps = ComponentPropsWithRef<'tbody'>;
3
3
  export declare const TableBody: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & {
4
- ref?: ((instance: HTMLTableSectionElement | null) => void) | import("react").RefObject<HTMLTableSectionElement> | null | undefined;
4
+ ref?: ((instance: HTMLTableSectionElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLTableSectionElement> | null | undefined;
5
5
  }, "ref"> & import("react").RefAttributes<HTMLTableSectionElement>>;
@@ -1,5 +1,5 @@
1
1
  import { ComponentPropsWithRef } from 'react';
2
2
  export type TableCellProps = ComponentPropsWithRef<'td'>;
3
3
  export declare const TableCell: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, "ref"> & {
4
- ref?: ((instance: HTMLTableDataCellElement | null) => void) | import("react").RefObject<HTMLTableDataCellElement> | null | undefined;
4
+ ref?: ((instance: HTMLTableDataCellElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLTableDataCellElement> | null | undefined;
5
5
  }, "ref"> & import("react").RefAttributes<HTMLTableCellElement>>;
@@ -1,5 +1,5 @@
1
1
  import { ComponentPropsWithRef } from 'react';
2
2
  export type ToastButtonProps = ComponentPropsWithRef<'button'>;
3
3
  export declare const ToastButton: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
4
- ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
4
+ ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
5
5
  }, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -15,7 +15,7 @@ export class Toaster {
15
15
  onHide;
16
16
  constructor(params) {
17
17
  this._id = 0;
18
- this.timeoutMs = params?.timeoutMs || 10000;
18
+ this.timeoutMs = params?.timeoutMs || 10_000;
19
19
  this.onShow = params?.onShowToast;
20
20
  this.onHide = params?.onHideToast;
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "draft-components",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "description": "The React based UI components library.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -22,7 +22,7 @@
22
22
  "css"
23
23
  ],
24
24
  "scripts": {
25
- "prepare": "husky install",
25
+ "prepare": "husky",
26
26
  "test": "vitest run",
27
27
  "coverage": "vitest run --coverage",
28
28
  "lint": "npm run lint-js && npm run lint-css",
@@ -55,47 +55,49 @@
55
55
  "react-dom": ">= 18"
56
56
  },
57
57
  "devDependencies": {
58
- "@heroicons/react": "2.1.1",
59
- "@storybook/addon-actions": "7.6.7",
60
- "@storybook/addon-essentials": "7.6.7",
61
- "@storybook/addon-links": "7.6.7",
62
- "@storybook/addon-themes": "7.6.7",
63
- "@storybook/react": "7.6.7",
64
- "@storybook/react-vite": "7.6.7",
65
- "@stylistic/eslint-plugin": "1.6.3",
66
- "@testing-library/dom": "9.3.3",
67
- "@testing-library/jest-dom": "6.2.0",
68
- "@testing-library/react": "14.1.2",
58
+ "@heroicons/react": "2.1.5",
59
+ "@storybook/addon-actions": "^8.2.7",
60
+ "@storybook/addon-essentials": "^8.2.7",
61
+ "@storybook/addon-links": "^8.2.7",
62
+ "@storybook/addon-themes": "^8.2.7",
63
+ "@storybook/core-common": "^8.2.7",
64
+ "@storybook/react": "^8.2.7",
65
+ "@storybook/react-vite": "^8.2.7",
66
+ "@stylistic/eslint-plugin": "2.6.1",
67
+ "@testing-library/dom": "10.4.0",
68
+ "@testing-library/jest-dom": "6.4.8",
69
+ "@testing-library/react": "16.0.0",
69
70
  "@testing-library/user-event": "14.5.2",
70
- "@types/node": "20.10.7",
71
- "@types/react": "18.2.47",
72
- "@types/react-dom": "18.2.18",
73
- "@typescript-eslint/eslint-plugin": "7.1.1",
74
- "@typescript-eslint/parser": "7.1.1",
75
- "@vitest/coverage-istanbul": "1.1.3",
76
- "autoprefixer": "10.4.16",
71
+ "@types/node": "20.14.13",
72
+ "@types/react": "18.3.3",
73
+ "@types/react-dom": "18.3.0",
74
+ "@typescript-eslint/eslint-plugin": "8.0.0",
75
+ "@typescript-eslint/parser": "8.0.0",
76
+ "@vitejs/plugin-react": "4.3.1",
77
+ "@vitest/coverage-istanbul": "2.0.5",
78
+ "autoprefixer": "10.4.19",
77
79
  "color": "4.2.3",
78
80
  "eslint": "8.57.0",
79
- "eslint-plugin-jsx-a11y": "6.8.0",
80
- "eslint-plugin-react": "7.34.0",
81
- "eslint-plugin-react-hooks": "4.6.0",
81
+ "eslint-plugin-jsx-a11y": "6.9.0",
82
+ "eslint-plugin-react": "7.35.0",
83
+ "eslint-plugin-react-hooks": "4.6.2",
82
84
  "eslint-plugin-storybook": "0.8.0",
83
- "eslint-plugin-testing-library": "6.2.0",
84
- "glob": "10.3.10",
85
- "husky": "8.0.3",
86
- "jsdom": "23.2.0",
87
- "lint-staged": "15.2.0",
88
- "postcss": "8.4.33",
89
- "postcss-import": "16.0.0",
90
- "react": "18.2.0",
91
- "react-dom": "18.2.0",
92
- "storybook": "7.6.7",
93
- "stylelint": "16.2.1",
94
- "stylelint-config-recess-order": "5.0.0",
95
- "stylelint-config-standard": "36.0.0",
96
- "typescript": "5.3.3",
97
- "vite": "5.0.11",
98
- "vitest": "1.1.3"
85
+ "eslint-plugin-testing-library": "6.2.2",
86
+ "glob": "11.0.0",
87
+ "husky": "9.1.4",
88
+ "jsdom": "24.1.1",
89
+ "lint-staged": "15.2.7",
90
+ "postcss": "8.4.40",
91
+ "postcss-import": "16.1.0",
92
+ "react": "18.3.1",
93
+ "react-dom": "18.3.1",
94
+ "storybook": "^8.2.7",
95
+ "stylelint": "16.8.1",
96
+ "stylelint-config-recess-order": "5.0.1",
97
+ "stylelint-config-standard": "36.0.1",
98
+ "typescript": "5.5.4",
99
+ "vite": "5.3.5",
100
+ "vitest": "2.0.5"
99
101
  },
100
102
  "lint-staged": {
101
103
  "*.ts?(x)": "npm run lint-js",