@wonderflow/react-components 3.0.0-beta.3 → 3.0.0-beta.30
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-option.d.ts +39 -0
- package/autocomplete/autocomplete-option.js +11 -0
- package/autocomplete/autocomplete.d.ts +24 -0
- package/autocomplete/autocomplete.js +82 -0
- package/autocomplete/autocomplete.module.css +1 -0
- package/autocomplete/index.d.ts +2 -0
- package/autocomplete/index.js +1 -0
- package/button/button.module.css +1 -1
- package/card/card.module.css +1 -1
- package/core/typography.css +1 -1
- package/core/utils/media.css +19 -1
- package/core/utils/vibrancy.css +0 -24
- package/core.css +1 -1
- package/datetime/datetime.d.ts +7 -0
- package/datetime/datetime.js +16 -0
- package/datetime/index.d.ts +2 -0
- package/datetime/index.js +1 -0
- package/drawer/drawer.d.ts +85 -0
- package/drawer/drawer.js +34 -0
- package/drawer/drawer.module.css +1 -0
- package/drawer/index.d.ts +2 -0
- package/drawer/index.js +1 -0
- package/dropdown/dropdown.d.ts +25 -11
- package/dropdown/dropdown.js +36 -24
- package/dropdown/dropdown.module.css +1 -1
- package/dropdown/index.d.ts +0 -2
- package/icon/icon.d.ts +1 -1
- package/index.d.ts +11 -3
- package/index.js +6 -2
- package/input-group/input-group.js +3 -3
- package/list/list.js +2 -2
- package/list/list.module.css +1 -1
- package/menu/index.d.ts +6 -0
- package/menu/index.js +3 -0
- package/menu/menu-item/menu-item-checkbox.d.ts +11 -0
- package/menu/menu-item/menu-item-checkbox.js +5 -0
- package/{dropdown/item/dropdown-item.d.ts → menu/menu-item/menu-item.d.ts} +23 -10
- package/menu/menu-item/menu-item.js +23 -0
- package/menu/menu-item/menu-item.module.css +1 -0
- package/menu/menu.d.ts +16 -0
- package/menu/menu.js +15 -0
- package/menu/menu.module.css +1 -0
- package/modal/content/modal-content.js +4 -3
- package/modal/content/modal-content.module.css +1 -1
- package/modal/index.d.ts +0 -1
- package/modal/index.js +0 -1
- package/modal/modal.d.ts +0 -10
- package/modal/modal.js +24 -7
- package/modal/modal.module.css +1 -1
- package/overlay-container/index.d.ts +1 -0
- package/overlay-container/index.js +1 -0
- package/overlay-container/overlay-container.d.ts +14 -0
- package/overlay-container/overlay-container.js +8 -4
- package/overlay-container/overlay-container.module.css +1 -0
- package/overlay-container/overlay-context.d.ts +9 -0
- package/overlay-container/overlay-context.js +23 -0
- package/package.json +65 -22
- package/select/select.js +2 -2
- package/select/select.module.css +1 -1
- package/selection-controls/selection-controls.module.css +1 -1
- package/snackbar/snackbar.d.ts +1 -1
- package/snackbar/snackbar.js +2 -2
- package/snackbar/snackbar.module.css +1 -1
- package/split-button/split-button.module.css +1 -1
- package/stack/stack.d.ts +3 -2
- package/stack/stack.module.css +1 -1
- package/star-meter/star-meter.d.ts +4 -0
- package/star-meter/star-meter.js +4 -4
- package/table/index.d.ts +1 -0
- package/text/text.d.ts +5 -0
- package/text/text.js +2 -2
- package/text/text.module.css +1 -1
- package/textfield/base-field/base-field.d.ts +1 -1
- package/textfield/base-field/base-field.module.css +1 -1
- package/textfield/textfield.d.ts +2 -2
- package/textfield/textfield.js +9 -8
- package/themes/dark.css +1 -1
- package/themes/light.css +1 -1
- package/title/title.js +1 -1
- package/title/title.module.css +1 -1
- package/tooltip/tooltip.d.ts +1 -1
- package/tooltip/tooltip.js +19 -19
- package/tooltip/tooltip.module.css +1 -1
- package/dropdown/item/dropdown-item.js +0 -23
- package/dropdown/item/dropdown-item.module.css +0 -1
- package/dropdown/item-checkbox/dropdown-item-checkbox.d.ts +0 -11
- package/dropdown/item-checkbox/dropdown-item-checkbox.js +0 -5
- package/dropdown/menu/dropdown-menu.d.ts +0 -13
- package/dropdown/menu/dropdown-menu.js +0 -13
- package/dropdown/menu/dropdown-menu.module.css +0 -1
- package/modal/modal-context.d.ts +0 -9
- package/modal/modal-context.js +0 -23
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wonderflow/react-components",
|
|
3
3
|
"description": "UI components from Wonderflow's Wanda design system",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.30",
|
|
5
5
|
"author": "Wonderflow",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"bugs": {
|
|
26
26
|
"url": "https://github.com/wonderflow-bv/react-components/issues"
|
|
27
27
|
},
|
|
28
|
-
"homepage": "https://
|
|
28
|
+
"homepage": "https://design.wonderflow.ai/",
|
|
29
29
|
"browserslist": [
|
|
30
30
|
"last 2 Chrome versions",
|
|
31
31
|
"last 2 Firefox versions",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"scripts": {
|
|
36
36
|
"start": "run-s build:themes build:icons storybook",
|
|
37
37
|
"storybook": "start-storybook --quiet -p 6006",
|
|
38
|
+
"commit": "cz",
|
|
38
39
|
"lint": "run-s lint:scripts && run-s lint:styles",
|
|
39
40
|
"lint:scripts": "eslint \"src/**/*.{tsx,ts}\"",
|
|
40
41
|
"lint:styles": "stylelint src/**/*.css",
|
|
@@ -63,17 +64,16 @@
|
|
|
63
64
|
"postbuild": "run-s prepare:package"
|
|
64
65
|
},
|
|
65
66
|
"dependencies": {
|
|
66
|
-
"@react-aria/interactions": "3.7.0",
|
|
67
67
|
"@wonderflow/tokens": "1.3.7",
|
|
68
|
-
"ahooks": "3.
|
|
68
|
+
"ahooks": "3.1.3",
|
|
69
69
|
"clsx": "1.1.1",
|
|
70
|
-
"framer-motion": "
|
|
70
|
+
"framer-motion": "5.5.5",
|
|
71
71
|
"postcss": "^8.4.5",
|
|
72
72
|
"react": "^17.0",
|
|
73
|
-
"react-data-table-component": "7.4.
|
|
73
|
+
"react-data-table-component": "7.4.6",
|
|
74
74
|
"react-dom": "^17.0",
|
|
75
75
|
"react-focus-on": "3.5.4",
|
|
76
|
-
"react-loading-skeleton": "3.0.
|
|
76
|
+
"react-loading-skeleton": "3.0.2",
|
|
77
77
|
"react-masonry-css": "1.0.16",
|
|
78
78
|
"react-paginate": "8.1.0",
|
|
79
79
|
"react-popper-tooltip": "4.3.1",
|
|
@@ -88,24 +88,26 @@
|
|
|
88
88
|
"react-dom": "^17.0"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
|
-
"@babel/core": "7.16.
|
|
92
|
-
"@commitlint/cli": "
|
|
93
|
-
"@commitlint/config-conventional": "
|
|
91
|
+
"@babel/core": "7.16.7",
|
|
92
|
+
"@commitlint/cli": "16.0.1",
|
|
93
|
+
"@commitlint/config-conventional": "16.0.0",
|
|
94
94
|
"@semantic-release/exec": "6.0.3",
|
|
95
95
|
"@semantic-release/git": "10.0.1",
|
|
96
96
|
"@semantic-release/github": "8.0.2",
|
|
97
97
|
"@semantic-release/npm": "8.0.3",
|
|
98
98
|
"@semantic-release/release-notes-generator": "10.0.3",
|
|
99
|
-
"@storybook/addon-actions": "6.4
|
|
100
|
-
"@storybook/addon-essentials": "6.4
|
|
101
|
-
"@storybook/addon-links": "6.4
|
|
99
|
+
"@storybook/addon-actions": "6.5.0-alpha.4",
|
|
100
|
+
"@storybook/addon-essentials": "6.5.0-alpha.4",
|
|
101
|
+
"@storybook/addon-links": "6.5.0-alpha.4",
|
|
102
102
|
"@storybook/addon-postcss": "2.0.0",
|
|
103
|
-
"@storybook/addons": "6.4
|
|
104
|
-
"@storybook/
|
|
105
|
-
"@storybook/
|
|
103
|
+
"@storybook/addons": "6.5.0-alpha.4",
|
|
104
|
+
"@storybook/builder-webpack5": "6.5.0-alpha.4",
|
|
105
|
+
"@storybook/manager-webpack5": "6.5.0-alpha.4",
|
|
106
|
+
"@storybook/react": "6.5.0-alpha.4",
|
|
107
|
+
"@storybook/theming": "6.5.0-alpha.4",
|
|
106
108
|
"@types/react-dom": "17.0.11",
|
|
107
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
108
|
-
"@typescript-eslint/parser": "5.
|
|
109
|
+
"@typescript-eslint/eslint-plugin": "5.8.1",
|
|
110
|
+
"@typescript-eslint/parser": "5.8.1",
|
|
109
111
|
"@wonderflow/config": "3.0.3",
|
|
110
112
|
"@wonderflow/eslint-config": "1.1.8",
|
|
111
113
|
"@wonderflow/stylelint-config": "1.1.3",
|
|
@@ -116,7 +118,8 @@
|
|
|
116
118
|
"cz-conventional-changelog": "3.3.0",
|
|
117
119
|
"directory-tree": "3.0.1",
|
|
118
120
|
"eslint": "7.32.0",
|
|
119
|
-
"eslint-plugin-react": "7.
|
|
121
|
+
"eslint-plugin-react": "7.28.0",
|
|
122
|
+
"eslint-plugin-storybook": "0.5.5",
|
|
120
123
|
"fs-extra": "10.0.0",
|
|
121
124
|
"husky": "7.0.4",
|
|
122
125
|
"is-ci": "3.0.1",
|
|
@@ -129,15 +132,55 @@
|
|
|
129
132
|
"semantic-release": "18.0.1",
|
|
130
133
|
"storybook-addon-themes": "6.1.0",
|
|
131
134
|
"storybook-css-modules-preset": "1.1.1",
|
|
132
|
-
"style-dictionary": "3.
|
|
133
|
-
"
|
|
135
|
+
"style-dictionary": "3.1.1",
|
|
136
|
+
"styled-components": "5.3.3",
|
|
137
|
+
"stylelint": "14.2.0",
|
|
134
138
|
"svgo": "2.8.0",
|
|
135
139
|
"svgstore": "3.0.1",
|
|
136
140
|
"typescript": "4.5.4",
|
|
137
141
|
"typescript-plugin-css-modules": "3.4.0",
|
|
138
|
-
"
|
|
142
|
+
"webpack": "5.65.0",
|
|
143
|
+
"yargs": "17.3.1"
|
|
139
144
|
},
|
|
140
145
|
"resolutions": {
|
|
141
146
|
"rc": "1.2.8"
|
|
147
|
+
},
|
|
148
|
+
"config": {
|
|
149
|
+
"commitizen": {
|
|
150
|
+
"path": "cz-conventional-changelog"
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"release": {
|
|
154
|
+
"branches": [
|
|
155
|
+
"main",
|
|
156
|
+
{
|
|
157
|
+
"name": "beta",
|
|
158
|
+
"channel": "beta",
|
|
159
|
+
"prerelease": true
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
"plugins": [
|
|
163
|
+
"commit-analyzer-fail-on-no-release",
|
|
164
|
+
"@semantic-release/release-notes-generator",
|
|
165
|
+
[
|
|
166
|
+
"@semantic-release/github",
|
|
167
|
+
{
|
|
168
|
+
"addReleases": true
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
[
|
|
172
|
+
"@semantic-release/npm",
|
|
173
|
+
{
|
|
174
|
+
"pkgRoot": "dist"
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
[
|
|
178
|
+
"@semantic-release/exec",
|
|
179
|
+
{
|
|
180
|
+
"prepareCmd": "npx replace-json-property package.json version ${nextRelease.version}"
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
"@semantic-release/git"
|
|
184
|
+
]
|
|
142
185
|
}
|
|
143
186
|
}
|
package/select/select.js
CHANGED
|
@@ -5,12 +5,12 @@ import { Select as SelectClass, FieldContainer, Icon as IconClass, Field } from
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { useUIDSeed } from 'react-uid';
|
|
7
7
|
export const Select = forwardRef(({ children, className, disabled = false, icon = 'sort-alt', label, kind = 'single', dimension = 'regular', onChange, ...otherProps }, forwardedRef) => {
|
|
8
|
-
const
|
|
8
|
+
const seedID = useUIDSeed();
|
|
9
9
|
const iconSizes = {
|
|
10
10
|
small: 14,
|
|
11
11
|
regular: 16,
|
|
12
12
|
big: 24
|
|
13
13
|
};
|
|
14
|
-
return (_jsxs(Stack, { as: "fieldset", rowGap: 4, className: clsx(SelectClass, className), "data-select-is-multiple": kind === 'multiple', "data-select-has-label": Boolean(label), "data-select-dimension": dimension, "aria-disabled": disabled, horizontalAlign: "start", verticalAlign: "start", inline: true, tabIndex: disabled ? 0 : undefined, children: [label && _jsx(Text, { as: "label", size: dimension === 'small' ? 14 : 16, htmlFor:
|
|
14
|
+
return (_jsxs(Stack, { as: "fieldset", rowGap: 4, className: clsx(SelectClass, className), "data-select-is-multiple": kind === 'multiple', "data-select-has-label": Boolean(label), "data-select-dimension": dimension, "aria-disabled": disabled, horizontalAlign: "start", verticalAlign: "start", inline: true, tabIndex: disabled ? 0 : undefined, children: [label && _jsx(Text, { as: "label", size: dimension === 'small' ? 14 : 16, htmlFor: seedID('select'), children: label }, void 0), _jsxs("div", { className: FieldContainer, children: [_jsx("select", { disabled: disabled, className: Field, id: seedID('select'), multiple: kind === 'multiple', onChange: onChange, ref: forwardedRef, ...otherProps, children: children }, void 0), kind === 'single' && (_jsx(Icon, { className: IconClass, name: icon, dimension: iconSizes[dimension] }, void 0))] }, void 0)] }, void 0));
|
|
15
15
|
});
|
|
16
16
|
Select.displayName = 'Select';
|
package/select/select.module.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.Select{-webkit-appearance:none;appearance:none;padding:0;position:relative}.Select[data-select-dimension=small]{--field-height:1.33rem;--field-padding:0.33rem;--font-size:0.78rem}.Select[data-select-dimension=regular]{--field-height:2.22rem;--field-padding:0.89rem;--font-size:0.89rem}.Select[data-select-dimension=big]{--field-height:2.67rem;--field-padding:0.89rem;--font-size:1.00rem}.FieldContainer{color:var(--global-vibrancy-foreground);inline-size:100%;position:relative}.Select[aria-disabled=true] .FieldContainer{color:var(--global-disabled-foreground)}.Field{-webkit-appearance:none;appearance:none;background:linear-gradient(to bottom,var(--global-vibrancy-background),var(--global-vibrancy-background));block-size:var(--field-height);border:0;border-radius:.22rem;box-sizing:border-box;color:inherit;display:block;font-family:inherit;font-size:var(--font-size);inline-size:100%;
|
|
1
|
+
.Select{-webkit-appearance:none;appearance:none;padding:0;position:relative}.Select[data-select-dimension=small]{--field-height:1.33rem;--field-padding:0.33rem;--font-size:0.78rem}.Select[data-select-dimension=regular]{--field-height:2.22rem;--field-padding:0.89rem;--font-size:0.89rem}.Select[data-select-dimension=big]{--field-height:2.67rem;--field-padding:0.89rem;--font-size:1.00rem}.FieldContainer{color:var(--global-vibrancy-foreground);inline-size:100%;position:relative}.Select[aria-disabled=true] .FieldContainer{color:var(--global-disabled-foreground)}.Field{-webkit-appearance:none;appearance:none;-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background:linear-gradient(to bottom,var(--global-vibrancy-background),var(--global-vibrancy-background));block-size:var(--field-height);border:0;border-radius:.22rem;box-sizing:border-box;color:inherit;display:block;font-family:inherit;font-size:var(--font-size);inline-size:100%;margin:0;overflow:hidden;padding:0 calc(var(--field-padding)*3.5) 0 var(--field-padding);text-overflow:ellipsis}.Field:disabled{background:linear-gradient(to bottom,var(--global-disabled-background),var(--global-disabled-background));color:var(--global-disabled-foreground);cursor:not-allowed}.Field option{color:#000}.Field optgroup{color:initial}.Field[multiple]{block-size:auto;overflow:auto;padding:.44rem .89rem}.Field[multiple] option{color:currentColor;padding:calc(var(--field-padding)/2) var(--field-padding)}.Field[multiple] option:checked{background:var(--dimmed-4) linear-gradient(to bottom,var(--dimmed-4) 0,var(--dimmed-4) 100%);background-color:var(--dimmed-4);color:var(--dimmed-0)}.Field[multiple] optgroup{color:currentColor;font-family:inherit;font-size:inherit;line-height:inherit;margin:0 0 1rem}.Icon{border-radius:.22rem;pointer-events:none;position:absolute;right:calc(var(--field-padding) - var(--field-padding)/3);top:calc(var(--field-padding) - var(--field-padding)/4)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.Checkbox{--w:24px;--h:24px;-webkit-appearance:none;appearance:none;-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background:
|
|
1
|
+
.Checkbox{--w:24px;--h:24px;-webkit-appearance:none;appearance:none;-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background-color:var(--global-vibrancy-background);block-size:var(--h);border-radius:.22rem;color:var(--global-background);inline-size:var(--w);max-block-size:var(--h);max-inline-size:var(--w);position:relative}.Checkbox:after{block-size:27%;border-bottom:2px solid;border-left:2px solid;content:"";display:none;inline-size:50%;left:50%;position:absolute;top:50%;transform:translate(-50%,-80%) rotate(-45deg)}.Checkbox:active{background-color:var(--global-vibrancy-background-hover)}.Checkbox:checked,.Checkbox[data-control-indeterminate=true]{background:var(--dimmed-7)}.Checkbox:checked:after,.Checkbox[data-control-indeterminate=true]:after{display:block}.Checkbox:disabled{background-color:var(--global-disabled-background);color:var(--global-disabled-foreground);cursor:not-allowed}.Checkbox[data-control-dimension=small]{--w:16px;--h:16px}.Checkbox[data-control-indeterminate=true]:after{block-size:2px;border-left:0;transform:translate(-50%,-50%)}.Radio{composes:Checkbox;border-radius:100%}.Radio:after{background-color:currentColor;block-size:50%;border:0;border-radius:100%;inline-size:50%;transform:translate(-50%,-50%)}.Toggle{--w:44px;--h:24px;--p:2px;composes:Radio;border-radius:200px;color:var(--dimmed-7)}.Toggle:checked{color:var(--global-background)}.Toggle:disabled{color:var(--global-disabled-foreground)}.Toggle:after{block-size:calc(var(--h) - var(--p)*2);bottom:var(--p);display:block;inline-size:calc(var(--h) - var(--p)*2);left:var(--p);top:var(--p);transform:none;transition:transform .1s cubic-bezier(.3,.07,.34,1),background-color .1s cubic-bezier(.3,.07,.34,1)}.Toggle:checked:after{display:block;transform:translateX(100%)}.Toggle[data-control-dimension=small]{--w:28px;--h:16px}
|
package/snackbar/snackbar.d.ts
CHANGED
|
@@ -36,6 +36,6 @@ export declare type SnackbarProps = {
|
|
|
36
36
|
*/
|
|
37
37
|
onDismiss?(): void;
|
|
38
38
|
};
|
|
39
|
-
declare type PolymorphicSnackbar = Polymorphic.ForwardRefComponent<'
|
|
39
|
+
declare type PolymorphicSnackbar = Polymorphic.ForwardRefComponent<'output', SnackbarProps>;
|
|
40
40
|
export declare const Snackbar: PolymorphicSnackbar;
|
|
41
41
|
export {};
|
package/snackbar/snackbar.js
CHANGED
|
@@ -3,7 +3,7 @@ import { forwardRef } from 'react';
|
|
|
3
3
|
import { Snackbar as SnackbarClass, Icon as IconClass, Action } from './snackbar.module.css';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { Title, Stack, Icon, Button } from '../';
|
|
6
|
-
export const Snackbar = forwardRef(({ children, className, title, icon, kind = 'neutral', as: Wrapper = '
|
|
6
|
+
export const Snackbar = forwardRef(({ children, className, title, icon, kind = 'neutral', as: Wrapper = 'output', dismissable, dismissLabel = 'Dismiss', onDismiss, ...otherProps }, forwardedRef) => {
|
|
7
7
|
const defaultIcons = {
|
|
8
8
|
info: 'circle-info',
|
|
9
9
|
warning: 'triangle-exclamation',
|
|
@@ -11,5 +11,5 @@ export const Snackbar = forwardRef(({ children, className, title, icon, kind = '
|
|
|
11
11
|
positive: 'check',
|
|
12
12
|
danger: 'circle-x'
|
|
13
13
|
};
|
|
14
|
-
return (_jsx(Wrapper, { ref: forwardedRef, className: clsx(SnackbarClass, className), "data-snackbar-kind": kind, role: "
|
|
14
|
+
return (_jsx(Wrapper, { ref: forwardedRef, className: clsx(SnackbarClass, className), "data-snackbar-kind": kind, role: "status", ...otherProps, children: _jsxs(Stack, { verticalAlign: "start", horizontalAlign: "start", direction: "row", columnGap: 16, fill: false, children: [_jsx(Icon, { className: IconClass, name: icon || defaultIcons[kind], dimension: 24 }, void 0), _jsxs(Stack, { rowGap: 16, children: [_jsxs(Stack, { rowGap: 8, children: [title && _jsx(Title, { level: "5", children: title }, void 0), _jsx("p", { children: children }, void 0)] }, void 0), dismissable && (_jsx(Stack, { horizontalAlign: "end", children: _jsx(Button, { onClick: onDismiss, className: Action, children: dismissLabel }, void 0) }, void 0))] }, void 0)] }, void 0) }, void 0));
|
|
15
15
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.Snackbar{background:linear-gradient(to right,var(--snackbar-fg) 4px,var(--snackbar-bg) 4px);border-radius:.22rem;color:var(--snackbar-fg);overflow:hidden;padding:.89rem 1.33rem}.Snackbar p{font-size:.89rem}.Snackbar[data-snackbar-kind=neutral]{--snackbar-bg:var(--highlight-gray-background);--snackbar-fg:var(--highlight-gray-foreground)}.Snackbar[data-snackbar-kind=positive]{--snackbar-bg:var(--highlight-green-background);--snackbar-fg:var(--highlight-green-foreground)}.Snackbar[data-snackbar-kind=warning]{--snackbar-bg:var(--highlight-yellow-background);--snackbar-fg:var(--highlight-yellow-foreground)}.Snackbar[data-snackbar-kind=info]{--snackbar-bg:var(--highlight-blue-background);--snackbar-fg:var(--highlight-blue-foreground)}.Snackbar[data-snackbar-kind=danger]{--snackbar-bg:var(--highlight-red-background);--snackbar-fg:var(--highlight-red-foreground)}.Icon{flex-shrink:0}.Action:is(.Action.Action){background-color:var(--snackbar-fg);color:var(--snackbar-bg)}
|
|
1
|
+
.Snackbar{background:linear-gradient(to right,var(--snackbar-fg) 4px,var(--snackbar-bg) 4px);border-radius:.22rem;color:var(--snackbar-fg);display:block;overflow:hidden;padding:.89rem 1.33rem}.Snackbar p{font-size:.89rem}.Snackbar[data-snackbar-kind=neutral]{--snackbar-bg:var(--highlight-gray-background);--snackbar-fg:var(--highlight-gray-foreground)}.Snackbar[data-snackbar-kind=positive]{--snackbar-bg:var(--highlight-green-background);--snackbar-fg:var(--highlight-green-foreground)}.Snackbar[data-snackbar-kind=warning]{--snackbar-bg:var(--highlight-yellow-background);--snackbar-fg:var(--highlight-yellow-foreground)}.Snackbar[data-snackbar-kind=info]{--snackbar-bg:var(--highlight-blue-background);--snackbar-fg:var(--highlight-blue-foreground)}.Snackbar[data-snackbar-kind=danger]{--snackbar-bg:var(--highlight-red-background);--snackbar-fg:var(--highlight-red-foreground)}.Icon{flex-shrink:0}.Action:is(.Action.Action){background-color:var(--snackbar-fg);color:var(--snackbar-bg)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.SplitButton>:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.SplitButton
|
|
1
|
+
.SplitButton>:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.SplitButton>[data-button-dimension=big]:first-child{padding-left:.89rem;padding-right:.89rem}.SplitButton>*>button{--separator-color:#6666;border-bottom-left-radius:0;border-top-left-radius:0;box-shadow:inset 1px 0 0 0 var(--separator-color)}.SplitButton>*>button[data-button-kind=primary]{--separator-color:#ffffff4d}.SplitButton>*>button:is([data-button-dimension=big],[data-button-dimension=regular]){padding-left:.44rem;padding-right:.44rem}
|
package/stack/stack.d.ts
CHANGED
|
@@ -41,9 +41,10 @@ export declare type StackProps = {
|
|
|
41
41
|
*/
|
|
42
42
|
verticalPadding?: TokensTypes['space'];
|
|
43
43
|
/**
|
|
44
|
-
* Renderes children as rows or columns
|
|
44
|
+
* Renderes children as rows or columns. The value can be one of the flex directions.
|
|
45
|
+
* More info: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction
|
|
45
46
|
*/
|
|
46
|
-
direction?: 'row' | 'column';
|
|
47
|
+
direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
47
48
|
};
|
|
48
49
|
declare type PolymorphicStack = Polymorphic.ForwardRefComponent<'div', StackProps>;
|
|
49
50
|
export declare const Stack: PolymorphicStack;
|
package/stack/stack.module.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:where(.Stack){grid-gap:var(--rGap,0) var(--cGap,0);align-items:var(--hAlign);display:flex;flex-direction:column;justify-content:var(--vAlign);padding:var(--vPadding,0) var(--hPadding,0)}:where(.Stack)[data-stack-fill=true]>*{flex-grow:1}:where(.Stack)[data-stack-direction
|
|
1
|
+
:where(.Stack){grid-gap:var(--rGap,0) var(--cGap,0);align-items:var(--hAlign);display:flex;flex-direction:column;justify-content:var(--vAlign);padding:var(--vPadding,0) var(--hPadding,0)}:where(.Stack):where([data-stack-fill=true])>*{flex-grow:1}[data-stack-direction=column-reverse]:where(.Stack){flex-direction:column-reverse}[data-stack-direction^=row]:where(.Stack){align-items:var(--vAlign);justify-content:var(--hAlign)}[data-stack-direction=row]:where(.Stack){flex-direction:row}[data-stack-direction=row-reverse]:where(.Stack){flex-direction:row-reverse}[data-stack-inline=true]:where(.Stack){display:inline-flex;flex-grow:0}[data-stack-wrap=true]:where(.Stack){flex-wrap:wrap}
|
|
@@ -26,6 +26,10 @@ export declare type StarMeterProps = {
|
|
|
26
26
|
* Set the size of the star meter.
|
|
27
27
|
*/
|
|
28
28
|
dimension?: 'small' | 'regular' | 'big';
|
|
29
|
+
/**
|
|
30
|
+
* Hide the label indicator.
|
|
31
|
+
*/
|
|
32
|
+
hideLabel?: boolean;
|
|
29
33
|
};
|
|
30
34
|
declare type PolymorphicStarMeter = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof Stack>, Polymorphic.OwnProps<typeof Stack> & StarMeterProps>;
|
|
31
35
|
export declare const StarMeter: PolymorphicStarMeter;
|
package/star-meter/star-meter.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { useUIDSeed } from 'react-uid';
|
|
5
5
|
import { Text, Stack, Icon } from '../';
|
|
6
6
|
import { StarMeter as StarMeterClass, Gradient, Icon as IconClass } from './star-meter.module.css';
|
|
7
|
-
export const StarMeter = forwardRef(({ className, value = 0, starCount = 5, label, dimension = 'regular', ...otherProps }, forwardedRef) => {
|
|
8
|
-
const
|
|
7
|
+
export const StarMeter = forwardRef(({ className, value = 0, starCount = 5, label, dimension = 'regular', hideLabel = false, ...otherProps }, forwardedRef) => {
|
|
8
|
+
const seedID = useUIDSeed();
|
|
9
9
|
const labelSize = {
|
|
10
10
|
small: 14,
|
|
11
11
|
regular: 16,
|
|
@@ -40,5 +40,5 @@ export const StarMeter = forwardRef(({ className, value = 0, starCount = 5, labe
|
|
|
40
40
|
return _jsx(Icon, { name: "star", className: IconClass, dimension: 16, fill: fillType }, starIndex);
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
|
-
return (_jsxs(Stack, { inline: true, direction: "row", verticalAlign: "center", columnGap: 8, className: clsx(StarMeterClass, className), role: "meter", "aria-valuenow": clamp(value, 0, starCount), "aria-valuemin": 0, "aria-valuemax": starCount, "aria-labelledby":
|
|
43
|
+
return (_jsxs(Stack, { inline: true, direction: "row", verticalAlign: "center", columnGap: 8, className: clsx(StarMeterClass, className), role: "meter", "aria-valuenow": clamp(value, 0, starCount), "aria-valuemin": 0, "aria-valuemax": starCount, "aria-labelledby": seedID('star-meter'), "data-star-meter-dimension": dimension, ref: forwardedRef, ...otherProps, children: [_jsx("svg", { "aria-hidden": "true", className: Gradient, width: "100", height: "50", version: "1.1", xmlns: "http://www.w3.org/2000/svg", children: _jsx("defs", { children: _jsxs("linearGradient", { id: "HalfStar", children: [_jsx("stop", { offset: "0", style: { stopColor: 'var(--star-color)' } }, void 0), _jsx("stop", { offset: "50%", style: { stopColor: 'var(--star-color)' } }, void 0), _jsx("stop", { offset: "50.1%", style: { stopColor: 'var(--star-dimmed-color)' } }, void 0), _jsx("stop", { offset: "100%", style: { stopColor: 'var(--star-dimmed-color)' } }, void 0)] }, void 0) }, void 0) }, void 0), _jsx(Stack, { direction: "row", columnGap: 2, children: starType(starCount, value) }, void 0), _jsx(Text, { dimmed: 6, id: seedID('star-meter'), size: labelSize[dimension], weight: "bold", children: !hideLabel && _jsx(_Fragment, { children: label || value.toString() }, void 0) }, void 0)] }, void 0));
|
|
44
44
|
});
|
package/table/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { Table } from './table';
|
|
2
2
|
export type { TableProps } from './table';
|
|
3
|
+
export type { TableColumn, TableRow, TableStyles, Theme, Themes, ConditionalStyles, ExpanderComponentProps, PaginationComponentProps, PaginationOptions, PaginationServerOptions, ContextMessage, SortOrder } from 'react-data-table-component';
|
package/text/text.d.ts
CHANGED
|
@@ -34,6 +34,11 @@ export declare type TextProps = {
|
|
|
34
34
|
* the text will be always the same size across all breakpoints.
|
|
35
35
|
*/
|
|
36
36
|
responsive?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Set the text line-height of the text. This uses
|
|
39
|
+
* the predefined tokens from the typography system.
|
|
40
|
+
*/
|
|
41
|
+
lineHeight?: 'none' | 'small' | 'large';
|
|
37
42
|
};
|
|
38
43
|
declare type PolymorphicText = Polymorphic.ForwardRefComponent<'p', TextProps>;
|
|
39
44
|
export declare const Text: PolymorphicText;
|
package/text/text.js
CHANGED
|
@@ -2,10 +2,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { Text as TextClass } from './text.module.css';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
export const Text = forwardRef(({ children, className, size, sentiment, dimmed, weight, maxWidth, textAlign = 'start', as: Wrapper = 'p', responsive = true, style, ...otherProps }, forwardedRef) => {
|
|
5
|
+
export const Text = forwardRef(({ children, className, size, sentiment, dimmed, weight, maxWidth, textAlign = 'start', as: Wrapper = 'p', responsive = true, lineHeight = 'large', style, ...otherProps }, forwardedRef) => {
|
|
6
6
|
const dynamicStyle = {
|
|
7
7
|
'--maxW': maxWidth,
|
|
8
8
|
'--tAlign': textAlign
|
|
9
9
|
};
|
|
10
|
-
return (_jsx(Wrapper, { ref: forwardedRef, "data-text-size": size, "data-text-weight": weight, "data-text-sentiment": sentiment, "data-text-dimmed": dimmed, "data-text-responsive": responsive, className: clsx(TextClass, className), style: { ...dynamicStyle, ...style }, ...otherProps, children: children }, void 0));
|
|
10
|
+
return (_jsx(Wrapper, { ref: forwardedRef, "data-text-size": size, "data-text-weight": weight, "data-text-sentiment": sentiment, "data-text-dimmed": dimmed, "data-text-line-height": lineHeight, "data-text-responsive": size === 14 ? 14 : responsive, className: clsx(TextClass, className), style: { ...dynamicStyle, ...style }, ...otherProps, children: children }, void 0));
|
|
11
11
|
});
|
package/text/text.module.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.Text{font-size:var(--fs-max);
|
|
1
|
+
.Text{font-size:var(--fs-max);max-inline-size:var(--maxW,initial);min-block-size:.01vh;text-align:var(--tAlign)}.Text[data-text-dimmed="5"]{color:var(--dimmed-5)}.Text[data-text-dimmed="6"]{color:var(--dimmed-6)}.Text[data-text-dimmed="7"]{color:var(--dimmed-7)}.Text[data-text-sentiment=positive]{color:var(--highlight-green-foreground)}.Text[data-text-sentiment=informative]{color:var(--highlight-blue-foreground)}.Text[data-text-sentiment=danger]{color:var(--highlight-red-foreground)}.Text[data-text-sentiment=warning]{color:var(--highlight-yellow-foreground)}.Text[data-text-size="14"]{font-size:.78rem}.Text[data-text-size="16"]{--fs-min:0.78rem;--fs-max:0.89rem}.Text[data-text-size="18"]{--fs-min:0.89rem;--fs-max:1.00rem}.Text[data-text-size="22"]{--fs-min:1.00rem;--fs-max:1.22rem}.Text[data-text-size="28"]{--fs-min:1.22rem;--fs-max:1.56rem}.Text[data-text-weight=thin]{font-weight:100}.Text[data-text-weight=bold]{font-weight:600}.Text[data-text-responsive=true]{font-size:var(--fs-min)}@media (min-width:48em){.Text[data-text-responsive=true]{font-size:var(--fs-max)}}.Text[data-text-line-height=none]{line-height:1}.Text[data-text-line-height=small]{line-height:1.2}.Text[data-text-line-height=large]{line-height:1.5}
|
|
@@ -7,7 +7,7 @@ export declare type PrimitiveInputType = HTMLInputElement | HTMLTextAreaElement;
|
|
|
7
7
|
/**
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
|
-
export declare type BaseFieldProps = InputHTMLAttributes<
|
|
10
|
+
export declare type BaseFieldProps = InputHTMLAttributes<PrimitiveInputType> & {
|
|
11
11
|
invalid?: boolean;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.BaseField{-webkit-appearance:none;appearance:none;background-color:var(--global-background);block-size:var(--field-height);border:1px solid var(--dimmed-2);border-radius:.22rem;box-sizing:border-box;caret-color:var(--cta-default);color:inherit;display:flex;font-family:inherit;font-size:var(--font-size);inline-size:100%;line-height:1;margin:0;outline-offset:2px;overflow:hidden;padding:0 var(--field-padding);text-overflow:ellipsis}[data-textfield-has-icon=true] .BaseField::-webkit-calendar-picker-indicator{opacity:0;position:absolute;right:calc(var(--field-padding)/2)}.BaseField:-moz-ui-invalid{box-shadow:none}.BaseField::placeholder{color:var(--dimmed-5)}.BaseField.focus-visible{border-color:var(--dimmed-5)}.BaseField:focus-visible{border-color:var(--dimmed-5)}.BaseField:disabled{
|
|
1
|
+
.BaseField{-webkit-appearance:none;appearance:none;background-color:var(--global-background);block-size:var(--field-height);border:1px solid var(--dimmed-2);border-radius:.22rem;box-sizing:border-box;caret-color:var(--cta-default);color:inherit;display:flex;font-family:inherit;font-size:var(--font-size);inline-size:100%;line-height:1;margin:0;outline-offset:2px;overflow:hidden;padding:0 var(--field-padding);text-overflow:ellipsis}[data-textfield-has-icon=true] .BaseField::-webkit-calendar-picker-indicator{opacity:0;position:absolute;right:calc(var(--field-padding)/2)}.BaseField:-moz-ui-invalid{box-shadow:none}.BaseField::placeholder{color:var(--dimmed-5)}.BaseField.focus-visible{border-color:var(--dimmed-5)}.BaseField:focus-visible{border-color:var(--dimmed-5)}.BaseField:disabled{background:linear-gradient(to bottom,var(--global-disabled-background),var(--global-disabled-background));border-color:#0000;color:var(--global-disabled-foreground);cursor:not-allowed}.BaseField:disabled::placeholder{color:var(--dimmed-6)}.BaseField[readonly]{border-style:dashed;box-shadow:none;cursor:default}.BaseField:-webkit-autofill,.BaseField:-webkit-autofill:active,.BaseField:-webkit-autofill:focus,.BaseField:-webkit-autofill:hover{border:1px solid var(--dimmed-2);box-shadow:0 0 0 100px var(--global-background) inset}.BaseField:autofill,.BaseField:autofill:active,.BaseField:autofill:focus,.BaseField:autofill:hover{border:1px solid var(--dimmed-2);box-shadow:0 0 0 100px var(--global-background) inset}.BaseField:is(:invalid,[data-basefield-invalid=true],:out-of-range),.BaseField:is(:invalid,[data-basefield-invalid=true],:out-of-range).focus-visible{border-color:var(--highlight-red-foreground)}.BaseField:is(:invalid,[data-basefield-invalid=true],:out-of-range),.BaseField:is(:invalid,[data-basefield-invalid=true],:out-of-range):focus-visible{border-color:var(--highlight-red-foreground)}.BaseField[type=number]{-webkit-appearance:textfield;appearance:textfield}.BaseField[type=number]::-webkit-inner-spin-button,.BaseField[type=number]::-webkit-outer-spin-button{display:none}.BaseField[type=search]{-webkit-appearance:none;appearance:none}.BaseField[type=search]::-webkit-search-cancel-button,.BaseField[type=search]::-webkit-search-decoration{-webkit-appearance:none;appearance:none}textarea.BaseField{block-size:auto;line-height:1.5;min-block-size:1.78rem;padding:calc(var(--field-padding)/2) calc(var(--field-padding) + .89rem) calc(var(--field-padding)/2) var(--field-padding);resize:vertical}textarea.BaseField::-webkit-datetime-edit-text{opacity:30%}textarea.BaseField::-webkit-calendar-picker-indicator{color:var(--global-foreground)}textarea.BaseField:-moz-ui-invalid{box-shadow:none}textarea.BaseField::-webkit-calendar-picker-indicator:hover{background-color:initial}
|
package/textfield/textfield.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { BaseFieldProps, PrimitiveInputType } from './base-field';
|
|
1
2
|
import { ChangeEvent } from 'react';
|
|
2
3
|
import { IconNames } from '../icons/types';
|
|
3
|
-
import { BaseFieldProps, PrimitiveInputType } from './base-field';
|
|
4
4
|
export declare type TextfieldProps = BaseFieldProps & {
|
|
5
5
|
/**
|
|
6
6
|
* Set the icon to show on the left or right side of the input.
|
|
@@ -47,7 +47,7 @@ export declare type TextfieldProps = BaseFieldProps & {
|
|
|
47
47
|
*/
|
|
48
48
|
onChange?: (event: ChangeEvent<PrimitiveInputType>) => void;
|
|
49
49
|
};
|
|
50
|
-
export declare const Textfield: import("react").ForwardRefExoticComponent<import("react").InputHTMLAttributes<
|
|
50
|
+
export declare const Textfield: import("react").ForwardRefExoticComponent<import("react").InputHTMLAttributes<PrimitiveInputType> & {
|
|
51
51
|
invalid?: boolean | undefined;
|
|
52
52
|
} & {
|
|
53
53
|
/**
|
package/textfield/textfield.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useCallback, useState } from 'react';
|
|
3
|
-
import { Text, Stack, Icon, IconButton } from '../';
|
|
4
2
|
import { BaseField } from './base-field';
|
|
3
|
+
import { forwardRef, useCallback, useState, useMemo } from 'react';
|
|
4
|
+
import { FieldContainer, IconButton as IconButtonClass, Icon as IconClass, InputField, Textfield as TextfieldClass } from './textfield.module.css';
|
|
5
|
+
import { Icon, IconButton, Stack, Text } from '../';
|
|
5
6
|
import clsx from 'clsx';
|
|
6
7
|
import { useUIDSeed } from 'react-uid';
|
|
7
|
-
|
|
8
|
-
export const Textfield = forwardRef(({ children, className, disabled = false, icon, label, textarea, readOnly, invalid, iconPosition = 'right', dimension = 'regular', type, onChange, ...otherProps }, forwardedRef) => {
|
|
8
|
+
export const Textfield = forwardRef(({ children, className, disabled = false, icon, label, textarea, readOnly, invalid, id, iconPosition = 'right', dimension = 'regular', type, style, onChange, ...otherProps }, forwardedRef) => {
|
|
9
9
|
const [passwordVisible, setPasswordVisible] = useState(false);
|
|
10
|
-
const
|
|
10
|
+
const seedID = useUIDSeed();
|
|
11
11
|
const isPassword = type === 'password';
|
|
12
|
+
const fieldID = useMemo(() => id || seedID('field'), [id, seedID]);
|
|
12
13
|
const handlePasswordVisibility = useCallback(() => {
|
|
13
14
|
setPasswordVisible(visibility => !visibility);
|
|
14
15
|
}, []);
|
|
@@ -28,8 +29,8 @@ export const Textfield = forwardRef(({ children, className, disabled = false, ic
|
|
|
28
29
|
disabled,
|
|
29
30
|
onChange
|
|
30
31
|
};
|
|
31
|
-
return (_jsxs(Stack, { as: "fieldset", rowGap: 4, className: clsx(TextfieldClass, className), "data-textfield-has-icon": isPassword || Boolean(icon), "data-textfield-icon-position": iconPosition, "data-textfield-dimension": dimension, "data-textfield-invalid": invalid, "aria-disabled": disabled, horizontalAlign: "stretch", verticalAlign: "start", tabIndex: disabled ? 0 : undefined, children: [label && _jsx(Text, { as: "label", size: dimension === 'small' ? 14 : 16, htmlFor:
|
|
32
|
-
? (_jsx(BaseField, { ref: forwardedRef, as: "textarea", id:
|
|
33
|
-
: (_jsx(BaseField, { className: InputField, id:
|
|
32
|
+
return (_jsxs(Stack, { as: "fieldset", rowGap: 4, className: clsx(TextfieldClass, className), "data-textfield-has-icon": isPassword || Boolean(icon), "data-textfield-icon-position": iconPosition, "data-textfield-dimension": dimension, "data-textfield-invalid": invalid, "aria-disabled": disabled, horizontalAlign: "stretch", verticalAlign: "start", tabIndex: disabled ? 0 : undefined, style: style, children: [label && _jsx(Text, { as: "label", size: dimension === 'small' ? 14 : 16, htmlFor: fieldID, children: label }, void 0), _jsxs("div", { className: FieldContainer, children: [textarea
|
|
33
|
+
? (_jsx(BaseField, { ref: forwardedRef, as: "textarea", id: fieldID, ...commonProps, ...otherProps }, void 0))
|
|
34
|
+
: (_jsx(BaseField, { className: InputField, id: fieldID, ref: forwardedRef, type: passwordVisible ? 'text' : type, ...commonProps, ...otherProps }, void 0)), isPassword && (_jsx(IconButton, { className: IconButtonClass, dimension: actionSizes[dimension], onClick: handlePasswordVisibility, kind: "flat", "aria-label": "Reveal password", icon: passwordVisible ? 'eye-slash' : 'eye' }, void 0)), !textarea && icon && !isPassword && (_jsx(Icon, { className: IconClass, name: icon, dimension: iconSizes[dimension] }, void 0))] }, void 0)] }, void 0));
|
|
34
35
|
});
|
|
35
36
|
Textfield.displayName = 'Textfield';
|
package/themes/dark.css
CHANGED
package/themes/light.css
CHANGED
package/title/title.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
2
|
import * as styles from './title.module.css';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
export const Title = forwardRef(({ children, className, as: Wrapper = 'span', lineHeight = 'small', level = '1', textAlign = 'start', maxWidth, responsive = true, style, ...otherProps }, forwardedRef) => {
|
|
6
6
|
const computedLevel = level.match(/\d/g) ? `H${level}` : level.charAt(0).toUpperCase() + level.slice(1);
|
package/title/title.module.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.Title:is(.H1,.H2,.H3,.H4,.H5,.H6,.Display){--lh:
|
|
1
|
+
.Title:is(.H1,.H2,.H3,.H4,.H5,.H6,.Display){--lh:1.5;color:var(--heading-foreground);display:block;font-size:var(--fs-max);line-height:1.2;max-inline-size:var(--maxW,initial);min-block-size:.01vh;overflow-wrap:break-word;text-align:var(--tAlign)}.Title[data-title-line-height=small]:is(.H1,.H2,.H3,.H4,.H5,.H6,.Display){--lh:1.2}.Title[data-title-line-height=large]:is(.H1,.H2,.H3,.H4,.H5,.H6,.Display){line-height:1.5}.Title:is(.H6){--fs-min:0.78rem;--fs-max:1.00rem;font-weight:700}.Title:is(.H5){--fs-min:1rem;--fs-max:1.33rem;font-weight:700}.Title:is(.H5):before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title:is(.H4){--fs-min:1.33rem;--fs-max:1.77rem;font-weight:700}.Title:is(.H4):before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title:is(.H3){--fs-min:1.77rem;--fs-max:2.37rem;font-weight:800}.Title:is(.H3):before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title:is(.H2){--fs-min:2.37rem;--fs-max:3.16rem;font-weight:800}.Title:is(.H2):before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title:is(.H1){--fs-min:3.16rem;--fs-max:4.2rem;font-weight:800}.Title:is(.H1):before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title.Display{--fs-min:4.2rem;--fs-max:5.6rem;font-weight:800}.Title.Display:before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title[data-title-responsive=true]{font-size:var(--fs-min)}@media (min-width:48em){.Title[data-title-responsive=true]{font-size:var(--fs-max)}}
|
package/tooltip/tooltip.d.ts
CHANGED
package/tooltip/tooltip.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Children, cloneElement, useState } from 'react';
|
|
2
|
+
import { Children, cloneElement, useState, useRef } from 'react';
|
|
3
3
|
import { useUIDSeed } from 'react-uid';
|
|
4
|
-
import { useKeyPress } from 'ahooks';
|
|
4
|
+
import { useKeyPress, useFocusWithin } from 'ahooks';
|
|
5
5
|
import { Elevator } from '../';
|
|
6
|
-
import {
|
|
7
|
-
import { Tooltip as TooltipClass, Arrow, Trigger } from './tooltip.module.css';
|
|
6
|
+
import { Tooltip as TooltipClass, Balloon, Arrow } from './tooltip.module.css';
|
|
8
7
|
import { usePopperTooltip } from 'react-popper-tooltip';
|
|
9
|
-
export const Tooltip = ({ children, trigger, placement = 'bottom-start',
|
|
8
|
+
export const Tooltip = ({ children, trigger, placement = 'bottom-start', open, style, maxWidth = '40ch', fill = false, interactive = false, delay = 500 }) => {
|
|
10
9
|
const seedID = useUIDSeed();
|
|
11
|
-
const [
|
|
12
|
-
|
|
10
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
11
|
+
const tooltipContainerRef = useRef(null);
|
|
12
|
+
useKeyPress('esc', () => setIsOpen(false));
|
|
13
13
|
const { getArrowProps, getTooltipProps, setTooltipRef, setTriggerRef, visible } = usePopperTooltip({
|
|
14
14
|
delayShow: delay,
|
|
15
15
|
delayHide: 300,
|
|
16
|
-
trigger: ['hover'
|
|
17
|
-
visible:
|
|
16
|
+
trigger: ['hover'],
|
|
17
|
+
visible: open || isOpen,
|
|
18
18
|
closeOnTriggerHidden: true,
|
|
19
19
|
interactive: interactive,
|
|
20
|
-
onVisibleChange:
|
|
20
|
+
onVisibleChange: setIsOpen,
|
|
21
21
|
placement: placement,
|
|
22
22
|
offset: [0, 16]
|
|
23
23
|
}, {
|
|
24
24
|
strategy: 'fixed'
|
|
25
25
|
});
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
const isFocusWithin = useFocusWithin(tooltipContainerRef, {
|
|
27
|
+
onFocus: () => {
|
|
28
|
+
setIsOpen(true);
|
|
29
29
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
onFocusWithinChange: () => null
|
|
30
|
+
onBlur: (e) => {
|
|
31
|
+
(e.target?.parentElement !== tooltipContainerRef.current) && setIsOpen(false);
|
|
32
|
+
}
|
|
34
33
|
});
|
|
35
34
|
const dynamycStyle = {
|
|
36
35
|
'--maxW': maxWidth
|
|
37
36
|
};
|
|
38
|
-
return (_jsxs("div", { "data-tooltip-fill": fill, className:
|
|
37
|
+
return (_jsxs("div", { "data-tooltip-fill": fill, className: TooltipClass, ref: tooltipContainerRef, "data-tooltip-has-focus-within": isFocusWithin, style: { ...style }, children: [Children.map(trigger, (child) => cloneElement(child, {
|
|
39
38
|
ref: setTriggerRef,
|
|
39
|
+
tabIndex: 0,
|
|
40
40
|
'aria-describedby': seedID('tooltip-content')
|
|
41
|
-
})), visible && (_jsx(Elevator, { resting:
|
|
41
|
+
})), visible && (_jsx(Elevator, { resting: 1, children: _jsxs("div", { ref: setTooltipRef, role: "tooltip", id: seedID('tooltip-content'), "data-theme": "dark", ...getTooltipProps({ className: Balloon, style: dynamycStyle }), children: [children, _jsx("div", { ...getArrowProps({ className: Arrow }) }, void 0)] }, void 0) }, void 0))] }, void 0));
|
|
42
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.Tooltip{word-wrap:break-word;background-color:#31363f;border-radius:.22rem;font-size:.89rem;max-inline-size:var(--maxW);padding:.44rem .89rem;position:relative;z-index:2}.
|
|
1
|
+
.Tooltip{display:contents}.Balloon{word-wrap:break-word;background-color:#31363f;border-radius:.22rem;font-size:.89rem;max-inline-size:var(--maxW);padding:.44rem .89rem;position:relative;z-index:2}.Balloon[data-popper-reference-hidden=true]{pointer-events:none;visibility:hidden}.Arrow:before{background-color:#31363f;block-size:12px;content:"";inline-size:12px;position:absolute;transform:rotate(45deg);visibility:visible}.Balloon[data-popper-reference-hidden=true] .Arrow{pointer-events:none;visibility:hidden}.Balloon[data-popper-placement^=top] .Arrow{bottom:6px}.Balloon[data-popper-placement^=top] .Arrow:before{transform:translateX(-50%) rotate(45deg)}.Balloon[data-popper-placement^=left] .Arrow{right:6px}.Balloon[data-popper-placement^=left] .Arrow:before{transform:translateY(-50%) rotate(45deg)}.Balloon[data-popper-placement^=bottom] .Arrow{top:-6px}.Balloon[data-popper-placement^=bottom] .Arrow:before{transform:translateX(-50%) rotate(45deg)}.Balloon[data-popper-placement^=right] .Arrow{left:-6px}.Balloon[data-popper-placement^=right] .Arrow:before{transform:translateY(-50%) rotate(45deg)}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, forwardRef, useRef, useMemo } from 'react';
|
|
3
|
-
import { useRovingTabIndex, useFocusEffect } from 'react-roving-tabindex';
|
|
4
|
-
import { DropdownItem as DropdownItemClass, Icon as IconClass } from './dropdown-item.module.css';
|
|
5
|
-
import { Tooltip, Stack, Icon } from '../..';
|
|
6
|
-
import clsx from 'clsx';
|
|
7
|
-
export const DropdownItem = forwardRef(({ className, children, onClick, icon, dimension = 'regular', as: Wrapper = 'button', iconPosition = 'left', description, padding = true, disabled = false, ...props }, forwardedRef) => {
|
|
8
|
-
const itemRef = useRef(forwardedRef);
|
|
9
|
-
const [tabIndex, focused, handleKeyDown, handleClick] = useRovingTabIndex(itemRef, disabled);
|
|
10
|
-
const isIconRight = iconPosition === 'right';
|
|
11
|
-
useFocusEffect(focused, itemRef);
|
|
12
|
-
const triggerClick = useCallback(() => {
|
|
13
|
-
if (onClick) {
|
|
14
|
-
handleClick();
|
|
15
|
-
onClick();
|
|
16
|
-
}
|
|
17
|
-
}, [handleClick, onClick]);
|
|
18
|
-
const InnerContent = useMemo(() => (_jsxs(Stack, { direction: "row", as: "span", fill: false, horizontalAlign: isIconRight ? 'space-between' : 'start', verticalAlign: "center", columnGap: 8, horizontalPadding: 16, verticalPadding: 8, "data-dropdown-icon-right": isIconRight, "data-dropdown-has-icon": Boolean(icon), "data-dropdown-padding": padding, style: { inlineSize: '100%' }, children: [icon && (_jsx(Icon, { className: IconClass, name: icon, dimension: dimension === 'small' ? 14 : 16 }, void 0)), children] }, void 0)), [children, dimension, icon, isIconRight, padding]);
|
|
19
|
-
return (_jsx(Wrapper, { ref: itemRef, role: "menuitem", className: clsx(DropdownItemClass, className), onClick: disabled ? undefined : triggerClick, onKeyDown: disabled ? undefined : handleKeyDown, tabIndex: tabIndex, "aria-disabled": disabled, type: Wrapper === 'button' ? 'button' : undefined, "data-dropdown-item-dimension": dimension, ...props, children: description
|
|
20
|
-
? (_jsx(Tooltip, { fill: true, show: focused, placement: "right-start", trigger: InnerContent, children: description }, void 0))
|
|
21
|
-
: InnerContent }, void 0));
|
|
22
|
-
});
|
|
23
|
-
DropdownItem.displayName = 'Dropdown.Item';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.DropdownItem{background:none;border:0;box-sizing:border-box;color:var(--dimmed-6);cursor:pointer;font:inherit;font-size:.89rem;font-weight:600;inline-size:100%;line-height:1.2;position:relative;text-align:start}.DropdownItem[aria-checked=true]{color:var(--global-interactive-text)}.DropdownItem:before{border-radius:.22rem;bottom:0;content:"";left:.44rem;opacity:60%;position:absolute;right:.44rem;top:0}.DropdownItem:is(:hover,.focus-visible,[aria-pressed=true]):not([aria-disabled=true]){outline:none}.DropdownItem:is(:hover,:focus-visible,[aria-pressed=true]):not([aria-disabled=true]){outline:none}.DropdownItem:is(:hover,.focus-visible,[aria-pressed=true]):not([aria-disabled=true]):before{background-color:var(--dimmed-1)}.DropdownItem:is(:hover,:focus-visible,[aria-pressed=true]):not([aria-disabled=true]):before{background-color:var(--dimmed-1)}.DropdownItem[data-dropdown-item-dimension=small]{font-size:.78rem}.DropdownItem>*{position:relative}.DropdownItem[aria-disabled=true]{color:var(--global-disabled-foreground);cursor:not-allowed}.DropdownItem [data-dropdown-padding=true][data-dropdown-has-icon=false][data-dropdown-icon-right=false]{padding-left:2.22rem}.DropdownItem [data-dropdown-padding=true][data-dropdown-has-icon=false][data-dropdown-icon-right=true]{padding-right:2.22rem}[data-dropdown-icon-right=true] .Icon{order:2}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { DropdownItem, DropdownItemProps } from '../item/dropdown-item';
|
|
2
|
-
import { Polymorphic } from '../..';
|
|
3
|
-
export declare type DropdownItemCheckboxProps = DropdownItemProps & {
|
|
4
|
-
/**
|
|
5
|
-
* Set the default checked state of the checkbox item
|
|
6
|
-
*/
|
|
7
|
-
checked?: boolean;
|
|
8
|
-
};
|
|
9
|
-
declare type PolymorphicDropdownItemCheckbox = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof DropdownItem>, Polymorphic.OwnProps<typeof DropdownItem> & DropdownItemCheckboxProps>;
|
|
10
|
-
export declare const DropdownItemCheckbox: PolymorphicDropdownItemCheckbox;
|
|
11
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { DropdownItem } from '../item/dropdown-item';
|
|
4
|
-
export const DropdownItemCheckbox = forwardRef(({ children, checked, ...props }, forwardedRef) => _jsx(DropdownItem, { role: "menuitemcheckbox", "aria-checked": checked, ref: forwardedRef, ...props, children: children }, void 0));
|
|
5
|
-
DropdownItemCheckbox.displayName = 'Dropdown.ItemCheckbox';
|