colibri-ui 0.8.76 → 0.8.78
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/Autocomplete/Autocomplete.d.ts +6 -0
- package/Autocomplete/Autocomplete.js +298 -0
- package/Autocomplete/Autocomplete.module.css +147 -0
- package/Autocomplete/index.d.ts +2 -0
- package/Autocomplete/index.js +7 -0
- package/Autocomplete/index.props.d.ts +39 -0
- package/Autocomplete/package.json +9 -0
- package/Button/tokens.d.ts +78 -0
- package/Button/tokens.js +84 -0
- package/Calendar/Calendar.js +3 -1
- package/Input/index.d.ts +1 -1
- package/Input/index.js +20 -14
- package/Input/index.props.d.ts +4 -1
- package/List/List.d.ts +5 -0
- package/List/List.js +161 -0
- package/List/List.module.css +185 -0
- package/List/index.d.ts +2 -0
- package/List/index.js +9 -0
- package/List/index.props.d.ts +43 -0
- package/List/package.json +9 -0
- package/Modal/Modal.module.css +14 -7
- package/Modal/components/Body/Body.module.css +12 -0
- package/Modal/components/Body/index.d.ts +3 -0
- package/Modal/components/Body/index.js +27 -0
- package/Modal/components/Body/index.props.d.ts +1 -0
- package/Modal/components/Close/index.js +5 -2
- package/Modal/components/Close/index.props.d.ts +1 -0
- package/Modal/components/Footer/Footer.module.css +10 -0
- package/Modal/components/Footer/index.d.ts +3 -0
- package/Modal/components/Footer/index.js +23 -0
- package/Modal/components/Footer/index.props.d.ts +1 -0
- package/Modal/components/Header/Header.module.css +32 -0
- package/Modal/components/Header/index.d.ts +3 -0
- package/Modal/components/Header/index.js +37 -0
- package/Modal/components/Header/index.props.d.ts +1 -0
- package/Modal/components/Title/index.js +20 -7
- package/Modal/components/Title/index.props.d.ts +1 -2
- package/Modal/context.d.ts +9 -0
- package/Modal/context.js +15 -0
- package/Modal/index.d.ts +12 -2
- package/Modal/index.js +103 -31
- package/Modal/index.props.d.ts +25 -0
- package/Modal/useModalStack.d.ts +2 -0
- package/Modal/useModalStack.js +20 -0
- package/README.md +59 -0
- package/Theme/breakpoints.d.ts +20 -16
- package/Theme/breakpoints.js +21 -32
- package/Theme/colors/index.d.ts +4 -0
- package/Theme/colors/theme_buenos_aires.d.ts +4 -0
- package/Theme/colors/theme_buenos_aires.js +2 -0
- package/Theme/colors/theme_jaipur.d.ts +4 -0
- package/Theme/colors/theme_jaipur.js +2 -0
- package/Theme/index.d.ts +300 -152
- package/Theme/index.js +6 -2
- package/Theme/themes/buenos_aires.d.ts +73 -76
- package/Theme/themes/buenos_aires.js +73 -76
- package/Theme/themes/jaipur.d.ts +73 -76
- package/Theme/themes/jaipur.js +73 -76
- package/esm/Autocomplete/Autocomplete.d.ts +6 -0
- package/esm/Autocomplete/Autocomplete.js +288 -0
- package/esm/Autocomplete/Autocomplete.module.css +147 -0
- package/esm/Autocomplete/index.d.ts +2 -0
- package/esm/Autocomplete/index.props.d.ts +39 -0
- package/esm/Button/tokens.d.ts +78 -0
- package/esm/Button/tokens.js +82 -0
- package/esm/Calendar/Calendar.js +3 -1
- package/esm/Input/index.d.ts +1 -1
- package/esm/Input/index.js +16 -10
- package/esm/Input/index.props.d.ts +4 -1
- package/esm/List/List.d.ts +5 -0
- package/esm/List/List.js +150 -0
- package/esm/List/List.module.css +185 -0
- package/esm/List/index.d.ts +2 -0
- package/esm/List/index.props.d.ts +43 -0
- package/esm/Modal/Modal.module.css +14 -7
- package/esm/Modal/components/Body/Body.module.css +12 -0
- package/esm/Modal/components/Body/index.d.ts +3 -0
- package/esm/Modal/components/Body/index.js +18 -0
- package/esm/Modal/components/Body/index.props.d.ts +1 -0
- package/esm/Modal/components/Close/index.js +4 -2
- package/esm/Modal/components/Close/index.props.d.ts +1 -0
- package/esm/Modal/components/Footer/Footer.module.css +10 -0
- package/esm/Modal/components/Footer/index.d.ts +3 -0
- package/esm/Modal/components/Footer/index.js +15 -0
- package/esm/Modal/components/Footer/index.props.d.ts +1 -0
- package/esm/Modal/components/Header/Header.module.css +32 -0
- package/esm/Modal/components/Header/index.d.ts +3 -0
- package/esm/Modal/components/Header/index.js +28 -0
- package/esm/Modal/components/Header/index.props.d.ts +1 -0
- package/esm/Modal/components/Title/index.js +20 -8
- package/esm/Modal/components/Title/index.props.d.ts +1 -2
- package/esm/Modal/context.d.ts +9 -0
- package/esm/Modal/context.js +12 -0
- package/esm/Modal/index.d.ts +12 -2
- package/esm/Modal/index.js +92 -25
- package/esm/Modal/index.props.d.ts +25 -0
- package/esm/Modal/useModalStack.d.ts +2 -0
- package/esm/Modal/useModalStack.js +18 -0
- package/esm/Theme/breakpoints.d.ts +20 -16
- package/esm/Theme/breakpoints.js +20 -26
- package/esm/Theme/colors/index.d.ts +4 -0
- package/esm/Theme/colors/theme_buenos_aires.d.ts +4 -0
- package/esm/Theme/colors/theme_buenos_aires.js +2 -0
- package/esm/Theme/colors/theme_jaipur.d.ts +4 -0
- package/esm/Theme/colors/theme_jaipur.js +2 -0
- package/esm/Theme/index.d.ts +300 -152
- package/esm/Theme/index.js +3 -2
- package/esm/Theme/themes/buenos_aires.d.ts +73 -76
- package/esm/Theme/themes/buenos_aires.js +73 -76
- package/esm/Theme/themes/jaipur.d.ts +73 -76
- package/esm/Theme/themes/jaipur.js +73 -76
- package/esm/hooks/useMediaSizes/index.d.ts +2 -2
- package/esm/hooks/useMediaSizes/index.js +2 -2
- package/esm/hooks/useTrapFocus/index.d.ts +1 -1
- package/esm/hooks/useTrapFocus/index.js +3 -2
- package/esm/index.d.ts +8 -3
- package/esm/index.js +7 -0
- package/esm/theme_ba_variables.css +149 -76
- package/esm/theme_jaipur_variables.css +149 -76
- package/hooks/useMediaSizes/index.d.ts +2 -2
- package/hooks/useMediaSizes/index.js +1 -1
- package/hooks/useTrapFocus/index.d.ts +1 -1
- package/hooks/useTrapFocus/index.js +3 -2
- package/index.d.ts +8 -3
- package/index.js +54 -35
- package/package.json +1 -1
- package/theme_ba_variables.css +149 -76
- package/theme_jaipur_variables.css +149 -76
package/Button/tokens.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var commonButtonTokens = {
|
|
4
|
+
"component-button-font-size-xs": "0.75rem",
|
|
5
|
+
"component-button-font-size-s": "0.8125rem",
|
|
6
|
+
"component-button-font-size-m": "0.9375rem",
|
|
7
|
+
"component-button-font-size-l": "1.125rem",
|
|
8
|
+
"component-button-height-xs": "1.8125rem",
|
|
9
|
+
"component-button-height-s": "2rem",
|
|
10
|
+
"component-button-height-m": "2.25rem",
|
|
11
|
+
"component-button-height-l": "2.625rem",
|
|
12
|
+
"component-button-radius": "1.125rem",
|
|
13
|
+
"component-button-radius-lg": "1.5rem"
|
|
14
|
+
};
|
|
15
|
+
var BUTTON_TOKENS = Object.assign(Object.assign({}, commonButtonTokens), {
|
|
16
|
+
"component-button-primary-bg": "var(--color-action-primary)",
|
|
17
|
+
"component-button-primary-border": "var(--color-action-primary)",
|
|
18
|
+
"component-button-primary-text": "var(--color-action-secondary)",
|
|
19
|
+
"component-button-primary-bg-hover": "var(--color-action-primary-hover)",
|
|
20
|
+
"component-button-primary-border-hover": "var(--color-action-primary-hover)",
|
|
21
|
+
"component-button-primary-text-hover": "var(--color-action-secondary)",
|
|
22
|
+
"component-button-primary-bg-pressed": "var(--color-action-secondary)",
|
|
23
|
+
"component-button-primary-border-pressed": "var(--color-action-secondary)",
|
|
24
|
+
"component-button-primary-text-pressed": "var(--color-text-on-brand)",
|
|
25
|
+
"component-button-secondary-bg": "var(--color-bg-surface-strong)",
|
|
26
|
+
"component-button-secondary-border": "var(--color-border-default)",
|
|
27
|
+
"component-button-secondary-text": "var(--color-text-primary)",
|
|
28
|
+
"component-button-secondary-bg-hover": "var(--color-neutral-300)",
|
|
29
|
+
"component-button-secondary-border-hover": "var(--color-border-strong)",
|
|
30
|
+
"component-button-secondary-text-hover": "var(--color-text-primary)",
|
|
31
|
+
"component-button-secondary-bg-pressed": "var(--color-action-primary)",
|
|
32
|
+
"component-button-secondary-border-pressed": "var(--color-action-primary)",
|
|
33
|
+
"component-button-secondary-text-pressed": "var(--color-action-secondary)",
|
|
34
|
+
"component-button-outline-bg": "var(--color-bg-surface)",
|
|
35
|
+
"component-button-outline-border": "var(--color-border-default)",
|
|
36
|
+
"component-button-outline-text": "var(--color-text-primary)",
|
|
37
|
+
"component-button-outline-bg-hover": "var(--color-bg-surface-subtle)",
|
|
38
|
+
"component-button-outline-border-hover": "var(--color-border-strong)",
|
|
39
|
+
"component-button-outline-text-hover": "var(--color-text-primary)",
|
|
40
|
+
"component-button-outline-bg-pressed": "var(--color-bg-surface-strong)",
|
|
41
|
+
"component-button-outline-border-pressed": "var(--color-action-primary)",
|
|
42
|
+
"component-button-outline-text-pressed": "var(--color-action-primary-pressed)",
|
|
43
|
+
"component-button-pseudo-bg": "var(--color-bg-canvas)",
|
|
44
|
+
"component-button-pseudo-border": "var(--color-bg-canvas)",
|
|
45
|
+
"component-button-pseudo-text": "var(--color-text-primary)",
|
|
46
|
+
"component-button-pseudo-bg-hover": "var(--color-bg-surface-subtle)",
|
|
47
|
+
"component-button-pseudo-border-hover": "var(--color-bg-surface-subtle)",
|
|
48
|
+
"component-button-pseudo-text-hover": "var(--color-text-primary)",
|
|
49
|
+
"component-button-pseudo-bg-pressed": "var(--color-bg-surface-strong)",
|
|
50
|
+
"component-button-pseudo-border-pressed": "var(--color-bg-surface-strong)",
|
|
51
|
+
"component-button-pseudo-text-pressed": "var(--color-text-primary)",
|
|
52
|
+
"component-button-clear-bg": "transparent",
|
|
53
|
+
"component-button-clear-border": "transparent",
|
|
54
|
+
"component-button-clear-text": "var(--color-text-primary)",
|
|
55
|
+
"component-button-clear-bg-hover": "transparent",
|
|
56
|
+
"component-button-clear-border-hover": "transparent",
|
|
57
|
+
"component-button-clear-text-hover": "var(--color-action-clear-text-hover)",
|
|
58
|
+
"component-button-clear-bg-pressed": "transparent",
|
|
59
|
+
"component-button-clear-border-pressed": "transparent",
|
|
60
|
+
"component-button-clear-text-pressed": "var(--color-action-primary-pressed)",
|
|
61
|
+
"component-button-alert-bg": "var(--color-status-error)",
|
|
62
|
+
"component-button-alert-border": "var(--color-status-error)",
|
|
63
|
+
"component-button-alert-text": "var(--color-brand-white)",
|
|
64
|
+
"component-button-alert-bg-hover": "var(--color-status-error-hover)",
|
|
65
|
+
"component-button-alert-border-hover": "var(--color-status-error-hover)",
|
|
66
|
+
"component-button-alert-text-hover": "var(--color-brand-white)",
|
|
67
|
+
"component-button-alert-bg-pressed": "var(--color-status-error-accent)",
|
|
68
|
+
"component-button-alert-border-pressed": "var(--color-status-error-accent)",
|
|
69
|
+
"component-button-alert-text-pressed": "var(--color-brand-white)",
|
|
70
|
+
"component-button-success-bg": "var(--color-status-success-bg)",
|
|
71
|
+
"component-button-success-border": "var(--color-status-success-bg)",
|
|
72
|
+
"component-button-success-text": "var(--color-text-primary)",
|
|
73
|
+
"component-button-success-bg-hover": "var(--color-status-success-bg-hover)",
|
|
74
|
+
"component-button-success-border-hover": "var(--color-status-success-bg-hover)",
|
|
75
|
+
"component-button-success-text-hover": "var(--color-text-primary)",
|
|
76
|
+
"component-button-success-bg-pressed": "var(--color-status-success)",
|
|
77
|
+
"component-button-success-border-pressed": "var(--color-status-success)",
|
|
78
|
+
"component-button-success-text-pressed": "var(--color-brand-white)",
|
|
79
|
+
"component-button-bg-disabled": "var(--color-action-disabled)",
|
|
80
|
+
"component-button-border-disabled": "var(--color-action-disabled)",
|
|
81
|
+
"component-button-text-disabled": "var(--color-action-disabled-text)"
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
exports.BUTTON_TOKENS = BUTTON_TOKENS;
|
package/Calendar/Calendar.js
CHANGED
|
@@ -7,6 +7,7 @@ var React = require('react');
|
|
|
7
7
|
var index = require('../Button/index.js');
|
|
8
8
|
require('../Icons/index.js');
|
|
9
9
|
var styles = require('./Calendar.module.css');
|
|
10
|
+
var index$1 = require('../Typography/index.js');
|
|
10
11
|
var Chevron = require('../Icons/Chevron.js');
|
|
11
12
|
|
|
12
13
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -441,7 +442,8 @@ var Calendar = function Calendar(props) {
|
|
|
441
442
|
className: styles__default.default.month,
|
|
442
443
|
key: dayKey(month),
|
|
443
444
|
"aria-label": heading
|
|
444
|
-
}, monthsToShow === 2 && (/*#__PURE__*/React__default.default.createElement(
|
|
445
|
+
}, monthsToShow === 2 && (/*#__PURE__*/React__default.default.createElement(index$1.Typography, {
|
|
446
|
+
tag: "h2",
|
|
445
447
|
className: styles__default.default.heading
|
|
446
448
|
}, heading)), /*#__PURE__*/React__default.default.createElement("div", {
|
|
447
449
|
className: styles__default.default.weekdays,
|
package/Input/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { InputProps } from "./index.props";
|
|
3
|
-
export declare const Input: ({ className, startIcon, endIcon, label, hint, hasError, required, onChange, onFocus, onBlur, onKeyDown, inputRef, disabled, variant, size, ref, ...props }: InputProps) => React.JSX.Element;
|
|
3
|
+
export declare const Input: ({ className, startIcon, endIcon, label, hint, hasError, required, onChange, onFocus, onBlur, onKeyDown, inputRef, controlAfter, controlClassName, controlRef, disabled, variant, size, ref, ...props }: InputProps) => React.JSX.Element;
|
package/Input/index.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
var tslib = require('tslib');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
|
-
var index = require('../base/FormField/index.js');
|
|
7
|
-
var index
|
|
8
|
-
var index$
|
|
6
|
+
var index$2 = require('../base/FormField/index.js');
|
|
7
|
+
var index = require('../base/InputRoot/index.js');
|
|
8
|
+
var index$1 = require('../base/BaseInput/index.js');
|
|
9
9
|
|
|
10
10
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
|
|
@@ -25,35 +25,41 @@ var Input = function Input(_a) {
|
|
|
25
25
|
onBlur = _a.onBlur,
|
|
26
26
|
onKeyDown = _a.onKeyDown,
|
|
27
27
|
inputRef = _a.inputRef,
|
|
28
|
+
controlAfter = _a.controlAfter,
|
|
29
|
+
controlClassName = _a.controlClassName,
|
|
30
|
+
controlRef = _a.controlRef,
|
|
28
31
|
disabled = _a.disabled,
|
|
29
32
|
_a$variant = _a.variant,
|
|
30
33
|
variant = _a$variant === void 0 ? "primary" : _a$variant,
|
|
31
34
|
_a$size = _a.size,
|
|
32
35
|
size = _a$size === void 0 ? "m" : _a$size,
|
|
33
36
|
ref = _a.ref,
|
|
34
|
-
props = tslib.__rest(_a, ["className", "startIcon", "endIcon", "label", "hint", "hasError", "required", "onChange", "onFocus", "onBlur", "onKeyDown", "inputRef", "disabled", "variant", "size", "ref"]);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
label: label,
|
|
38
|
-
required: required,
|
|
39
|
-
hint: hint,
|
|
40
|
-
hasError: hasError
|
|
41
|
-
}, /*#__PURE__*/React__default.default.createElement(index$1.InputRoot, {
|
|
42
|
-
ref: ref,
|
|
37
|
+
props = tslib.__rest(_a, ["className", "startIcon", "endIcon", "label", "hint", "hasError", "required", "onChange", "onFocus", "onBlur", "onKeyDown", "inputRef", "controlAfter", "controlClassName", "controlRef", "disabled", "variant", "size", "ref"]);
|
|
38
|
+
var control = /*#__PURE__*/React__default.default.createElement(index.InputRoot, {
|
|
39
|
+
ref: controlRef !== null && controlRef !== void 0 ? controlRef : ref,
|
|
43
40
|
startIcon: startIcon,
|
|
44
41
|
endIcon: endIcon,
|
|
45
42
|
variant: variant,
|
|
46
43
|
size: size,
|
|
47
44
|
disabled: !!disabled,
|
|
48
45
|
hasError: hasError
|
|
49
|
-
}, /*#__PURE__*/React__default.default.createElement(index$
|
|
46
|
+
}, /*#__PURE__*/React__default.default.createElement(index$1.BaseInput, Object.assign({
|
|
50
47
|
ref: inputRef,
|
|
51
48
|
onChange: onChange,
|
|
52
49
|
onFocus: onFocus,
|
|
53
50
|
onBlur: onBlur,
|
|
54
51
|
onKeyDown: onKeyDown,
|
|
55
52
|
type: "text"
|
|
56
|
-
}, props)))
|
|
53
|
+
}, props)));
|
|
54
|
+
return /*#__PURE__*/React__default.default.createElement(index$2.FormField, {
|
|
55
|
+
className: clsx__default.default(className),
|
|
56
|
+
label: label,
|
|
57
|
+
required: required,
|
|
58
|
+
hint: hint,
|
|
59
|
+
hasError: hasError
|
|
60
|
+
}, controlAfter || controlClassName || controlRef ? (/*#__PURE__*/React__default.default.createElement("div", {
|
|
61
|
+
className: controlClassName
|
|
62
|
+
}, control, controlAfter)) : control);
|
|
57
63
|
};
|
|
58
64
|
|
|
59
65
|
exports.Input = Input;
|
package/Input/index.props.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ import type { ChangeEvent, ForwardedRef, InputHTMLAttributes, ReactNode, FocusEv
|
|
|
2
2
|
import type { FormFieldProps } from "../base/FormField/index.props";
|
|
3
3
|
import type { Size, Variant } from "../base/InputRoot/index.props";
|
|
4
4
|
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "size">, Omit<FormFieldProps, "children"> {
|
|
5
|
+
controlAfter?: ReactNode;
|
|
6
|
+
controlClassName?: string;
|
|
7
|
+
controlRef?: Ref<HTMLDivElement>;
|
|
5
8
|
endIcon?: ReactNode;
|
|
6
9
|
hasError?: boolean;
|
|
7
10
|
hint?: ReactNode;
|
|
@@ -12,7 +15,7 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
|
12
15
|
onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
|
|
13
16
|
onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
14
17
|
onInput?: (event: FormEvent<HTMLInputElement>) => void;
|
|
15
|
-
ref?: Ref<
|
|
18
|
+
ref?: Ref<HTMLDivElement>;
|
|
16
19
|
required?: boolean;
|
|
17
20
|
size?: Size;
|
|
18
21
|
startIcon?: ReactNode;
|
package/List/List.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ListItemProps, ListProps, ListSectionProps } from "./index.props";
|
|
3
|
+
export declare const List: React.ForwardRefExoticComponent<ListProps & React.RefAttributes<HTMLUListElement>>;
|
|
4
|
+
export declare const ListItem: React.ForwardRefExoticComponent<ListItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
5
|
+
export declare const ListSection: React.ForwardRefExoticComponent<ListSectionProps & React.RefAttributes<HTMLLIElement>>;
|
package/List/List.js
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
+
var tslib = require('tslib');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var clsx = require('clsx');
|
|
7
|
+
var styles = require('./List.module.css');
|
|
8
|
+
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefault(_defineProperty);
|
|
12
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
13
|
+
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
14
|
+
var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
15
|
+
|
|
16
|
+
var ListContext = /*#__PURE__*/React.createContext({
|
|
17
|
+
disabled: false,
|
|
18
|
+
dividers: false,
|
|
19
|
+
surface: "none"
|
|
20
|
+
});
|
|
21
|
+
var ItemContent = function ItemContent(_ref) {
|
|
22
|
+
var children = _ref.children,
|
|
23
|
+
description = _ref.description,
|
|
24
|
+
contentLeft = _ref.contentLeft,
|
|
25
|
+
contentRight = _ref.contentRight;
|
|
26
|
+
return /*#__PURE__*/React__default.default.createElement(React__default.default.Fragment, null, contentLeft != null && /*#__PURE__*/React__default.default.createElement("span", {
|
|
27
|
+
className: styles__default.default.left
|
|
28
|
+
}, contentLeft), /*#__PURE__*/React__default.default.createElement("span", {
|
|
29
|
+
className: styles__default.default.content
|
|
30
|
+
}, /*#__PURE__*/React__default.default.createElement("span", {
|
|
31
|
+
className: styles__default.default.title
|
|
32
|
+
}, children), description != null && (/*#__PURE__*/React__default.default.createElement("span", {
|
|
33
|
+
className: styles__default.default.description
|
|
34
|
+
}, description))), contentRight != null && (/*#__PURE__*/React__default.default.createElement("span", {
|
|
35
|
+
className: styles__default.default.right
|
|
36
|
+
}, contentRight)));
|
|
37
|
+
};
|
|
38
|
+
var List = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
39
|
+
var _a$size = _a.size,
|
|
40
|
+
size = _a$size === void 0 ? "m" : _a$size,
|
|
41
|
+
_a$density = _a.density,
|
|
42
|
+
density = _a$density === void 0 ? "normal" : _a$density,
|
|
43
|
+
_a$surface = _a.surface,
|
|
44
|
+
surface = _a$surface === void 0 ? "none" : _a$surface,
|
|
45
|
+
_a$dividers = _a.dividers,
|
|
46
|
+
dividers = _a$dividers === void 0 ? false : _a$dividers,
|
|
47
|
+
_a$disabled = _a.disabled,
|
|
48
|
+
disabled = _a$disabled === void 0 ? false : _a$disabled,
|
|
49
|
+
ariaLabel = _a.ariaLabel,
|
|
50
|
+
className = _a.className,
|
|
51
|
+
children = _a.children,
|
|
52
|
+
rest = tslib.__rest(_a, ["size", "density", "surface", "dividers", "disabled", "ariaLabel", "className", "children"]);
|
|
53
|
+
var context = React.useMemo(function () {
|
|
54
|
+
return {
|
|
55
|
+
disabled: disabled,
|
|
56
|
+
dividers: dividers,
|
|
57
|
+
surface: surface
|
|
58
|
+
};
|
|
59
|
+
}, [disabled, dividers, surface]);
|
|
60
|
+
return /*#__PURE__*/React__default.default.createElement(ListContext.Provider, {
|
|
61
|
+
value: context
|
|
62
|
+
}, /*#__PURE__*/React__default.default.createElement("ul", Object.assign({}, rest, {
|
|
63
|
+
ref: ref,
|
|
64
|
+
"aria-label": ariaLabel,
|
|
65
|
+
"aria-disabled": disabled || undefined,
|
|
66
|
+
className: clsx__default.default(styles__default.default.list, styles__default.default["size_".concat(size)], styles__default.default["density_".concat(density)], styles__default.default["surface_".concat(surface)], _defineProperty__default.default(_defineProperty__default.default({}, styles__default.default.dividers, dividers), styles__default.default["list_disabled"], disabled), className)
|
|
67
|
+
}), children));
|
|
68
|
+
});
|
|
69
|
+
List.displayName = "List";
|
|
70
|
+
var ListItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
71
|
+
var _a;
|
|
72
|
+
var _useContext = React.useContext(ListContext),
|
|
73
|
+
listDisabled = _useContext.disabled,
|
|
74
|
+
dividers = _useContext.dividers,
|
|
75
|
+
surface = _useContext.surface;
|
|
76
|
+
var children = props.children,
|
|
77
|
+
description = props.description,
|
|
78
|
+
contentLeft = props.contentLeft,
|
|
79
|
+
contentRight = props.contentRight,
|
|
80
|
+
_props$disabled = props.disabled,
|
|
81
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
82
|
+
_props$selected = props.selected,
|
|
83
|
+
selected = _props$selected === void 0 ? false : _props$selected,
|
|
84
|
+
className = props.className,
|
|
85
|
+
interactiveProps = tslib.__rest(props, ["children", "description", "contentLeft", "contentRight", "disabled", "selected", "className"]);
|
|
86
|
+
var isDisabled = listDisabled || disabled;
|
|
87
|
+
var itemClassName = clsx__default.default(styles__default.default.item, _defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default({}, styles__default.default["item_surface"], surface === "items"), styles__default.default["item_divider"], dividers), styles__default.default.selected, selected), styles__default.default["item_disabled"], isDisabled), className);
|
|
88
|
+
var content = /*#__PURE__*/React__default.default.createElement(ItemContent, {
|
|
89
|
+
contentLeft: contentLeft,
|
|
90
|
+
contentRight: contentRight,
|
|
91
|
+
description: description
|
|
92
|
+
}, children);
|
|
93
|
+
if ("href" in interactiveProps && interactiveProps.href) {
|
|
94
|
+
var _b = interactiveProps,
|
|
95
|
+
href = _b.href,
|
|
96
|
+
onAction = _b.onAction,
|
|
97
|
+
_onClick = _b.onClick,
|
|
98
|
+
anchorProps = tslib.__rest(_b, ["href", "onAction", "onClick"]);
|
|
99
|
+
return /*#__PURE__*/React__default.default.createElement("li", {
|
|
100
|
+
ref: ref,
|
|
101
|
+
className: itemClassName,
|
|
102
|
+
"aria-disabled": isDisabled || undefined
|
|
103
|
+
}, /*#__PURE__*/React__default.default.createElement("a", Object.assign({}, anchorProps, {
|
|
104
|
+
href: isDisabled ? undefined : href,
|
|
105
|
+
tabIndex: isDisabled ? -1 : anchorProps.tabIndex,
|
|
106
|
+
"aria-current": selected ? "page" : undefined,
|
|
107
|
+
className: styles__default.default.action,
|
|
108
|
+
onClick: function onClick(event) {
|
|
109
|
+
if (isDisabled) {
|
|
110
|
+
event.preventDefault();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
_onClick === null || _onClick === void 0 ? void 0 : _onClick(event);
|
|
114
|
+
if (!event.defaultPrevented) onAction === null || onAction === void 0 ? void 0 : onAction();
|
|
115
|
+
}
|
|
116
|
+
}), content));
|
|
117
|
+
}
|
|
118
|
+
if ("onAction" in interactiveProps && interactiveProps.onAction) {
|
|
119
|
+
var _c = interactiveProps,
|
|
120
|
+
_onAction = _c.onAction,
|
|
121
|
+
buttonProps = tslib.__rest(_c, ["onAction"]);
|
|
122
|
+
return /*#__PURE__*/React__default.default.createElement("li", {
|
|
123
|
+
ref: ref,
|
|
124
|
+
className: itemClassName
|
|
125
|
+
}, /*#__PURE__*/React__default.default.createElement("button", Object.assign({}, buttonProps, {
|
|
126
|
+
type: (_a = buttonProps.type) !== null && _a !== void 0 ? _a : "button",
|
|
127
|
+
disabled: isDisabled,
|
|
128
|
+
"aria-pressed": selected || undefined,
|
|
129
|
+
className: styles__default.default.action,
|
|
130
|
+
onClick: _onAction
|
|
131
|
+
}), content));
|
|
132
|
+
}
|
|
133
|
+
return /*#__PURE__*/React__default.default.createElement("li", Object.assign({}, interactiveProps, {
|
|
134
|
+
ref: ref,
|
|
135
|
+
className: itemClassName,
|
|
136
|
+
"aria-disabled": isDisabled || undefined,
|
|
137
|
+
"aria-current": selected || undefined
|
|
138
|
+
}), /*#__PURE__*/React__default.default.createElement("div", {
|
|
139
|
+
className: styles__default.default["static-content"]
|
|
140
|
+
}, content));
|
|
141
|
+
});
|
|
142
|
+
ListItem.displayName = "ListItem";
|
|
143
|
+
var ListSection = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
144
|
+
var title = _a.title,
|
|
145
|
+
children = _a.children,
|
|
146
|
+
className = _a.className,
|
|
147
|
+
rest = tslib.__rest(_a, ["title", "children", "className"]);
|
|
148
|
+
return /*#__PURE__*/React__default.default.createElement("li", Object.assign({}, rest, {
|
|
149
|
+
ref: ref,
|
|
150
|
+
className: clsx__default.default(styles__default.default.section, className)
|
|
151
|
+
}), title != null && /*#__PURE__*/React__default.default.createElement("div", {
|
|
152
|
+
className: styles__default.default["section-title"]
|
|
153
|
+
}, title), /*#__PURE__*/React__default.default.createElement("ul", {
|
|
154
|
+
className: styles__default.default["nested-list"]
|
|
155
|
+
}, children));
|
|
156
|
+
});
|
|
157
|
+
ListSection.displayName = "ListSection";
|
|
158
|
+
|
|
159
|
+
exports.List = List;
|
|
160
|
+
exports.ListItem = ListItem;
|
|
161
|
+
exports.ListSection = ListSection;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
.list {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
color: var(--component-list-text);
|
|
4
|
+
font-family: var(--font-family-ui);
|
|
5
|
+
list-style: none;
|
|
6
|
+
margin: var(--space-0);
|
|
7
|
+
padding: var(--space-0);
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.surface_container {
|
|
12
|
+
background: var(--component-list-bg);
|
|
13
|
+
border-radius: var(--component-list-container-radius);
|
|
14
|
+
padding: var(--component-list-container-padding);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.surface_items {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: var(--component-list-items-gap);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.item {
|
|
24
|
+
display: block;
|
|
25
|
+
margin: var(--space-0);
|
|
26
|
+
position: relative;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.item_surface {
|
|
30
|
+
background: var(--component-list-bg);
|
|
31
|
+
border-radius: var(--component-list-item-surface-radius);
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.action,
|
|
36
|
+
.static-content {
|
|
37
|
+
align-items: center;
|
|
38
|
+
background: transparent;
|
|
39
|
+
border: 0;
|
|
40
|
+
border-radius: var(--component-list-item-radius);
|
|
41
|
+
box-sizing: border-box;
|
|
42
|
+
color: inherit;
|
|
43
|
+
display: flex;
|
|
44
|
+
font: inherit;
|
|
45
|
+
gap: var(--component-list-item-gap);
|
|
46
|
+
min-height: var(--component-list-item-min-height-m);
|
|
47
|
+
padding: var(--component-list-item-padding-block) var(--component-list-item-padding-inline);
|
|
48
|
+
text-align: left;
|
|
49
|
+
text-decoration: none;
|
|
50
|
+
width: 100%;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.action {
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
}
|
|
56
|
+
.action:hover {
|
|
57
|
+
background: var(--component-list-item-bg-hover);
|
|
58
|
+
}
|
|
59
|
+
.action:focus-visible {
|
|
60
|
+
outline: var(--focus-ring-width) solid var(--component-list-focus-ring);
|
|
61
|
+
outline-offset: calc(var(--focus-ring-width) * -1);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.content {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex: 1;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
min-width: 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.title {
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
text-overflow: ellipsis;
|
|
75
|
+
white-space: nowrap;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.description {
|
|
79
|
+
color: var(--component-list-description);
|
|
80
|
+
font-size: var(--component-list-description-font-size);
|
|
81
|
+
line-height: var(--component-list-description-line-height);
|
|
82
|
+
margin-top: var(--component-list-description-offset);
|
|
83
|
+
overflow: hidden;
|
|
84
|
+
text-overflow: ellipsis;
|
|
85
|
+
white-space: nowrap;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.left,
|
|
89
|
+
.right {
|
|
90
|
+
align-items: center;
|
|
91
|
+
display: inline-flex;
|
|
92
|
+
flex: none;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.selected .action,
|
|
97
|
+
.selected .static-content {
|
|
98
|
+
background: var(--component-list-item-bg-selected);
|
|
99
|
+
color: var(--component-list-item-text-selected);
|
|
100
|
+
}
|
|
101
|
+
.selected .description {
|
|
102
|
+
color: var(--component-list-description-selected);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.list_disabled {
|
|
106
|
+
color: var(--component-list-text-disabled);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.item_divider:not(:last-child)::after {
|
|
110
|
+
background: var(--component-list-divider);
|
|
111
|
+
bottom: 0;
|
|
112
|
+
content: "";
|
|
113
|
+
height: var(--border-width-hairline);
|
|
114
|
+
left: var(--component-list-item-padding-inline);
|
|
115
|
+
position: absolute;
|
|
116
|
+
right: var(--component-list-item-padding-inline);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.density_compact .action,
|
|
120
|
+
.density_compact .static-content {
|
|
121
|
+
min-height: var(--component-list-item-min-height-compact);
|
|
122
|
+
padding-bottom: var(--component-list-item-padding-block-compact);
|
|
123
|
+
padding-top: var(--component-list-item-padding-block-compact);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.size_s {
|
|
127
|
+
font-size: var(--component-list-font-size-s);
|
|
128
|
+
line-height: var(--component-list-line-height-s);
|
|
129
|
+
}
|
|
130
|
+
.size_s .action,
|
|
131
|
+
.size_s .static-content {
|
|
132
|
+
min-height: var(--component-list-item-min-height-s);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.size_m {
|
|
136
|
+
font-size: var(--component-list-font-size-m);
|
|
137
|
+
line-height: var(--component-list-line-height-m);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.size_l {
|
|
141
|
+
font-size: var(--component-list-font-size-l);
|
|
142
|
+
line-height: var(--component-list-line-height-l);
|
|
143
|
+
}
|
|
144
|
+
.size_l .action,
|
|
145
|
+
.size_l .static-content {
|
|
146
|
+
min-height: var(--component-list-item-min-height-l);
|
|
147
|
+
padding-left: var(--component-list-item-padding-inline-l);
|
|
148
|
+
padding-right: var(--component-list-item-padding-inline-l);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.item_disabled {
|
|
152
|
+
color: var(--component-list-item-text-disabled);
|
|
153
|
+
}
|
|
154
|
+
.item_disabled .action {
|
|
155
|
+
cursor: not-allowed;
|
|
156
|
+
}
|
|
157
|
+
.item_disabled .action:hover {
|
|
158
|
+
background: transparent;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.section {
|
|
162
|
+
list-style: none;
|
|
163
|
+
margin: var(--space-0);
|
|
164
|
+
padding: var(--space-0);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.section + .section {
|
|
168
|
+
margin-top: var(--component-list-section-gap);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.section-title {
|
|
172
|
+
color: var(--component-list-section-title);
|
|
173
|
+
font-size: var(--component-list-section-title-font-size);
|
|
174
|
+
font-weight: var(--font-weight-semibold);
|
|
175
|
+
letter-spacing: var(--letter-spacing-ui);
|
|
176
|
+
line-height: var(--component-list-section-title-line-height);
|
|
177
|
+
padding: var(--component-list-section-title-padding-block-start) var(--component-list-item-padding-inline) var(--component-list-section-title-padding-block-end);
|
|
178
|
+
text-transform: uppercase;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.nested-list {
|
|
182
|
+
list-style: none;
|
|
183
|
+
margin: var(--space-0);
|
|
184
|
+
padding: var(--space-0);
|
|
185
|
+
}
|
package/List/index.d.ts
ADDED
package/List/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { AnchorHTMLAttributes, ButtonHTMLAttributes, HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export type ListSize = "s" | "m" | "l";
|
|
3
|
+
export type ListDensity = "compact" | "normal";
|
|
4
|
+
export type ListSurface = "none" | "container" | "items";
|
|
5
|
+
export interface ListContextValue {
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
dividers: boolean;
|
|
8
|
+
surface: ListSurface;
|
|
9
|
+
}
|
|
10
|
+
export interface ListProps extends HTMLAttributes<HTMLUListElement> {
|
|
11
|
+
ariaLabel?: string;
|
|
12
|
+
density?: ListDensity;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
dividers?: boolean;
|
|
15
|
+
size?: ListSize;
|
|
16
|
+
surface?: ListSurface;
|
|
17
|
+
}
|
|
18
|
+
export interface ListItemBaseProps {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
className?: string;
|
|
21
|
+
contentLeft?: ReactNode;
|
|
22
|
+
contentRight?: ReactNode;
|
|
23
|
+
description?: ReactNode;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
selected?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface ListItemStaticProps extends ListItemBaseProps, Omit<HTMLAttributes<HTMLLIElement>, "children" | "onClick"> {
|
|
28
|
+
href?: never;
|
|
29
|
+
onAction?: never;
|
|
30
|
+
}
|
|
31
|
+
export interface ListItemButtonProps extends ListItemBaseProps, Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "disabled" | "onClick"> {
|
|
32
|
+
href?: never;
|
|
33
|
+
onAction: () => void;
|
|
34
|
+
}
|
|
35
|
+
export interface ListItemLinkProps extends ListItemBaseProps, Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "children" | "href"> {
|
|
36
|
+
href: string;
|
|
37
|
+
onAction?: () => void;
|
|
38
|
+
}
|
|
39
|
+
export type ListItemProps = ListItemStaticProps | ListItemButtonProps | ListItemLinkProps;
|
|
40
|
+
export interface ListSectionProps extends Omit<HTMLAttributes<HTMLLIElement>, "title"> {
|
|
41
|
+
children: ReactNode;
|
|
42
|
+
title?: ReactNode;
|
|
43
|
+
}
|
package/Modal/Modal.module.css
CHANGED
|
@@ -6,19 +6,17 @@
|
|
|
6
6
|
width: 100%;
|
|
7
7
|
z-index: 1000;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
display: flex;
|
|
14
|
-
justify-content: space-between;
|
|
15
|
-
padding: var(--space-4) var(--space-5);
|
|
9
|
+
.root_contained {
|
|
10
|
+
left: 0;
|
|
11
|
+
position: absolute;
|
|
12
|
+
z-index: 2;
|
|
16
13
|
}
|
|
17
14
|
|
|
18
15
|
.close-wrapper {
|
|
19
16
|
align-items: center;
|
|
20
17
|
box-sizing: border-box;
|
|
21
18
|
display: flex;
|
|
19
|
+
flex: none;
|
|
22
20
|
justify-content: flex-end;
|
|
23
21
|
min-height: var(--component-modal-close-min-height);
|
|
24
22
|
padding: 0 var(--space-5);
|
|
@@ -32,6 +30,9 @@
|
|
|
32
30
|
top: 0;
|
|
33
31
|
width: 100%;
|
|
34
32
|
}
|
|
33
|
+
.root_contained .modal-overlay {
|
|
34
|
+
position: absolute;
|
|
35
|
+
}
|
|
35
36
|
|
|
36
37
|
.modal-wrapper {
|
|
37
38
|
background-color: var(--component-modal-bg);
|
|
@@ -53,4 +54,10 @@
|
|
|
53
54
|
max-height: calc(100vh - var(--component-modal-viewport-offset));
|
|
54
55
|
max-width: calc(100vw - var(--component-modal-viewport-offset));
|
|
55
56
|
min-width: var(--component-modal-desktop-min-width);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.modal-wrapper_contained.modal-wrapper_desktop {
|
|
60
|
+
max-height: calc(100% - var(--space-8));
|
|
61
|
+
max-width: calc(100% - var(--space-8));
|
|
62
|
+
min-width: 0;
|
|
56
63
|
}
|