@twreporter/react-typescript-components 0.1.0-beta.5 → 0.1.0-beta.7

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 (174) hide show
  1. package/README.md +11 -1
  2. package/lib/button/components/text-button/index.d.mts +24 -0
  3. package/lib/button/components/text-button/index.d.ts +24 -0
  4. package/lib/button/components/text-button/index.js +202 -0
  5. package/lib/button/components/text-button/index.js.map +1 -0
  6. package/lib/button/components/text-button/index.mjs +8 -0
  7. package/lib/button/components/text-button/index.mjs.map +1 -0
  8. package/lib/button/components/text-button/theme.d.mts +11 -0
  9. package/lib/button/components/text-button/theme.d.ts +11 -0
  10. package/lib/button/components/text-button/theme.js +65 -0
  11. package/lib/button/components/text-button/theme.js.map +1 -0
  12. package/lib/button/components/text-button/theme.mjs +5 -0
  13. package/lib/button/components/text-button/theme.mjs.map +1 -0
  14. package/lib/button/constant.d.mts +11 -0
  15. package/lib/button/constant.d.ts +11 -0
  16. package/lib/button/constant.js +13 -0
  17. package/lib/button/constant.js.map +1 -0
  18. package/lib/button/constant.mjs +3 -0
  19. package/lib/button/constant.mjs.map +1 -0
  20. package/lib/button/enum.d.mts +11 -0
  21. package/lib/button/enum.d.ts +11 -0
  22. package/lib/button/enum.js +19 -0
  23. package/lib/button/enum.js.map +1 -0
  24. package/lib/button/enum.mjs +3 -0
  25. package/lib/button/enum.mjs.map +1 -0
  26. package/lib/button/index.d.mts +26 -0
  27. package/lib/button/index.d.ts +26 -0
  28. package/lib/button/index.js +208 -0
  29. package/lib/button/index.js.map +1 -0
  30. package/lib/button/index.mjs +9 -0
  31. package/lib/button/index.mjs.map +1 -0
  32. package/lib/button/stories/text-button.stories.d.mts +55 -0
  33. package/lib/button/stories/text-button.stories.d.ts +55 -0
  34. package/lib/button/stories/text-button.stories.js +252 -0
  35. package/lib/button/stories/text-button.stories.js.map +1 -0
  36. package/lib/button/stories/text-button.stories.mjs +35 -0
  37. package/lib/button/stories/text-button.stories.mjs.map +1 -0
  38. package/lib/{chunk-3B7LTZRJ.mjs → chunk-6DXA3EX7.mjs} +8 -6
  39. package/lib/chunk-6DXA3EX7.mjs.map +1 -0
  40. package/lib/chunk-7NJDHQ2X.mjs +56 -0
  41. package/lib/chunk-7NJDHQ2X.mjs.map +1 -0
  42. package/lib/chunk-ELECTE3D.mjs +8 -0
  43. package/lib/chunk-ELECTE3D.mjs.map +1 -0
  44. package/lib/chunk-FF422IYY.mjs +38 -0
  45. package/lib/chunk-FF422IYY.mjs.map +1 -0
  46. package/lib/chunk-FVKIUNIP.mjs +58 -0
  47. package/lib/chunk-FVKIUNIP.mjs.map +1 -0
  48. package/lib/chunk-GQWO45DN.mjs +32 -0
  49. package/lib/chunk-GQWO45DN.mjs.map +1 -0
  50. package/lib/chunk-JB4TYHDE.mjs +11 -0
  51. package/lib/chunk-JB4TYHDE.mjs.map +1 -0
  52. package/lib/chunk-JFT6JILC.mjs +12 -0
  53. package/lib/chunk-JFT6JILC.mjs.map +1 -0
  54. package/lib/chunk-QOLETTSG.mjs +28 -0
  55. package/lib/chunk-QOLETTSG.mjs.map +1 -0
  56. package/lib/chunk-U22UKMAJ.mjs +84 -0
  57. package/lib/chunk-U22UKMAJ.mjs.map +1 -0
  58. package/lib/chunk-URJXIWFX.mjs +16 -0
  59. package/lib/chunk-URJXIWFX.mjs.map +1 -0
  60. package/lib/chunk-X2UWIBNH.mjs +16 -0
  61. package/lib/chunk-X2UWIBNH.mjs.map +1 -0
  62. package/lib/chunk-XO7SDD7W.mjs +17 -0
  63. package/lib/chunk-XO7SDD7W.mjs.map +1 -0
  64. package/lib/chunk-ZALXWB2J.mjs +27 -0
  65. package/lib/chunk-ZALXWB2J.mjs.map +1 -0
  66. package/lib/customized-link/external-link.d.mts +7 -0
  67. package/lib/customized-link/external-link.d.ts +7 -0
  68. package/lib/customized-link/external-link.js +18 -0
  69. package/lib/customized-link/external-link.js.map +1 -0
  70. package/lib/customized-link/external-link.mjs +3 -0
  71. package/lib/customized-link/external-link.mjs.map +1 -0
  72. package/lib/customized-link/index.d.mts +11 -0
  73. package/lib/customized-link/index.d.ts +11 -0
  74. package/lib/customized-link/index.js +42 -0
  75. package/lib/customized-link/index.js.map +1 -0
  76. package/lib/customized-link/index.mjs +5 -0
  77. package/lib/customized-link/index.mjs.map +1 -0
  78. package/lib/customized-link/internal-link.d.mts +7 -0
  79. package/lib/customized-link/internal-link.d.ts +7 -0
  80. package/lib/customized-link/internal-link.js +22 -0
  81. package/lib/customized-link/internal-link.js.map +1 -0
  82. package/lib/customized-link/internal-link.mjs +3 -0
  83. package/lib/customized-link/internal-link.mjs.map +1 -0
  84. package/lib/customized-link/type.d.mts +9 -0
  85. package/lib/customized-link/type.d.ts +9 -0
  86. package/lib/customized-link/type.js +4 -0
  87. package/lib/customized-link/type.js.map +1 -0
  88. package/lib/customized-link/type.mjs +3 -0
  89. package/lib/customized-link/type.mjs.map +1 -0
  90. package/lib/storybook/utils/get-enum-arg.d.mts +19 -0
  91. package/lib/storybook/utils/get-enum-arg.d.ts +19 -0
  92. package/lib/storybook/utils/get-enum-arg.js +31 -0
  93. package/lib/storybook/utils/get-enum-arg.js.map +1 -0
  94. package/lib/storybook/utils/get-enum-arg.mjs +3 -0
  95. package/lib/storybook/utils/get-enum-arg.mjs.map +1 -0
  96. package/lib/styles.css +199 -2
  97. package/lib/styles.css.map +1 -1
  98. package/lib/text/heading.d.mts +8 -8
  99. package/lib/text/heading.d.ts +8 -8
  100. package/lib/text/paragraph.d.mts +6 -6
  101. package/lib/text/paragraph.d.ts +6 -6
  102. package/lib/text/stories/heading.stories.d.mts +35 -0
  103. package/lib/text/stories/heading.stories.d.ts +35 -0
  104. package/lib/text/stories/heading.stories.js +131 -0
  105. package/lib/text/stories/heading.stories.js.map +1 -0
  106. package/lib/text/stories/heading.stories.mjs +50 -0
  107. package/lib/text/stories/heading.stories.mjs.map +1 -0
  108. package/lib/text/stories/paragraph.stories.d.mts +33 -0
  109. package/lib/text/stories/paragraph.stories.d.ts +33 -0
  110. package/lib/text/stories/paragraph.stories.js +108 -0
  111. package/lib/text/stories/paragraph.stories.js.map +1 -0
  112. package/lib/text/stories/paragraph.stories.mjs +40 -0
  113. package/lib/text/stories/paragraph.stories.mjs.map +1 -0
  114. package/lib/title-bar/components/title-tab/hook.d.mts +5 -0
  115. package/lib/title-bar/components/title-tab/hook.d.ts +5 -0
  116. package/lib/title-bar/components/title-tab/hook.js +34 -0
  117. package/lib/title-bar/components/title-tab/hook.js.map +1 -0
  118. package/lib/title-bar/components/title-tab/hook.mjs +3 -0
  119. package/lib/title-bar/components/title-tab/hook.mjs.map +1 -0
  120. package/lib/title-bar/components/title-tab/index.d.mts +11 -0
  121. package/lib/title-bar/components/title-tab/index.d.ts +11 -0
  122. package/lib/title-bar/components/title-tab/index.js +367 -0
  123. package/lib/title-bar/components/title-tab/index.js.map +1 -0
  124. package/lib/title-bar/components/title-tab/index.mjs +16 -0
  125. package/lib/title-bar/components/title-tab/index.mjs.map +1 -0
  126. package/lib/title-bar/components/title-tab/tab-item.d.mts +10 -0
  127. package/lib/title-bar/components/title-tab/tab-item.d.ts +10 -0
  128. package/lib/title-bar/components/title-tab/tab-item.js +250 -0
  129. package/lib/title-bar/components/title-tab/tab-item.js.map +1 -0
  130. package/lib/title-bar/components/title-tab/tab-item.mjs +13 -0
  131. package/lib/title-bar/components/title-tab/tab-item.mjs.map +1 -0
  132. package/lib/title-bar/components/title-tab/type.d.mts +8 -0
  133. package/lib/title-bar/components/title-tab/type.d.ts +8 -0
  134. package/lib/title-bar/components/title-tab/type.js +4 -0
  135. package/lib/title-bar/components/title-tab/type.js.map +1 -0
  136. package/lib/title-bar/components/title-tab/type.mjs +3 -0
  137. package/lib/title-bar/components/title-tab/type.mjs.map +1 -0
  138. package/lib/title-bar/components/title1.d.mts +10 -0
  139. package/lib/title-bar/components/title1.d.ts +10 -0
  140. package/lib/title-bar/components/title1.js +123 -0
  141. package/lib/title-bar/components/title1.js.map +1 -0
  142. package/lib/title-bar/components/title1.mjs +6 -0
  143. package/lib/title-bar/components/title1.mjs.map +1 -0
  144. package/lib/title-bar/components/title2.d.mts +3 -3
  145. package/lib/title-bar/components/title2.d.ts +3 -3
  146. package/lib/title-bar/components/title2.js +6 -4
  147. package/lib/title-bar/components/title2.js.map +1 -1
  148. package/lib/title-bar/components/title2.mjs +1 -1
  149. package/lib/title-bar/index.d.mts +15 -2
  150. package/lib/title-bar/index.d.ts +15 -2
  151. package/lib/title-bar/index.js +296 -8
  152. package/lib/title-bar/index.js.map +1 -1
  153. package/lib/title-bar/index.mjs +19 -3
  154. package/lib/title-bar/index.mjs.map +1 -1
  155. package/lib/title-bar/stories/title-tab.stories.d.mts +17 -0
  156. package/lib/title-bar/stories/title-tab.stories.d.ts +17 -0
  157. package/lib/title-bar/stories/title-tab.stories.js +391 -0
  158. package/lib/title-bar/stories/title-tab.stories.js.map +1 -0
  159. package/lib/title-bar/stories/title-tab.stories.mjs +39 -0
  160. package/lib/title-bar/stories/title-tab.stories.mjs.map +1 -0
  161. package/lib/title-bar/stories/title1.stories.d.mts +18 -0
  162. package/lib/title-bar/stories/title1.stories.d.ts +18 -0
  163. package/lib/title-bar/stories/title1.stories.js +155 -0
  164. package/lib/title-bar/stories/title1.stories.js.map +1 -0
  165. package/lib/title-bar/stories/title1.stories.mjs +35 -0
  166. package/lib/title-bar/stories/title1.stories.mjs.map +1 -0
  167. package/lib/title-bar/stories/title2.stories.d.mts +18 -0
  168. package/lib/title-bar/stories/title2.stories.d.ts +18 -0
  169. package/lib/title-bar/stories/title2.stories.js +304 -0
  170. package/lib/title-bar/stories/title2.stories.js.map +1 -0
  171. package/lib/title-bar/stories/title2.stories.mjs +38 -0
  172. package/lib/title-bar/stories/title2.stories.mjs.map +1 -0
  173. package/package.json +12 -5
  174. package/lib/chunk-3B7LTZRJ.mjs.map +0 -1
@@ -1,28 +1,28 @@
1
- import React__default from 'react';
1
+ import react__default from 'react';
2
2
  import { Type, TYPE } from './enum/index.js';
3
3
  import '../types/index.js';
4
4
 
5
- type HeadingProps = React__default.HTMLAttributes<HTMLHeadingElement> & {
5
+ type HeadingProps = react__default.HTMLAttributes<HTMLHeadingElement> & {
6
6
  text?: string;
7
7
  type?: Type;
8
8
  className?: string;
9
9
  };
10
- declare const H1: React__default.FC<HeadingProps> & {
10
+ declare const H1: react__default.FC<HeadingProps> & {
11
11
  Type: typeof TYPE;
12
12
  };
13
- declare const H2: React__default.FC<HeadingProps> & {
13
+ declare const H2: react__default.FC<HeadingProps> & {
14
14
  Type: typeof TYPE;
15
15
  };
16
- declare const H3: React__default.FC<HeadingProps> & {
16
+ declare const H3: react__default.FC<HeadingProps> & {
17
17
  Type: typeof TYPE;
18
18
  };
19
- declare const H4: React__default.FC<HeadingProps> & {
19
+ declare const H4: react__default.FC<HeadingProps> & {
20
20
  Type: typeof TYPE;
21
21
  };
22
- declare const H5: React__default.FC<HeadingProps> & {
22
+ declare const H5: react__default.FC<HeadingProps> & {
23
23
  Type: typeof TYPE;
24
24
  };
25
- declare const H6: React__default.FC<HeadingProps> & {
25
+ declare const H6: react__default.FC<HeadingProps> & {
26
26
  Type: typeof TYPE;
27
27
  };
28
28
 
@@ -1,22 +1,22 @@
1
- import React__default from 'react';
1
+ import react__default from 'react';
2
2
  import { Weight, WEIGHT } from './enum/index.mjs';
3
3
  import '../types/index.mjs';
4
4
 
5
- type ParagraphProps = React__default.HTMLAttributes<HTMLParagraphElement> & {
5
+ type ParagraphProps = react__default.HTMLAttributes<HTMLParagraphElement> & {
6
6
  text?: string;
7
7
  weight?: Weight;
8
8
  className?: string;
9
9
  };
10
- declare const P1: React__default.FC<ParagraphProps> & {
10
+ declare const P1: react__default.FC<ParagraphProps> & {
11
11
  Weight: typeof WEIGHT;
12
12
  };
13
- declare const P2: React__default.FC<ParagraphProps> & {
13
+ declare const P2: react__default.FC<ParagraphProps> & {
14
14
  Weight: typeof WEIGHT;
15
15
  };
16
- declare const P3: React__default.FC<ParagraphProps> & {
16
+ declare const P3: react__default.FC<ParagraphProps> & {
17
17
  Weight: typeof WEIGHT;
18
18
  };
19
- declare const P4: React__default.FC<ParagraphProps> & {
19
+ declare const P4: react__default.FC<ParagraphProps> & {
20
20
  Weight: typeof WEIGHT;
21
21
  };
22
22
 
@@ -1,22 +1,22 @@
1
- import React__default from 'react';
1
+ import react__default from 'react';
2
2
  import { Weight, WEIGHT } from './enum/index.js';
3
3
  import '../types/index.js';
4
4
 
5
- type ParagraphProps = React__default.HTMLAttributes<HTMLParagraphElement> & {
5
+ type ParagraphProps = react__default.HTMLAttributes<HTMLParagraphElement> & {
6
6
  text?: string;
7
7
  weight?: Weight;
8
8
  className?: string;
9
9
  };
10
- declare const P1: React__default.FC<ParagraphProps> & {
10
+ declare const P1: react__default.FC<ParagraphProps> & {
11
11
  Weight: typeof WEIGHT;
12
12
  };
13
- declare const P2: React__default.FC<ParagraphProps> & {
13
+ declare const P2: react__default.FC<ParagraphProps> & {
14
14
  Weight: typeof WEIGHT;
15
15
  };
16
- declare const P3: React__default.FC<ParagraphProps> & {
16
+ declare const P3: react__default.FC<ParagraphProps> & {
17
17
  Weight: typeof WEIGHT;
18
18
  };
19
- declare const P4: React__default.FC<ParagraphProps> & {
19
+ declare const P4: react__default.FC<ParagraphProps> & {
20
20
  Weight: typeof WEIGHT;
21
21
  };
22
22
 
@@ -0,0 +1,35 @@
1
+ import { Type, TYPE } from '../enum/index.mjs';
2
+ import * as react from 'react';
3
+ import { StoryObj } from '@storybook/react-vite';
4
+ import '../../types/index.mjs';
5
+
6
+ declare const meta: {
7
+ title: string;
8
+ component: react.FC<react.HTMLAttributes<HTMLHeadingElement> & {
9
+ text?: string;
10
+ type?: Type;
11
+ className?: string;
12
+ }> & {
13
+ Type: typeof TYPE;
14
+ };
15
+ argTypes: {
16
+ type: {
17
+ defaultValue: "article" | "default";
18
+ options: string[];
19
+ mapping: Record<string, "article" | "default">;
20
+ control: {
21
+ type: "radio";
22
+ };
23
+ };
24
+ };
25
+ };
26
+
27
+ type Story = StoryObj<typeof meta>;
28
+ declare const h1: Story;
29
+ declare const h2: Story;
30
+ declare const h3: Story;
31
+ declare const h4: Story;
32
+ declare const h5: Story;
33
+ declare const h6: Story;
34
+
35
+ export { meta as default, h1, h2, h3, h4, h5, h6 };
@@ -0,0 +1,35 @@
1
+ import { Type, TYPE } from '../enum/index.js';
2
+ import * as react from 'react';
3
+ import { StoryObj } from '@storybook/react-vite';
4
+ import '../../types/index.js';
5
+
6
+ declare const meta: {
7
+ title: string;
8
+ component: react.FC<react.HTMLAttributes<HTMLHeadingElement> & {
9
+ text?: string;
10
+ type?: Type;
11
+ className?: string;
12
+ }> & {
13
+ Type: typeof TYPE;
14
+ };
15
+ argTypes: {
16
+ type: {
17
+ defaultValue: "article" | "default";
18
+ options: string[];
19
+ mapping: Record<string, "article" | "default">;
20
+ control: {
21
+ type: "radio";
22
+ };
23
+ };
24
+ };
25
+ };
26
+
27
+ type Story = StoryObj<typeof meta>;
28
+ declare const h1: Story;
29
+ declare const h2: Story;
30
+ declare const h3: Story;
31
+ declare const h4: Story;
32
+ declare const h5: Story;
33
+ declare const h6: Story;
34
+
35
+ export { meta as default, h1, h2, h3, h4, h5, h6 };
@@ -0,0 +1,131 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var clsx = require('clsx');
6
+ var React = require('react');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+
9
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
+
11
+ var clsx__default = /*#__PURE__*/_interopDefault(clsx);
12
+ var React__default = /*#__PURE__*/_interopDefault(React);
13
+
14
+ // src/storybook/utils/get-enum-arg.ts
15
+ function getRadioArgFromEnum(enumObject, defaultValue) {
16
+ const keys = Object.keys(enumObject).filter(
17
+ (key) => Number.isNaN(Number(key))
18
+ );
19
+ const mapping = {};
20
+ keys.forEach((key) => {
21
+ mapping[key] = enumObject[key];
22
+ });
23
+ const defaultKey = keys.find((key) => enumObject[key] === defaultValue) || keys[0];
24
+ return {
25
+ defaultValue: enumObject[defaultKey],
26
+ options: keys,
27
+ mapping,
28
+ control: { type: "radio" }
29
+ };
30
+ }
31
+
32
+ // src/text/enum/index.ts
33
+ var TYPE = {
34
+ default: "default",
35
+ article: "article"
36
+ };
37
+
38
+ // src/text/heading.tsx
39
+ var baseClass = "font-bold";
40
+ var variantClass = {
41
+ H1: "text-[28px] leading-[125%] tablet:text-[36px]",
42
+ H2: "text-[24px] leading-[125%] tablet:text-[32px]",
43
+ H3: "text-[22px] leading-[150%] tablet:text-[28px]",
44
+ H4: "text-[18px] leading-[150%] tablet:text-[22px]",
45
+ H5: "text-[17px] leading-[150%] tablet:text-[18px]",
46
+ H6: "text-[16px] leading-[150%] tablet:text-[16px]"
47
+ };
48
+ var HeadingVariant = (variant) => {
49
+ const Component = ({
50
+ text = "",
51
+ type = TYPE.default,
52
+ className = "",
53
+ ...props
54
+ }) => {
55
+ const htmlTag = variant.toLowerCase();
56
+ const fontFamily = type === TYPE.article ? "font-title" : "font-default";
57
+ return React__default.default.createElement(
58
+ htmlTag,
59
+ {
60
+ className: clsx__default.default(
61
+ fontFamily,
62
+ baseClass,
63
+ variantClass[variant],
64
+ className
65
+ ),
66
+ ...props
67
+ },
68
+ text
69
+ );
70
+ };
71
+ Component.displayName = variant;
72
+ Component.Type = TYPE;
73
+ return Component;
74
+ };
75
+ var H1 = HeadingVariant("H1");
76
+ var H2 = HeadingVariant("H2");
77
+ var H3 = HeadingVariant("H3");
78
+ var H4 = HeadingVariant("H4");
79
+ var H5 = HeadingVariant("H5");
80
+ var H6 = HeadingVariant("H6");
81
+ var meta = {
82
+ title: "Text/Headline",
83
+ component: H1,
84
+ argTypes: {
85
+ type: getRadioArgFromEnum(H1.Type, H1.Type.default)
86
+ }
87
+ };
88
+ var heading_stories_default = meta;
89
+ var defaultArg = {
90
+ text: "\u6A19\u984C\u300C\u6A19\u984C\u300D\uFF1A\u6A19\u984C\uFF0C\u300A\u6A19\u984C\u300B\u6A19\u984CEnglish\u6A19\u984C123\u6A19\u984C\uFF1F",
91
+ type: H1.Type.default
92
+ };
93
+ var h1 = {
94
+ args: defaultArg,
95
+ parameters: { controls: { exclude: ["className"] } }
96
+ };
97
+ var h2 = {
98
+ render: (args) => /* @__PURE__ */ jsxRuntime.jsx(H2, { ...args }),
99
+ args: defaultArg,
100
+ parameters: { controls: { exclude: ["className"] } }
101
+ };
102
+ var h3 = {
103
+ render: (args) => /* @__PURE__ */ jsxRuntime.jsx(H3, { ...args }),
104
+ args: defaultArg,
105
+ parameters: { controls: { exclude: ["className"] } }
106
+ };
107
+ var h4 = {
108
+ render: (args) => /* @__PURE__ */ jsxRuntime.jsx(H4, { ...args }),
109
+ args: defaultArg,
110
+ parameters: { controls: { exclude: ["className"] } }
111
+ };
112
+ var h5 = {
113
+ render: (args) => /* @__PURE__ */ jsxRuntime.jsx(H5, { ...args }),
114
+ args: defaultArg,
115
+ parameters: { controls: { exclude: ["className"] } }
116
+ };
117
+ var h6 = {
118
+ render: (args) => /* @__PURE__ */ jsxRuntime.jsx(H6, { ...args }),
119
+ args: defaultArg,
120
+ parameters: { controls: { exclude: ["className"] } }
121
+ };
122
+
123
+ exports.default = heading_stories_default;
124
+ exports.h1 = h1;
125
+ exports.h2 = h2;
126
+ exports.h3 = h3;
127
+ exports.h4 = h4;
128
+ exports.h5 = h5;
129
+ exports.h6 = h6;
130
+ //# sourceMappingURL=heading.stories.js.map
131
+ //# sourceMappingURL=heading.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/storybook/utils/get-enum-arg.ts","../../../src/text/enum/index.ts","../../../src/text/heading.tsx","../../../src/text/stories/heading.stories.tsx"],"names":["React","clsx","jsx"],"mappings":";;;;;;;;;;;;;;AAwBO,SAAS,mBAAA,CACd,YACA,YAAA,EAC0B;AAE1B,EAAA,MAAM,IAAA,GAAO,MAAA,CAAO,IAAA,CAAK,UAAU,CAAA,CAAE,MAAA;AAAA,IAAO,CAAC,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,CAAA;AAAA,EAChC,IAAA,EAAM,UAAA;AAAA,EACN,UAAA,EAAY,EAAE,QAAA,EAAU,EAAE,SAAS,CAAC,WAAW,GAAE;AACnD;AAEO,IAAM,EAAA,GAAY;AAAA,EACvB,QAAQ,CAAC,IAAA,qBAASA,cAAA,CAAC,EAAA,EAAA,EAAI,GAAG,IAAA,EAAM,CAAA;AAAA,EAChC,IAAA,EAAM,UAAA;AAAA,EACN,UAAA,EAAY,EAAE,QAAA,EAAU,EAAE,SAAS,CAAC,WAAW,GAAE;AACnD;AAEO,IAAM,EAAA,GAAY;AAAA,EACvB,QAAQ,CAAC,IAAA,qBAASA,cAAA,CAAC,EAAA,EAAA,EAAI,GAAG,IAAA,EAAM,CAAA;AAAA,EAChC,IAAA,EAAM,UAAA;AAAA,EACN,UAAA,EAAY,EAAE,QAAA,EAAU,EAAE,SAAS,CAAC,WAAW,GAAE;AACnD;AAEO,IAAM,EAAA,GAAY;AAAA,EACvB,QAAQ,CAAC,IAAA,qBAASA,cAAA,CAAC,EAAA,EAAA,EAAI,GAAG,IAAA,EAAM,CAAA;AAAA,EAChC,IAAA,EAAM,UAAA;AAAA,EACN,UAAA,EAAY,EAAE,QAAA,EAAU,EAAE,SAAS,CAAC,WAAW,GAAE;AACnD;AAEO,IAAM,EAAA,GAAY;AAAA,EACvB,QAAQ,CAAC,IAAA,qBAASA,cAAA,CAAC,EAAA,EAAA,EAAI,GAAG,IAAA,EAAM,CAAA;AAAA,EAChC,IAAA,EAAM,UAAA;AAAA,EACN,UAAA,EAAY,EAAE,QAAA,EAAU,EAAE,SAAS,CAAC,WAAW,GAAE;AACnD","file":"heading.stories.js","sourcesContent":["type RadioArgObject<T> = {\n defaultValue: T\n options: T[]\n control: { type: 'radio' }\n}\n\nexport function getRadioArgFromObject<T extends string | number>(\n object: Record<string, T>,\n defaultValue: T\n): RadioArgObject<T> {\n return {\n defaultValue,\n options: Object.values(object),\n control: { type: 'radio' },\n }\n}\n\ntype RadioArgEnum<E> = {\n defaultValue: E\n options: string[]\n mapping: Record<string, E>\n control: { type: 'radio' }\n}\n\nexport function getRadioArgFromEnum<E extends Record<string, string | number>>(\n enumObject: E,\n defaultValue: E[keyof E]\n): RadioArgEnum<E[keyof E]> {\n // Only keep \"real\" keys (filter numeric reverse mapping)\n const keys = Object.keys(enumObject).filter((key) =>\n Number.isNaN(Number(key))\n )\n\n const mapping: Record<string, E[keyof E]> = {}\n keys.forEach((key) => {\n mapping[key] = enumObject[key as keyof E]\n })\n\n // Find the key corresponding to the default value\n const defaultKey =\n keys.find((key) => enumObject[key as keyof E] === defaultValue) || keys[0]\n\n return {\n defaultValue: enumObject[defaultKey as keyof E],\n options: keys,\n mapping,\n control: { type: 'radio' },\n }\n}\n","import type { ValuesOf } from '../../types'\n\nexport const TYPE = {\n default: 'default',\n article: 'article',\n} as const\n\nexport type Type = ValuesOf<typeof TYPE>\n\nexport const WEIGHT = {\n extraLight: 'extra-light',\n normal: 'normal',\n bold: 'bold',\n} as const\n\nexport type Weight = ValuesOf<typeof WEIGHT>\n","import clsx from 'clsx'\nimport React from 'react'\nimport { TYPE, type Type } from './enum'\n\ntype HeadingProps = React.HTMLAttributes<HTMLHeadingElement> & {\n text?: string\n type?: Type\n className?: string\n}\n\nconst baseClass = 'font-bold'\n\nconst variantClass = {\n H1: 'text-[28px] leading-[125%] tablet:text-[36px]',\n H2: 'text-[24px] leading-[125%] tablet:text-[32px]',\n H3: 'text-[22px] leading-[150%] tablet:text-[28px]',\n H4: 'text-[18px] leading-[150%] tablet:text-[22px]',\n H5: 'text-[17px] leading-[150%] tablet:text-[18px]',\n H6: 'text-[16px] leading-[150%] tablet:text-[16px]',\n}\n\nconst HeadingVariant = (variant: keyof typeof variantClass) => {\n const Component: React.FC<HeadingProps> & { Type: typeof TYPE } = ({\n text = '',\n type = TYPE.default,\n className = '',\n ...props\n }) => {\n const htmlTag = variant.toLowerCase() // 產生 'h1', 'h2', ...\n const fontFamily = type === TYPE.article ? 'font-title' : 'font-default'\n return React.createElement(\n htmlTag,\n {\n className: clsx(\n fontFamily,\n baseClass,\n variantClass[variant],\n className\n ),\n ...props,\n },\n text\n )\n }\n Component.displayName = variant\n Component.Type = TYPE\n return Component\n}\n\nconst H1 = HeadingVariant('H1')\nconst H2 = HeadingVariant('H2')\nconst H3 = HeadingVariant('H3')\nconst H4 = HeadingVariant('H4')\nconst H5 = HeadingVariant('H5')\nconst H6 = HeadingVariant('H6')\n\nexport { H1, H2, H3, H4, H5, H6 }\n","import type { Meta, StoryObj } from '@storybook/react-vite'\n// utils\nimport { getRadioArgFromEnum } from '../../storybook/utils/get-enum-arg'\n// components\nimport { H1, H2, H3, H4, H5, H6 } from '../heading'\n\nconst meta = {\n title: 'Text/Headline',\n component: H1,\n argTypes: {\n type: getRadioArgFromEnum(H1.Type, H1.Type.default),\n },\n} satisfies Meta<typeof H1>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nconst defaultArg = {\n text: '標題「標題」:標題,《標題》標題English標題123標題?',\n type: H1.Type.default,\n}\n\nexport const h1: Story = {\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n\nexport const h2: Story = {\n render: (args) => <H2 {...args} />,\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n\nexport const h3: Story = {\n render: (args) => <H3 {...args} />,\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n\nexport const h4: Story = {\n render: (args) => <H4 {...args} />,\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n\nexport const h5: Story = {\n render: (args) => <H5 {...args} />,\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n\nexport const h6: Story = {\n render: (args) => <H6 {...args} />,\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n"]}
@@ -0,0 +1,50 @@
1
+ import { H1, H2, H3, H4, H5, H6 } from '../../chunk-JHLT5GDV.mjs';
2
+ import { getRadioArgFromEnum } from '../../chunk-QOLETTSG.mjs';
3
+ import '../../chunk-UM7RNC2Y.mjs';
4
+ import { jsx } from 'react/jsx-runtime';
5
+
6
+ var meta = {
7
+ title: "Text/Headline",
8
+ component: H1,
9
+ argTypes: {
10
+ type: getRadioArgFromEnum(H1.Type, H1.Type.default)
11
+ }
12
+ };
13
+ var heading_stories_default = meta;
14
+ var defaultArg = {
15
+ text: "\u6A19\u984C\u300C\u6A19\u984C\u300D\uFF1A\u6A19\u984C\uFF0C\u300A\u6A19\u984C\u300B\u6A19\u984CEnglish\u6A19\u984C123\u6A19\u984C\uFF1F",
16
+ type: H1.Type.default
17
+ };
18
+ var h1 = {
19
+ args: defaultArg,
20
+ parameters: { controls: { exclude: ["className"] } }
21
+ };
22
+ var h2 = {
23
+ render: (args) => /* @__PURE__ */ jsx(H2, { ...args }),
24
+ args: defaultArg,
25
+ parameters: { controls: { exclude: ["className"] } }
26
+ };
27
+ var h3 = {
28
+ render: (args) => /* @__PURE__ */ jsx(H3, { ...args }),
29
+ args: defaultArg,
30
+ parameters: { controls: { exclude: ["className"] } }
31
+ };
32
+ var h4 = {
33
+ render: (args) => /* @__PURE__ */ jsx(H4, { ...args }),
34
+ args: defaultArg,
35
+ parameters: { controls: { exclude: ["className"] } }
36
+ };
37
+ var h5 = {
38
+ render: (args) => /* @__PURE__ */ jsx(H5, { ...args }),
39
+ args: defaultArg,
40
+ parameters: { controls: { exclude: ["className"] } }
41
+ };
42
+ var h6 = {
43
+ render: (args) => /* @__PURE__ */ jsx(H6, { ...args }),
44
+ args: defaultArg,
45
+ parameters: { controls: { exclude: ["className"] } }
46
+ };
47
+
48
+ export { heading_stories_default as default, h1, h2, h3, h4, h5, h6 };
49
+ //# sourceMappingURL=heading.stories.mjs.map
50
+ //# sourceMappingURL=heading.stories.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/text/stories/heading.stories.tsx"],"names":[],"mappings":";;;;;AAMA,IAAM,IAAA,GAAO;AAAA,EACX,KAAA,EAAO,eAAA;AAAA,EACP,SAAA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AA,EAAY,EAAE,QAAA,EAAU,EAAE,SAAS,CAAC,WAAW,GAAE;AACnD;AAEO,IAAM,EAAA,GAAY;AAAA,EACvB,QAAQ,CAAC,IAAA,qBAAS,GAAA,CAAC,EAAA,EAAA,EAAI,GAAG,IAAA,EAAM,CAAA;AAAA,EAChC,IAAA,EAAM,UAAA;AAAA,EACN,UAAA,EAAY,EAAE,QAAA,EAAU,EAAE,SAAS,CAAC,WAAW,GAAE;AACnD","file":"heading.stories.mjs","sourcesContent":["import type { Meta, StoryObj } from '@storybook/react-vite'\n// utils\nimport { getRadioArgFromEnum } from '../../storybook/utils/get-enum-arg'\n// components\nimport { H1, H2, H3, H4, H5, H6 } from '../heading'\n\nconst meta = {\n title: 'Text/Headline',\n component: H1,\n argTypes: {\n type: getRadioArgFromEnum(H1.Type, H1.Type.default),\n },\n} satisfies Meta<typeof H1>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nconst defaultArg = {\n text: '標題「標題」:標題,《標題》標題English標題123標題?',\n type: H1.Type.default,\n}\n\nexport const h1: Story = {\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n\nexport const h2: Story = {\n render: (args) => <H2 {...args} />,\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n\nexport const h3: Story = {\n render: (args) => <H3 {...args} />,\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n\nexport const h4: Story = {\n render: (args) => <H4 {...args} />,\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n\nexport const h5: Story = {\n render: (args) => <H5 {...args} />,\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n\nexport const h6: Story = {\n render: (args) => <H6 {...args} />,\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n"]}
@@ -0,0 +1,33 @@
1
+ import { Weight, WEIGHT } from '../enum/index.mjs';
2
+ import * as react from 'react';
3
+ import { StoryObj } from '@storybook/react-vite';
4
+ import '../../types/index.mjs';
5
+
6
+ declare const meta: {
7
+ title: string;
8
+ component: react.FC<react.HTMLAttributes<HTMLParagraphElement> & {
9
+ text?: string;
10
+ weight?: Weight;
11
+ className?: string;
12
+ }> & {
13
+ Weight: typeof WEIGHT;
14
+ };
15
+ argTypes: {
16
+ weight: {
17
+ defaultValue: "bold" | "extra-light" | "normal";
18
+ options: string[];
19
+ mapping: Record<string, "bold" | "extra-light" | "normal">;
20
+ control: {
21
+ type: "radio";
22
+ };
23
+ };
24
+ };
25
+ };
26
+
27
+ type Story = StoryObj<typeof meta>;
28
+ declare const p1: Story;
29
+ declare const p2: Story;
30
+ declare const p3: Story;
31
+ declare const p4: Story;
32
+
33
+ export { meta as default, p1, p2, p3, p4 };
@@ -0,0 +1,33 @@
1
+ import { Weight, WEIGHT } from '../enum/index.js';
2
+ import * as react from 'react';
3
+ import { StoryObj } from '@storybook/react-vite';
4
+ import '../../types/index.js';
5
+
6
+ declare const meta: {
7
+ title: string;
8
+ component: react.FC<react.HTMLAttributes<HTMLParagraphElement> & {
9
+ text?: string;
10
+ weight?: Weight;
11
+ className?: string;
12
+ }> & {
13
+ Weight: typeof WEIGHT;
14
+ };
15
+ argTypes: {
16
+ weight: {
17
+ defaultValue: "bold" | "extra-light" | "normal";
18
+ options: string[];
19
+ mapping: Record<string, "bold" | "extra-light" | "normal">;
20
+ control: {
21
+ type: "radio";
22
+ };
23
+ };
24
+ };
25
+ };
26
+
27
+ type Story = StoryObj<typeof meta>;
28
+ declare const p1: Story;
29
+ declare const p2: Story;
30
+ declare const p3: Story;
31
+ declare const p4: Story;
32
+
33
+ export { meta as default, p1, p2, p3, p4 };
@@ -0,0 +1,108 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var clsx = require('clsx');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
+
10
+ var clsx__default = /*#__PURE__*/_interopDefault(clsx);
11
+
12
+ // src/storybook/utils/get-enum-arg.ts
13
+ function getRadioArgFromEnum(enumObject, defaultValue) {
14
+ const keys = Object.keys(enumObject).filter(
15
+ (key) => Number.isNaN(Number(key))
16
+ );
17
+ const mapping = {};
18
+ keys.forEach((key) => {
19
+ mapping[key] = enumObject[key];
20
+ });
21
+ const defaultKey = keys.find((key) => enumObject[key] === defaultValue) || keys[0];
22
+ return {
23
+ defaultValue: enumObject[defaultKey],
24
+ options: keys,
25
+ mapping,
26
+ control: { type: "radio" }
27
+ };
28
+ }
29
+
30
+ // src/text/enum/index.ts
31
+ var WEIGHT = {
32
+ extraLight: "extra-light",
33
+ normal: "normal",
34
+ bold: "bold"
35
+ };
36
+ var baseClass = "font-default leading-[150%] flex items-center m-0";
37
+ var variantClass = {
38
+ P1: "text-[16px]",
39
+ P2: "text-[14px]",
40
+ P3: "text-[12px]",
41
+ P4: "text-[10px]"
42
+ };
43
+ var ParagraphVariant = (variant) => {
44
+ const Component = ({
45
+ text = "",
46
+ weight = WEIGHT.normal,
47
+ className = "",
48
+ ...props
49
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
50
+ "p",
51
+ {
52
+ className: clsx__default.default(
53
+ baseClass,
54
+ variantClass[variant],
55
+ `font-${weight}`,
56
+ className
57
+ ),
58
+ ...props,
59
+ children: text
60
+ }
61
+ );
62
+ Component.displayName = variant;
63
+ Component.Weight = WEIGHT;
64
+ return Component;
65
+ };
66
+ var P1 = ParagraphVariant("P1");
67
+ var P2 = ParagraphVariant("P2");
68
+ var P3 = ParagraphVariant("P3");
69
+ var P4 = ParagraphVariant("P4");
70
+ var meta = {
71
+ title: "Text/Paragraph",
72
+ component: P1,
73
+ argTypes: {
74
+ weight: getRadioArgFromEnum(P1.Weight, P1.Weight.normal)
75
+ }
76
+ };
77
+ var paragraph_stories_default = meta;
78
+ var defaultArg = {
79
+ text: "\u5167\u6587\u300C\u5167\u6587\u300D\uFF1A\u5167\u6587\uFF0C\u300A\u5167\u6587\u300B\u5167\u6587English\u5167\u6587123\u5167\u6587\uFF1F",
80
+ weight: P1.Weight.normal
81
+ };
82
+ var p1 = {
83
+ args: defaultArg,
84
+ parameters: { controls: { exclude: ["className"] } }
85
+ };
86
+ var p2 = {
87
+ render: (args) => /* @__PURE__ */ jsxRuntime.jsx(P2, { ...args }),
88
+ args: defaultArg,
89
+ parameters: { controls: { exclude: ["className"] } }
90
+ };
91
+ var p3 = {
92
+ render: (args) => /* @__PURE__ */ jsxRuntime.jsx(P3, { ...args }),
93
+ args: defaultArg,
94
+ parameters: { controls: { exclude: ["className"] } }
95
+ };
96
+ var p4 = {
97
+ render: (args) => /* @__PURE__ */ jsxRuntime.jsx(P4, { ...args }),
98
+ args: defaultArg,
99
+ parameters: { controls: { exclude: ["className"] } }
100
+ };
101
+
102
+ exports.default = paragraph_stories_default;
103
+ exports.p1 = p1;
104
+ exports.p2 = p2;
105
+ exports.p3 = p3;
106
+ exports.p4 = p4;
107
+ //# sourceMappingURL=paragraph.stories.js.map
108
+ //# sourceMappingURL=paragraph.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/storybook/utils/get-enum-arg.ts","../../../src/text/enum/index.ts","../../../src/text/paragraph.tsx","../../../src/text/stories/paragraph.stories.tsx"],"names":["jsx","clsx"],"mappings":";;;;;;;;;;;;AAwBO,SAAS,mBAAA,CACd,YACA,YAAA,EAC0B;AAE1B,EAAA,MAAM,IAAA,GAAO,MAAA,CAAO,IAAA,CAAK,UAAU,CAAA,CAAE,MAAA;AAAA,IAAO,CAAC,GAAA,KAC3C,MAAA,CAAO,KAAA,CAAM,MAAA,CAAO,GAAG,CAAC;AAAA,GAC1B;AAEA,EAAA,MAAM,UAAsC,EAAC;AAC7C,EAAA,IAAA,CAAK,OAAA,CAAQ,CAAC,GAAA,KAAQ;AACpB,IAAA,OAAA,CAAQ,GAAG,CAAA,GAAI,UAAA,CAAW,GAAc,CAAA;AAAA,EAC1C,CAAC,CAAA;AAGD,EAAA,MAAM,UAAA,G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AS,CAAC,WAAW,GAAE;AACnD","file":"paragraph.stories.js","sourcesContent":["type RadioArgObject<T> = {\n defaultValue: T\n options: T[]\n control: { type: 'radio' }\n}\n\nexport function getRadioArgFromObject<T extends string | number>(\n object: Record<string, T>,\n defaultValue: T\n): RadioArgObject<T> {\n return {\n defaultValue,\n options: Object.values(object),\n control: { type: 'radio' },\n }\n}\n\ntype RadioArgEnum<E> = {\n defaultValue: E\n options: string[]\n mapping: Record<string, E>\n control: { type: 'radio' }\n}\n\nexport function getRadioArgFromEnum<E extends Record<string, string | number>>(\n enumObject: E,\n defaultValue: E[keyof E]\n): RadioArgEnum<E[keyof E]> {\n // Only keep \"real\" keys (filter numeric reverse mapping)\n const keys = Object.keys(enumObject).filter((key) =>\n Number.isNaN(Number(key))\n )\n\n const mapping: Record<string, E[keyof E]> = {}\n keys.forEach((key) => {\n mapping[key] = enumObject[key as keyof E]\n })\n\n // Find the key corresponding to the default value\n const defaultKey =\n keys.find((key) => enumObject[key as keyof E] === defaultValue) || keys[0]\n\n return {\n defaultValue: enumObject[defaultKey as keyof E],\n options: keys,\n mapping,\n control: { type: 'radio' },\n }\n}\n","import type { ValuesOf } from '../../types'\n\nexport const TYPE = {\n default: 'default',\n article: 'article',\n} as const\n\nexport type Type = ValuesOf<typeof TYPE>\n\nexport const WEIGHT = {\n extraLight: 'extra-light',\n normal: 'normal',\n bold: 'bold',\n} as const\n\nexport type Weight = ValuesOf<typeof WEIGHT>\n","import clsx from 'clsx'\nimport type React from 'react'\nimport { WEIGHT, type Weight } from './enum'\n\ntype ParagraphProps = React.HTMLAttributes<HTMLParagraphElement> & {\n text?: string\n weight?: Weight\n className?: string\n}\n\nconst baseClass = 'font-default leading-[150%] flex items-center m-0'\n\nconst variantClass = {\n P1: 'text-[16px]',\n P2: 'text-[14px]',\n P3: 'text-[12px]',\n P4: 'text-[10px]',\n}\n\nconst ParagraphVariant = (variant: keyof typeof variantClass) => {\n const Component: React.FC<ParagraphProps> & { Weight: typeof WEIGHT } = ({\n text = '',\n weight = WEIGHT.normal,\n className = '',\n ...props\n }) => (\n <p\n className={clsx(\n baseClass,\n variantClass[variant],\n `font-${weight}`,\n className\n )}\n {...props}\n >\n {text}\n </p>\n )\n Component.displayName = variant\n Component.Weight = WEIGHT\n return Component\n}\n\nconst P1 = ParagraphVariant('P1')\nconst P2 = ParagraphVariant('P2')\nconst P3 = ParagraphVariant('P3')\nconst P4 = ParagraphVariant('P4')\n\nexport { P1, P2, P3, P4 }\n","import type { Meta, StoryObj } from '@storybook/react-vite'\n// utils\nimport { getRadioArgFromEnum } from '../../storybook/utils/get-enum-arg'\n// components\nimport { P1, P2, P3, P4 } from '../paragraph'\n\nconst meta = {\n title: 'Text/Paragraph',\n component: P1,\n argTypes: {\n weight: getRadioArgFromEnum(P1.Weight, P1.Weight.normal),\n },\n} satisfies Meta<typeof P1>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nconst defaultArg = {\n text: '內文「內文」:內文,《內文》內文English內文123內文?',\n weight: P1.Weight.normal,\n}\n\nexport const p1: Story = {\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n\nexport const p2: Story = {\n render: (args) => <P2 {...args} />,\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n\nexport const p3: Story = {\n render: (args) => <P3 {...args} />,\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n\nexport const p4: Story = {\n render: (args) => <P4 {...args} />,\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n"]}
@@ -0,0 +1,40 @@
1
+ import { getRadioArgFromEnum } from '../../chunk-QOLETTSG.mjs';
2
+ import { P1, P2, P3, P4 } from '../../chunk-HQG6Q2EY.mjs';
3
+ import '../../chunk-UM7RNC2Y.mjs';
4
+ import { jsx } from 'react/jsx-runtime';
5
+
6
+ var meta = {
7
+ title: "Text/Paragraph",
8
+ component: P1,
9
+ argTypes: {
10
+ weight: getRadioArgFromEnum(P1.Weight, P1.Weight.normal)
11
+ }
12
+ };
13
+ var paragraph_stories_default = meta;
14
+ var defaultArg = {
15
+ text: "\u5167\u6587\u300C\u5167\u6587\u300D\uFF1A\u5167\u6587\uFF0C\u300A\u5167\u6587\u300B\u5167\u6587English\u5167\u6587123\u5167\u6587\uFF1F",
16
+ weight: P1.Weight.normal
17
+ };
18
+ var p1 = {
19
+ args: defaultArg,
20
+ parameters: { controls: { exclude: ["className"] } }
21
+ };
22
+ var p2 = {
23
+ render: (args) => /* @__PURE__ */ jsx(P2, { ...args }),
24
+ args: defaultArg,
25
+ parameters: { controls: { exclude: ["className"] } }
26
+ };
27
+ var p3 = {
28
+ render: (args) => /* @__PURE__ */ jsx(P3, { ...args }),
29
+ args: defaultArg,
30
+ parameters: { controls: { exclude: ["className"] } }
31
+ };
32
+ var p4 = {
33
+ render: (args) => /* @__PURE__ */ jsx(P4, { ...args }),
34
+ args: defaultArg,
35
+ parameters: { controls: { exclude: ["className"] } }
36
+ };
37
+
38
+ export { paragraph_stories_default as default, p1, p2, p3, p4 };
39
+ //# sourceMappingURL=paragraph.stories.mjs.map
40
+ //# sourceMappingURL=paragraph.stories.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/text/stories/paragraph.stories.tsx"],"names":[],"mappings":";;;;;AAMA,IAAM,IAAA,GAAO;AAAA,EACX,KAAA,EAAO,gBAAA;AAAA,EACP,SAAA,EAAW,EAAA;AAAA,EACX,QAAA,EAAU;AAAA,IACR,QAAQ,mBAAA,CAAoB,EAAA,CAAG,MAAA,EAAQ,EAAA,CAAG,OAAO,MAAM;AAAA;AAE3D,CAAA;AAEA,IAAO,yBAAA,GAAQ;AAGf,IAAM,UAAA,GAAa;AAAA,EACjB,IAAA,EAAM,0IAAA;AAAA,EACN,MAAA,EAAQ,GAAG,MAAA,CAAO;AACpB,CAAA;AAEO,IAAM,EAAA,GAAY;AAAA,EACvB,IAAA,EAAM,UAAA;AAAA,EACN,UAAA,EAAY,EAAE,QAAA,EAAU,EAAE,SAAS,CAAC,WAAW,GAAE;AACnD;AAEO,IAAM,EAAA,GAAY;AAAA,EACvB,QAAQ,CAAC,IAAA,qBAAS,GAAA,CAAC,EAAA,EAAA,EAAI,GAAG,IAAA,EAAM,CAAA;AAAA,EAChC,IAAA,EAAM,UAAA;AAAA,EACN,UAAA,EAAY,EAAE,QAAA,EAAU,EAAE,SAAS,CAAC,WAAW,GAAE;AACnD;AAEO,IAAM,EAAA,GAAY;AAAA,EACvB,QAAQ,CAAC,IAAA,qBAAS,GAAA,CAAC,EAAA,EAAA,EAAI,GAAG,IAAA,EAAM,CAAA;AAAA,EAChC,IAAA,EAAM,UAAA;AAAA,EACN,UAAA,EAAY,EAAE,QAAA,EAAU,EAAE,SAAS,CAAC,WAAW,GAAE;AACnD;AAEO,IAAM,EAAA,GAAY;AAAA,EACvB,QAAQ,CAAC,IAAA,qBAAS,GAAA,CAAC,EAAA,EAAA,EAAI,GAAG,IAAA,EAAM,CAAA;AAAA,EAChC,IAAA,EAAM,UAAA;AAAA,EACN,UAAA,EAAY,EAAE,QAAA,EAAU,EAAE,SAAS,CAAC,WAAW,GAAE;AACnD","file":"paragraph.stories.mjs","sourcesContent":["import type { Meta, StoryObj } from '@storybook/react-vite'\n// utils\nimport { getRadioArgFromEnum } from '../../storybook/utils/get-enum-arg'\n// components\nimport { P1, P2, P3, P4 } from '../paragraph'\n\nconst meta = {\n title: 'Text/Paragraph',\n component: P1,\n argTypes: {\n weight: getRadioArgFromEnum(P1.Weight, P1.Weight.normal),\n },\n} satisfies Meta<typeof P1>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nconst defaultArg = {\n text: '內文「內文」:內文,《內文》內文English內文123內文?',\n weight: P1.Weight.normal,\n}\n\nexport const p1: Story = {\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n\nexport const p2: Story = {\n render: (args) => <P2 {...args} />,\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n\nexport const p3: Story = {\n render: (args) => <P3 {...args} />,\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n\nexport const p4: Story = {\n render: (args) => <P4 {...args} />,\n args: defaultArg,\n parameters: { controls: { exclude: ['className'] } },\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import * as react from 'react';
2
+
3
+ declare const useScrollStatus: (setShowNext: (show: boolean) => void) => react.RefObject<HTMLDivElement | null>;
4
+
5
+ export { useScrollStatus };
@@ -0,0 +1,5 @@
1
+ import * as react from 'react';
2
+
3
+ declare const useScrollStatus: (setShowNext: (show: boolean) => void) => react.RefObject<HTMLDivElement | null>;
4
+
5
+ export { useScrollStatus };