lucentia-ui 0.2.1 → 0.2.3

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 (30) hide show
  1. package/README.md +0 -2
  2. package/dist/components/Button/Button.module.css +3 -3
  3. package/dist/components/Checkbox/Checkbox.module.css +2 -2
  4. package/dist/components/Input/Input.module.css +2 -2
  5. package/dist/components/Radio/Radio.module.css +2 -2
  6. package/dist/components/Textarea/Textarea.d.ts +1 -1
  7. package/dist/components/Textarea/Textarea.js +2 -2
  8. package/dist/components/Textarea/Textarea.module.css +15 -0
  9. package/dist/components/Textarea/Textarea.stories.d.ts +1 -0
  10. package/dist/components/Textarea/Textarea.stories.js +5 -0
  11. package/dist/components/Textarea/types.d.ts +2 -0
  12. package/dist/components/ThemeProvider/ThemeProvider.js +1 -1
  13. package/dist/components/ThemeProvider/ThemeProvider.module.css +46 -13
  14. package/dist/components/Typography/Heading.d.ts +13 -0
  15. package/dist/components/Typography/Heading.js +6 -0
  16. package/dist/components/Typography/Label.d.ts +12 -0
  17. package/dist/components/Typography/Label.js +5 -0
  18. package/dist/components/Typography/Text.d.ts +9 -0
  19. package/dist/components/Typography/Text.js +7 -0
  20. package/dist/components/Typography/index.d.ts +4 -0
  21. package/dist/components/Typography/index.js +4 -0
  22. package/dist/components/Typography/types.d.ts +7 -0
  23. package/dist/components/Typography/types.js +1 -0
  24. package/dist/components/Typography/typography.module.css +95 -0
  25. package/dist/fonts/NotoSansJP-Black.woff2 +0 -0
  26. package/dist/index.d.ts +1 -0
  27. package/dist/index.js +1 -0
  28. package/dist/styles/base.css +0 -6
  29. package/dist/styles/font.css +9 -1
  30. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,3 @@
1
1
  # lucentia-ui
2
2
 
3
3
  React UI design token and component system based on neumorphism, featuring two color themes: light and dark.
4
-
5
- -
@@ -1,6 +1,6 @@
1
1
  .button {
2
2
  font-family: var(--font);
3
- font-weight: 500;
3
+ font-weight: var(--font-weight-medium);
4
4
  border: 2px solid transparent;
5
5
  cursor: pointer;
6
6
 
@@ -91,13 +91,13 @@
91
91
 
92
92
  .sm {
93
93
  padding: var(--space-xs) var(--space-lg);
94
- font-size: 0.875rem;
94
+ font-size: var(--font-size-14);
95
95
  box-shadow: var(--shadow-sm);
96
96
  }
97
97
 
98
98
  .md {
99
99
  padding: var(--space-sm) var(--space-2xl);
100
- font-size: 1rem;
100
+ font-size: var(--font-size-16);
101
101
  box-shadow: var(--shadow-md);
102
102
  }
103
103
 
@@ -8,7 +8,7 @@
8
8
  gap: var(--space-sm);
9
9
  cursor: pointer;
10
10
  font-family: var(--font);
11
- font-weight: 500;
11
+ font-weight: var(--font-weight-medium);
12
12
  color: var(--color-on-surface);
13
13
  }
14
14
 
@@ -49,5 +49,5 @@
49
49
  }
50
50
 
51
51
  .label {
52
- font-size: 1rem;
52
+ font-size: var(--font-size-16);
53
53
  }
@@ -40,13 +40,13 @@
40
40
 
41
41
  /* ===== size ===== */
42
42
  .sm {
43
- font-size: 0.875rem;
43
+ font-size: var(--font-size-14);
44
44
  padding: var(--space-sm) var(--space-md);
45
45
  box-shadow: var(--shadow-sm-in);
46
46
  }
47
47
 
48
48
  .md {
49
- font-size: 1rem;
49
+ font-size: var(--font-size-16);
50
50
  padding: var(--space-md) var(--space-lg);
51
51
  box-shadow: var(--shadow-md-in);
52
52
  }
@@ -4,7 +4,7 @@
4
4
  gap: var(--space-sm);
5
5
  cursor: pointer;
6
6
  font-family: var(--font);
7
- font-weight: 500;
7
+ font-weight: var(--font-weight-medium);
8
8
  color: var(--color-on-surface);
9
9
  }
10
10
 
@@ -45,5 +45,5 @@
45
45
  }
46
46
 
47
47
  .label {
48
- font-size: 1rem;
48
+ font-size: var(--font-size-16);
49
49
  }
@@ -1,2 +1,2 @@
1
1
  import { TextareaProps } from "./types";
2
- export declare const Textarea: ({ state, className, rows, ...props }: TextareaProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Textarea: ({ state, size, className, rows, ...props }: TextareaProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import styles from "./Textarea.module.css";
3
3
  import clsx from "clsx";
4
- export const Textarea = ({ state = "default", className, rows = 3, ...props }) => {
5
- return (_jsx("textarea", { rows: rows, className: clsx(styles.textarea, styles[state], className), ...props }));
4
+ export const Textarea = ({ state = "default", size = "md", className, rows = 3, ...props }) => {
5
+ return (_jsx("textarea", { rows: rows, className: clsx(styles.textarea, styles[state], styles[size], className), ...props }));
6
6
  };
@@ -39,3 +39,18 @@
39
39
  opacity: 0.5;
40
40
  cursor: not-allowed;
41
41
  }
42
+
43
+
44
+
45
+ /* ===== size ===== */
46
+ .sm {
47
+ font-size: var(--font-size-14);
48
+ padding: var(--space-sm) var(--space-md);
49
+ box-shadow: var(--shadow-sm-in);
50
+ }
51
+
52
+ .md {
53
+ font-size: var(--font-size-16);
54
+ padding: var(--space-md) var(--space-lg);
55
+ box-shadow: var(--shadow-md-in);
56
+ }
@@ -5,3 +5,4 @@ export default meta;
5
5
  type Story = StoryObj<typeof Textarea>;
6
6
  export declare const Default: Story;
7
7
  export declare const State: Story;
8
+ export declare const Size: Story;
@@ -20,3 +20,8 @@ export const State = {
20
20
  }, children: [_jsx(Textarea, { placeholder: "Default State", state: "default" }), _jsx(Textarea, { placeholder: "Error State", state: "error" }), _jsx(Textarea, { placeholder: "Disabled State", disabled: true })] }));
21
21
  },
22
22
  };
23
+ export const Size = {
24
+ render: () => {
25
+ return (_jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "flex-start", gap: 16 }, children: [_jsx(Textarea, { placeholder: "Small Size", size: "sm" }), _jsx(Textarea, { placeholder: "Medium Size", size: "md" })] }));
26
+ },
27
+ };
@@ -1,4 +1,6 @@
1
1
  export type TextareaState = "default" | "error";
2
+ export type size = "sm" | "md";
2
3
  export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
3
4
  state?: TextareaState;
5
+ size?: size;
4
6
  }
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import styles from "./ThemeProvider.module.css";
3
3
  export function ThemeProvider({ theme = "light", children, }) {
4
- return (_jsx("main", { className: `${styles.theme} ${theme === "dark" ? styles.dark : styles.light}`, children: children }));
4
+ return (_jsx("div", { className: `${styles.theme} ${theme === "dark" ? styles.dark : styles.light}`, children: children }));
5
5
  }
@@ -1,8 +1,33 @@
1
1
  .theme {
2
2
  min-height: 100%;
3
+ font-family:
4
+ var(--font),
5
+ system-ui,
6
+ -apple-system,
7
+ sans-serif;
8
+ background: var(--color-background);
9
+
3
10
  /* font */
4
11
  --font: "Noto Sans JP", sans-serif;
5
12
 
13
+ --font-size-12: 12px;
14
+ --font-size-14: 14px;
15
+ --font-size-16: 16px;
16
+ --font-size-18: 18px;
17
+ --font-size-20: 20px;
18
+ --font-size-28: 28px;
19
+ --font-size-40: 40px;
20
+ --font-size-48: 48px;
21
+
22
+ --line-tight: 1.2;
23
+ --line-snug: 1.35;
24
+ --line-normal: 1.6;
25
+
26
+ --font-weight-regular: 400;
27
+ --font-weight-medium: 500;
28
+ --font-weight-bold: 600;
29
+ --font-weight-black: 700;
30
+
6
31
  /* ===== Radius ===== */
7
32
  --radius-sm: 8px;
8
33
  --radius-md: 16px;
@@ -22,7 +47,6 @@
22
47
 
23
48
  /* ===== Layout ===== */
24
49
  --container: 1120px;
25
-
26
50
  }
27
51
 
28
52
  .light {
@@ -59,19 +83,24 @@
59
83
  /* ===== Effect ===== */
60
84
  --blur: blur(8px);
61
85
 
62
- --shadow-sm: -2px -2px 2px 1px var(--color-shadow-l),
86
+ --shadow-sm:
87
+ -2px -2px 2px 1px var(--color-shadow-l),
63
88
  2px 2px 2px 1px var(--color-shadow-d);
64
89
 
65
- --shadow-sm-in: inset -2px -2px 2px var(--color-shadow-l),
66
- inset 2px 2px 2px var(--color-shadow-d);
90
+ --shadow-sm-in:
91
+ inset -2px -2px 2px var(--color-shadow-l),
92
+ inset 2px 2px 2px var(--color-shadow-d);
67
93
 
68
- --shadow-md: -2px -2px 4px 2px var(--color-shadow-l),
94
+ --shadow-md:
95
+ -2px -2px 4px 2px var(--color-shadow-l),
69
96
  2px 2px 4px 2px var(--color-shadow-d);
70
97
 
71
- --shadow-md-in: inset -4px -4px 4px var(--color-shadow-l),
98
+ --shadow-md-in:
99
+ inset -4px -4px 4px var(--color-shadow-l),
72
100
  inset 4px 4px 4px var(--color-shadow-d);
73
101
 
74
- --shadow-lg: -4px -4px 16px 8px var(--color-shadow-l),
102
+ --shadow-lg:
103
+ -4px -4px 16px 8px var(--color-shadow-l),
75
104
  4px 4px 16px 8px var(--color-shadow-d);
76
105
  }
77
106
 
@@ -108,18 +137,22 @@
108
137
  /* ===== Effect ===== */
109
138
  --blur: blur(8px);
110
139
 
111
- --shadow-sm: -2px -2px 2px var(--color-shadow-l),
112
- 2px 2px 2px 1px var(--color-shadow-d);
140
+ --shadow-sm:
141
+ -2px -2px 2px var(--color-shadow-l), 2px 2px 2px 1px var(--color-shadow-d);
113
142
 
114
- --shadow-sm-in: inset -2px -2px 2px var(--color-shadow-l),
143
+ --shadow-sm-in:
144
+ inset -2px -2px 2px var(--color-shadow-l),
115
145
  inset 2px 2px 2px var(--color-shadow-d);
116
146
 
117
- --shadow-md: -2px -2px 4px 2px var(--color-shadow-l),
147
+ --shadow-md:
148
+ -2px -2px 4px 2px var(--color-shadow-l),
118
149
  2px 2px 4px 2px var(--color-shadow-d);
119
150
 
120
- --shadow-md-in: inset -4px -4px 4px var(--color-shadow-l),
151
+ --shadow-md-in:
152
+ inset -4px -4px 4px var(--color-shadow-l),
121
153
  inset 4px 4px 4px var(--color-shadow-d);
122
154
 
123
- --shadow-lg: -4px -4px 16px 8px var(--color-shadow-l),
155
+ --shadow-lg:
156
+ -4px -4px 16px 8px var(--color-shadow-l),
124
157
  4px 4px 16px 8px var(--color-shadow-d);
125
158
  }
@@ -0,0 +1,13 @@
1
+ import type { TypographyVariant, TypographyColor } from "./types";
2
+ import type React from "react";
3
+ type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
4
+ type HeadingVariant = Extract<TypographyVariant, "display-lg" | "heading-xl" | "heading-lg" | "heading-md" | "heading-sm" | "heading-xs">;
5
+ type HeadingProps = {
6
+ level: HeadingLevel;
7
+ variant?: HeadingVariant;
8
+ color?: TypographyColor;
9
+ className?: string;
10
+ children: React.ReactNode;
11
+ };
12
+ export declare const Heading: ({ level, variant, color, className, children, }: HeadingProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Text } from "./Text";
3
+ export const Heading = ({ level, variant = "heading-lg", color = "default", className, children, }) => {
4
+ const Tag = `h${level}`;
5
+ return (_jsx(Text, { as: Tag, variant: variant, color: color, className: className, children: children }));
6
+ };
@@ -0,0 +1,12 @@
1
+ import type { TypographyVariant, TypographyColor } from "./types";
2
+ import type React from "react";
3
+ type LabelVariant = Extract<TypographyVariant, "label-md" | "label-sm">;
4
+ type LabelProps = {
5
+ htmlFor?: string;
6
+ variant?: LabelVariant;
7
+ color?: TypographyColor;
8
+ className?: string;
9
+ children: React.ReactNode;
10
+ };
11
+ export declare const Label: ({ htmlFor, variant, color, className, children, }: LabelProps) => import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Text } from "./Text";
3
+ export const Label = ({ htmlFor, variant = "label-sm", color = "default", className, children, }) => {
4
+ return (_jsx(Text, { as: "label", variant: variant, color: color, htmlFor: htmlFor, className: className, children: children }));
5
+ };
@@ -0,0 +1,9 @@
1
+ import type { TypographyVariant, TypographyColor, PolymorphicProps } from "./types";
2
+ import type React from "react";
3
+ type TextProps<E extends React.ElementType> = PolymorphicProps<E, {
4
+ variant?: TypographyVariant;
5
+ color?: TypographyColor;
6
+ className?: string;
7
+ }>;
8
+ export declare const Text: <E extends React.ElementType = "span">({ as, variant, color, className, ...props }: TextProps<E>) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import clsx from "clsx";
3
+ import styles from "./typography.module.css";
4
+ export const Text = ({ as, variant = "body-md", color = "default", className, ...props }) => {
5
+ const Component = as || "span";
6
+ return (_jsx(Component, { className: clsx(styles[variant], styles[`color-${color}`], className), ...props }));
7
+ };
@@ -0,0 +1,4 @@
1
+ export { Text } from "./Text";
2
+ export { Heading } from "./Heading";
3
+ export { Label } from "./Label";
4
+ export * from "./types";
@@ -0,0 +1,4 @@
1
+ export { Text } from "./Text";
2
+ export { Heading } from "./Heading";
3
+ export { Label } from "./Label";
4
+ export * from "./types";
@@ -0,0 +1,7 @@
1
+ import type React from "react";
2
+ export type AsProp<E extends React.ElementType> = {
3
+ as?: E;
4
+ };
5
+ export type PolymorphicProps<E extends React.ElementType, P> = P & AsProp<E> & Omit<React.ComponentPropsWithoutRef<E>, keyof P | "as">;
6
+ export type TypographyVariant = "display-lg" | "heading-xl" | "heading-lg" | "heading-md" | "heading-sm" | "heading-xs" | "body-md" | "body-sm" | "label-md" | "label-sm";
7
+ export type TypographyColor = "default" | "muted" | "primary" | "secondary" | "error" | "success";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,95 @@
1
+ /* ========================================
2
+ Display
3
+ ======================================== */
4
+
5
+ .display-lg {
6
+ font-size: var(--font-size-48);
7
+ line-height: var(--line-tight);
8
+ font-weight: var(--font-weight-bold);
9
+ }
10
+
11
+ /* ========================================
12
+ Heading
13
+ ======================================== */
14
+
15
+ .heading-xl {
16
+ font-size: var(--font-size-28);
17
+ line-height: var(--line-snug);
18
+ font-weight: var(--font-weight-bold);
19
+ }
20
+
21
+ .heading-lg {
22
+ font-size: var(--font-size-24);
23
+ line-height: var(--line-snug);
24
+ font-weight: var(--font-weight-bold);
25
+ }
26
+
27
+ .heading-md {
28
+ font-size: var(--font-size-20);
29
+ line-height: var(--line-snug);
30
+ font-weight: var(--font-weight-bold);
31
+ }
32
+
33
+ .heading-sm {
34
+ font-size: var(--font-size-18);
35
+ line-height: var(--line-snug);
36
+ font-weight: var(--font-weight-medium);
37
+ }
38
+
39
+ .heading-xs {
40
+ font-size: var(--font-size-16);
41
+ line-height: var(--line-snug);
42
+ font-weight: var(--font-weight-mideum);
43
+ }
44
+
45
+ /* ========================================
46
+ Body
47
+ ======================================== */
48
+
49
+ .body-md {
50
+ font-size: var(--font-size-16);
51
+ line-height: var(--line-normal);
52
+ font-weight: var(--font-weight-regular);
53
+ }
54
+
55
+ .body-sm {
56
+ font-size: var(--font-size-14);
57
+ line-height: var(--line-normal);
58
+ font-weight: var(--font-weight-regular);
59
+ }
60
+
61
+ /* ========================================
62
+ Label
63
+ ======================================== */
64
+
65
+ .label-md {
66
+ font-size: var(--font-size-16);
67
+ line-height: var(--line-snug);
68
+ font-weight: var(--font-weight-medium);
69
+ }
70
+
71
+ .label-sm {
72
+ font-size: var(--font-size-14);
73
+ line-height: var(--line-snug);
74
+ font-weight: var(--font-weight-medium);
75
+ }
76
+
77
+ /* ========================================
78
+ Color
79
+ ======================================== */
80
+
81
+ .color-default {
82
+ color: var(--color-on-background);
83
+ }
84
+
85
+ .color-muted {
86
+ color: var(--color-on-surface-variant);
87
+ }
88
+
89
+ .color-primary {
90
+ color: var(--color-primary);
91
+ }
92
+
93
+ .color-error {
94
+ color: var(--color-error);
95
+ }
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export * from "./components/Divider";
6
6
  export * from "./components/Radio";
7
7
  export * from "./components/Input";
8
8
  export * from "./components/Textarea";
9
+ export * from "./components/Typography";
9
10
  export * from "./components/Select";
10
11
  export * from "./components/Switch";
11
12
  export * from "./components/Feedback/Modal";
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ export * from "./components/Divider";
7
7
  export * from "./components/Radio";
8
8
  export * from "./components/Input";
9
9
  export * from "./components/Textarea";
10
+ export * from "./components/Typography";
10
11
  export * from "./components/Select";
11
12
  export * from "./components/Switch";
12
13
  export * from "./components/Feedback/Modal";
@@ -33,15 +33,9 @@ html {
33
33
  text-size-adjust: 100%;
34
34
  }
35
35
 
36
- body {
37
- line-height: 1.5;
38
- font-family: var(--font, system-ui, -apple-system, sans-serif);
39
- padding: 0;
40
- }
41
36
 
42
37
  main {
43
38
  min-height: 100vh;
44
- background: var(--color-background);
45
39
  }
46
40
 
47
41
  /* リスト */
@@ -20,4 +20,12 @@
20
20
  font-weight: 600;
21
21
  font-style: normal;
22
22
  font-display: swap;
23
- }
23
+ }
24
+
25
+ @font-face {
26
+ font-family: "Noto Sans JP";
27
+ src: url("../fonts/NotoSansJP-Black.woff2") format("woff2");
28
+ font-weight: 700;
29
+ font-style: normal;
30
+ font-display: swap;
31
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucentia-ui",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "React UI design token and component system based on neumorphism, featuring two color themes: light and dark.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",