draft-components 3.3.0 → 3.5.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.
- package/css/draft-components.css +103 -67
- package/dist/components/button/icon-button.d.ts +0 -1
- package/dist/components/color-picker/color-picker.css +1 -2
- package/dist/components/filtered-search/string-set-filter-item.d.ts +1 -1
- package/dist/components/hero-icons/24/outline/arrow-small-down-icon.d.ts +1 -2
- package/dist/components/hero-icons/24/outline/arrow-small-up-icon.d.ts +1 -2
- package/dist/components/hero-icons/24/outline/arrows-up-down-icon.d.ts +1 -2
- package/dist/components/hero-icons/24/outline/chevron-left-icon.d.ts +1 -2
- package/dist/components/hero-icons/24/outline/chevron-right-icon.d.ts +1 -2
- package/dist/components/hero-icons/24/outline/eye-icon.d.ts +1 -2
- package/dist/components/hero-icons/24/outline/eye-slash-icon.d.ts +1 -2
- package/dist/components/hero-icons/24/outline/magnifying-glass-icon.d.ts +1 -2
- package/dist/components/hero-icons/24/outline/trash-icon.d.ts +1 -2
- package/dist/components/hero-icons/24/outline/x-mark-icon.d.ts +1 -2
- package/dist/components/hero-icons/24/solid/exclamation-triangle-icon.d.ts +1 -2
- package/dist/components/popover/popover.d.ts +9 -9
- package/dist/components/search-select/search-select.css +79 -54
- package/dist/components/search-select/search-select.d.ts +13 -5
- package/dist/components/search-select/search-select.js +17 -12
- package/dist/components/segmented-control/segmented-control.css +11 -11
- package/dist/components/select/select.d.ts +19 -19
- package/dist/components/selection-control/selection-control.d.ts +1 -1
- package/dist/components/slide-over/slide-over.d.ts +4 -4
- package/dist/components/spinner/spinner.d.ts +1 -1
- package/dist/components/table/table-body.d.ts +1 -1
- package/dist/components/table/table-cell.d.ts +1 -1
- package/dist/components/text-input/text-input.css +12 -0
- package/dist/components/text-input/text-input.d.ts +2 -0
- package/dist/components/text-input/text-input.js +2 -1
- package/dist/components/toast/toast-button.d.ts +1 -1
- package/dist/components/toaster/toaster.js +1 -1
- package/package.json +41 -39
package/css/draft-components.css
CHANGED
|
@@ -1758,6 +1758,18 @@
|
|
|
1758
1758
|
outline: none;
|
|
1759
1759
|
}
|
|
1760
1760
|
|
|
1761
|
+
.dc-text-input_align_left .dc-text-input__native {
|
|
1762
|
+
text-align: left;
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
.dc-text-input_align_right .dc-text-input__native {
|
|
1766
|
+
text-align: right;
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
.dc-text-input_align_center .dc-text-input__native {
|
|
1770
|
+
text-align: center;
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1761
1773
|
.dc-text-input__slot-left,
|
|
1762
1774
|
.dc-text-input__slot-right {
|
|
1763
1775
|
box-sizing: border-box;
|
|
@@ -2056,6 +2068,75 @@
|
|
|
2056
2068
|
color-scheme: dark;
|
|
2057
2069
|
}
|
|
2058
2070
|
|
|
2071
|
+
.dc-search-select-button-label {
|
|
2072
|
+
display: inline-flex;
|
|
2073
|
+
gap: 0.5em;
|
|
2074
|
+
align-items: center;
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
.dc-search-select-button-label > b {
|
|
2078
|
+
font-weight: 700;
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
.dc-search-select-option {
|
|
2082
|
+
box-sizing: border-box;
|
|
2083
|
+
display: flex;
|
|
2084
|
+
flex-direction: column;
|
|
2085
|
+
justify-content: center;
|
|
2086
|
+
min-height: 28px;
|
|
2087
|
+
padding: 4px 8px;
|
|
2088
|
+
font-size: 14px;
|
|
2089
|
+
line-height: 1.25;
|
|
2090
|
+
color: inherit;
|
|
2091
|
+
cursor: default;
|
|
2092
|
+
border-radius: 5px;
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
.dc-search-select-option_highlighted {
|
|
2096
|
+
color: var(--dc-control-primary-text-color);
|
|
2097
|
+
background: var(--dc-control-bg-inset);
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
.dc-search-select-option_selected {
|
|
2101
|
+
color: var(--dc-control-on-primary-color);
|
|
2102
|
+
background: var(--dc-control-primary-color);
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2105
|
+
.dc-search-select-option__caption {
|
|
2106
|
+
font-size: 80%;
|
|
2107
|
+
opacity: 0.75;
|
|
2108
|
+
}
|
|
2109
|
+
|
|
2110
|
+
.dc-search-select-separator {
|
|
2111
|
+
display: flex;
|
|
2112
|
+
align-items: center;
|
|
2113
|
+
width: 100%;
|
|
2114
|
+
padding: 8px 0;
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
.dc-search-select-separator::before,
|
|
2118
|
+
.dc-search-select-separator::after {
|
|
2119
|
+
display: block;
|
|
2120
|
+
height: 1px;
|
|
2121
|
+
content: '';
|
|
2122
|
+
background: var(--dc-control-bg-inset);
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
.dc-search-select-separator::before {
|
|
2126
|
+
flex-shrink: 0;
|
|
2127
|
+
width: 12px;
|
|
2128
|
+
}
|
|
2129
|
+
|
|
2130
|
+
.dc-search-select-separator::after {
|
|
2131
|
+
flex-grow: 1;
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
.dc-search-select-separator__label {
|
|
2135
|
+
padding: 0 8px;
|
|
2136
|
+
font-size: 12px;
|
|
2137
|
+
color: var(--dc-control-secondary-text-color);
|
|
2138
|
+
}
|
|
2139
|
+
|
|
2059
2140
|
.dc-search-select {
|
|
2060
2141
|
--dc-search-select-font-size: 14px;
|
|
2061
2142
|
--dc-search-select-text-color: var(--dc-control-primary-text-color);
|
|
@@ -2089,6 +2170,7 @@
|
|
|
2089
2170
|
|
|
2090
2171
|
.dc-search-select:focus {
|
|
2091
2172
|
border-color: var(--dc-search-select-focus-ring-color);
|
|
2173
|
+
outline: none;
|
|
2092
2174
|
box-shadow: 0 0 0 1px var(--dc-search-select-focus-ring-color);
|
|
2093
2175
|
}
|
|
2094
2176
|
|
|
@@ -2124,7 +2206,7 @@
|
|
|
2124
2206
|
--dc-search-select-radius: 8px;
|
|
2125
2207
|
}
|
|
2126
2208
|
|
|
2127
|
-
.dc-search-select__slot-
|
|
2209
|
+
.dc-search-select__slot-right {
|
|
2128
2210
|
position: absolute;
|
|
2129
2211
|
top: 0;
|
|
2130
2212
|
right: 0;
|
|
@@ -2142,18 +2224,21 @@
|
|
|
2142
2224
|
}
|
|
2143
2225
|
|
|
2144
2226
|
.dc-search-select__popover {
|
|
2227
|
+
--dc-search-select-popover-padding: 8px;
|
|
2228
|
+
--dc-search-select-popover-radius: 8px;
|
|
2229
|
+
|
|
2145
2230
|
padding: 0;
|
|
2146
|
-
padding-bottom:
|
|
2147
|
-
border-radius:
|
|
2231
|
+
padding-bottom: var(--dc-search-select-popover-padding);
|
|
2232
|
+
border-radius: var(--dc-search-select-popover-radius);
|
|
2148
2233
|
}
|
|
2149
2234
|
|
|
2150
2235
|
.dc-search-select__textbox {
|
|
2151
|
-
padding:
|
|
2236
|
+
padding: var(--dc-search-select-popover-padding);
|
|
2152
2237
|
}
|
|
2153
2238
|
|
|
2154
2239
|
.dc-search-select__listbox {
|
|
2155
2240
|
max-height: 352px;
|
|
2156
|
-
padding: 0
|
|
2241
|
+
padding: 0 var(--dc-search-select-popover-padding);
|
|
2157
2242
|
margin: 0;
|
|
2158
2243
|
overflow-y: auto;
|
|
2159
2244
|
list-style: none;
|
|
@@ -2161,58 +2246,10 @@
|
|
|
2161
2246
|
border-bottom-left-radius: inherit;
|
|
2162
2247
|
}
|
|
2163
2248
|
|
|
2164
|
-
.dc-search-
|
|
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 {
|
|
2249
|
+
.dc-search-select__listbox > [role="option"] + [role="option"] {
|
|
2183
2250
|
margin-top: 2px;
|
|
2184
2251
|
}
|
|
2185
2252
|
|
|
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
2253
|
.dark .dc-search-select,
|
|
2217
2254
|
.dark.dc-search-select {
|
|
2218
2255
|
color-scheme: dark;
|
|
@@ -3108,19 +3145,19 @@
|
|
|
3108
3145
|
font-size: 15px;
|
|
3109
3146
|
}
|
|
3110
3147
|
|
|
3111
|
-
.dc-segmented__item + .dc-segmented__item
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
background:
|
|
3118
|
-
|
|
3148
|
+
.dc-segmented__item + .dc-segmented__item {
|
|
3149
|
+
background-image: linear-gradient(to bottom,
|
|
3150
|
+
transparent 25%,
|
|
3151
|
+
var(--dc-segmented-delimiter-color) 25% 75%,
|
|
3152
|
+
transparent 75%
|
|
3153
|
+
);
|
|
3154
|
+
background-repeat: no-repeat;
|
|
3155
|
+
background-size: 1px 100%;
|
|
3119
3156
|
}
|
|
3120
3157
|
|
|
3121
|
-
.dc-segmented__item_selected
|
|
3122
|
-
.dc-segmented__item_selected + .dc-segmented__item
|
|
3123
|
-
|
|
3158
|
+
.dc-segmented__item_selected,
|
|
3159
|
+
.dc-segmented__item_selected + .dc-segmented__item {
|
|
3160
|
+
background-image: none;
|
|
3124
3161
|
}
|
|
3125
3162
|
|
|
3126
3163
|
.dc-segmented-button {
|
|
@@ -3340,8 +3377,7 @@
|
|
|
3340
3377
|
height: 1px;
|
|
3341
3378
|
overflow: hidden;
|
|
3342
3379
|
clip: rect(0 0 0 0);
|
|
3343
|
-
|
|
3344
|
-
clip-path: inset(50%);
|
|
3380
|
+
clip-path: inset(50%);
|
|
3345
3381
|
white-space: nowrap;
|
|
3346
3382
|
}
|
|
3347
3383
|
|
|
@@ -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>>;
|
|
@@ -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:
|
|
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
|
|
38
|
-
isOpen?: boolean
|
|
39
|
-
shouldTrapFocus?: boolean
|
|
40
|
-
shouldFocusAnchorAfterEscPress?: boolean
|
|
41
|
-
transitionDurationMs?: number
|
|
42
|
-
anchorGap?: number
|
|
43
|
-
viewportGap?: number
|
|
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
|
|
49
|
-
onClose?: PopoverCloseCallback
|
|
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);
|
|
@@ -31,6 +100,7 @@
|
|
|
31
100
|
|
|
32
101
|
.dc-search-select:focus {
|
|
33
102
|
border-color: var(--dc-search-select-focus-ring-color);
|
|
103
|
+
outline: none;
|
|
34
104
|
box-shadow: 0 0 0 1px var(--dc-search-select-focus-ring-color);
|
|
35
105
|
}
|
|
36
106
|
|
|
@@ -66,7 +136,7 @@
|
|
|
66
136
|
--dc-search-select-radius: 8px;
|
|
67
137
|
}
|
|
68
138
|
|
|
69
|
-
.dc-search-select__slot-
|
|
139
|
+
.dc-search-select__slot-right {
|
|
70
140
|
position: absolute;
|
|
71
141
|
top: 0;
|
|
72
142
|
right: 0;
|
|
@@ -84,18 +154,21 @@
|
|
|
84
154
|
}
|
|
85
155
|
|
|
86
156
|
.dc-search-select__popover {
|
|
157
|
+
--dc-search-select-popover-padding: 8px;
|
|
158
|
+
--dc-search-select-popover-radius: 8px;
|
|
159
|
+
|
|
87
160
|
padding: 0;
|
|
88
|
-
padding-bottom:
|
|
89
|
-
border-radius:
|
|
161
|
+
padding-bottom: var(--dc-search-select-popover-padding);
|
|
162
|
+
border-radius: var(--dc-search-select-popover-radius);
|
|
90
163
|
}
|
|
91
164
|
|
|
92
165
|
.dc-search-select__textbox {
|
|
93
|
-
padding:
|
|
166
|
+
padding: var(--dc-search-select-popover-padding);
|
|
94
167
|
}
|
|
95
168
|
|
|
96
169
|
.dc-search-select__listbox {
|
|
97
170
|
max-height: 352px;
|
|
98
|
-
padding: 0
|
|
171
|
+
padding: 0 var(--dc-search-select-popover-padding);
|
|
99
172
|
margin: 0;
|
|
100
173
|
overflow-y: auto;
|
|
101
174
|
list-style: none;
|
|
@@ -103,58 +176,10 @@
|
|
|
103
176
|
border-bottom-left-radius: inherit;
|
|
104
177
|
}
|
|
105
178
|
|
|
106
|
-
.dc-search-
|
|
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 {
|
|
179
|
+
.dc-search-select__listbox > [role="option"] + [role="option"] {
|
|
125
180
|
margin-top: 2px;
|
|
126
181
|
}
|
|
127
182
|
|
|
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
183
|
.dark .dc-search-select,
|
|
159
184
|
.dark.dc-search-select {
|
|
160
185
|
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
|
-
|
|
5
|
+
searchQueryLowerCased: string;
|
|
6
6
|
}) => ReactNode;
|
|
7
7
|
export type SearchSelectSize = 'sm' | 'md' | 'lg';
|
|
8
8
|
export type SearchSelectProps<Value> = {
|
|
@@ -12,6 +12,7 @@ export type SearchSelectProps<Value> = {
|
|
|
12
12
|
invalid?: boolean;
|
|
13
13
|
loading?: boolean;
|
|
14
14
|
disabled?: boolean;
|
|
15
|
+
readOnly?: boolean;
|
|
15
16
|
textboxIcon?: ReactNode;
|
|
16
17
|
textboxAriaLabel?: string;
|
|
17
18
|
textboxPlaceholder?: string;
|
|
@@ -21,16 +22,23 @@ export type SearchSelectProps<Value> = {
|
|
|
21
22
|
value: Value;
|
|
22
23
|
onChange: (value: Value) => void;
|
|
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
|
+
export declare function SearchSelect<Value>({ className, size, fullWidth, invalid, loading, disabled, readOnly, textboxIcon, textboxAriaLabel, textboxPlaceholder, labelledBy, displayedValue, children, value: selectedValue, onChange: onSelectedValueChange, }: SearchSelectProps<Value>): import("react/jsx-runtime").JSX.Element;
|
|
25
26
|
export declare namespace SearchSelect {
|
|
26
|
-
var Option: <T>({ className, value, children, }: {
|
|
27
|
-
className?: string
|
|
27
|
+
var Option: <T>({ className, value, children, caption, }: {
|
|
28
|
+
className?: string;
|
|
28
29
|
value: T;
|
|
29
30
|
children: ReactNode;
|
|
31
|
+
caption?: ReactNode;
|
|
30
32
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
31
33
|
var Separator: ({ className, children, }: {
|
|
32
|
-
className?: string
|
|
34
|
+
className?: string;
|
|
33
35
|
children?: ReactNode;
|
|
34
36
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
var ButtonLabel: ({ className, icon, value, children, }: {
|
|
38
|
+
className?: string;
|
|
39
|
+
icon?: ReactNode;
|
|
40
|
+
value: ReactNode;
|
|
41
|
+
children: ReactNode;
|
|
42
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
35
43
|
}
|
|
36
44
|
export {};
|
|
@@ -6,7 +6,7 @@ import { Popover } from '../popover/popover.js';
|
|
|
6
6
|
import { TextInput } from '../text-input/text-input.js';
|
|
7
7
|
import { Spinner } from '../spinner/spinner.js';
|
|
8
8
|
import { ChevronDown, MagnifyingGlass } from './icons.js';
|
|
9
|
-
export function SearchSelect({ className, size = 'md', fullWidth, invalid, loading, disabled, textboxIcon, textboxAriaLabel, textboxPlaceholder = '', labelledBy, displayedValue, children, value: selectedValue, onChange: onSelectedValueChange, }) {
|
|
9
|
+
export function SearchSelect({ className, size = 'md', fullWidth, invalid, loading, disabled, readOnly, textboxIcon, textboxAriaLabel, textboxPlaceholder = '', labelledBy, displayedValue, children, value: selectedValue, onChange: onSelectedValueChange, }) {
|
|
10
10
|
const id = useId();
|
|
11
11
|
const buttonId = `${id}button`;
|
|
12
12
|
const textboxId = `${id}textbox`;
|
|
@@ -16,7 +16,7 @@ export function SearchSelect({ className, size = 'md', fullWidth, invalid, loadi
|
|
|
16
16
|
const [searchQuery, setSearchQuery] = useState('');
|
|
17
17
|
const [highlightedValue, setHighlightedValue] = useState(selectedValue);
|
|
18
18
|
const openPopover = () => {
|
|
19
|
-
if (disabled || loading) {
|
|
19
|
+
if (readOnly || disabled || loading) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
options.clear();
|
|
@@ -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-
|
|
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
|
-
|
|
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
|
-
|
|
166
|
-
'dc-search-
|
|
167
|
-
'dc-search-
|
|
168
|
-
'dc-search-
|
|
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-
|
|
173
|
-
? _jsx("div", { className: "dc-search-
|
|
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
|
+
};
|
|
@@ -46,19 +46,19 @@
|
|
|
46
46
|
font-size: 15px;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.dc-segmented__item + .dc-segmented__item
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
background:
|
|
56
|
-
|
|
49
|
+
.dc-segmented__item + .dc-segmented__item {
|
|
50
|
+
background-image: linear-gradient(to bottom,
|
|
51
|
+
transparent 25%,
|
|
52
|
+
var(--dc-segmented-delimiter-color) 25% 75%,
|
|
53
|
+
transparent 75%
|
|
54
|
+
);
|
|
55
|
+
background-repeat: no-repeat;
|
|
56
|
+
background-size: 1px 100%;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
.dc-segmented__item_selected
|
|
60
|
-
.dc-segmented__item_selected + .dc-segmented__item
|
|
61
|
-
|
|
59
|
+
.dc-segmented__item_selected,
|
|
60
|
+
.dc-segmented__item_selected + .dc-segmented__item {
|
|
61
|
+
background-image: none;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
.dc-segmented-button {
|
|
@@ -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
|
|
26
|
-
invalid?: boolean
|
|
27
|
-
loading?: boolean
|
|
28
|
-
size?: SelectSize
|
|
29
|
-
displayedOptionsCount?: number
|
|
25
|
+
fullWidth?: boolean;
|
|
26
|
+
invalid?: boolean;
|
|
27
|
+
loading?: boolean;
|
|
28
|
+
size?: SelectSize;
|
|
29
|
+
displayedOptionsCount?: number;
|
|
30
30
|
} & {
|
|
31
|
-
multiple?: false
|
|
32
|
-
value?: string | number
|
|
33
|
-
defaultValue?: string | number
|
|
34
|
-
onChangeValue?: (
|
|
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
|
|
39
|
-
invalid?: boolean
|
|
40
|
-
loading?: boolean
|
|
41
|
-
size?: SelectSize
|
|
42
|
-
displayedOptionsCount?: number
|
|
38
|
+
fullWidth?: boolean;
|
|
39
|
+
invalid?: boolean;
|
|
40
|
+
loading?: boolean;
|
|
41
|
+
size?: SelectSize;
|
|
42
|
+
displayedOptionsCount?: number;
|
|
43
43
|
} & {
|
|
44
44
|
multiple: true;
|
|
45
|
-
value?: string[]
|
|
46
|
-
defaultValue?: string[]
|
|
47
|
-
onChangeValue?: (
|
|
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
|
|
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
|
|
18
|
-
animationDisabled?: boolean
|
|
19
|
-
shouldCloseOnEscKeyPress?: boolean
|
|
20
|
-
shouldCloseOnBackdropClick?: boolean
|
|
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?:
|
|
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>>;
|
|
@@ -100,6 +100,18 @@
|
|
|
100
100
|
outline: none;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
.dc-text-input_align_left .dc-text-input__native {
|
|
104
|
+
text-align: left;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.dc-text-input_align_right .dc-text-input__native {
|
|
108
|
+
text-align: right;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.dc-text-input_align_center .dc-text-input__native {
|
|
112
|
+
text-align: center;
|
|
113
|
+
}
|
|
114
|
+
|
|
103
115
|
.dc-text-input__slot-left,
|
|
104
116
|
.dc-text-input__slot-right {
|
|
105
117
|
box-sizing: border-box;
|
|
@@ -4,6 +4,7 @@ type TextInputBaseProps = Omit<TextInputHTMLProps, 'type' | 'size'>;
|
|
|
4
4
|
export type TextInputType = 'date' | 'datetime-local' | 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'time' | 'url' | 'week';
|
|
5
5
|
export type TextInputSize = 'sm' | 'md' | 'lg';
|
|
6
6
|
export type TextInputSlotStyle = 'plain' | 'tinted';
|
|
7
|
+
export type TextInputTextAlign = 'left' | 'right' | 'center';
|
|
7
8
|
export type TextInputSlotRenderer = (props: {
|
|
8
9
|
className: string;
|
|
9
10
|
}) => ReactNode;
|
|
@@ -17,6 +18,7 @@ export type TextInputProps = TextInputBaseProps & {
|
|
|
17
18
|
slotLeft?: ReactNode | TextInputSlotRenderer;
|
|
18
19
|
slotRight?: ReactNode | TextInputSlotRenderer;
|
|
19
20
|
slotStyle?: TextInputSlotStyle;
|
|
21
|
+
textAlign?: TextInputTextAlign;
|
|
20
22
|
onChangeValue?: TextInputValueChangeHandler;
|
|
21
23
|
};
|
|
22
24
|
export declare const TextInput: import("react").ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useState } from 'react';
|
|
3
3
|
import { classNames } from '../../lib/react-helpers.js';
|
|
4
|
-
export const TextInput = forwardRef(function TextInput({ style, className, fullWidth, size = 'md', sizeInChars, slotStyle = 'plain', slotLeft, slotRight, type = 'text', invalid, disabled, onChange, onFocus, onBlur, onChangeValue, ...props }, ref) {
|
|
4
|
+
export const TextInput = forwardRef(function TextInput({ style, className, fullWidth, size = 'md', sizeInChars, slotStyle = 'plain', textAlign = 'left', slotLeft, slotRight, type = 'text', invalid, disabled, onChange, onFocus, onBlur, onChangeValue, ...props }, ref) {
|
|
5
5
|
const [focused, setFocused] = useState(false);
|
|
6
6
|
let elementBeforeInput;
|
|
7
7
|
if (slotLeft) {
|
|
@@ -46,6 +46,7 @@ export const TextInput = forwardRef(function TextInput({ style, className, fullW
|
|
|
46
46
|
return (_jsxs("div", { style: style, className: classNames(className, 'dc-text-input', {
|
|
47
47
|
[`dc-text-input_${size}`]: size,
|
|
48
48
|
[`dc-text-input_slot_${slotStyle}`]: slotStyle,
|
|
49
|
+
[`dc-text-input_align_${textAlign}`]: textAlign,
|
|
49
50
|
'dc-text-input_full-width': fullWidth,
|
|
50
51
|
'dc-text-input_invalid': invalid,
|
|
51
52
|
'dc-text-input_focused': focused,
|
|
@@ -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>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "draft-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.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
|
|
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.
|
|
59
|
-
"@storybook/addon-actions": "
|
|
60
|
-
"@storybook/addon-essentials": "
|
|
61
|
-
"@storybook/addon-links": "
|
|
62
|
-
"@storybook/addon-themes": "
|
|
63
|
-
"@storybook/
|
|
64
|
-
"@storybook/react
|
|
65
|
-
"@
|
|
66
|
-
"@
|
|
67
|
-
"@testing-library/
|
|
68
|
-
"@testing-library/
|
|
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.
|
|
71
|
-
"@types/react": "18.
|
|
72
|
-
"@types/react-dom": "18.
|
|
73
|
-
"@typescript-eslint/eslint-plugin": "
|
|
74
|
-
"@typescript-eslint/parser": "
|
|
75
|
-
"@
|
|
76
|
-
"
|
|
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.
|
|
80
|
-
"eslint-plugin-react": "7.
|
|
81
|
-
"eslint-plugin-react-hooks": "4.6.
|
|
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.
|
|
84
|
-
"glob": "
|
|
85
|
-
"husky": "
|
|
86
|
-
"jsdom": "
|
|
87
|
-
"lint-staged": "15.2.
|
|
88
|
-
"postcss": "8.4.
|
|
89
|
-
"postcss-import": "16.
|
|
90
|
-
"react": "18.
|
|
91
|
-
"react-dom": "18.
|
|
92
|
-
"storybook": "
|
|
93
|
-
"stylelint": "16.
|
|
94
|
-
"stylelint-config-recess-order": "5.0.
|
|
95
|
-
"stylelint-config-standard": "36.0.
|
|
96
|
-
"typescript": "5.
|
|
97
|
-
"vite": "5.
|
|
98
|
-
"vitest": "
|
|
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",
|