lucentia-ui 0.1.7 → 0.1.8

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.
package/README.md CHANGED
@@ -96,20 +96,15 @@ ThemeProvider は:
96
96
 
97
97
  という役割を持ちます。
98
98
 
99
- ### テーマ切り替え例(Next.js)
99
+ ## テーマ設定例
100
100
 
101
101
  ```tsx
102
- import { useState } from "react";
103
102
  import { ThemeProvider, Button } from "lucentia-ui";
104
103
 
105
104
  export default function App() {
106
- const [theme, setTheme] = useState<"light" | "dark">("light");
107
-
108
105
  return (
109
- <ThemeProvider theme={theme}>
110
- <Button onClick={() => setTheme(theme === "light" ? "dark" : "light")}>
111
- Toggle theme
112
- </Button>
106
+ <ThemeProvider theme="dark">
107
+ {children}
113
108
  </ThemeProvider>
114
109
  );
115
110
  }
@@ -0,0 +1,2 @@
1
+ import type { DividerProps } from "./types";
2
+ export declare const Divider: React.FC<DividerProps>;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import styles from "./Divider.module.css";
3
+ export const Divider = ({ orientation = "horizontal", variant = "default", className, }) => {
4
+ return (_jsx("div", { role: "separator", "aria-orientation": orientation, "data-orientation": orientation, "data-variant": variant, className: [styles.divider, className].filter(Boolean).join(" ") }));
5
+ };
@@ -0,0 +1,28 @@
1
+ .divider {
2
+ background: var(--color-border);
3
+ flex-shrink: 0;
4
+ }
5
+
6
+ /* orientation */
7
+ .divider[data-orientation="horizontal"] {
8
+ width: 100%;
9
+ height: 2px;
10
+ }
11
+
12
+ .divider[data-orientation="vertical"] {
13
+ width: 2px;
14
+ height: 100%;
15
+ }
16
+
17
+
18
+ /* variants */
19
+
20
+ .divider[data-variant="groove"][data-orientation="horizontal"]{
21
+ box-shadow: var(--shadow-sm-in);
22
+ height: 4px;
23
+ }
24
+
25
+ .divider[data-variant="groove"][data-orientation="vertical"]{
26
+ box-shadow: var(--shadow-sm-in);
27
+ width: 4px;
28
+ }
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Divider } from "./Divider";
3
+ declare const meta: Meta<typeof Divider>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Divider>;
6
+ export declare const Default: Story;
7
+ export declare const Groove: Story;
8
+ export declare const Vertical: Story;
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Divider } from "./Divider";
3
+ const meta = {
4
+ title: "Components/Divider",
5
+ component: Divider,
6
+ args: {
7
+ orientation: "horizontal",
8
+ variant: "default",
9
+ },
10
+ argTypes: {
11
+ orientation: {
12
+ control: "radio",
13
+ options: ["horizontal", "vertical"],
14
+ },
15
+ variant: {
16
+ control: "radio",
17
+ options: ["default", "groove"],
18
+ },
19
+ },
20
+ };
21
+ export default meta;
22
+ /**
23
+ * 共通レンダラー
24
+ * - vertical / horizontal 両方確認できるサイズ
25
+ * - flex + shrink防止前提
26
+ */
27
+ const renderDivider = (args) => (_jsx("div", { style: {
28
+ display: "flex",
29
+ width: "200px",
30
+ height: "200px",
31
+ alignItems: "center",
32
+ justifyContent: "center",
33
+ }, children: _jsx(Divider, { ...args }) }));
34
+ export const Default = {
35
+ render: renderDivider,
36
+ };
37
+ export const Groove = {
38
+ render: renderDivider,
39
+ args: {
40
+ variant: "groove",
41
+ },
42
+ };
43
+ export const Vertical = {
44
+ render: renderDivider,
45
+ args: {
46
+ orientation: "vertical",
47
+ },
48
+ };
@@ -0,0 +1,2 @@
1
+ export { Divider } from "./Divider";
2
+ export type { DividerProps, DividerOrientation, DividerVariant } from "./types";
@@ -0,0 +1 @@
1
+ export { Divider } from "./Divider";
@@ -0,0 +1,7 @@
1
+ export type DividerOrientation = "horizontal" | "vertical";
2
+ export type DividerVariant = "default" | "groove";
3
+ export interface DividerProps {
4
+ orientation?: DividerOrientation;
5
+ variant?: DividerVariant;
6
+ className?: string;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -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("div", { className: `${styles.theme} ${theme === "dark" ? styles.dark : styles.light}`, children: children }));
4
+ return (_jsx("main", { className: `${styles.theme} ${theme === "dark" ? styles.dark : styles.light}`, children: children }));
5
5
  }
@@ -22,6 +22,7 @@
22
22
 
23
23
  /* ===== Layout ===== */
24
24
  --container: 1120px;
25
+
25
26
  }
26
27
 
27
28
  .light {
@@ -36,10 +36,13 @@ html {
36
36
  body {
37
37
  line-height: 1.5;
38
38
  font-family: var(--font, system-ui, -apple-system, sans-serif);
39
- color: var(--color-on-background, #161d1d);
40
- background-color: var(--color-background, #f4fbfa);
41
39
  padding: 0;
42
- }
40
+ }
41
+
42
+ main {
43
+ min-height: 100vh;
44
+ background: var(--color-background);
45
+ }
43
46
 
44
47
  /* リスト */
45
48
  ul,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucentia-ui",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
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",