lucentia-ui 0.2.2 → 0.2.4

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 +4 -3
  3. package/dist/components/Checkbox/Checkbox.module.css +2 -2
  4. package/dist/components/Feedback/Modal/Modal.js +2 -2
  5. package/dist/components/Feedback/Modal/Modal.module.css +2 -2
  6. package/dist/components/Feedback/Modal/types.d.ts +1 -0
  7. package/dist/components/Input/Input.module.css +2 -2
  8. package/dist/components/Radio/Radio.module.css +2 -2
  9. package/dist/components/Textarea/Textarea.d.ts +1 -1
  10. package/dist/components/Textarea/Textarea.js +2 -2
  11. package/dist/components/Textarea/Textarea.module.css +15 -0
  12. package/dist/components/Textarea/Textarea.stories.d.ts +1 -0
  13. package/dist/components/Textarea/Textarea.stories.js +5 -0
  14. package/dist/components/Textarea/types.d.ts +2 -0
  15. package/dist/components/ThemeProvider/ThemeProvider.module.css +48 -14
  16. package/dist/components/Typography/Heading.d.ts +13 -0
  17. package/dist/components/Typography/Heading.js +6 -0
  18. package/dist/components/Typography/Label.d.ts +12 -0
  19. package/dist/components/Typography/Label.js +5 -0
  20. package/dist/components/Typography/Text.d.ts +9 -0
  21. package/dist/components/Typography/Text.js +7 -0
  22. package/dist/components/Typography/index.d.ts +4 -0
  23. package/dist/components/Typography/index.js +4 -0
  24. package/dist/components/Typography/types.d.ts +7 -0
  25. package/dist/components/Typography/types.js +1 -0
  26. package/dist/components/Typography/typography.module.css +95 -0
  27. package/dist/index.d.ts +1 -0
  28. package/dist/index.js +1 -0
  29. package/dist/styles/font.css +1 -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
 
@@ -107,6 +107,7 @@
107
107
  .md.button:active:not(:disabled),
108
108
  .button[data-state="pressed"] {
109
109
  box-shadow: none;
110
+ background: var(--color-surface-container);
110
111
  }
111
112
 
112
113
  .button:focus-visible {
@@ -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
  }
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from "react";
3
3
  import { createPortal } from "react-dom";
4
4
  import styles from "./Modal.module.css";
5
- export const Modal = ({ open, onClose, children }) => {
5
+ export const Modal = ({ open, onClose, children, className, }) => {
6
6
  const [mounted, setMounted] = useState(false);
7
7
  useEffect(() => {
8
8
  setMounted(true);
@@ -12,5 +12,5 @@ export const Modal = ({ open, onClose, children }) => {
12
12
  const modalRoot = document.getElementById("modal-root");
13
13
  if (!modalRoot)
14
14
  return null;
15
- return createPortal(_jsx("div", { className: styles.overlay, onClick: onClose, children: _jsx("div", { className: styles.modal, onClick: (e) => e.stopPropagation(), children: children }) }), modalRoot);
15
+ return createPortal(_jsx("div", { className: styles.overlay, onClick: onClose, children: _jsx("div", { className: [styles.modal, className].filter(Boolean).join(" "), onClick: (e) => e.stopPropagation(), children: children }) }), modalRoot);
16
16
  };
@@ -10,10 +10,10 @@
10
10
  }
11
11
 
12
12
  .modal {
13
- background: var(--color-surface);
13
+ background: var(--color-background);
14
14
  color: var(--color-on-surface);
15
15
  border-radius: var(--radius-md);
16
- box-shadow: var(--shadow-lg);
16
+ box-shadow: var(--shadow-surface-lg);
17
17
  padding: var(--space-lg);
18
18
  min-width: 320px;
19
19
  max-width: 90vw;
@@ -3,4 +3,5 @@ export type ModalProps = {
3
3
  open: boolean;
4
4
  onClose?: () => void;
5
5
  children: ReactNode;
6
+ className?: string;
6
7
  };
@@ -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,12 +1,35 @@
1
1
  .theme {
2
2
  min-height: 100%;
3
- font-family: var(--font), system-ui, -apple-system, sans-serif;
3
+ font-family:
4
+ var(--font),
5
+ system-ui,
6
+ -apple-system,
7
+ sans-serif;
4
8
  background: var(--color-background);
5
9
 
6
10
  /* font */
7
11
  --font: "Noto Sans JP", sans-serif;
8
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
+
9
31
  /* ===== Radius ===== */
32
+ --radius-xs: 4px;
10
33
  --radius-sm: 8px;
11
34
  --radius-md: 16px;
12
35
  --radius-max: 999px;
@@ -25,7 +48,6 @@
25
48
 
26
49
  /* ===== Layout ===== */
27
50
  --container: 1120px;
28
-
29
51
  }
30
52
 
31
53
  .light {
@@ -62,20 +84,28 @@
62
84
  /* ===== Effect ===== */
63
85
  --blur: blur(8px);
64
86
 
65
- --shadow-sm: -2px -2px 2px 1px var(--color-shadow-l),
87
+ --shadow-sm:
88
+ -2px -2px 2px 1px var(--color-shadow-l),
66
89
  2px 2px 2px 1px var(--color-shadow-d);
67
90
 
68
- --shadow-sm-in: inset -2px -2px 2px var(--color-shadow-l),
69
- inset 2px 2px 2px var(--color-shadow-d);
91
+ --shadow-sm-in:
92
+ inset -2px -2px 2px var(--color-shadow-l),
93
+ inset 2px 2px 2px var(--color-shadow-d);
70
94
 
71
- --shadow-md: -2px -2px 4px 2px var(--color-shadow-l),
95
+ --shadow-md:
96
+ -2px -2px 4px 2px var(--color-shadow-l),
72
97
  2px 2px 4px 2px var(--color-shadow-d);
73
98
 
74
- --shadow-md-in: inset -4px -4px 4px var(--color-shadow-l),
99
+ --shadow-md-in:
100
+ inset -4px -4px 4px var(--color-shadow-l),
75
101
  inset 4px 4px 4px var(--color-shadow-d);
76
102
 
77
- --shadow-lg: -4px -4px 16px 8px var(--color-shadow-l),
103
+ --shadow-lg:
104
+ -4px -4px 16px 8px var(--color-shadow-l),
78
105
  4px 4px 16px 8px var(--color-shadow-d);
106
+
107
+ --shadow-surface-lg:
108
+ 0px 4px 16px 8px var(--color-shadow-d);
79
109
  }
80
110
 
81
111
  .dark {
@@ -111,18 +141,22 @@
111
141
  /* ===== Effect ===== */
112
142
  --blur: blur(8px);
113
143
 
114
- --shadow-sm: -2px -2px 2px var(--color-shadow-l),
115
- 2px 2px 2px 1px var(--color-shadow-d);
144
+ --shadow-sm:
145
+ -2px -2px 2px var(--color-shadow-l), 2px 2px 2px 1px var(--color-shadow-d);
116
146
 
117
- --shadow-sm-in: inset -2px -2px 2px var(--color-shadow-l),
147
+ --shadow-sm-in:
148
+ inset -2px -2px 2px var(--color-shadow-l),
118
149
  inset 2px 2px 2px var(--color-shadow-d);
119
150
 
120
- --shadow-md: -2px -2px 4px 2px var(--color-shadow-l),
151
+ --shadow-md:
152
+ -2px -2px 4px 2px var(--color-shadow-l),
121
153
  2px 2px 4px 2px var(--color-shadow-d);
122
154
 
123
- --shadow-md-in: inset -4px -4px 4px var(--color-shadow-l),
155
+ --shadow-md-in:
156
+ inset -4px -4px 4px var(--color-shadow-l),
124
157
  inset 4px 4px 4px var(--color-shadow-d);
125
158
 
126
- --shadow-lg: -4px -4px 16px 8px var(--color-shadow-l),
159
+ --shadow-lg:
160
+ -4px -4px 16px 8px var(--color-shadow-l),
127
161
  4px 4px 16px 8px var(--color-shadow-d);
128
162
  }
@@ -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-medium);
25
+ }
26
+
27
+ .heading-md {
28
+ font-size: var(--font-size-20);
29
+ line-height: var(--line-snug);
30
+ font-weight: var(--font-weight-medium);
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-medium);
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";
@@ -20,4 +20,4 @@
20
20
  font-weight: 600;
21
21
  font-style: normal;
22
22
  font-display: swap;
23
- }
23
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucentia-ui",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
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",