@lunit/design-system 2.0.0 → 2.0.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.
Files changed (32) hide show
  1. package/dist/cjs/components/Checkbox/index.js +1 -1
  2. package/dist/cjs/components/Checkbox/index.js.map +1 -1
  3. package/dist/cjs/components/Dialog/index.js +1 -1
  4. package/dist/cjs/components/Dialog/index.js.map +1 -1
  5. package/dist/cjs/components/Radio/index.js +1 -1
  6. package/dist/cjs/components/Radio/index.js.map +1 -1
  7. package/dist/cjs/index.js +1 -1
  8. package/dist/cjs/index.js.map +1 -1
  9. package/dist/components/Checkbox/Checkbox.js +2 -2
  10. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  11. package/dist/components/Dialog/Dialog.js +2 -6
  12. package/dist/components/Dialog/Dialog.js.map +1 -1
  13. package/dist/components/Dialog/Dialog.styled.js +17 -8
  14. package/dist/components/Dialog/Dialog.styled.js.map +1 -1
  15. package/dist/components/Dialog/components/DialogAction.js +1 -1
  16. package/dist/components/Dialog/components/DialogAction.js.map +1 -1
  17. package/dist/components/Radio/Radio.js +2 -2
  18. package/dist/components/Radio/Radio.js.map +1 -1
  19. package/dist/foundation/colors/token/component.js +2 -2
  20. package/dist/foundation/colors/token/component.js.map +1 -1
  21. package/dist/types/components/Button/Button.styled.d.ts +3 -3
  22. package/dist/types/components/Chip/Chip.styled.d.ts +12 -12
  23. package/dist/types/components/Dialog/Dialog.d.ts +1 -1
  24. package/dist/types/components/ToggleButton/ToggleButton.styled.d.ts +2 -2
  25. package/package.json +1 -1
  26. package/src/components/Checkbox/Checkbox.tsx +4 -4
  27. package/src/components/Dialog/Dialog.styled.ts +17 -10
  28. package/src/components/Dialog/Dialog.tsx +4 -10
  29. package/src/components/Dialog/components/DialogAction.tsx +1 -1
  30. package/src/components/Radio/Radio.tsx +4 -4
  31. package/src/foundation/colors/token/component.ts +3 -3
  32. package/src/stories/components/Dialog/DialogDocs.mdx +181 -0
@@ -16,7 +16,7 @@ export const tokenComponentColor: TokenComponentColorValue = {
16
16
  },
17
17
  btn_secondary_bg: {
18
18
  light1: "--grey_10",
19
- light2: "--grey_00",
19
+ light2: "--grey_0",
20
20
  dark1: "--grey_60",
21
21
  dark2: "--grey_60",
22
22
  },
@@ -163,8 +163,8 @@ export const tokenComponentColor: TokenComponentColorValue = {
163
163
  datatable_zebra: {
164
164
  light1: "rgba(0, 0, 0, 0.03)", // "--grey_100 3%",
165
165
  light2: "rgba(0, 0, 0, 0.03)", // "--grey_100 3%",
166
- dark1: "rgba(255, 255, 255, 0.03)", // "--grey_00 3%",
167
- dark2: "rgba(255, 255, 255, 0.03)", // "--grey_00 3%",
166
+ dark1: "rgba(255, 255, 255, 0.03)", // "--grey_0 3%",
167
+ dark2: "rgba(255, 255, 255, 0.03)", // "--grey_0 3%",
168
168
  },
169
169
  },
170
170
  scrollbars: {
@@ -0,0 +1,181 @@
1
+ import { Canvas, Stories, Controls, Meta, Story } from "@storybook/blocks";
2
+ import { Error } from "@lunit/design-system-icons";
3
+
4
+ import Dialog from "@/components/Dialog";
5
+ import * as DialogStories from "./Dialog.stories";
6
+
7
+ <Meta name="Dialog Docs" of={DialogStories} />
8
+
9
+ # Dialog
10
+
11
+ Dialogs inform users about a task and can contain critical information, require decisions, or involve multiple tasks.
12
+ Dialogs are rendered in a [Portal](https://react.dev/reference/react-dom/createPortal) and are not affected by the z-index of the parent component.
13
+
14
+ ## Usage
15
+
16
+ ### Basic Dialog
17
+
18
+ ```tsx
19
+ import { Dialog } from "@lunit/design-system";
20
+ // or
21
+ import Dialog from "@lunit/design-system/Dialog";
22
+
23
+ <Dialog />;
24
+ ```
25
+
26
+ ### Demo
27
+
28
+ The Dialog demo cannot be seen in the mdx canvas since it is rendered in a [Portal](https://react.dev/reference/react-dom/createPortal).
29
+ Please go to the stories to see the demo.
30
+
31
+ <Controls />
32
+
33
+ ### IsOpen
34
+
35
+ The `isOpen` prop is used to control the render of the Dialog. <br />
36
+ If it is set to `false`, the Dialog will not be rendered in the DOM.
37
+
38
+ ```tsx
39
+ <Dialog isOpen={true} onClose={close} type="passive" title="Title area">
40
+ Lorem Ipsum is simply dummy text of the a printing and typesetting industry
41
+ </Dialog>
42
+ ```
43
+
44
+ ### Dismiss(onClose, enableBackButtonClose, enableBackdropClick)
45
+
46
+ The `onClose` prop is used to close the Dialog. You can pass a function to the prop to close the Dialog. <br />
47
+ If the `enableBackButtonClick` prop is set to `true`, the Dialog will be closed when the back button(escape/backspace key) is pressed. <br />
48
+ If the `enableBackdropClose` prop is set to `true`, the Dialog will be closed when the backdrop(outside of the dialog area) is clicked. <br />
49
+
50
+ <br />
51
+ The `enableBackButtonClick` is awalys `true` in Passive Modal, but it is optional
52
+ in Action Modal. <br />
53
+ The `enableBackdropClose` is awalys `true` only in Passive Modal.
54
+
55
+ ```tsx
56
+ <Dialog isOpen={true} onClose={close} type="passive" title="Title area">
57
+ Lorem Ipsum is simply dummy text of the a printing and typesetting industry
58
+ </Dialog>
59
+ <Dialog isOpen={true} onClose={close} type="action" title="Title area" actions={actionsChildren} enableBackButtonClick>
60
+ Lorem Ipsum is simply dummy text of the a printing and typesetting industry
61
+ </Dialog>
62
+ ```
63
+
64
+ ### Type
65
+
66
+ The Dialog Modal has 2 types: passive and action. <br />
67
+ Passive modals are persistent until dismissed in one of the ways mentioned above. <br />
68
+ Action modals must have actions and are dismissed when the user clicks on one of the actions (backdrop close is also optional). <br />
69
+
70
+ ```tsx
71
+ <Dialog isOpen={true} onClose={close} type="passive" title="Title area">
72
+ Lorem Ipsum is simply dummy text of the a printing and typesetting industry
73
+ </Dialog>
74
+ <Dialog isOpen={true} onClose={close} type="action" title="Title area" actions={actionsChildren}>
75
+ Lorem Ipsum is simply dummy text of the a printing and typesetting industry
76
+ </Dialog>
77
+
78
+ ```
79
+
80
+ ### NonModal
81
+
82
+ The nonModal prop renders the Dialog as a non-modal Dialog. <br />
83
+ Non-modal Dialogs provide non-critical information and do not block the user's interaction with the rest of the application. <br />
84
+ Non-modal Dialogs have an action type only. <br />
85
+
86
+ ```tsx
87
+ <Dialog
88
+ isOpen={true}
89
+ onClose={close}
90
+ nonModal
91
+ type="action"
92
+ title="Title area"
93
+ actions={actionsChildren}
94
+ >
95
+ Lorem Ipsum is simply dummy text of the a printing and typesetting industry
96
+ </Dialog>
97
+ ```
98
+
99
+ ### Title(Title, titleIcon, titleVariant)
100
+
101
+ The `title` prop sets the title of the Dialog. <br />
102
+ The `titleIcon` prop sets the icon of the title. <br />
103
+ The `titleVariant` prop sets the variant of the title icon. <br />
104
+
105
+ ```tsx
106
+ <Dialog
107
+ isOpen={true}
108
+ onClose={close}
109
+ type="passive"
110
+ title="Title area"
111
+ titleIcon={<Error color="error" variant="filled" />}
112
+ titleVariant="error"
113
+ >
114
+ Lorem Ipsum is simply dummy text of the a printing and typesetting industry
115
+ </Dialog>
116
+ ```
117
+
118
+ ### Children
119
+
120
+ The `children` prop sets the content of the Dialog. <br />
121
+ You can pass any component to the children prop.
122
+
123
+ ```tsx
124
+ <Dialog isOpen={true} onClose={close} type="passive" title="Title area">
125
+ Lorem Ipsum is simply dummy text of the a printing and typesetting industry
126
+ </Dialog>
127
+ ```
128
+
129
+ ### Actions
130
+
131
+ The `actions` prop sets the actions of the Dialog. <br />
132
+ You can pass any component to the actions prop only when the type of the modal is action.
133
+
134
+ ```tsx
135
+ <Dialog
136
+ isOpen={true}
137
+ onClose={close}
138
+ type="action"
139
+ title="Title area"
140
+ actions={actionsChildren}
141
+ >
142
+ Lorem Ipsum is simply dummy text of the a printing and typesetting industry
143
+ </Dialog>
144
+ ```
145
+
146
+ ### Size
147
+
148
+ The Dialog has 3 sizes: `small` and `medium`.
149
+
150
+ ```tsx
151
+ <Dialog
152
+ isOpen={true}
153
+ onClose={close}
154
+ type="passive"
155
+ title="Title area"
156
+ size="small"
157
+ >
158
+ Lorem Ipsum is simply dummy text of the a printing and typesetting industry
159
+ </Dialog>
160
+
161
+ <Dialog
162
+ isOpen={true}
163
+ onClose={close}
164
+ type="passive"
165
+ title="Title area"
166
+ size="medium"
167
+ >
168
+ Lorem Ipsum is simply dummy text of the a printing and typesetting industry
169
+ </Dialog>
170
+ ```
171
+
172
+ ## Reference
173
+
174
+ - [Material-UI Dialog](https://mui.com/material-ui/react-dialog/)
175
+ - [Material-UI Dialog API](https://mui.com/material-ui/api/dialog/)
176
+ - [Lunit Design System Dialog Figma](https://www.figma.com/design/9CoirIDPof6exynJosiGXi/Design-System_2.0.0_Latest?node-id=474-56088&m=dev)
177
+
178
+ ## Support
179
+
180
+ - Github: [Create a new issue](https://github.com/lunit-io/design-system/issues/new)
181
+ - Slack: #tf_design_system