@crystallize/design-system 1.20.1 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.css +83 -472
- package/dist/index.js +7 -7
- package/dist/index.mjs +7 -7
- package/package.json +20 -20
- package/src/action-menu/action-menu.css +4 -0
- package/src/action-menu/action-menu.tsx +1 -1
- package/src/button/Button.stories.tsx +8 -1
- package/src/checkbox/checkbox.stories.tsx +13 -7
- package/src/colors/Colors.stories.tsx +37 -8
- package/src/dialog/Dialog.stories.tsx +4 -4
- package/src/dialog/confirm-dialog.tsx +1 -1
- package/src/dialog/dialog.css +10 -0
- package/src/dialog/dialog.tsx +1 -1
- package/src/dropdown-menu/DropdownMenu.stories.tsx +4 -4
- package/src/icon-button/IconButton.stories.tsx +9 -2
- package/src/iconography/Icon.stories.tsx +6 -3
- package/src/index.css +0 -11
- package/src/input-with-label/InputWithLabel.stories.tsx +1 -1
- package/src/popover/popover.stories.tsx +2 -2
- package/src/progress/progress.css +1 -1
- package/src/radio/radio.stories.tsx +75 -37
- package/src/rich-text-editor/plugins/DraggableBlockPlugin/index.css +1 -1
- package/src/rich-text-editor/plugins/FloatingLinkEditorPlugin/index.css +2 -1
- package/src/rich-text-editor/plugins/ToolbarPlugin/index.css +6 -1
- package/src/rich-text-editor/plugins/ToolbarPlugin/index.tsx +1 -1
- package/src/rich-text-editor/rich-text-editor.css +2 -1
- package/src/rich-text-editor/rich-text-editor.stories.tsx +9 -15
- package/src/rich-text-editor/tests/rich-text-editor-text-formats.test.tsx +11 -2
- package/src/rich-text-editor/themes/CrystallizeRTEditorTheme.css +8 -9
- package/src/select/select.css +2 -1
- package/src/select/select.stories.tsx +1 -1
- package/src/slider/Slider.stories.tsx +1 -1
- package/src/stack-icon/stack-icon.css +8 -0
- package/src/stack-icon/stack-icon.tsx +3 -5
- package/src/switch/Switch.stories.tsx +15 -9
- package/src/tag/tag.css +4 -0
- package/src/tag/tag.tsx +1 -1
- package/src/toast/toast.css +3 -1
- package/src/toast/toast.stories.tsx +2 -2
- package/src/tooltip/Tooltip.stories.tsx +20 -7
- package/src/tooltip/tooltip.css +2 -1
- package/tailwind.config.cjs +17 -1
package/dist/index.js
CHANGED
|
@@ -29214,7 +29214,7 @@ function ActionMenu({ children, tabIndex, size, ...delegated }) {
|
|
|
29214
29214
|
type: "button",
|
|
29215
29215
|
children: [
|
|
29216
29216
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", {
|
|
29217
|
-
className: "
|
|
29217
|
+
className: "c-action-menu__trigger-text",
|
|
29218
29218
|
children: "Open more options"
|
|
29219
29219
|
}),
|
|
29220
29220
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", {
|
|
@@ -34535,7 +34535,7 @@ function DialogContent({ children, closable = true, type, className, container,
|
|
|
34535
34535
|
...delegated,
|
|
34536
34536
|
children: [
|
|
34537
34537
|
IconComponent && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("div", {
|
|
34538
|
-
className: "
|
|
34538
|
+
className: "c-dialog-icon-wrapper",
|
|
34539
34539
|
children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(IconComponent, {
|
|
34540
34540
|
className: "c-dialog-icon",
|
|
34541
34541
|
width: 34,
|
|
@@ -34645,7 +34645,7 @@ function ConfirmDialog({
|
|
|
34645
34645
|
}),
|
|
34646
34646
|
content,
|
|
34647
34647
|
(displayOk || okCancel || displayCancel) && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", {
|
|
34648
|
-
className: "
|
|
34648
|
+
className: "c-dialog-content__buttons",
|
|
34649
34649
|
children: [
|
|
34650
34650
|
cancelButton,
|
|
34651
34651
|
okButton
|
|
@@ -35174,11 +35174,11 @@ var Slider = (0, import_react111.forwardRef)(({ className, transparentRange, ...
|
|
|
35174
35174
|
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
35175
35175
|
function StackIcon({ type, children, size = 18 }) {
|
|
35176
35176
|
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("span", {
|
|
35177
|
-
className: "
|
|
35177
|
+
className: "c-stack-icon",
|
|
35178
35178
|
children: [
|
|
35179
35179
|
type === "create" && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", {
|
|
35180
35180
|
style: { width: size, height: size },
|
|
35181
|
-
className: "
|
|
35181
|
+
className: "c-stack-icon__icon",
|
|
35182
35182
|
children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Icon.Add, {
|
|
35183
35183
|
width: size - 4,
|
|
35184
35184
|
height: size - 4
|
|
@@ -35233,7 +35233,7 @@ function Tag({ children, className, variant, size, prepend, onRemove, ...delegat
|
|
|
35233
35233
|
height: 12
|
|
35234
35234
|
}),
|
|
35235
35235
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", {
|
|
35236
|
-
className: "
|
|
35236
|
+
className: "c-tag__remove-button-text",
|
|
35237
35237
|
children: "Remove"
|
|
35238
35238
|
})
|
|
35239
35239
|
]
|
|
@@ -37665,7 +37665,7 @@ function BlockFormatDropDown({
|
|
|
37665
37665
|
"data-testid": "toggle-block-format-code",
|
|
37666
37666
|
children: [
|
|
37667
37667
|
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)("i", {
|
|
37668
|
-
className: `icon c-rte-icon-code
|
|
37668
|
+
className: `icon c-rte-icon-code c-rte-toolbar__block-format__icon ${blockType === "code" ? "selected" : ""}`
|
|
37669
37669
|
}),
|
|
37670
37670
|
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)("span", {
|
|
37671
37671
|
className: `c-rte-toolbar__block-format__text ${blockType === "code" ? "selected" : ""}`,
|
package/dist/index.mjs
CHANGED
|
@@ -324,7 +324,7 @@ function ActionMenu({ children, tabIndex, size, ...delegated }) {
|
|
|
324
324
|
type: "button",
|
|
325
325
|
children: [
|
|
326
326
|
/* @__PURE__ */ jsx9("span", {
|
|
327
|
-
className: "
|
|
327
|
+
className: "c-action-menu__trigger-text",
|
|
328
328
|
children: "Open more options"
|
|
329
329
|
}),
|
|
330
330
|
/* @__PURE__ */ jsx9("span", {
|
|
@@ -5645,7 +5645,7 @@ function DialogContent({ children, closable = true, type, className, container,
|
|
|
5645
5645
|
...delegated,
|
|
5646
5646
|
children: [
|
|
5647
5647
|
IconComponent && /* @__PURE__ */ jsx112("div", {
|
|
5648
|
-
className: "
|
|
5648
|
+
className: "c-dialog-icon-wrapper",
|
|
5649
5649
|
children: /* @__PURE__ */ jsx112(IconComponent, {
|
|
5650
5650
|
className: "c-dialog-icon",
|
|
5651
5651
|
width: 34,
|
|
@@ -5755,7 +5755,7 @@ function ConfirmDialog({
|
|
|
5755
5755
|
}),
|
|
5756
5756
|
content,
|
|
5757
5757
|
(displayOk || okCancel || displayCancel) && /* @__PURE__ */ jsxs102("div", {
|
|
5758
|
-
className: "
|
|
5758
|
+
className: "c-dialog-content__buttons",
|
|
5759
5759
|
children: [
|
|
5760
5760
|
cancelButton,
|
|
5761
5761
|
okButton
|
|
@@ -6284,11 +6284,11 @@ var Slider = forwardRef111(({ className, transparentRange, ...delegated }, ref)
|
|
|
6284
6284
|
import { jsx as jsx126, jsxs as jsxs108 } from "react/jsx-runtime";
|
|
6285
6285
|
function StackIcon({ type, children, size = 18 }) {
|
|
6286
6286
|
return /* @__PURE__ */ jsxs108("span", {
|
|
6287
|
-
className: "
|
|
6287
|
+
className: "c-stack-icon",
|
|
6288
6288
|
children: [
|
|
6289
6289
|
type === "create" && /* @__PURE__ */ jsx126("span", {
|
|
6290
6290
|
style: { width: size, height: size },
|
|
6291
|
-
className: "
|
|
6291
|
+
className: "c-stack-icon__icon",
|
|
6292
6292
|
children: /* @__PURE__ */ jsx126(Icon.Add, {
|
|
6293
6293
|
width: size - 4,
|
|
6294
6294
|
height: size - 4
|
|
@@ -6343,7 +6343,7 @@ function Tag({ children, className, variant, size, prepend, onRemove, ...delegat
|
|
|
6343
6343
|
height: 12
|
|
6344
6344
|
}),
|
|
6345
6345
|
/* @__PURE__ */ jsx127("span", {
|
|
6346
|
-
className: "
|
|
6346
|
+
className: "c-tag__remove-button-text",
|
|
6347
6347
|
children: "Remove"
|
|
6348
6348
|
})
|
|
6349
6349
|
]
|
|
@@ -8857,7 +8857,7 @@ function BlockFormatDropDown({
|
|
|
8857
8857
|
"data-testid": "toggle-block-format-code",
|
|
8858
8858
|
children: [
|
|
8859
8859
|
/* @__PURE__ */ jsx141("i", {
|
|
8860
|
-
className: `icon c-rte-icon-code
|
|
8860
|
+
className: `icon c-rte-icon-code c-rte-toolbar__block-format__icon ${blockType === "code" ? "selected" : ""}`
|
|
8861
8861
|
}),
|
|
8862
8862
|
/* @__PURE__ */ jsx141("span", {
|
|
8863
8863
|
className: `c-rte-toolbar__block-format__text ${blockType === "code" ? "selected" : ""}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crystallize/design-system",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"types": "./dist/index.d.ts",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -60,35 +60,35 @@
|
|
|
60
60
|
"@faker-js/faker": "7.6.0",
|
|
61
61
|
"@ianvs/prettier-plugin-sort-imports": "^3.7.1",
|
|
62
62
|
"@mdx-js/react": "^2.2.1",
|
|
63
|
-
"@storybook/addon-actions": "7.
|
|
64
|
-
"@storybook/addon-backgrounds": "7.
|
|
63
|
+
"@storybook/addon-actions": "7.6.2",
|
|
64
|
+
"@storybook/addon-backgrounds": "7.6.2",
|
|
65
65
|
"@storybook/addon-docs": "7.0.0-beta.14",
|
|
66
|
-
"@storybook/addon-essentials": "7.
|
|
67
|
-
"@storybook/addon-highlight": "7.
|
|
68
|
-
"@storybook/addon-interactions": "7.
|
|
69
|
-
"@storybook/addon-links": "7.
|
|
70
|
-
"@storybook/addon-measure": "7.
|
|
71
|
-
"@storybook/addon-outline": "7.
|
|
72
|
-
"@storybook/manager-api": "7.
|
|
73
|
-
"@storybook/react": "7.
|
|
74
|
-
"@storybook/react-vite": "7.
|
|
75
|
-
"@storybook/theming": "7.
|
|
76
|
-
"@testing-library/jest-dom": "
|
|
77
|
-
"@testing-library/react": "
|
|
78
|
-
"@testing-library/user-event": "14.
|
|
66
|
+
"@storybook/addon-essentials": "7.6.2",
|
|
67
|
+
"@storybook/addon-highlight": "7.6.2",
|
|
68
|
+
"@storybook/addon-interactions": "7.6.2",
|
|
69
|
+
"@storybook/addon-links": "7.6.2",
|
|
70
|
+
"@storybook/addon-measure": "7.6.2",
|
|
71
|
+
"@storybook/addon-outline": "7.6.2",
|
|
72
|
+
"@storybook/manager-api": "7.6.2",
|
|
73
|
+
"@storybook/react": "7.6.2",
|
|
74
|
+
"@storybook/react-vite": "7.6.2",
|
|
75
|
+
"@storybook/theming": "7.6.2",
|
|
76
|
+
"@testing-library/jest-dom": "6.1.5",
|
|
77
|
+
"@testing-library/react": "14.1.2",
|
|
78
|
+
"@testing-library/user-event": "14.5.1",
|
|
79
79
|
"@types/prettier": "2.7.2",
|
|
80
80
|
"@types/react": "17.0.1",
|
|
81
81
|
"@types/react-dom": "17.0.1",
|
|
82
|
-
"@types/testing-library__jest-dom": "5.14.5",
|
|
83
82
|
"@vitejs/plugin-react": "^3.0.1",
|
|
84
83
|
"concurrently": "^7.6.0",
|
|
85
84
|
"hex-rgb": "4.3.0",
|
|
86
85
|
"postcss": "^8.4.21",
|
|
86
|
+
"postcss-import": "^15.1.0",
|
|
87
87
|
"prettier": "2.8.4",
|
|
88
|
-
"storybook": "7.
|
|
88
|
+
"storybook": "7.6.2",
|
|
89
89
|
"storybook-addon-designs": "^6.3.1",
|
|
90
90
|
"storybook-dark-mode": "^2.0.5",
|
|
91
|
-
"tailwindcss": "^3.3.
|
|
91
|
+
"tailwindcss": "^3.3.5",
|
|
92
92
|
"tsup": "^6.5.0",
|
|
93
93
|
"typescript": "4.9.4",
|
|
94
94
|
"vite": "4.3.4",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
],
|
|
117
117
|
"scripts": {
|
|
118
118
|
"build:storybook": "storybook build -s public",
|
|
119
|
-
"build:tw": "tailwindcss
|
|
119
|
+
"build:tw": "tailwindcss -c ./tailwind.config.cjs -i src/index.css -o dist/index.css",
|
|
120
120
|
"build:tsup": "tsup src/index.ts --format esm,cjs --dts",
|
|
121
121
|
"build": "pnpm build:tw && pnpm build:tsup",
|
|
122
122
|
"dev:tw": "tailwindcss --content ./src/**/*.tsx,!./src/**/*.stories.tsx -c ./tailwind.config.cjs -i src/index.css -o dist/index.css --watch & tsup src/index.ts --format esm --dts --watch",
|
|
@@ -36,7 +36,7 @@ export function ActionMenu({ children, tabIndex, size, ...delegated }: ActionMen
|
|
|
36
36
|
tabIndex={tabIndex}
|
|
37
37
|
type="button"
|
|
38
38
|
>
|
|
39
|
-
<span className="
|
|
39
|
+
<span className="c-action-menu__trigger-text">Open more options</span>
|
|
40
40
|
<span className="c-action-menu-dot"></span>
|
|
41
41
|
<span className="c-action-menu-dot"></span>
|
|
42
42
|
<span className="c-action-menu-dot"></span>
|
|
@@ -30,7 +30,14 @@ export const AllButton: Story = {
|
|
|
30
30
|
render: () => {
|
|
31
31
|
return (
|
|
32
32
|
<div>
|
|
33
|
-
<div
|
|
33
|
+
<div
|
|
34
|
+
style={{
|
|
35
|
+
display: 'grid',
|
|
36
|
+
gridTemplateColumns: 'repeat(6, minmax(0, 1fr))',
|
|
37
|
+
gap: '1.5rem',
|
|
38
|
+
justifyItems: 'center',
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
34
41
|
{sizes.map(size =>
|
|
35
42
|
variants.map(variant =>
|
|
36
43
|
intent.map(intent => (
|
|
@@ -36,9 +36,11 @@ export const Controlled: Story = {
|
|
|
36
36
|
export const WithLabel: Story = {
|
|
37
37
|
render: () => {
|
|
38
38
|
return (
|
|
39
|
-
<div
|
|
39
|
+
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
40
40
|
<Checkbox id="with-label-c1" defaultChecked={true} />
|
|
41
|
-
<Label htmlFor="with-label-c1">
|
|
41
|
+
<Label style={{ marginLeft: '0.5rem' }} htmlFor="with-label-c1">
|
|
42
|
+
Accept terms and conditions.
|
|
43
|
+
</Label>
|
|
42
44
|
</div>
|
|
43
45
|
);
|
|
44
46
|
},
|
|
@@ -47,14 +49,18 @@ export const WithLabel: Story = {
|
|
|
47
49
|
export const Disabled: Story = {
|
|
48
50
|
render: () => {
|
|
49
51
|
return (
|
|
50
|
-
<div
|
|
51
|
-
<div
|
|
52
|
+
<div>
|
|
53
|
+
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
52
54
|
<Checkbox id="disabled-c1" defaultChecked={true} disabled />
|
|
53
|
-
<Label htmlFor="disabled-c1">
|
|
55
|
+
<Label style={{ marginLeft: '0.5rem' }} htmlFor="disabled-c1">
|
|
56
|
+
Accept terms and conditions.
|
|
57
|
+
</Label>
|
|
54
58
|
</div>
|
|
55
|
-
<div
|
|
59
|
+
<div style={{ display: 'flex', marginTop: '1rem', alignItems: 'center' }}>
|
|
56
60
|
<Checkbox id="disabled-c2" defaultChecked={false} disabled />
|
|
57
|
-
<Label htmlFor="disabled-c2">
|
|
61
|
+
<Label style={{ marginLeft: '0.5rem' }} htmlFor="disabled-c2">
|
|
62
|
+
Accept terms and conditions.
|
|
63
|
+
</Label>
|
|
58
64
|
</div>
|
|
59
65
|
</div>
|
|
60
66
|
);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { cx } from 'class-variance-authority';
|
|
2
1
|
import { useDarkMode } from 'storybook-dark-mode';
|
|
3
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
3
|
|
|
@@ -73,8 +72,8 @@ function ColorItem({ colorName, color }: { colorName: ColorName; color: Color })
|
|
|
73
72
|
|
|
74
73
|
return (
|
|
75
74
|
<div>
|
|
76
|
-
<h2
|
|
77
|
-
<div
|
|
75
|
+
<h2 style={{ color: 'rgb(var(--c-color-gray))' }}>{colorName}</h2>
|
|
76
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(10, minmax(0, 1fr))' }}>
|
|
78
77
|
{shades.map(shade => {
|
|
79
78
|
// @ts-expect-error
|
|
80
79
|
const def = color[shade] as string;
|
|
@@ -87,20 +86,50 @@ function ColorItem({ colorName, color }: { colorName: ColorName; color: Color })
|
|
|
87
86
|
return (
|
|
88
87
|
<div>
|
|
89
88
|
<div
|
|
90
|
-
style={{
|
|
91
|
-
|
|
89
|
+
style={{
|
|
90
|
+
background: def,
|
|
91
|
+
color: textColor,
|
|
92
|
+
display: 'flex',
|
|
93
|
+
position: 'relative',
|
|
94
|
+
flex: '1 1 0%',
|
|
95
|
+
justifyContent: 'center',
|
|
96
|
+
alignItems: 'center',
|
|
97
|
+
height: '6rem',
|
|
98
|
+
}}
|
|
92
99
|
>
|
|
93
100
|
{!isDefault ? null : (
|
|
94
101
|
<div
|
|
95
|
-
className="h-[8px] w-[8px] rounded"
|
|
96
102
|
style={{
|
|
103
|
+
width: 8,
|
|
104
|
+
height: 8,
|
|
97
105
|
backgroundColor: 'currentColor',
|
|
106
|
+
borderRadius: '0.25rem',
|
|
98
107
|
}}
|
|
99
108
|
/>
|
|
100
109
|
)}
|
|
101
|
-
<div
|
|
110
|
+
<div
|
|
111
|
+
style={{
|
|
112
|
+
position: 'absolute',
|
|
113
|
+
top: '0.5rem',
|
|
114
|
+
right: '0.5rem',
|
|
115
|
+
left: '0.5rem',
|
|
116
|
+
fontSize: '0.875rem',
|
|
117
|
+
lineHeight: '1.25rem',
|
|
118
|
+
textAlign: 'center',
|
|
119
|
+
}}
|
|
120
|
+
>
|
|
121
|
+
{shade}
|
|
122
|
+
</div>
|
|
102
123
|
</div>
|
|
103
|
-
<div
|
|
124
|
+
<div
|
|
125
|
+
style={{
|
|
126
|
+
padding: '1rem',
|
|
127
|
+
fontSize: '0.875rem',
|
|
128
|
+
lineHeight: '1.25rem',
|
|
129
|
+
textAlign: 'center',
|
|
130
|
+
color: 'rgb(var(--c-color-gray))',
|
|
131
|
+
}}
|
|
132
|
+
>
|
|
104
133
|
{applicatedAt.map(a => (
|
|
105
134
|
<div key={a.application}>{a.application}</div>
|
|
106
135
|
))}
|
|
@@ -15,7 +15,7 @@ export default meta;
|
|
|
15
15
|
type Story = StoryObj<typeof Dialog>;
|
|
16
16
|
|
|
17
17
|
const Lorem = () => (
|
|
18
|
-
<p
|
|
18
|
+
<p style={{ lineHeight: '1.5rem' }}>
|
|
19
19
|
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Reiciendis neque id, blanditiis exercitationem doloremque
|
|
20
20
|
quam ab minima architecto culpa.
|
|
21
21
|
</p>
|
|
@@ -30,7 +30,7 @@ export const Component: Story = {
|
|
|
30
30
|
<Dialog.Content>
|
|
31
31
|
<Dialog.Title>This is a normal Dialog</Dialog.Title>
|
|
32
32
|
<Dialog.Description>That is described in a declarative way</Dialog.Description>
|
|
33
|
-
<div
|
|
33
|
+
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
|
34
34
|
Here will go the main content
|
|
35
35
|
<ActionMenu>
|
|
36
36
|
<ActionMenu.Item onSelect={() => console.warn('Download')}>Download</ActionMenu.Item>
|
|
@@ -58,7 +58,7 @@ export const ComponentWithDangerAction: Story = {
|
|
|
58
58
|
<Lorem />
|
|
59
59
|
</Dialog.Description>
|
|
60
60
|
|
|
61
|
-
<div
|
|
61
|
+
<div style={{ display: 'flex', marginTop: '2rem', gap: '1rem', justifyContent: 'flex-end' }}>
|
|
62
62
|
<Button>Cancel</Button>
|
|
63
63
|
<Button intent="danger">Delete</Button>
|
|
64
64
|
</div>
|
|
@@ -76,7 +76,7 @@ export const ShowConfirm: Story = {
|
|
|
76
76
|
title: 'We need your confirmation',
|
|
77
77
|
description: 'In order to proceed to you account we need your confirmation',
|
|
78
78
|
content: (
|
|
79
|
-
<p
|
|
79
|
+
<p style={{ marginTop: '1.5rem', marginBottom: '1.5rem' }}>
|
|
80
80
|
We really like cookies and our cookies is what allow us to provide you with an awesome user experience. Do
|
|
81
81
|
you allow us to set some cookies for you?
|
|
82
82
|
</p>
|
|
@@ -59,7 +59,7 @@ export function ConfirmDialog({
|
|
|
59
59
|
{description && <Dialog.Description>{description}</Dialog.Description>}
|
|
60
60
|
{content}
|
|
61
61
|
{(displayOk || okCancel || displayCancel) && (
|
|
62
|
-
<div className="
|
|
62
|
+
<div className="c-dialog-content__buttons">
|
|
63
63
|
{cancelButton}
|
|
64
64
|
{okButton}
|
|
65
65
|
</div>
|
package/src/dialog/dialog.css
CHANGED
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
@apply fixed inset-0 z-[100] bg-overlay;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
&-icon-wrapper {
|
|
10
|
+
@apply flex h-[44px] w-[44px] min-w-[44px] items-center justify-center rounded-lg bg-gray-50-900 p-[5px];
|
|
11
|
+
}
|
|
12
|
+
|
|
9
13
|
&-icon {
|
|
10
14
|
@apply my-1 shrink-0;
|
|
11
15
|
}
|
|
@@ -25,4 +29,10 @@
|
|
|
25
29
|
&-with-icon {
|
|
26
30
|
@apply flex items-start gap-6 pl-6;
|
|
27
31
|
}
|
|
32
|
+
|
|
33
|
+
&-content {
|
|
34
|
+
&__buttons {
|
|
35
|
+
@apply mt-4 flex items-center justify-end gap-4;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
28
38
|
}
|
package/src/dialog/dialog.tsx
CHANGED
|
@@ -41,7 +41,7 @@ function DialogContent({ children, closable = true, type, className, container,
|
|
|
41
41
|
<DialogPrimitive.Overlay className="c-dialog-overlay" />
|
|
42
42
|
<DialogPrimitive.Content className={dialogContentStyles({ withIcon, class: className })} {...delegated}>
|
|
43
43
|
{IconComponent && (
|
|
44
|
-
<div className="
|
|
44
|
+
<div className="c-dialog-icon-wrapper">
|
|
45
45
|
<IconComponent className="c-dialog-icon" width={34} height={34} />
|
|
46
46
|
</div>
|
|
47
47
|
)}
|
|
@@ -14,15 +14,15 @@ function ContentWithIcon() {
|
|
|
14
14
|
<>
|
|
15
15
|
<DropdownMenu.Label>View</DropdownMenu.Label>
|
|
16
16
|
<DropdownMenu.Item>
|
|
17
|
-
<div
|
|
17
|
+
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
18
18
|
<Icon.Glasses width={24} height={24} />
|
|
19
|
-
<span
|
|
19
|
+
<span style={{ padding: '0 12px' }}>Nerdy</span>
|
|
20
20
|
</div>
|
|
21
21
|
</DropdownMenu.Item>
|
|
22
22
|
<DropdownMenu.Item>
|
|
23
|
-
<div
|
|
23
|
+
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
24
24
|
<Icon.GraphQL width={24} height={24} />
|
|
25
|
-
<span
|
|
25
|
+
<span style={{ padding: '0 12px' }}>Developer</span>
|
|
26
26
|
</div>
|
|
27
27
|
</DropdownMenu.Item>
|
|
28
28
|
</>
|
|
@@ -19,9 +19,16 @@ export const AllButton: Story = {
|
|
|
19
19
|
name: 'All Buttons',
|
|
20
20
|
render: () => {
|
|
21
21
|
return (
|
|
22
|
-
<div
|
|
22
|
+
<div
|
|
23
|
+
style={{
|
|
24
|
+
display: 'grid',
|
|
25
|
+
gridTemplateColumns: 'repeat(5, minmax(0, 1fr))',
|
|
26
|
+
gap: '1.5rem',
|
|
27
|
+
justifyItems: 'center',
|
|
28
|
+
}}
|
|
29
|
+
>
|
|
23
30
|
{sizes.map(size => (
|
|
24
|
-
<Card>
|
|
31
|
+
<Card style={{ display: 'flex', alignItems: 'center' }}>
|
|
25
32
|
<IconButton size={size}>
|
|
26
33
|
<Icon.Cancel width={16} height={16} />
|
|
27
34
|
</IconButton>
|
|
@@ -20,14 +20,15 @@ export const AllIcons: Story = {
|
|
|
20
20
|
render: () => {
|
|
21
21
|
return (
|
|
22
22
|
<div>
|
|
23
|
-
<div
|
|
23
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '1.5rem' }}>
|
|
24
24
|
{Object.keys(Icon).map(iconName => {
|
|
25
25
|
// @ts-expect-error
|
|
26
26
|
const Cmp = Icon[iconName];
|
|
27
27
|
const cmpString = `<Icon.${iconName} />`;
|
|
28
28
|
return (
|
|
29
29
|
<div
|
|
30
|
-
className="
|
|
30
|
+
className="copy-icon-button"
|
|
31
|
+
style={{ width: '9rem', height: '9rem', textAlign: 'center', cursor: 'pointer' }}
|
|
31
32
|
onClick={() => {
|
|
32
33
|
const type = 'text/plain';
|
|
33
34
|
const blob = new Blob([cmpString], { type });
|
|
@@ -37,7 +38,9 @@ export const AllIcons: Story = {
|
|
|
37
38
|
<Card title={cmpString}>
|
|
38
39
|
<Cmp width={44} height={44} />
|
|
39
40
|
</Card>
|
|
40
|
-
<div
|
|
41
|
+
<div style={{ marginTop: '0.5rem', fontSize: '0.75rem', lineHeight: '1rem', whiteSpace: 'nowrap' }}>
|
|
42
|
+
{cmpString}
|
|
43
|
+
</div>
|
|
41
44
|
</div>
|
|
42
45
|
);
|
|
43
46
|
})}
|
package/src/index.css
CHANGED
|
@@ -28,7 +28,7 @@ type Story = StoryObj<typeof Popover>;
|
|
|
28
28
|
export const SimpleTemplate: Story = {
|
|
29
29
|
name: 'Simple Template',
|
|
30
30
|
render: args => (
|
|
31
|
-
<div
|
|
31
|
+
<div style={{ display: 'flex', paddingTop: '3.5rem', justifyContent: 'center', width: '50%' }}>
|
|
32
32
|
<Popover {...args} content="Content goes here">
|
|
33
33
|
<Icon.Customers width={32} height={32} />
|
|
34
34
|
</Popover>
|
|
@@ -39,7 +39,7 @@ export const SimpleTemplate: Story = {
|
|
|
39
39
|
export const WithCustomCloseButton: Story = {
|
|
40
40
|
name: 'With custom Close button',
|
|
41
41
|
render: () => (
|
|
42
|
-
<div
|
|
42
|
+
<div style={{ display: 'flex', paddingTop: '3.5rem', justifyContent: 'center', width: '50%' }}>
|
|
43
43
|
<Popover content="Content goes here" side="left" closeButton={<button>close</button>}>
|
|
44
44
|
<Icon.Customers width={32} height={32} />
|
|
45
45
|
</Popover>
|