@flodesk/grain 11.35.1 → 11.35.2
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/es/foundational/field.js +4 -12
- package/es/foundational/styles.js +0 -3
- package/es/styles/foundational.js +3 -2
- package/es/styles/variables.js +1 -1
- package/es/types/components/arrange.d.ts +18 -0
- package/es/types/components/autocomplete.d.ts +39 -0
- package/es/types/components/autocomplete2.d.ts +45 -0
- package/es/types/components/badge.d.ts +12 -0
- package/es/types/components/box.d.ts +59 -0
- package/es/types/components/breakpoints-provider.d.ts +15 -0
- package/es/types/components/button.d.ts +19 -0
- package/es/types/components/checkbox.d.ts +23 -0
- package/es/types/components/dropdown.d.ts +26 -0
- package/es/types/components/flex.d.ts +22 -0
- package/es/types/components/icon-button.d.ts +16 -0
- package/es/types/components/icon-toggle.d.ts +14 -0
- package/es/types/components/icon.d.ts +11 -0
- package/es/types/components/index.d.ts +32 -0
- package/es/types/components/link.d.ts +12 -0
- package/es/types/components/modal.d.ts +27 -0
- package/es/types/components/nav.d.ts +17 -0
- package/es/types/components/pagination.d.ts +9 -0
- package/es/types/components/popover.d.ts +18 -0
- package/es/types/components/progress.d.ts +8 -0
- package/es/types/components/provider.d.ts +11 -0
- package/es/types/components/radio.d.ts +23 -0
- package/es/types/components/select.d.ts +26 -0
- package/es/types/components/slider.d.ts +21 -0
- package/es/types/components/spinner.d.ts +9 -0
- package/es/types/components/stack.d.ts +10 -0
- package/es/types/components/switch.d.ts +12 -0
- package/es/types/components/tab.d.ts +17 -0
- package/es/types/components/text-button.d.ts +16 -0
- package/es/types/components/text-input.d.ts +25 -0
- package/es/types/components/text-toggle.d.ts +14 -0
- package/es/types/components/text.d.ts +17 -0
- package/es/types/components/textarea.d.ts +22 -0
- package/es/types/components/toast.d.ts +17 -0
- package/es/types/components/tooltip.d.ts +19 -0
- package/es/types/foundational/field.d.ts +30 -0
- package/es/types/foundational/index.d.ts +3 -0
- package/es/types/foundational/menu.d.ts +58 -0
- package/es/types/foundational/styles.d.ts +37 -0
- package/es/types/hooks/index.d.ts +2 -0
- package/es/types/hooks/useMedia.d.ts +1 -0
- package/es/types/hooks/useOnClickOutside.d.ts +4 -0
- package/es/types/icons/common.d.ts +3 -0
- package/es/types/icons/index.d.ts +85 -0
- package/es/types/index.d.ts +15 -0
- package/es/types/shared.d.ts +41 -0
- package/es/types/tokens.d.ts +141 -0
- package/es/types/utilities/index.d.ts +2 -0
- package/es/types/utilities/responsive.d.ts +20 -0
- package/es/types/utilities/styles.d.ts +20 -0
- package/es/types/variables/colors.d.ts +14 -0
- package/es/types/variables/index.d.ts +2 -0
- package/es/types/variables/vars.d.ts +92 -0
- package/es/utilities/responsive.js +1 -5
- package/es/utilities/style-config.js +3 -3
- package/es/utilities/styles.js +2 -10
- package/es/variables/vars.js +1 -32
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ function Demo() {
|
|
|
24
24
|
|
|
25
25
|
### Add text styles context
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
Apply the `grn-context` class to any wrapper. It sets the `line-height` dynamically. Use it on as many wrappers as needed.
|
|
28
28
|
|
|
29
29
|
In the future, once Grain is widely adopted, we will remove these classes and apply the text styles globally.
|
|
30
30
|
|
package/es/foundational/field.js
CHANGED
|
@@ -16,17 +16,9 @@ import { IconCross } from '../icons';
|
|
|
16
16
|
import { getColor, getRadius, getSpace, getTransition, getWeight } from '../utilities';
|
|
17
17
|
import { styles } from './styles';
|
|
18
18
|
import { types } from '../types';
|
|
19
|
-
import PropTypes from 'prop-types';
|
|
20
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
21
|
-
export const fieldVars = {
|
|
22
|
-
xPadding: '12px',
|
|
23
|
-
borderColor: getColor('fade3'),
|
|
24
|
-
borderColorHover: getColor('fade6'),
|
|
25
|
-
borderColorFocus: getColor('shade9'),
|
|
26
|
-
borderColorDisabled: getColor('shade5'),
|
|
27
|
-
backgroundColorDisabled: getColor('shade2')
|
|
28
|
-
}; // fix for safari v16, incorrect color when disabled
|
|
19
|
+
import PropTypes from 'prop-types'; // fix for safari v16, incorrect color when disabled
|
|
29
20
|
|
|
21
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
30
22
|
const safari16Fix = "\n &:not(:placeholder-shown) {\n -webkit-text-fill-color: ".concat(getColor('content'), ";\n }\n &:placeholder-shown {\n -webkit-text-fill-color: var(--grn-field-placeholder-color);\n }\n opacity: 1;\n");
|
|
31
23
|
export const fieldDisabledStyles = "\n background-color: var(--grn-field-background-disabled);\n border-color: var(--grn-field-border-color-disabled);\n ".concat(safari16Fix, ";\n");
|
|
32
24
|
export const fieldPlaceholderStyles = "\n /* these selectors are needed to force the color */\n &:not(:disabled, :read-only)::placeholder,\n &:disabled::placeholder,\n &:read-only::placeholder {\n color: var(--grn-field-placeholder-color);\n }\n";
|
|
@@ -58,7 +50,7 @@ const InputFieldRoot = /*#__PURE__*/_styled("input", process.env.NODE_ENV === "p
|
|
|
58
50
|
paddingRight
|
|
59
51
|
} = _ref3;
|
|
60
52
|
return "0 ".concat(getSpace(paddingRight), " 0 ").concat(getSpace(paddingLeft));
|
|
61
|
-
}, ";height:var(--grn-textbox-height-m);" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
53
|
+
}, ";height:var(--grn-textbox-height-m);" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9mb3VuZGF0aW9uYWwvZmllbGQuanN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlFbUMiLCJmaWxlIjoiLi4vLi4vc3JjL2ZvdW5kYXRpb25hbC9maWVsZC5qc3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBmb3J3YXJkUmVmIH0gZnJvbSAncmVhY3QnO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sZHJlbiwgLi4ucHJvcHMgfSwgcmVmKSA9PiAoXG4gIDxGaWVsZExhYmVsUm9vdCByZWY9e3JlZn0gey4uLnByb3BzfT5cbiAgICB7Y2hpbGRyZW59XG4gIDwvRmllbGRMYWJlbFJvb3Q+XG4pKTtcblxuRmllbGRMYWJlbC5wcm9wVHlwZXMgPSB7XG4gIGNoaWxkcmVuOiBQcm9wVHlwZXMubm9kZSxcbn07XG5cbmV4cG9ydCBjb25zdCBGaWVsZEhpbnQgPSBmb3J3YXJkUmVmKCh7IGNoaWxkcmVuLCAuLi5wcm9wcyB9LCByZWYpID0+IChcbiAgPFRleHQgY29sb3I9XCJjb250ZW50MlwiIHJlZj17cmVmfSB7Li4ucHJvcHN9PlxuICAgIHtjaGlsZHJlbn1cbiAgPC9UZXh0PlxuKSk7XG5cbkZpZWxkSGludC5wcm9wVHlwZXMgPSB7XG4gIGNoaWxkcmVuOiBQcm9wVHlwZXMubm9kZSxcbn07XG5cbmV4cG9ydCBjb25zdCBGaWVsZENsZWFyQnV0dG9uID0gKHsgb25DbGljaywgdGFnID0gJ2J1dHRvbicsIC4uLnByb3BzIH0pID0+IChcbiAgPEljb25CdXR0b24gaWNvbj17PEljb25Dcm9zcyAvPn0gb25DbGljaz17b25DbGlja30gdGFnPXt0YWd9IHsuLi5wcm9wc30gLz5cbik7XG5cbkZpZWxkQ2xlYXJCdXR0b24ucHJvcFR5cGVzID0ge1xuICBvbkNsaWNrOiBQcm9wVHlwZXMuZnVuYyxcbiAgdGFnOiB0eXBlcy5idXR0b25UYWcsXG59O1xuIl19 */"));
|
|
62
54
|
|
|
63
55
|
export const InputField = /*#__PURE__*/forwardRef((_ref4, ref) => {
|
|
64
56
|
let {
|
|
@@ -95,7 +87,7 @@ const FieldLabelRoot = /*#__PURE__*/_styled("label", process.env.NODE_ENV === "p
|
|
|
95
87
|
} : {
|
|
96
88
|
target: "e1swxi6p0",
|
|
97
89
|
label: "FieldLabelRoot"
|
|
98
|
-
})("display:block;font-weight:", getWeight('medium'), ";transition:", getTransition('fast'), ";margin:unset;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
90
|
+
})("display:block;font-weight:", getWeight('medium'), ";transition:", getTransition('fast'), ";margin:unset;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9mb3VuZGF0aW9uYWwvZmllbGQuanN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1IbUMiLCJmaWxlIjoiLi4vLi4vc3JjL2ZvdW5kYXRpb25hbC9maWVsZC5qc3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBmb3J3YXJkUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgVGV4dCwgSWNvbkJ1dHRvbiB9IGZyb20gJy4uL2NvbXBvbmVudHMnO1xuaW1wb3J0IHsgSWNvbkNyb3NzIH0gZnJvbSAnLi4vaWNvbnMnO1xuaW1wb3J0IHsgZ2V0Q29sb3IsIGdldFJhZGl1cywgZ2V0U3BhY2UsIGdldFRyYW5zaXRpb24sIGdldFdlaWdodCB9IGZyb20gJy4uL3V0aWxpdGllcyc7XG5pbXBvcnQgeyBzdHlsZXMgfSBmcm9tICcuL3N0eWxlcyc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyB0eXBlcyB9IGZyb20gJy4uL3R5cGVzJztcbmltcG9ydCBQcm9wVHlwZXMgZnJvbSAncHJvcC10eXBlcyc7XG5cbi8vIGZpeCBmb3Igc2FmYXJpIHYxNiwgaW5jb3JyZWN0IGNvbG9yIHdoZW4gZGlzYWJsZWRcbmNvbnN0IHNhZmFyaTE2Rml4ID0gYFxuICAmOm5vdCg6cGxhY2Vob2xkZXItc2hvd24pIHtcbiAgICAtd2Via2l0LXRleHQ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ID0+IChcbiAgPEljb25CdXR0b24gaWNvbj17PEljb25Dcm9zcyAvPn0gb25DbGljaz17b25DbGlja30gdGFnPXt0YWd9IHsuLi5wcm9wc30gLz5cbik7XG5cbkZpZWxkQ2xlYXJCdXR0b24ucHJvcFR5cGVzID0ge1xuICBvbkNsaWNrOiBQcm9wVHlwZXMuZnVuYyxcbiAgdGFnOiB0eXBlcy5idXR0b25UYWcsXG59O1xuIl19 */"));
|
|
99
91
|
|
|
100
92
|
export const FieldLabel = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
101
93
|
let {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { getColor, getRadius, getTextSize, getTransition, getWeight } from '../utilities';
|
|
2
2
|
export const capHeight = "0.74em";
|
|
3
3
|
export const lineHeightAndCapHeightOffset = "calc((var(--grn-lineHeight-global) - ".concat(capHeight, ") / 2)");
|
|
4
|
-
export const componentVars = {
|
|
5
|
-
strokeSize: '1px'
|
|
6
|
-
};
|
|
7
4
|
const buttonResetStyles = "\n appearance: none;\n font-family: inherit;\n font-size: inherit;\n font-weight: ".concat(getWeight('medium'), ";\n cursor: pointer;\n");
|
|
8
5
|
export const transitionStyles = "\n transition: ".concat(getTransition('leave'), ";\n\n &:hover {\n transition: ").concat(getTransition('hover'), ";\n }\n\n &:active {\n transition: ").concat(getTransition('active'), ";\n }\n");
|
|
9
6
|
export const styles = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const legacyVariables = "\n :root {\n --grn-
|
|
1
|
+
const legacyVariables = "\n :root {\n --grn-textbox-textSize-s: var(--grn-text-s);\n }\n";
|
|
2
2
|
export const borderVariables = "\n :root {\n --grn-border-size: 1px;\n }\n";
|
|
3
3
|
const capValue = "\n :root {\n @supports not (font-size: 1cap) { --grn-cap-value: 0.74em }\n @supports (font-size: 1cap) { --grn-cap-value: 1cap }\n }\n";
|
|
4
4
|
export const capVariables = "\n :root {\n --grn-cap: var(--grn-cap-value);\n }\n";
|
|
@@ -8,5 +8,6 @@ const experiments = "\n [data-experiment-compact-textbox=\"true\"] {\n --grn
|
|
|
8
8
|
export const textboxVariables = "\n :root {\n --grn-textbox-height-s: 28px;\n --grn-textbox-paddingX-s: var(--grn-space-s);\n --grn-textbox-radius-s: var(--grn-radius-xs);\n --grn-textbox-text-s: var(--grn-text-s);\n\n --grn-textbox-height-m: 40px;\n --grn-textbox-paddingX-m: var(--grn-space-m);\n --grn-textbox-radius-m: var(--grn-radius-s);\n --grn-textbox-text-m: var(--grn-text-m);\n }\n";
|
|
9
9
|
export const clearbuttonVariables = "\n :root {\n --grn-clearbutton-height: 36px;\n }\n";
|
|
10
10
|
export const formVariables = "\n :root {\n --grn-form-title-content-gap: var(--grn-space-l);\n --grn-form-contents-gap: var(--grn-space-m);\n --grn-form-content-actions-gap: var(--grn-space-xl);\n --grn-form-control-label-gap: var(--grn-space-s);\n }\n";
|
|
11
|
-
const
|
|
11
|
+
export const transitionVariables = "\n :root {\n --grn-transition-leave: var(--grn-transition-slow);\n --grn-transition-hover: var(--grn-transition-fast);\n --grn-transition-active: var(--grn-transition-xxFast);\n }\n";
|
|
12
|
+
const foundationalVariables = "\n ".concat(legacyVariables, "\n ").concat(fieldVariables, "\n ").concat(componentVariables, "\n ").concat(textboxVariables, "\n ").concat(clearbuttonVariables, "\n ").concat(experiments, "\n ").concat(capValue, "\n ").concat(capVariables, "\n ").concat(borderVariables, "\n ").concat(formVariables, "\n ").concat(transitionVariables, "\n");
|
|
12
13
|
export default foundationalVariables;
|
package/es/styles/variables.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const variables = "\n :root {\n --grn-unit: 8px;\n }\n\n :root {\n --grn-text-s: 12px;\n --grn-text-m: 14px;\n --grn-text-l: 18px;\n --grn-text-xl: 24px;\n --grn-text-xxl: 30px;\n }\n\n /* text size \u2715 ~1.2 */\n :root {\n --grn-icon-s: 14px;\n --grn-icon-m: 18px;\n --grn-icon-l: 22px;\n --grn-icon-xl: 28px;\n --grn-icon-xxl: 36px;\n }\n\n :root {\n --grn-weight-normal: 400;\n --grn-weight-medium: 500;\n }\n\n :root {\n --grn-space-xs: calc(var(--grn-unit) / 2);\n --grn-space-s: calc(var(--grn-unit) * 1);\n --grn-space-s2: calc(var(--grn-unit) * 1.5);\n --grn-space-m: calc(var(--grn-unit) * 2);\n --grn-space-l: calc(var(--grn-unit) * 3);\n --grn-space-l2: calc(var(--grn-unit) * 4);\n --grn-space-xl: calc(var(--grn-unit) * 5);\n --grn-space-xl2: calc(var(--grn-unit) * 6);\n --grn-space-xxl: calc(var(--grn-unit) * 7);\n }\n\n :root {\n --grn-radius-xs: 3px;\n --grn-radius-s: 6px;\n --grn-radius-m: 8px;\n --grn-radius-l: 10px;\n }\n\n :root {\n --grn-transition-slow: 400ms;\n --grn-transition-fast: 200ms;\n --grn-transition-xFast: 160ms;\n --grn-transition-xxFast: 80ms;\n }\n\n :root,\n [data-theme] {\n --grn-color-backdrop: hsl(var(--H) 15% 10% / 0.6);\n
|
|
1
|
+
const variables = "\n :root {\n --grn-unit: 8px;\n }\n\n :root {\n --grn-text-s: 12px;\n --grn-text-m: 14px;\n --grn-text-l: 18px;\n --grn-text-xl: 24px;\n --grn-text-xxl: 30px;\n }\n\n /* text size \u2715 ~1.2 */\n :root {\n --grn-icon-s: 14px;\n --grn-icon-m: 18px;\n --grn-icon-l: 22px;\n --grn-icon-xl: 28px;\n --grn-icon-xxl: 36px;\n }\n\n :root {\n --grn-weight-normal: 400;\n --grn-weight-medium: 500;\n }\n\n :root {\n --grn-space-xs: calc(var(--grn-unit) / 2);\n --grn-space-s: calc(var(--grn-unit) * 1);\n --grn-space-s2: calc(var(--grn-unit) * 1.5);\n --grn-space-m: calc(var(--grn-unit) * 2);\n --grn-space-l: calc(var(--grn-unit) * 3);\n --grn-space-l2: calc(var(--grn-unit) * 4);\n --grn-space-xl: calc(var(--grn-unit) * 5);\n --grn-space-xl2: calc(var(--grn-unit) * 6);\n --grn-space-xxl: calc(var(--grn-unit) * 7);\n }\n\n :root {\n --grn-radius-xs: 3px;\n --grn-radius-s: 6px;\n --grn-radius-m: 8px;\n --grn-radius-l: 10px;\n }\n\n :root {\n --grn-transition-slow: 400ms;\n --grn-transition-fast: 200ms;\n --grn-transition-xFast: 160ms;\n --grn-transition-xxFast: 80ms;\n }\n\n :root,\n [data-theme] {\n --grn-color-backdrop: hsl(var(--H) 15% 10% / 0.6);\n }\n";
|
|
2
2
|
export default variables;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { BoxProps } from './box';
|
|
3
|
+
import { DimensionPropType, AlignmentType, ContentPositionType, DirectionType } from '../shared';
|
|
4
|
+
|
|
5
|
+
export interface ArrangeProps extends BoxProps, HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
gap?: DimensionPropType;
|
|
7
|
+
columnGap?: DimensionPropType;
|
|
8
|
+
rowGap?: DimensionPropType;
|
|
9
|
+
alignItems?: AlignmentType;
|
|
10
|
+
justifyItems?: AlignmentType;
|
|
11
|
+
justifyContent?: ContentPositionType;
|
|
12
|
+
alignContent?: ContentPositionType;
|
|
13
|
+
columns?: string | number;
|
|
14
|
+
rows?: string | number;
|
|
15
|
+
autoFlow?: DirectionType;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const Arrange: FC<ArrangeProps>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes, InputHTMLAttributes } from 'react';
|
|
2
|
+
import { ColorPropType } from '../shared';
|
|
3
|
+
import { MenuPlacement } from '../foundational/menu';
|
|
4
|
+
|
|
5
|
+
export interface AutocompleteOption {
|
|
6
|
+
value: string;
|
|
7
|
+
content: string;
|
|
8
|
+
groupTitle?: string;
|
|
9
|
+
preContent?: React.ReactNode;
|
|
10
|
+
isDisabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface AutocompleteProps
|
|
14
|
+
extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value'> {
|
|
15
|
+
options: AutocompleteOption[];
|
|
16
|
+
value?: string;
|
|
17
|
+
onChange: (_selectedOption: AutocompleteOption) => void;
|
|
18
|
+
isCreatable?: boolean;
|
|
19
|
+
onCreate?: (_newOption: AutocompleteOption) => void;
|
|
20
|
+
menuPlacement?: MenuPlacement;
|
|
21
|
+
menuWidth?: string | number;
|
|
22
|
+
menuMaxHeight?: string;
|
|
23
|
+
menuZIndex?: number;
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
label?: React.ReactNode;
|
|
26
|
+
hint?: React.ReactNode;
|
|
27
|
+
menuItemsHaveEllipsis?: boolean;
|
|
28
|
+
hasPortal?: boolean;
|
|
29
|
+
hasError?: boolean;
|
|
30
|
+
errorMessage?: string;
|
|
31
|
+
searchField?: string;
|
|
32
|
+
backgroundColor?: ColorPropType;
|
|
33
|
+
onClear?: () => void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const Autocomplete: FC<AutocompleteProps> & {
|
|
37
|
+
Label: FC<HTMLAttributes<HTMLLabelElement> & { children: React.ReactNode }>;
|
|
38
|
+
Hint: FC<HTMLAttributes<HTMLDivElement> & { children: React.ReactNode }>;
|
|
39
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import { ColorPropType } from '../shared';
|
|
3
|
+
import { MenuPlacement } from '../foundational/menu';
|
|
4
|
+
|
|
5
|
+
export interface Autocomplete2Option {
|
|
6
|
+
value: string;
|
|
7
|
+
content: string;
|
|
8
|
+
groupTitle?: string;
|
|
9
|
+
item?: (props: {
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
isSelected: boolean;
|
|
12
|
+
isDisabled: boolean;
|
|
13
|
+
hasEllipsis?: boolean;
|
|
14
|
+
}) => React.ReactNode;
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface Autocomplete2Props {
|
|
19
|
+
options: Autocomplete2Option[];
|
|
20
|
+
value?: string;
|
|
21
|
+
onChange: (option: Autocomplete2Option) => void;
|
|
22
|
+
isCreatable?: boolean;
|
|
23
|
+
onCreate?: (option: Autocomplete2Option) => void;
|
|
24
|
+
menuPlacement?: MenuPlacement;
|
|
25
|
+
menuWidth?: string | number;
|
|
26
|
+
menuMaxHeight?: string;
|
|
27
|
+
menuZIndex?: number;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
label?: React.ReactNode;
|
|
30
|
+
hint?: React.ReactNode;
|
|
31
|
+
menuItemsHaveEllipsis?: boolean;
|
|
32
|
+
hasPortal?: boolean;
|
|
33
|
+
hasError?: boolean;
|
|
34
|
+
errorMessage?: string;
|
|
35
|
+
isDisabled?: boolean;
|
|
36
|
+
searchField?: string;
|
|
37
|
+
backgroundColor?: ColorPropType;
|
|
38
|
+
onClear?: () => void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const Autocomplete2: FC<Autocomplete2Props> & {
|
|
42
|
+
Label: FC<{ children: React.ReactNode }>;
|
|
43
|
+
Hint: FC<{ children: React.ReactNode }>;
|
|
44
|
+
Item: FC<{ children: React.ReactNode; hasEllipsis?: boolean; paddingLeft?: string }>;
|
|
45
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { ColorPropType } from '../shared';
|
|
3
|
+
|
|
4
|
+
export interface BadgeProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
color?: ColorPropType;
|
|
7
|
+
backgroundColor?: ColorPropType;
|
|
8
|
+
borderColor?: ColorPropType;
|
|
9
|
+
variant?: 'neutral' | 'danger' | 'warning' | 'success';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const Badge: FC<BadgeProps>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { FC, DOMAttributes, PropsWithChildren, RefAttributes } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
ColorPropType,
|
|
4
|
+
DimensionPropType,
|
|
5
|
+
RadiusPropType,
|
|
6
|
+
PositionType,
|
|
7
|
+
OverflowPropType,
|
|
8
|
+
BorderWidthType,
|
|
9
|
+
SideType,
|
|
10
|
+
} from '../shared';
|
|
11
|
+
import { ShadowTokens } from '../tokens';
|
|
12
|
+
|
|
13
|
+
export interface BoxProps
|
|
14
|
+
extends PropsWithChildren,
|
|
15
|
+
RefAttributes<HTMLDivElement>,
|
|
16
|
+
Partial<HTMLDivElement>,
|
|
17
|
+
DOMAttributes<HTMLDivElement> {
|
|
18
|
+
color?: ColorPropType;
|
|
19
|
+
colorHover?: ColorPropType;
|
|
20
|
+
backgroundColor?: ColorPropType;
|
|
21
|
+
backgroundColorHover?: ColorPropType;
|
|
22
|
+
borderColor?: ColorPropType;
|
|
23
|
+
borderColorHover?: ColorPropType;
|
|
24
|
+
borderWidth?: BorderWidthType;
|
|
25
|
+
borderSide?: SideType;
|
|
26
|
+
width?: DimensionPropType;
|
|
27
|
+
minWidth?: DimensionPropType;
|
|
28
|
+
maxWidth?: DimensionPropType;
|
|
29
|
+
height?: DimensionPropType;
|
|
30
|
+
minHeight?: DimensionPropType;
|
|
31
|
+
maxHeight?: DimensionPropType;
|
|
32
|
+
radius?: RadiusPropType;
|
|
33
|
+
shadow?: keyof ShadowTokens;
|
|
34
|
+
shadowHover?: keyof ShadowTokens;
|
|
35
|
+
padding?: DimensionPropType;
|
|
36
|
+
paddingTop?: DimensionPropType;
|
|
37
|
+
paddingBottom?: DimensionPropType;
|
|
38
|
+
paddingLeft?: DimensionPropType;
|
|
39
|
+
paddingRight?: DimensionPropType;
|
|
40
|
+
paddingX?: DimensionPropType;
|
|
41
|
+
paddingY?: DimensionPropType;
|
|
42
|
+
margin?: DimensionPropType;
|
|
43
|
+
marginTop?: DimensionPropType;
|
|
44
|
+
marginBottom?: DimensionPropType;
|
|
45
|
+
marginLeft?: DimensionPropType;
|
|
46
|
+
marginRight?: DimensionPropType;
|
|
47
|
+
marginX?: DimensionPropType;
|
|
48
|
+
marginY?: DimensionPropType;
|
|
49
|
+
position?: PositionType;
|
|
50
|
+
top?: DimensionPropType;
|
|
51
|
+
bottom?: DimensionPropType;
|
|
52
|
+
left?: DimensionPropType;
|
|
53
|
+
right?: DimensionPropType;
|
|
54
|
+
overflow?: OverflowPropType;
|
|
55
|
+
overflowX?: OverflowPropType;
|
|
56
|
+
overflowY?: OverflowPropType;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const Box: FC<BoxProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface BreakpointsProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
breakpoints?: {
|
|
6
|
+
tablet?: number;
|
|
7
|
+
mobile?: number;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const BreakpointsProvider: FC<BreakpointsProviderProps>;
|
|
12
|
+
export const BreakpointsContext: React.Context<{
|
|
13
|
+
tablet: number;
|
|
14
|
+
mobile: number;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
export type ButtonVariant = 'neutral' | 'accent' | 'danger';
|
|
4
|
+
export type ButtonTag = 'button' | 'a' | 'span';
|
|
5
|
+
|
|
6
|
+
export interface ButtonProps {
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
variant?: ButtonVariant;
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
iconPosition?: 'left' | 'right';
|
|
12
|
+
hasFullWidth?: boolean;
|
|
13
|
+
hasSpinner?: boolean;
|
|
14
|
+
type?: 'button' | 'submit' | 'reset';
|
|
15
|
+
tag?: ButtonTag;
|
|
16
|
+
onClick?: (_event: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const Button: FC<ButtonProps>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { FC, InputHTMLAttributes, LabelHTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
4
|
+
id: string;
|
|
5
|
+
onChange?: (_event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
|
+
isDisabled?: boolean;
|
|
7
|
+
isChecked?: boolean;
|
|
8
|
+
isIndeterminate?: boolean;
|
|
9
|
+
label?: string;
|
|
10
|
+
hint?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface CheckboxBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
14
|
+
onChange?: (_event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
isChecked?: boolean;
|
|
17
|
+
isIndeterminate?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const Checkbox: FC<CheckboxProps> & {
|
|
21
|
+
Label: FC<LabelHTMLAttributes<HTMLLabelElement> & { children: React.ReactNode }>;
|
|
22
|
+
Box: FC<CheckboxBoxProps>;
|
|
23
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { DimensionPropType } from '../shared';
|
|
3
|
+
import { MenuPlacement } from '../foundational/menu';
|
|
4
|
+
|
|
5
|
+
export interface DropdownOption {
|
|
6
|
+
type?: 'divider' | 'node';
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
content?: React.ReactNode;
|
|
9
|
+
variant?: 'neutral' | 'danger';
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
node?: (_props: { requestClose: () => void }) => React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface DropdownProps extends HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
options: DropdownOption[];
|
|
16
|
+
menuPlacement?: MenuPlacement;
|
|
17
|
+
menuWidth?: DimensionPropType;
|
|
18
|
+
menuZIndex?: number;
|
|
19
|
+
trigger?: React.ReactNode;
|
|
20
|
+
hasPortal?: boolean;
|
|
21
|
+
onOpenChange?: (_isOpen: boolean) => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const Dropdown: FC<DropdownProps> & {
|
|
25
|
+
Trigger: FC<HTMLAttributes<HTMLDivElement> & { children: React.ReactNode }>;
|
|
26
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { BoxProps } from './box';
|
|
3
|
+
import {
|
|
4
|
+
DirectionType,
|
|
5
|
+
FlexWrapType,
|
|
6
|
+
ContentPositionType,
|
|
7
|
+
AlignmentType,
|
|
8
|
+
DimensionPropType,
|
|
9
|
+
} from '../shared';
|
|
10
|
+
|
|
11
|
+
export interface FlexProps extends BoxProps {
|
|
12
|
+
direction?: DirectionType;
|
|
13
|
+
wrap?: FlexWrapType;
|
|
14
|
+
justifyContent?: ContentPositionType;
|
|
15
|
+
alignItems?: AlignmentType;
|
|
16
|
+
alignContent?: ContentPositionType;
|
|
17
|
+
gap?: DimensionPropType;
|
|
18
|
+
columnGap?: DimensionPropType;
|
|
19
|
+
rowGap?: DimensionPropType;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const Flex: FC<FlexProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FC, ButtonHTMLAttributes, AnchorHTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface IconButtonProps
|
|
4
|
+
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color'>,
|
|
5
|
+
Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'color'> {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
color?: string;
|
|
10
|
+
variant?: 'neutral' | 'danger';
|
|
11
|
+
type?: 'button' | 'submit' | 'reset';
|
|
12
|
+
isActive?: boolean;
|
|
13
|
+
tag?: 'button' | 'a' | 'span';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const IconButton: FC<IconButtonProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface IconToggleGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface IconToggleProps extends HTMLAttributes<HTMLButtonElement> {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
isActive?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const IconToggleGroup: FC<IconToggleGroupProps>;
|
|
14
|
+
export const IconToggle: FC<IconToggleProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { ColorPropType } from '../shared';
|
|
3
|
+
|
|
4
|
+
export interface IconProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
hasEvenBoundary?: boolean;
|
|
7
|
+
size?: 's' | 'm' | 'l' | 'xl' | 'xxl' | number | string;
|
|
8
|
+
color?: ColorPropType;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const Icon: FC<IconProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export * from './arrange';
|
|
2
|
+
export * from './autocomplete';
|
|
3
|
+
export * from './autocomplete2';
|
|
4
|
+
export * from './badge';
|
|
5
|
+
export * from './box';
|
|
6
|
+
export * from './button';
|
|
7
|
+
export * from './checkbox';
|
|
8
|
+
export * from './dropdown';
|
|
9
|
+
export * from './flex';
|
|
10
|
+
export * from './icon';
|
|
11
|
+
export * from './icon-button';
|
|
12
|
+
export * from './icon-toggle';
|
|
13
|
+
export * from './link';
|
|
14
|
+
export * from './modal';
|
|
15
|
+
export * from './nav';
|
|
16
|
+
export * from './pagination';
|
|
17
|
+
export * from './popover';
|
|
18
|
+
export * from './progress';
|
|
19
|
+
export * from './provider';
|
|
20
|
+
export * from './radio';
|
|
21
|
+
export * from './select';
|
|
22
|
+
export * from './slider';
|
|
23
|
+
export * from './spinner';
|
|
24
|
+
export * from './stack';
|
|
25
|
+
export * from './switch';
|
|
26
|
+
export * from './tab';
|
|
27
|
+
export * from './text-button';
|
|
28
|
+
export * from './text-input';
|
|
29
|
+
export * from './text-toggle';
|
|
30
|
+
export * from './textarea';
|
|
31
|
+
export * from './toast';
|
|
32
|
+
export * from './tooltip';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
href?: string;
|
|
6
|
+
target?: string;
|
|
7
|
+
variant?: 'neutral' | 'subtle';
|
|
8
|
+
tag?: 'a' | 'button' | 'span';
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const Link: FC<LinkProps>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { FC, ForwardRefExoticComponent, RefAttributes, HTMLAttributes } from 'react';
|
|
2
|
+
import { DimensionPropType, RadiusPropType } from '../shared';
|
|
3
|
+
|
|
4
|
+
export interface ModalProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
hasCloseButton?: boolean;
|
|
9
|
+
title?: React.ReactNode;
|
|
10
|
+
description?: React.ReactNode;
|
|
11
|
+
cardPadding?: DimensionPropType;
|
|
12
|
+
cardMaxWidth?: number | string | 'narrow' | 'medium' | 'wide';
|
|
13
|
+
cardHeight?: DimensionPropType;
|
|
14
|
+
cardMaxHeight?: DimensionPropType;
|
|
15
|
+
cardRadius?: RadiusPropType;
|
|
16
|
+
cardTop?: DimensionPropType;
|
|
17
|
+
zIndex?: number;
|
|
18
|
+
initialFocus?: React.RefObject<HTMLElement>;
|
|
19
|
+
returnFocus?: React.RefObject<HTMLElement>;
|
|
20
|
+
closeButtonProps?: Record<string, unknown>;
|
|
21
|
+
paddingX?: DimensionPropType;
|
|
22
|
+
disableCloseHandler?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const Modal: ForwardRefExoticComponent<ModalProps & RefAttributes<HTMLDivElement>> & {
|
|
26
|
+
Title: FC<{ children: React.ReactNode } & HTMLAttributes<HTMLDivElement>>;
|
|
27
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes, AnchorHTMLAttributes } from 'react';
|
|
2
|
+
import { DirectionType } from '../shared';
|
|
3
|
+
import { BoxProps } from './box';
|
|
4
|
+
|
|
5
|
+
export interface NavProps extends BoxProps, HTMLAttributes<HTMLElement> {
|
|
6
|
+
direction?: DirectionType;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface NavItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
10
|
+
isActive?: boolean;
|
|
11
|
+
href?: string;
|
|
12
|
+
icon?: React.ReactNode;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const Nav: FC<NavProps>;
|
|
17
|
+
export const NavItem: FC<NavItemProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { DimensionPropType } from '../shared';
|
|
3
|
+
import { MenuPlacement } from '../foundational/menu';
|
|
4
|
+
|
|
5
|
+
export interface PopoverProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
padding?: DimensionPropType;
|
|
7
|
+
width?: DimensionPropType;
|
|
8
|
+
placement?: MenuPlacement;
|
|
9
|
+
trigger?: React.ReactNode;
|
|
10
|
+
zIndex?: number;
|
|
11
|
+
isOpen?: boolean;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
hasPortal?: boolean;
|
|
14
|
+
strategy?: 'absolute' | 'fixed';
|
|
15
|
+
offset?: DimensionPropType;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const Popover: FC<PopoverProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
breakpoints?: {
|
|
6
|
+
tablet?: number;
|
|
7
|
+
mobile?: number;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const GrainProvider: FC<ProviderProps>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { FC, InputHTMLAttributes, LabelHTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
4
|
+
id: string;
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
isChecked?: boolean;
|
|
7
|
+
name?: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
hint?: React.ReactNode;
|
|
10
|
+
onChange?: (_e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface RadioBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
14
|
+
onChange?: (_e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
isChecked?: boolean;
|
|
17
|
+
name?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const Radio: FC<RadioProps> & {
|
|
21
|
+
Label: FC<LabelHTMLAttributes<HTMLLabelElement> & { children: React.ReactNode }>;
|
|
22
|
+
Box: FC<RadioBoxProps>;
|
|
23
|
+
};
|