@lunit/design-system 2.0.2 → 2.2.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.
Files changed (187) hide show
  1. package/README.md +107 -7
  2. package/dist/cjs/components/Alert/index.js +1 -1
  3. package/dist/cjs/components/Alert/index.js.map +1 -1
  4. package/dist/cjs/components/Button/index.js +1 -1
  5. package/dist/cjs/components/Button/index.js.map +1 -1
  6. package/dist/cjs/components/Checkbox/index.js +1 -1
  7. package/dist/cjs/components/Checkbox/index.js.map +1 -1
  8. package/dist/cjs/components/Chip/index.js +1 -1
  9. package/dist/cjs/components/Chip/index.js.map +1 -1
  10. package/dist/cjs/components/DataTable/index.js.map +1 -1
  11. package/dist/cjs/components/DatePicker/index.js.map +1 -1
  12. package/dist/cjs/components/Dialog/index.js +1 -1
  13. package/dist/cjs/components/Dialog/index.js.map +1 -1
  14. package/dist/cjs/components/Dropdown/index.js +1 -1
  15. package/dist/cjs/components/Dropdown/index.js.map +1 -1
  16. package/dist/cjs/components/FormLabel/index.js +1 -1
  17. package/dist/cjs/components/FormLabel/index.js.map +1 -1
  18. package/dist/cjs/components/Radio/index.js +1 -1
  19. package/dist/cjs/components/Radio/index.js.map +1 -1
  20. package/dist/cjs/components/RadioGroup/index.js.map +1 -1
  21. package/dist/cjs/components/TextField/index.js +1 -1
  22. package/dist/cjs/components/TextField/index.js.map +1 -1
  23. package/dist/cjs/components/Toggle/index.js +1 -1
  24. package/dist/cjs/components/Toggle/index.js.map +1 -1
  25. package/dist/cjs/components/ToggleButton/index.js +1 -1
  26. package/dist/cjs/components/ToggleButton/index.js.map +1 -1
  27. package/dist/cjs/components/Tooltip/index.js.map +1 -1
  28. package/dist/cjs/components/Typography/index.js.map +1 -1
  29. package/dist/cjs/index.js +1 -1
  30. package/dist/cjs/index.js.map +1 -1
  31. package/dist/components/Chip/Chip.styled.js +9 -16
  32. package/dist/components/Chip/Chip.styled.js.map +1 -1
  33. package/dist/components/Dialog/Dialog.js +0 -6
  34. package/dist/components/Dialog/Dialog.js.map +1 -1
  35. package/dist/components/Dropdown/Dropdown.js +37 -4
  36. package/dist/components/Dropdown/Dropdown.js.map +1 -1
  37. package/dist/components/Dropdown/Dropdown.styled.js +161 -0
  38. package/dist/components/Dropdown/Dropdown.styled.js.map +1 -0
  39. package/dist/components/Dropdown/Dropdown.types.js +2 -0
  40. package/dist/components/Dropdown/Dropdown.types.js.map +1 -0
  41. package/dist/components/Dropdown/DropdownItem.js +36 -0
  42. package/dist/components/Dropdown/DropdownItem.js.map +1 -0
  43. package/dist/components/Dropdown/index.js +1 -0
  44. package/dist/components/Dropdown/index.js.map +1 -1
  45. package/dist/components/TextField/TextField.js +1 -1
  46. package/dist/components/TextField/TextField.js.map +1 -1
  47. package/dist/components/TextField/TextField.style.js +27 -3
  48. package/dist/components/TextField/TextField.style.js.map +1 -1
  49. package/dist/foundation/Typography/index.js +5 -0
  50. package/dist/foundation/Typography/index.js.map +1 -1
  51. package/dist/foundation/Typography/tokens.js +44 -0
  52. package/dist/foundation/Typography/tokens.js.map +1 -1
  53. package/dist/foundation/colors/base/blue.js +12 -10
  54. package/dist/foundation/colors/base/blue.js.map +1 -1
  55. package/dist/foundation/colors/base/green.js +11 -9
  56. package/dist/foundation/colors/base/green.js.map +1 -1
  57. package/dist/foundation/colors/base/grey.js +30 -15
  58. package/dist/foundation/colors/base/grey.js.map +1 -1
  59. package/dist/foundation/colors/base/lunitTeal.js +2 -0
  60. package/dist/foundation/colors/base/lunitTeal.js.map +1 -1
  61. package/dist/foundation/colors/base/magenta.js +3 -1
  62. package/dist/foundation/colors/base/magenta.js.map +1 -1
  63. package/dist/foundation/colors/base/orange.js +11 -9
  64. package/dist/foundation/colors/base/orange.js.map +1 -1
  65. package/dist/foundation/colors/base/purple.js +3 -1
  66. package/dist/foundation/colors/base/purple.js.map +1 -1
  67. package/dist/foundation/colors/base/red.js +5 -3
  68. package/dist/foundation/colors/base/red.js.map +1 -1
  69. package/dist/foundation/colors/base/yellow.js +12 -10
  70. package/dist/foundation/colors/base/yellow.js.map +1 -1
  71. package/dist/foundation/colors/index.js +3 -0
  72. package/dist/foundation/colors/index.js.map +1 -1
  73. package/dist/foundation/colors/token/component.js +26 -22
  74. package/dist/foundation/colors/token/component.js.map +1 -1
  75. package/dist/foundation/colors/token/core.js +21 -0
  76. package/dist/foundation/colors/token/core.js.map +1 -1
  77. package/dist/index.js +1 -1
  78. package/dist/index.js.map +1 -1
  79. package/dist/types/components/Button/Button.styled.d.ts +35 -50
  80. package/dist/types/components/Chip/Chip.styled.d.ts +4 -76
  81. package/dist/types/components/Chip/Chip.types.d.ts +1 -1
  82. package/dist/types/components/Dialog/Dialog.d.ts +0 -3
  83. package/dist/types/components/Dropdown/Dropdown.d.ts +3 -1
  84. package/dist/types/components/Dropdown/Dropdown.styled.d.ts +7 -0
  85. package/dist/types/components/Dropdown/Dropdown.types.d.ts +11 -0
  86. package/dist/types/components/Dropdown/DropdownItem.d.ts +13 -0
  87. package/dist/types/components/Dropdown/index.d.ts +2 -0
  88. package/dist/types/components/TextField/TextField.types.d.ts +1 -1
  89. package/dist/types/components/TextField/TextFieldIcon.d.ts +1 -1
  90. package/dist/types/components/ToggleButton/ToggleButton.styled.d.ts +1 -32
  91. package/dist/types/components/Typography/Typography.d.ts +1 -1
  92. package/dist/types/foundation/Typography/index.d.ts +21 -1
  93. package/dist/types/foundation/Typography/tokens.d.ts +15 -0
  94. package/dist/types/foundation/colors/base/blue.d.ts +2 -0
  95. package/dist/types/foundation/colors/base/green.d.ts +2 -0
  96. package/dist/types/foundation/colors/base/grey.d.ts +15 -0
  97. package/dist/types/foundation/colors/base/lunitTeal.d.ts +2 -0
  98. package/dist/types/foundation/colors/base/magenta.d.ts +2 -0
  99. package/dist/types/foundation/colors/base/orange.d.ts +2 -0
  100. package/dist/types/foundation/colors/base/purple.d.ts +2 -0
  101. package/dist/types/foundation/colors/base/red.d.ts +2 -0
  102. package/dist/types/foundation/colors/base/yellow.d.ts +2 -0
  103. package/dist/types/foundation/colors/index.d.ts +3 -0
  104. package/dist/types/foundation/colors/types.d.ts +3 -0
  105. package/dist/types/foundation/index.d.ts +3 -0
  106. package/dist/types/index.d.ts +1 -1
  107. package/package.json +20 -22
  108. package/src/components/Chip/Chip.styled.ts +9 -16
  109. package/src/components/Chip/Chip.types.ts +2 -0
  110. package/src/components/Dialog/Dialog.tsx +0 -8
  111. package/src/components/Dropdown/Dropdown.styled.tsx +170 -0
  112. package/src/components/Dropdown/Dropdown.tsx +59 -8
  113. package/src/components/Dropdown/Dropdown.types.ts +17 -0
  114. package/src/components/Dropdown/DropdownItem.tsx +107 -0
  115. package/src/components/Dropdown/index.ts +6 -0
  116. package/src/components/TextField/TextField.style.ts +28 -3
  117. package/src/components/TextField/TextField.tsx +1 -7
  118. package/src/components/TextField/TextField.types.ts +2 -0
  119. package/src/components/TextField/TextFieldIcon.tsx +1 -1
  120. package/src/foundation/Typography/index.ts +10 -0
  121. package/src/foundation/Typography/tokens.ts +45 -0
  122. package/src/foundation/colors/base/blue.ts +12 -10
  123. package/src/foundation/colors/base/green.ts +11 -9
  124. package/src/foundation/colors/base/grey.ts +30 -15
  125. package/src/foundation/colors/base/lunitTeal.ts +2 -0
  126. package/src/foundation/colors/base/magenta.ts +3 -1
  127. package/src/foundation/colors/base/orange.ts +11 -9
  128. package/src/foundation/colors/base/purple.ts +3 -1
  129. package/src/foundation/colors/base/red.ts +5 -3
  130. package/src/foundation/colors/base/yellow.ts +12 -10
  131. package/src/foundation/colors/index.ts +3 -0
  132. package/src/foundation/colors/token/component.ts +26 -22
  133. package/src/foundation/colors/token/core.ts +21 -0
  134. package/src/foundation/colors/types.ts +3 -0
  135. package/src/index.ts +6 -1
  136. package/src/stories/GettingStarted.mdx +10 -16
  137. package/src/stories/components/Alert/Alert.stories.tsx +3 -3
  138. package/src/stories/components/Button/BasicButton.stories.tsx +2 -2
  139. package/src/stories/components/Button/ButtonDocs.mdx +1 -1
  140. package/src/stories/components/Button/Color.stories.tsx +2 -2
  141. package/src/stories/components/Button/IconButton.stories.tsx +2 -2
  142. package/src/stories/components/Button/Kind.stories.tsx +2 -2
  143. package/src/stories/components/CheckBox/BasicCheckbox.stories.tsx +2 -2
  144. package/src/stories/components/CheckBox/CheckboxDocs.mdx +1 -1
  145. package/src/stories/components/Chip/Chip.stories.tsx +20 -2
  146. package/src/stories/components/Chip/ChipDocs.mdx +21 -1
  147. package/src/stories/components/DataTable/DataTable.stories.tsx +1 -1
  148. package/src/stories/components/DatePicker/DatePicker.stories.tsx +1 -1
  149. package/src/stories/components/Dialog/Dialog.stories.tsx +19 -8
  150. package/src/stories/components/Dialog/DialogDocs.mdx +3 -11
  151. package/src/stories/components/Dropdown/Dropdown.stories.tsx +299 -10
  152. package/src/stories/components/Dropdown/DropdownExamples.stories.tsx +221 -0
  153. package/src/stories/components/Dropdown/DropdownItem.stories.tsx +360 -0
  154. package/src/stories/components/SelectControl/RadioGroup.stories.tsx +1 -1
  155. package/src/stories/components/SelectControl/RadioStatus.stories.tsx +1 -1
  156. package/src/stories/components/SelectControl/Toggle.stories.tsx +2 -2
  157. package/src/stories/components/TextField/BasicTextField.stories.tsx +37 -16
  158. package/src/stories/components/TextField/TextFieldDocs.mdx +13 -1
  159. package/src/stories/components/TextField/TextFieldMulti.stories.tsx +8 -11
  160. package/src/stories/components/TextField/TextFieldSingle.stories.tsx +8 -11
  161. package/src/stories/components/TextField/TextFieldSize.stories.tsx +7 -8
  162. package/src/stories/components/Toast/Toast.stories.tsx +8 -3
  163. package/src/stories/components/ToggleButton/Basic.stories.tsx +152 -113
  164. package/src/stories/components/ToggleButton/ToggleButtonDocs.mdx +1 -1
  165. package/src/stories/components/ToggleButton/ToggleButtonKind.stories.tsx +5 -5
  166. package/src/stories/components/ToggleButton/WithIcon.stories.tsx +2 -2
  167. package/src/stories/components/Tooltip/Tooltip.stories.tsx +1 -1
  168. package/src/stories/foundation/Elevation/Elevation.stories.tsx +1 -20
  169. package/src/stories/foundation/Typography/Typography.mdx +1 -1
  170. package/src/stories/foundation/Typography/Typography.stories.tsx +14 -1
  171. package/src/stories/foundation/Typography/const.ts +6 -1
  172. package/src/stories/foundation/colors/Colors.stories.tsx +2 -2
  173. package/src/stories/foundation/colors/Docs.mdx +1 -1
  174. package/src/stories/foundation/colors/Mui.stories.tsx +1 -1
  175. package/src/stories/foundation/colors/Token.inComponent.stories.tsx +1 -1
  176. package/src/stories/foundation/colors/TokenPaletteTable.stories.tsx +1 -1
  177. package/src/stories/foundation/colors/TokenPaletteTable.tsx +19 -1
  178. package/tsconfig.json +0 -1
  179. package/dist/cjs/components/Modal/index.js +0 -2
  180. package/dist/cjs/components/Modal/index.js.map +0 -1
  181. package/dist/components/Modal/Modal.js +0 -7
  182. package/dist/components/Modal/Modal.js.map +0 -1
  183. package/dist/components/Modal/index.js +0 -2
  184. package/dist/components/Modal/index.js.map +0 -1
  185. package/dist/types/components/Modal/Modal.d.ts +0 -2
  186. package/dist/types/components/Modal/index.d.ts +0 -1
  187. package/src/stories/components/ToggleButton/Group.stories.tsx +0 -221
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from "react";
2
- import { StoryFn, Meta } from "@storybook/react";
2
+ import { StoryFn, Meta } from "@storybook/react-webpack5";
3
3
  import {
4
4
  Alert,
5
5
  Box,
@@ -13,8 +13,6 @@ import {
13
13
  TextField,
14
14
  Tooltip,
15
15
  } from "@mui/material";
16
- import { DatePicker, LocalizationProvider } from "@mui/x-date-pickers";
17
- import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
18
16
  import { Dayjs } from "dayjs";
19
17
  import { Container, Title } from "./styled";
20
18
 
@@ -96,23 +94,6 @@ const Elevation = ({ surface, isBase = false }: ElevationProps) => {
96
94
  </Select>
97
95
  </Container>
98
96
 
99
- <Title>Date Picker</Title>
100
- <Container>
101
- <LocalizationProvider dateAdapter={AdapterDayjs}>
102
- <DatePicker
103
- label="Basic example"
104
- value={value}
105
- onChange={(newValue) => {
106
- setValue(newValue);
107
- }}
108
- renderInput={(params) => <TextField {...params} />}
109
- PaperProps={{
110
- className: surface,
111
- }}
112
- />
113
- </LocalizationProvider>
114
- </Container>
115
-
116
97
  <Title>Alert</Title>
117
98
  <Container>
118
99
  <Alert sx={{ flex: 1 }}>
@@ -1,4 +1,4 @@
1
- import { Meta, Canvas, Story } from "@storybook/blocks";
1
+ import { Meta, Canvas, Story } from "@storybook/addon-docs/blocks";
2
2
  import * as TypographyStories from "./Typography.stories";
3
3
 
4
4
  import Typography from "@/components/Typography";
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
 
3
- import { StoryFn } from "@storybook/react";
3
+ import { StoryFn } from "@storybook/react-webpack5";
4
4
  import { Box } from "@mui/material";
5
5
  import { styled } from "@mui/material/styles";
6
6
 
@@ -29,6 +29,19 @@ export const AllVariants = () => (
29
29
  }
30
30
  variants={variants.body}
31
31
  />
32
+ <TypographyGroup
33
+ heading="Small Body Variation"
34
+ dummy={
35
+ <>
36
+ AI will be the new standard of care. 123456789
37
+ <br />
38
+ By Lunit. With AI, we aim to make data-driven medicine
39
+ <br />
40
+ the new standard of care.
41
+ </>
42
+ }
43
+ variants={variants.smallBody}
44
+ />
32
45
  <TypographyGroup
33
46
  heading="etc"
34
47
  dummy="NEWS & UPDATE 71456"
@@ -13,13 +13,18 @@ const body = [
13
13
  "body2_14_regular",
14
14
  "body3_12_semibold",
15
15
  "body3_12_regular",
16
+ "body_m2",
17
+ "body_reg6",
18
+ "body_reg8",
16
19
  ] as const;
20
+ const smallBody = ["small_body_sb1", "small_body_m2"] as const;
17
21
  const etc = ["button1", "button2", "caption", "overline"] as const;
18
22
 
19
23
  export const variants = {
20
24
  headline,
21
25
  body,
26
+ smallBody,
22
27
  etc,
23
28
  };
24
29
 
25
- export const variantArray = [...headline, ...body, ...etc];
30
+ export const variantArray = [...headline, ...body, ...smallBody, ...etc];
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { StoryFn, Meta } from "@storybook/react";
2
+ import { StoryFn, Meta } from "@storybook/react-webpack5";
3
3
  import { Typography, useTheme } from "@mui/material";
4
4
  import { Color, ColorContainer, Container, PaletteContainer } from "./styled";
5
5
  import map from "lodash/map";
@@ -44,7 +44,7 @@ const BaseColors = () => {
44
44
  ))}
45
45
  </PaletteContainer>
46
46
  </div>
47
- )
47
+ ),
48
48
  )}
49
49
  </Container>
50
50
  );
@@ -1,4 +1,4 @@
1
- import { Canvas, Meta } from "@storybook/blocks";
1
+ import { Canvas, Meta } from "@storybook/addon-docs/blocks";
2
2
 
3
3
  import Box from '@mui/material/Box';
4
4
  import Grid from '@mui/material/Grid';
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { StoryFn, Meta } from "@storybook/react";
2
+ import { StoryFn, Meta } from "@storybook/react-webpack5";
3
3
  import Pagination from "@mui/material/Pagination";
4
4
  import DeleteIcon from "@mui/icons-material/Delete";
5
5
 
@@ -1,5 +1,5 @@
1
1
  import React, { ReactNode } from "react";
2
- import { Meta } from "@storybook/react";
2
+ import { Meta } from "@storybook/react-webpack5";
3
3
  import { Box, styled, TextField, Typography, useTheme } from "@mui/material";
4
4
 
5
5
  export const InComponentWithStyled = () => {
@@ -1,4 +1,4 @@
1
- import { Meta } from "@storybook/react";
1
+ import { Meta } from "@storybook/react-webpack5";
2
2
  import TokenPaletteTable from "./TokenPaletteTable";
3
3
 
4
4
  export default {
@@ -78,6 +78,16 @@ const TokenPaletteTable = ({ kind }: TokenPaletteTableProps) => {
78
78
  );
79
79
  };
80
80
 
81
+ const deprecatedTokenList = [
82
+ "btn_secondary_border",
83
+ "btn_selected_secondary_bg",
84
+ "datatable_border_01",
85
+ "datatable_border_02",
86
+ "hover",
87
+ "focused",
88
+ "selected",
89
+ ];
90
+
81
91
  return (
82
92
  <TableContainer>
83
93
  <Table stickyHeader>
@@ -100,7 +110,15 @@ const TokenPaletteTable = ({ kind }: TokenPaletteTableProps) => {
100
110
  <TableRow key={paletteKey}>
101
111
  <TableCell sx={{ height: "72px" }}>
102
112
  <StyledTypography>
103
- {kind}.{paletteKey}
113
+ {kind}.{paletteKey}{" "}
114
+ {deprecatedTokenList.includes(paletteKey) && (
115
+ <Box
116
+ component="span"
117
+ sx={{ color: "red", fontWeight: "bold" }}
118
+ >
119
+ (Deprecated)
120
+ </Box>
121
+ )}
104
122
  </StyledTypography>
105
123
  </TableCell>
106
124
  <TokenPaletteCell
package/tsconfig.json CHANGED
@@ -5,7 +5,6 @@
5
5
  "jsx": "react",
6
6
  "strict": true,
7
7
  "allowSyntheticDefaultImports": true,
8
- "lib": ["es6", "dom"],
9
8
  "noImplicitThis": true,
10
9
  "strictNullChecks": true,
11
10
  "baseUrl": "./",
@@ -1,2 +0,0 @@
1
- (()=>{"use strict";var e={d:(r,t)=>{for(var o in t)e.o(t,o)&&!e.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:t[o]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{default:()=>l});const t=require("react/jsx-runtime"),o=require("@mui/material"),l=()=>(0,t.jsx)(o.Box,{children:"Modal"});module.exports=r})();
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"components/Modal/index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFV,EAAyBC,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,mCCL9D,MAAM,EAA+BC,QAAQ,qBCAvC,EAA+BA,QAAQ,iBCO7C,EAJc,KACL,SAAC,EAAAC,IAAG,oB","sources":["webpack://@lunit/design-system/webpack/bootstrap","webpack://@lunit/design-system/webpack/runtime/define property getters","webpack://@lunit/design-system/webpack/runtime/hasOwnProperty shorthand","webpack://@lunit/design-system/webpack/runtime/make namespace object","webpack://@lunit/design-system/external commonjs \"react/jsx-runtime\"","webpack://@lunit/design-system/external commonjs \"@mui/material\"","webpack://@lunit/design-system/./src/components/Modal/Modal.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react/jsx-runtime\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material\");","import React from \"react\";\nimport { Box } from \"@mui/material\";\n\nconst Modal = () => {\n return <Box>Modal</Box>;\n};\n\nexport default Modal;\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","Box"],"sourceRoot":""}
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Box } from "@mui/material";
3
- const Modal = () => {
4
- return _jsx(Box, { children: "Modal" });
5
- };
6
- export default Modal;
7
- //# sourceMappingURL=Modal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,MAAM,KAAK,GAAG,GAAG,EAAE;IACjB,OAAO,KAAC,GAAG,wBAAY,CAAC;AAC1B,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -1,2 +0,0 @@
1
- export { default } from "./Modal";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC"}
@@ -1,2 +0,0 @@
1
- declare const Modal: () => import("react/jsx-runtime").JSX.Element;
2
- export default Modal;
@@ -1 +0,0 @@
1
- export { default } from "./Modal";
@@ -1,221 +0,0 @@
1
- import React from "react";
2
- import { action } from "@storybook/addon-actions";
3
-
4
- import ToggleButton from "@/components/ToggleButton";
5
- import ToggleButtonGroup from "@/components/ToggleButtonGroup";
6
-
7
- import type { StoryFn, Meta } from "@storybook/react";
8
-
9
- export default {
10
- title: "Components/ToggleButton",
11
- component: ToggleButton,
12
- args: {
13
- children: "Text",
14
- kind: "contained",
15
- color: "primary",
16
- selectedColor: "primary",
17
- size: "small",
18
- disabled: false,
19
- },
20
- argTypes: {
21
- icon: {
22
- control: false,
23
- description: `Use this prop when you want to add icon.
24
- \n It is added to the left of the text criteria`,
25
- table: {
26
- defaultValue: { summary: "undefined" },
27
- type: { summary: "React.ReactNode" },
28
- },
29
- },
30
- value: {
31
- control: false,
32
- table: { type: { summary: "any" } },
33
- },
34
- selected: {
35
- control: false,
36
- table: {
37
- defaultValue: { summary: "false" },
38
- },
39
- },
40
- selectedColor: {
41
- control: {
42
- type: "radio",
43
- },
44
- options: ["primary", "secondary"],
45
- description:
46
- "The color of the button when it is in an select state. It has nothing to do with active button",
47
- table: {
48
- defaultValue: { summary: "primary" },
49
- },
50
- },
51
- color: {
52
- control: {
53
- type: "radio",
54
- },
55
- options: ["primary", "secondary"],
56
- description: "Button has three Kinds Contained, Ghost",
57
- table: {
58
- defaultValue: { summary: "primary" },
59
- },
60
- },
61
- kind: {
62
- control: {
63
- type: "radio",
64
- },
65
- options: ["contained", "outlined", "ghost"],
66
- table: {
67
- defaultValue: { summary: "contained" },
68
- },
69
- },
70
- children: {
71
- type: "string",
72
- },
73
- disabled: {
74
- control: {
75
- type: "boolean",
76
- },
77
- table: {
78
- defaultValue: { summary: "false" },
79
- },
80
- },
81
- size: {
82
- control: {
83
- type: "radio",
84
- },
85
- options: ["small", "medium", "large"],
86
- table: {
87
- defaultValue: { summary: "small" },
88
- },
89
- },
90
- onChange: {
91
- type: "function",
92
- control: false,
93
- options: ["function", undefined],
94
- mapping: {
95
- function: action("onChange"),
96
- undefined: undefined,
97
- },
98
- },
99
- onClick: {
100
- type: "function",
101
- control: {
102
- type: "radio",
103
- },
104
- options: ["function", undefined],
105
- mapping: {
106
- function: action("onClick"),
107
- undefined: undefined,
108
- },
109
- description:
110
- "It is a callback function that is called when the button is clicked.",
111
- },
112
- },
113
- parameters: {
114
- controls: {
115
- include: [
116
- "value",
117
- "kind",
118
- "selectedColor",
119
- "onClick",
120
- "children",
121
- "disabled",
122
- "size",
123
- "selected",
124
- "color",
125
- "onChange",
126
- "icon",
127
- ],
128
- },
129
- docs: {
130
- description: {
131
- component: `A Toggle Button can be used to group related options. please
132
- see [Material-UI Toggle Button](https://mui.com/material-ui/react-toggle-button/).`,
133
- },
134
- },
135
- },
136
- } as Meta<typeof ToggleButton>;
137
-
138
- const GroupTemplate: StoryFn<typeof ToggleButton> = (arg) => {
139
- const [alignment, setAlignment] = React.useState<string | null>("left");
140
-
141
- const handleAlignment = (
142
- event: React.MouseEvent<HTMLElement>,
143
- newAlignment: string | null
144
- ) => {
145
- setAlignment(newAlignment);
146
- };
147
-
148
- return (
149
- <ToggleButtonGroup
150
- value={alignment}
151
- exclusive
152
- onChange={handleAlignment}
153
- aria-label="text alignment"
154
- sx={{
155
- "& button": {
156
- marginRight: "7px",
157
- },
158
- }}
159
- >
160
- <ToggleButton {...arg} value="left">
161
- left
162
- </ToggleButton>
163
- <ToggleButton {...arg} value="center">
164
- center
165
- </ToggleButton>
166
- <ToggleButton {...arg} value="right">
167
- right
168
- </ToggleButton>
169
- <ToggleButton {...arg} value="justify" disabled>
170
- justify
171
- </ToggleButton>
172
- </ToggleButtonGroup>
173
- );
174
- };
175
-
176
- export const Group = {
177
- render: GroupTemplate,
178
- name: "Group",
179
- };
180
-
181
- const GroupMultipleTemplate: StoryFn<typeof ToggleButton> = (arg) => {
182
- const [alignments, setAlignments] = React.useState(() => ["left", "center"]);
183
-
184
- const handleAlignments = (
185
- event: React.MouseEvent<HTMLElement>,
186
- newAlignment: string[]
187
- ) => {
188
- setAlignments(newAlignment);
189
- };
190
-
191
- return (
192
- <ToggleButtonGroup
193
- value={alignments}
194
- onChange={handleAlignments}
195
- aria-label="text alignment"
196
- sx={{
197
- "& button": {
198
- marginRight: "7px",
199
- },
200
- }}
201
- >
202
- <ToggleButton {...arg} value="left">
203
- left
204
- </ToggleButton>
205
- <ToggleButton {...arg} value="center">
206
- center
207
- </ToggleButton>
208
- <ToggleButton {...arg} value="right">
209
- right
210
- </ToggleButton>
211
- <ToggleButton {...arg} value="justify" disabled>
212
- justify
213
- </ToggleButton>
214
- </ToggleButtonGroup>
215
- );
216
- };
217
-
218
- export const GroupMultiple = {
219
- render: GroupMultipleTemplate,
220
- name: "Group: Multiple selection",
221
- };