@ultraviolet/ui 3.5.0 → 3.6.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/README.md +1 -1
- package/dist/components/Checkbox/styles.css.d.ts.map +1 -1
- package/dist/components/Chip/index.d.ts +1 -1
- package/dist/components/Link/styles.css.d.ts +31 -31
- package/dist/components/Link/styles.css.d.ts.map +1 -1
- package/dist/components/Link/styles.css.js +1 -1
- package/dist/components/List/Row.d.ts +1 -0
- package/dist/components/List/Row.d.ts.map +1 -1
- package/dist/components/List/Row.js +9 -3
- package/dist/components/List/index.d.ts +0 -3
- package/dist/components/List/index.d.ts.map +1 -1
- package/dist/components/Menu/MenuContent.d.ts.map +1 -1
- package/dist/components/Menu/index.d.ts.map +1 -1
- package/dist/components/NumberInput/index.d.ts +1 -1
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popup/helpers.d.ts +1 -1
- package/dist/components/Popup/helpers.d.ts.map +1 -1
- package/dist/components/Popup/helpers.js +6 -6
- package/dist/components/Popup/index.d.ts +1 -1
- package/dist/components/Popup/index.d.ts.map +1 -1
- package/dist/components/Popup/index.js +1 -1
- package/dist/components/Popup/styles.css.js +0 -1
- package/dist/components/Popup/variables.css.js +1 -0
- package/dist/components/SelectInput/components/Dropdown.d.ts +14 -1
- package/dist/components/SelectInput/components/Dropdown.d.ts.map +1 -1
- package/dist/components/SelectInput/components/Dropdown.js +304 -131
- package/dist/components/SelectInput/components/SearchBarDropdown.d.ts.map +1 -1
- package/dist/components/SelectInput/components/SearchBarDropdown.js +10 -4
- package/dist/components/SelectInput/components/SelectBar.d.ts.map +1 -1
- package/dist/components/SelectInput/components/SelectBar.js +1 -4
- package/dist/components/SelectInput/components/dropdown.css.d.ts +7 -5
- package/dist/components/SelectInput/components/dropdown.css.d.ts.map +1 -1
- package/dist/components/SelectInput/components/dropdown.css.js +13 -9
- package/dist/components/SelectInput/constants.d.ts +13 -0
- package/dist/components/SelectInput/constants.d.ts.map +1 -0
- package/dist/components/SelectInput/constants.js +18 -0
- package/dist/components/SelectInput/index.d.ts +11 -5
- package/dist/components/SelectInput/index.d.ts.map +1 -1
- package/dist/components/SelectInput/index.js +7 -1
- package/dist/components/SelectInput/types.d.ts +0 -5
- package/dist/components/SelectInput/types.d.ts.map +1 -1
- package/dist/components/Slider/components/DoubleSlider.d.ts +1 -1
- package/dist/components/Slider/components/DoubleSlider.d.ts.map +1 -1
- package/dist/components/Slider/components/DoubleSlider.js +14 -10
- package/dist/components/Slider/components/SingleSlider.d.ts +1 -1
- package/dist/components/Slider/components/SingleSlider.d.ts.map +1 -1
- package/dist/components/Slider/components/SingleSlider.js +9 -3
- package/dist/components/Slider/index.d.ts +1 -1
- package/dist/components/Slider/index.d.ts.map +1 -1
- package/dist/components/Slider/index.js +3 -0
- package/dist/components/Slider/types.d.ts +5 -0
- package/dist/components/Slider/types.d.ts.map +1 -1
- package/dist/components/Stack/index.d.ts +2 -3
- package/dist/components/Stack/index.d.ts.map +1 -1
- package/dist/components/Stack/index.js +67 -65
- package/dist/components/Tabs/index.d.ts +1 -1
- package/dist/components/TextInput/index.d.ts +1 -1
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/components/Tooltip/index.d.ts.map +1 -1
- package/dist/theme/ThemeProvider.js +1 -1
- package/dist/ui.css +1 -1
- package/package.json +4 -4
- package/dist/components/SelectInput/types.js +0 -9
|
@@ -7,16 +7,19 @@ var dropdownContainerUnGrouped = "uv_5kpm8k3";
|
|
|
7
7
|
var dropdownGroup = "uv_5kpm8k4";
|
|
8
8
|
var dropdownGroupSelectable = "uv_5kpm8k5";
|
|
9
9
|
var dropdownGroupWrapper = "uv_5kpm8k6";
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
10
|
+
var emptyStateGroupStyle = "uv_5kpm8k7";
|
|
11
|
+
var dropdownItem = createRuntimeFn({ defaultClassName: "uv_5kpm8k9 uv_5kpm8k8 uv_5kpm8k7", variantClassNames: { selected: { true: "uv_5kpm8ka" }, disabled: { true: "uv_5kpm8kb" } }, defaultVariants: { disabled: false, selected: false }, compoundVariants: [] });
|
|
12
|
+
var footer = "uv_5kpm8kc";
|
|
13
|
+
var dropdownCheckbox = "uv_5kpm8kd";
|
|
14
|
+
var dropdownEmptyState = "uv_5kpm8ke";
|
|
15
|
+
var dropdownLoadMore = "uv_5kpm8kf";
|
|
16
|
+
var dropdownInfo = "uv_5kpm8kg";
|
|
17
|
+
var dropdownInfoTextItem = "uv_5kpm8kh";
|
|
18
|
+
var dropdownInfoContainer = "uv_5kpm8ki";
|
|
19
|
+
var searchBar = "uv_5kpm8kj";
|
|
20
|
+
var comboboxCreate = "uv_5kpm8kk uv_5kpm8k8 uv_5kpm8k7";
|
|
19
21
|
export {
|
|
22
|
+
comboboxCreate,
|
|
20
23
|
dropdown,
|
|
21
24
|
dropdownCheckbox,
|
|
22
25
|
dropdownContainer,
|
|
@@ -31,6 +34,7 @@ export {
|
|
|
31
34
|
dropdownItem,
|
|
32
35
|
dropdownLoadMore,
|
|
33
36
|
dropdownWidth,
|
|
37
|
+
emptyStateGroupStyle,
|
|
34
38
|
footer,
|
|
35
39
|
searchBar
|
|
36
40
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const DROPDOWN_MAX_HEIGHT = 256;
|
|
2
|
+
export declare const OPTION_SELECTOR = "#items > div[role=\"option\"]:not([aria-disabled=\"true\"]), #add-option";
|
|
3
|
+
export declare const SIZES_TAG: {
|
|
4
|
+
gap: number;
|
|
5
|
+
paddings: number;
|
|
6
|
+
plusTag: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const INPUT_SIZE_HEIGHT: {
|
|
9
|
+
readonly large: "600";
|
|
10
|
+
readonly medium: "500";
|
|
11
|
+
readonly small: "400";
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/SelectInput/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,MAAM,CAAA;AAGtC,eAAO,MAAM,eAAe,6EAC4C,CAAA;AAExE,eAAO,MAAM,SAAS;;;;CAIrB,CAAA;AAED,eAAO,MAAM,iBAAiB;;;;CAIpB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const DROPDOWN_MAX_HEIGHT = 256;
|
|
2
|
+
const OPTION_SELECTOR = '#items > div[role="option"]:not([aria-disabled="true"]), #add-option';
|
|
3
|
+
const SIZES_TAG = {
|
|
4
|
+
gap: 8,
|
|
5
|
+
paddings: 16
|
|
6
|
+
};
|
|
7
|
+
const INPUT_SIZE_HEIGHT = {
|
|
8
|
+
large: "600",
|
|
9
|
+
medium: "500",
|
|
10
|
+
small: "400"
|
|
11
|
+
// sizing theme tokens key
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
DROPDOWN_MAX_HEIGHT,
|
|
15
|
+
INPUT_SIZE_HEIGHT,
|
|
16
|
+
OPTION_SELECTOR,
|
|
17
|
+
SIZES_TAG
|
|
18
|
+
};
|
|
@@ -30,10 +30,6 @@ type SelectInputProps<IsMulti extends undefined | boolean = false> = {
|
|
|
30
30
|
* Message to show when no option available
|
|
31
31
|
*/
|
|
32
32
|
emptyState?: ReactNode;
|
|
33
|
-
/**
|
|
34
|
-
* Whether it is possible to search through the input
|
|
35
|
-
*/
|
|
36
|
-
searchable?: boolean;
|
|
37
33
|
/**
|
|
38
34
|
* Whether the component in disabled
|
|
39
35
|
*/
|
|
@@ -74,6 +70,14 @@ type SelectInputProps<IsMulti extends undefined | boolean = false> = {
|
|
|
74
70
|
* Display an error message under the select bar
|
|
75
71
|
*/
|
|
76
72
|
error?: string | boolean;
|
|
73
|
+
searchable?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* When searchable, set a combobox to dynamically add an option
|
|
76
|
+
*/
|
|
77
|
+
addOption?: {
|
|
78
|
+
text: string;
|
|
79
|
+
onClick: (searchText: string) => void;
|
|
80
|
+
};
|
|
77
81
|
/**
|
|
78
82
|
* Display a success message under the select bar
|
|
79
83
|
*/
|
|
@@ -123,10 +127,12 @@ type SelectInputProps<IsMulti extends undefined | boolean = false> = {
|
|
|
123
127
|
* Please wrap that definition in useCallback
|
|
124
128
|
*/
|
|
125
129
|
onOpen?: () => void;
|
|
130
|
+
groupError?: Record<string, ReactNode>;
|
|
131
|
+
groupEmptyState?: Record<string, ReactNode>;
|
|
126
132
|
} & Pick<HTMLAttributes<HTMLDivElement>, 'id' | 'onBlur' | 'onFocus' | 'aria-label' | 'className' | 'style'>;
|
|
127
133
|
/**
|
|
128
134
|
* SelectInput component is used to select one or many elements from a selection.
|
|
129
135
|
*/
|
|
130
|
-
export declare const SelectInput: <IsMulti extends undefined | boolean>({ name, id, onBlur, onFocus, onChange, "aria-label": ariaLabel, value, label, helper, options, size, emptyState, descriptionDirection, success, error, "data-testid": dataTestId, className, tooltip, footer, placeholderSearch, placeholder, searchable, disabled, readOnly, clearable, multiselect, required, labelDescription, autofocus, loadMore, optionalInfoPlacement, isLoading, selectAll, selectAllGroup, dropdownAlign, portalTarget, onOpen, style, }: SelectInputProps<IsMulti>) => import("react/jsx-runtime").JSX.Element;
|
|
136
|
+
export declare const SelectInput: <IsMulti extends undefined | boolean>({ name, id, onBlur, onFocus, onChange, "aria-label": ariaLabel, value, label, helper, options, size, emptyState, descriptionDirection, success, error, "data-testid": dataTestId, className, tooltip, footer, placeholderSearch, placeholder, searchable, disabled, readOnly, clearable, multiselect, required, labelDescription, autofocus, loadMore, optionalInfoPlacement, isLoading, selectAll, selectAllGroup, dropdownAlign, portalTarget, onOpen, groupEmptyState, groupError, style, addOption, }: SelectInputProps<IsMulti>) => import("react/jsx-runtime").JSX.Element;
|
|
131
137
|
export {};
|
|
132
138
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SelectInput/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAOrC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,KAAK,gBAAgB,CAAC,OAAO,SAAS,SAAS,GAAG,OAAO,GAAG,KAAK,IAAI;IACnE;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,OAAO,EAAE,QAAQ,CAAA;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB;;OAEG;IACH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SelectInput/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAOrC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,KAAK,gBAAgB,CAAC,OAAO,SAAS,SAAS,GAAG,OAAO,GAAG,KAAK,IAAI;IACnE;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,iBAAiB,CAAC,EAA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|
51
|
+
groupError,
|
|
52
|
+
style,
|
|
53
|
+
addOption
|
|
51
54
|
}) => {
|
|
52
55
|
const localId = useId();
|
|
53
56
|
const finalId = id ?? localId;
|
|
@@ -82,10 +85,13 @@ const SelectInput = ({
|
|
|
82
85
|
/* @__PURE__ */ jsx(
|
|
83
86
|
Dropdown,
|
|
84
87
|
{
|
|
88
|
+
addOption,
|
|
85
89
|
descriptionDirection,
|
|
86
90
|
dropdownAlign,
|
|
87
91
|
emptyState,
|
|
88
92
|
footer,
|
|
93
|
+
groupEmptyState,
|
|
94
|
+
groupError,
|
|
89
95
|
id: dropdownId,
|
|
90
96
|
isLoading,
|
|
91
97
|
loadMore,
|
|
@@ -36,9 +36,4 @@ export type ReducerAction = {
|
|
|
36
36
|
selectedValues: ReducerState['selectedValues'];
|
|
37
37
|
selectedGroups: ReducerState['selectedGroups'];
|
|
38
38
|
};
|
|
39
|
-
export declare const INPUT_SIZE_HEIGHT: {
|
|
40
|
-
readonly large: "600";
|
|
41
|
-
readonly medium: "500";
|
|
42
|
-
readonly small: "400";
|
|
43
|
-
};
|
|
44
39
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/SelectInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,GAAG,CACA;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GACtC;IACE,KAAK,EAAE,SAAS,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;C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;CACnB,CACJ,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,GAAG,UAAU,EAAE,CAAA;AAElE,MAAM,MAAM,YAAY,GAAG;IACzB,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,WAAW,EAAE,OAAO,CAAA;IACpB,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAC9C;IACE,IAAI,EAAE,cAAc,CAAA;IACpB,aAAa,EAAE,UAAU,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GACD;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IACE,IAAI,EAAE,OAAO,CAAA;IACb,cAAc,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAA;IAC9C,cAAc,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAA;CAC/C,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DoubleSliderProps } from '../types';
|
|
2
|
-
export declare const DoubleSlider: ({ name, tooltip, direction, disabled, error, "data-testid": dataTestId, value, onChange, min, max, step, id, onBlur, onFocus, options, unit, label, className, input, prefix, suffix, required, tooltipPosition, "aria-label": ariaLabel, labelDescription, }: DoubleSliderProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const DoubleSlider: ({ name, tooltip, direction, disabled, error, "data-testid": dataTestId, value, onChange, min, max, step, id, onBlur, onFocus, options, unit, label, className, input, prefix, suffix, required, tooltipPosition, "aria-label": ariaLabel, labelDescription, customValueDisplay, }: DoubleSliderProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=DoubleSlider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DoubleSlider.d.ts","sourceRoot":"","sources":["../../../../src/components/Slider/components/DoubleSlider.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAGjD,eAAO,MAAM,YAAY,GAAI
|
|
1
|
+
{"version":3,"file":"DoubleSlider.d.ts","sourceRoot":"","sources":["../../../../src/components/Slider/components/DoubleSlider.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAGjD,eAAO,MAAM,YAAY,GAAI,mRA2B1B,iBAAiB,4CAoXnB,CAAA"}
|
|
@@ -37,7 +37,8 @@ const DoubleSlider = ({
|
|
|
37
37
|
required,
|
|
38
38
|
tooltipPosition,
|
|
39
39
|
"aria-label": ariaLabel,
|
|
40
|
-
labelDescription
|
|
40
|
+
labelDescription,
|
|
41
|
+
customValueDisplay
|
|
41
42
|
}) => {
|
|
42
43
|
const theme = useTheme();
|
|
43
44
|
const localId = useId();
|
|
@@ -209,15 +210,18 @@ const DoubleSlider = ({
|
|
|
209
210
|
});
|
|
210
211
|
}, [min, max, value]);
|
|
211
212
|
return /* @__PURE__ */ jsxs(Stack, { direction: "column", gap: 1, justifyContent: "left", children: [
|
|
212
|
-
label ? /* @__PURE__ */
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
213
|
+
label ? /* @__PURE__ */ jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [
|
|
214
|
+
/* @__PURE__ */ jsx(
|
|
215
|
+
Label,
|
|
216
|
+
{
|
|
217
|
+
htmlFor: finalId,
|
|
218
|
+
labelDescription,
|
|
219
|
+
required,
|
|
220
|
+
children: label
|
|
221
|
+
}
|
|
222
|
+
),
|
|
223
|
+
customValueDisplay
|
|
224
|
+
] }) : null,
|
|
221
225
|
/* @__PURE__ */ jsxs(Stack, { direction, gap: 1, width: "100%", children: [
|
|
222
226
|
direction === "column" ? /* @__PURE__ */ jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [
|
|
223
227
|
styledValue(leftToShow, "left"),
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { SingleSliderProps } from '../types';
|
|
2
|
-
export declare const SingleSlider: ({ name, tooltip, direction, disabled, error, "data-testid": dataTestId, value, onChange, min, max, step, id, onBlur, unit, options, onFocus, className, label, input, prefix, suffix, required, labelDescription, "aria-label": ariaLabel, tooltipPosition, }: SingleSliderProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const SingleSlider: ({ name, tooltip, direction, disabled, error, "data-testid": dataTestId, value, onChange, min, max, step, id, onBlur, unit, options, onFocus, className, label, input, prefix, suffix, required, labelDescription, customValueDisplay, "aria-label": ariaLabel, tooltipPosition, }: SingleSliderProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=SingleSlider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingleSlider.d.ts","sourceRoot":"","sources":["../../../../src/components/Slider/components/SingleSlider.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAKjD,eAAO,MAAM,YAAY,GAAI
|
|
1
|
+
{"version":3,"file":"SingleSlider.d.ts","sourceRoot":"","sources":["../../../../src/components/Slider/components/SingleSlider.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAKjD,eAAO,MAAM,YAAY,GAAI,mRA2B1B,iBAAiB,4CA6OnB,CAAA"}
|
|
@@ -36,6 +36,7 @@ const SingleSlider = ({
|
|
|
36
36
|
suffix,
|
|
37
37
|
required,
|
|
38
38
|
labelDescription,
|
|
39
|
+
customValueDisplay,
|
|
39
40
|
"aria-label": ariaLabel,
|
|
40
41
|
tooltipPosition
|
|
41
42
|
}) => {
|
|
@@ -174,11 +175,15 @@ const SingleSlider = ({
|
|
|
174
175
|
children: label
|
|
175
176
|
}
|
|
176
177
|
),
|
|
177
|
-
direction === "column" ? styledValue(valueToShow) : null
|
|
178
|
+
direction === "column" && (input || !customValueDisplay) ? styledValue(valueToShow) : null,
|
|
179
|
+
direction === "column" && customValueDisplay && !input ? customValueDisplay : null
|
|
178
180
|
]
|
|
179
181
|
}
|
|
180
182
|
) : null,
|
|
181
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", justifyContent: "flex-end", children: [
|
|
184
|
+
direction === "column" && !label && (input || !customValueDisplay) ? styledValue(valueToShow) : null,
|
|
185
|
+
direction === "column" && !label && customValueDisplay && !input ? customValueDisplay : null
|
|
186
|
+
] }),
|
|
182
187
|
/* @__PURE__ */ jsxs(Stack, { direction: "column", gap: 1, justifyContent: "center", width: "100%", children: [
|
|
183
188
|
/* @__PURE__ */ jsx(
|
|
184
189
|
Tooltip,
|
|
@@ -239,7 +244,8 @@ const SingleSlider = ({
|
|
|
239
244
|
}
|
|
240
245
|
) : null
|
|
241
246
|
] }),
|
|
242
|
-
direction === "row" ? styledValue(valueToShow) : null
|
|
247
|
+
direction === "row" && (input || !customValueDisplay) ? styledValue(valueToShow) : null,
|
|
248
|
+
direction === "row" && customValueDisplay && !input ? customValueDisplay : null
|
|
243
249
|
] });
|
|
244
250
|
};
|
|
245
251
|
export {
|
|
@@ -4,5 +4,5 @@ import type { SliderProps } from './types';
|
|
|
4
4
|
* - For a simple slider (one handle) : prop `value` must be number.
|
|
5
5
|
* - For a double slider (two handles): prop `value` must be an array of numbers (of length 2) and prop `double` must be set to `true`. **Make sure that others props have the correct type.**
|
|
6
6
|
*/
|
|
7
|
-
export declare const Slider: ({ name, label, helper, tooltip, direction, input, prefix, unit, suffix, required, disabled, error, options, "data-testid": dataTestId, value, onChange, min, double, max, step, id, onBlur, onFocus, className, tooltipPosition, style, labelDescription, "aria-label": ariaLabel, }: SliderProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const Slider: ({ name, label, helper, tooltip, direction, input, prefix, unit, suffix, required, disabled, error, options, "data-testid": dataTestId, value, onChange, min, double, max, step, id, onBlur, onFocus, className, tooltipPosition, style, customValueDisplay, labelDescription, "aria-label": ariaLabel, }: SliderProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;GAIG;AACH,eAAO,MAAM,MAAM,GAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;GAIG;AACH,eAAO,MAAM,MAAM,GAAI,0SA8BpB,WAAW,4CAgGb,CAAA"}
|
|
@@ -33,6 +33,7 @@ const Slider = ({
|
|
|
33
33
|
className,
|
|
34
34
|
tooltipPosition = "top",
|
|
35
35
|
style,
|
|
36
|
+
customValueDisplay,
|
|
36
37
|
labelDescription,
|
|
37
38
|
"aria-label": ariaLabel
|
|
38
39
|
}) => {
|
|
@@ -61,6 +62,7 @@ const Slider = ({
|
|
|
61
62
|
{
|
|
62
63
|
"aria-label": ariaLabel,
|
|
63
64
|
className,
|
|
65
|
+
customValueDisplay,
|
|
64
66
|
"data-testid": dataTestId,
|
|
65
67
|
direction,
|
|
66
68
|
disabled,
|
|
@@ -90,6 +92,7 @@ const Slider = ({
|
|
|
90
92
|
{
|
|
91
93
|
"aria-label": ariaLabel,
|
|
92
94
|
className,
|
|
95
|
+
customValueDisplay,
|
|
93
96
|
"data-testid": dataTestId,
|
|
94
97
|
direction,
|
|
95
98
|
disabled,
|
|
@@ -48,6 +48,11 @@ type DefaultProps = {
|
|
|
48
48
|
* Whether an error occured
|
|
49
49
|
*/
|
|
50
50
|
error?: string | boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Display this content instead of the slider value.
|
|
53
|
+
* For a single slider (`double="false"`), if a prefix or a suffix is defined, this prop overrides them
|
|
54
|
+
*/
|
|
55
|
+
customValueDisplay?: ReactNode;
|
|
51
56
|
/**
|
|
52
57
|
* Options for a non-linear scale, overrides `min`, `max`. This is usefull if step is not enough to get the desired granularity.
|
|
53
58
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtD,KAAK,YAAY,GAAG;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAA;IAC5B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,gBAAgB,CAAC,EAAE,SAAS,CAAA;IAC5B;;OAEG;IACH,eAAe,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAA;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cA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AM,KAAK,IAAI,CAAA;IAClC,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC1B;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB,CAAA;AAED,KAAK,WAAW,GAAG;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACpC,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,MAAM,CAAA;IACrC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,YAAY,GACpC,CAAC,WAAW,GAAG,WAAW,CAAC,GAAG;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAEH,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,WAAW,CAAA;AAE1D,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,WAAW,CAAA;AAE1D,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CSSProperties, ElementType,
|
|
1
|
+
import type { CSSProperties, ElementType, ReactElement } from 'react';
|
|
2
2
|
import type { UltravioletUITheme } from '../../theme';
|
|
3
3
|
import type { AlignItemsType, JustifyContentType } from './styles.css';
|
|
4
4
|
import type { PolymorphicComponentProps } from './types';
|
|
@@ -15,11 +15,10 @@ type OwnStackProps = {
|
|
|
15
15
|
minWidth?: CSSProperties['minWidth'];
|
|
16
16
|
flex?: CSSProperties['flex'];
|
|
17
17
|
className?: string;
|
|
18
|
-
children: ReactNode;
|
|
19
18
|
'data-testid'?: string;
|
|
20
19
|
id?: string;
|
|
21
20
|
};
|
|
22
21
|
export type StackProps<T extends ElementType = 'div'> = PolymorphicComponentProps<T, OwnStackProps>;
|
|
23
|
-
export declare const Stack: <T extends ElementType = "div">(
|
|
22
|
+
export declare const Stack: <T extends ElementType = "div">(props: StackProps<T>) => ReactElement;
|
|
24
23
|
export {};
|
|
25
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Stack/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Stack/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EAEX,YAAY,EACb,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAEtE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAGxD,KAAK,cAAc,CAAC,CAAC,IACjB,CAAC,GACD,OAAO,CAAC,MAAM,CAAC,MAAM,kBAAkB,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAG/D,KAAK,QAAQ,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,MAAM,EAAE,GACnE,CAAC,GACD,KAAK,CAAA;AA4BT,KAAK,aAAa,GAAG;IACnB,GAAG,CAAC,EAAE,cAAc,CAChB,MAAM,kBAAkB,CAAC,OAAO,CAAC,GACjC,QAAQ,CAAC,MAAM,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAC9C,CAAA;IACD,SAAS,CAAC,EAAE,cAAc,CACxB,KAAK,GAAG,QAAQ,GAAG,aAAa,GAAG,gBAAgB,CACpD,CAAA;IACD,UAAU,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAA;IAC3C,cAAc,CAAC,EAAE,cAAc,CAAC,kBAAkB,CAAC,CAAA;IACnD,IAAI,CAAC,EAAE,cAAc,CAAC,OAAO,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC,CAAA;IAC1D,KAAK,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;IAC9B,QAAQ,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAA;IACpC,QAAQ,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAA;IACpC,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,WAAW,GAAG,KAAK,IAClD,yBAAyB,CAAC,CAAC,EAAE,aAAa,CAAC,CAAA;AA+F7C,eAAO,MAAM,KAAK,EAAa,CAAC,CAAC,SAAS,WAAW,GAAG,KAAK,EAC3D,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,KACjB,YAAY,CAAA"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { consoleLightTheme } from "@ultraviolet/themes";
|
|
4
4
|
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
5
|
-
import { useMemo } from "react";
|
|
5
|
+
import { forwardRef, useMemo } from "react";
|
|
6
6
|
import { sprinkles, stack } from "./styles.css.js";
|
|
7
7
|
import { flexVar, minWidthVar, maxWidthVar, widthVar } from "./variables.css.js";
|
|
8
8
|
const mapRepsonsiveGap = (object) => object ? Object.keys(object).reduce(
|
|
@@ -12,70 +12,72 @@ const mapRepsonsiveGap = (object) => object ? Object.keys(object).reduce(
|
|
|
12
12
|
}),
|
|
13
13
|
{}
|
|
14
14
|
) : {};
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
15
|
+
const IStack = forwardRef(
|
|
16
|
+
({
|
|
17
|
+
gap,
|
|
18
|
+
direction = "column",
|
|
19
|
+
alignItems = "normal",
|
|
20
|
+
justifyContent = "normal",
|
|
21
|
+
wrap = "nowrap",
|
|
22
|
+
className,
|
|
23
|
+
children,
|
|
24
|
+
id,
|
|
25
|
+
"data-testid": dataTestId,
|
|
26
|
+
width,
|
|
27
|
+
maxWidth,
|
|
28
|
+
minWidth,
|
|
29
|
+
flex,
|
|
30
|
+
as,
|
|
31
|
+
style,
|
|
32
|
+
...props
|
|
33
|
+
}, ref) => {
|
|
34
|
+
const wrapValue = useMemo(() => {
|
|
35
|
+
if (typeof wrap === "boolean") {
|
|
36
|
+
return wrap ? "wrap" : "nowrap";
|
|
37
|
+
}
|
|
38
|
+
if (typeof wrap === "object") {
|
|
39
|
+
return Object.keys(wrap).reduce(
|
|
40
|
+
(acc, key) => ({
|
|
41
|
+
...acc,
|
|
42
|
+
[key]: wrap[key] ? "wrap" : "nowrap"
|
|
43
|
+
}),
|
|
44
|
+
{}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
return wrap;
|
|
48
|
+
}, [wrap]);
|
|
49
|
+
const Component = as || "div";
|
|
50
|
+
const sprinkleClassName = sprinkles({
|
|
51
|
+
alignItems: typeof alignItems === "object" ? alignItems : { xxsmall: alignItems },
|
|
52
|
+
flexDirection: typeof direction === "object" ? direction : { xxsmall: direction },
|
|
53
|
+
flexWrap: typeof wrapValue === "object" ? wrapValue : { xxsmall: wrapValue },
|
|
54
|
+
gap: typeof gap === "object" ? mapRepsonsiveGap(gap) : { xxsmall: gap ? consoleLightTheme.space[gap] : void 0 },
|
|
55
|
+
justifyContent: typeof justifyContent === "object" ? justifyContent : { xxsmall: justifyContent }
|
|
56
|
+
});
|
|
57
|
+
const combinedClassName = [className, stack, sprinkleClassName].filter(Boolean).join(" ");
|
|
58
|
+
return /* @__PURE__ */ jsx(
|
|
59
|
+
Component,
|
|
60
|
+
{
|
|
61
|
+
className: combinedClassName,
|
|
62
|
+
"data-testid": dataTestId,
|
|
63
|
+
id,
|
|
64
|
+
ref,
|
|
65
|
+
style: {
|
|
66
|
+
...assignInlineVars({
|
|
67
|
+
[widthVar]: width?.toString(),
|
|
68
|
+
[maxWidthVar]: maxWidth?.toString(),
|
|
69
|
+
[minWidthVar]: minWidth?.toString(),
|
|
70
|
+
[flexVar]: flex?.toString()
|
|
71
|
+
}),
|
|
72
|
+
...style
|
|
73
|
+
},
|
|
74
|
+
...props,
|
|
75
|
+
children
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
const Stack = IStack;
|
|
79
81
|
export {
|
|
80
82
|
Stack
|
|
81
83
|
};
|
|
@@ -24,7 +24,7 @@ export declare const Tabs: {
|
|
|
24
24
|
tooltip?: string;
|
|
25
25
|
value?: string | number;
|
|
26
26
|
style?: import("react").CSSProperties;
|
|
27
|
-
} & Omit<any, "tooltip" | "disabled" | "as" | "className" | "
|
|
27
|
+
} & Omit<any, "tooltip" | "disabled" | "as" | "className" | "role" | "children" | "value" | "badge" | "counter">, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
28
28
|
Menu: import("react").ForwardRefExoticComponent<{
|
|
29
29
|
children: ReactNode;
|
|
30
30
|
disclosure: ReactNode;
|
|
@@ -26,5 +26,5 @@ export declare const TextInput: import("react").ForwardRefExoticComponent<{
|
|
|
26
26
|
value?: string;
|
|
27
27
|
defaultValue?: string;
|
|
28
28
|
onChangeValue?: (value: string) => void;
|
|
29
|
-
} & Pick<InputHTMLAttributes<HTMLInputElement>, "style" | "disabled" | "id" | "
|
|
29
|
+
} & Pick<InputHTMLAttributes<HTMLInputElement>, "style" | "disabled" | "id" | "autoFocus" | "tabIndex" | "role" | "aria-atomic" | "aria-label" | "aria-labelledby" | "aria-live" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "onKeyUp" | "name" | "autoComplete" | "required" | "placeholder" | "readOnly"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
30
30
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -37,7 +37,7 @@ export declare const Tooltip: import("react").ForwardRefExoticComponent<Pick<{
|
|
|
37
37
|
portalTarget?: HTMLElement;
|
|
38
38
|
dynamicDomRendering?: boolean;
|
|
39
39
|
style?: import("react").CSSProperties;
|
|
40
|
-
} & import("react").RefAttributes<HTMLDivElement>, "text" | "maxWidth" | "visible" | "style" | "className" | "
|
|
40
|
+
} & import("react").RefAttributes<HTMLDivElement>, "text" | "maxWidth" | "visible" | "style" | "className" | "data-testid" | "id" | "tabIndex" | "role" | "children" | "portalTarget" | "containerFullHeight" | "containerFullWidth" | "disableAnimation" | "debounceDelay" | "innerRef"> & {
|
|
41
41
|
placement?: Exclude<ComponentProps<typeof Popup>["placement"], "nested-menu">;
|
|
42
42
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
43
43
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAEhD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAyBhC;;;GAGG;AACH,eAAO,MAAM,OAAO;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAEhD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAyBhC;;;GAGG;AACH,eAAO,MAAM,OAAO;;;iBAwCR,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA/CC,OAAO,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC;kDAoD9E,CAAA"}
|
|
@@ -8,7 +8,7 @@ const useTheme = () => {
|
|
|
8
8
|
const context = useContext(ThemeContext);
|
|
9
9
|
if (!context) {
|
|
10
10
|
throw new Error(
|
|
11
|
-
"useTheme must be used within a ThemeProvider imported from @ultraviolet/
|
|
11
|
+
"useTheme must be used within a ThemeProvider imported from @ultraviolet/themes"
|
|
12
12
|
);
|
|
13
13
|
}
|
|
14
14
|
return context;
|