@liner-fe/design-library 1.0.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.
- package/README.md +73 -0
- package/lib/index.d.ts +61 -0
- package/lib/index.js +465 -0
- package/package.json +61 -0
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# React + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
+
|
|
5
|
+
Currently, two official plugins are available:
|
|
6
|
+
|
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
+
|
|
10
|
+
## React Compiler
|
|
11
|
+
|
|
12
|
+
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
|
13
|
+
|
|
14
|
+
## Expanding the ESLint configuration
|
|
15
|
+
|
|
16
|
+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
export default defineConfig([
|
|
20
|
+
globalIgnores(['dist']),
|
|
21
|
+
{
|
|
22
|
+
files: ['**/*.{ts,tsx}'],
|
|
23
|
+
extends: [
|
|
24
|
+
// Other configs...
|
|
25
|
+
|
|
26
|
+
// Remove tseslint.configs.recommended and replace with this
|
|
27
|
+
tseslint.configs.recommendedTypeChecked,
|
|
28
|
+
// Alternatively, use this for stricter rules
|
|
29
|
+
tseslint.configs.strictTypeChecked,
|
|
30
|
+
// Optionally, add this for stylistic rules
|
|
31
|
+
tseslint.configs.stylisticTypeChecked,
|
|
32
|
+
|
|
33
|
+
// Other configs...
|
|
34
|
+
],
|
|
35
|
+
languageOptions: {
|
|
36
|
+
parserOptions: {
|
|
37
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
38
|
+
tsconfigRootDir: import.meta.dirname,
|
|
39
|
+
},
|
|
40
|
+
// other options...
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
]);
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
// eslint.config.js
|
|
50
|
+
import reactX from 'eslint-plugin-react-x';
|
|
51
|
+
import reactDom from 'eslint-plugin-react-dom';
|
|
52
|
+
|
|
53
|
+
export default defineConfig([
|
|
54
|
+
globalIgnores(['dist']),
|
|
55
|
+
{
|
|
56
|
+
files: ['**/*.{ts,tsx}'],
|
|
57
|
+
extends: [
|
|
58
|
+
// Other configs...
|
|
59
|
+
// Enable lint rules for React
|
|
60
|
+
reactX.configs['recommended-typescript'],
|
|
61
|
+
// Enable lint rules for React DOM
|
|
62
|
+
reactDom.configs.recommended,
|
|
63
|
+
],
|
|
64
|
+
languageOptions: {
|
|
65
|
+
parserOptions: {
|
|
66
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
67
|
+
tsconfigRootDir: import.meta.dirname,
|
|
68
|
+
},
|
|
69
|
+
// other options...
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
]);
|
|
73
|
+
```
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ButtonProps, TextButtonProps } from '@liner-fe/prism';
|
|
3
|
+
import { ClassValue } from 'clsx';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
declare const TemplateDialog: {
|
|
7
|
+
({ open, preventEscape, onOpenChange, children, }: {
|
|
8
|
+
open?: boolean;
|
|
9
|
+
onOpenChange?: (open: boolean) => void;
|
|
10
|
+
preventEscape?: boolean;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}): react_jsx_runtime.JSX.Element;
|
|
13
|
+
Close({ onClose }: {
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
}): react_jsx_runtime.JSX.Element;
|
|
16
|
+
Title({ children, className, }: {
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
className?: ClassValue;
|
|
19
|
+
}): react_jsx_runtime.JSX.Element;
|
|
20
|
+
Description({ children, className, }: {
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
className?: ClassValue;
|
|
23
|
+
}): react_jsx_runtime.JSX.Element;
|
|
24
|
+
Buttons({ children, className, }: {
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
className?: ClassValue;
|
|
27
|
+
}): react_jsx_runtime.JSX.Element;
|
|
28
|
+
Button({ children, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
declare const TemplateIllustDialog: {
|
|
32
|
+
({ open, preventEscape, onOpenChange, children, }: {
|
|
33
|
+
open?: boolean;
|
|
34
|
+
onOpenChange?: (open: boolean) => void;
|
|
35
|
+
preventEscape?: boolean;
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
}): react_jsx_runtime.JSX.Element;
|
|
38
|
+
Close({ onClose }: {
|
|
39
|
+
onClose: () => void;
|
|
40
|
+
}): react_jsx_runtime.JSX.Element;
|
|
41
|
+
IllustContainer({ children, className, }: {
|
|
42
|
+
children: ReactNode;
|
|
43
|
+
className?: ClassValue;
|
|
44
|
+
}): react_jsx_runtime.JSX.Element;
|
|
45
|
+
Title({ children, className, }: {
|
|
46
|
+
children: ReactNode;
|
|
47
|
+
className?: ClassValue;
|
|
48
|
+
}): react_jsx_runtime.JSX.Element;
|
|
49
|
+
Description({ children, className, }: {
|
|
50
|
+
children: ReactNode;
|
|
51
|
+
className?: ClassValue;
|
|
52
|
+
}): react_jsx_runtime.JSX.Element;
|
|
53
|
+
Buttons({ children, className, }: {
|
|
54
|
+
children: ReactNode;
|
|
55
|
+
className?: ClassValue;
|
|
56
|
+
}): react_jsx_runtime.JSX.Element;
|
|
57
|
+
Button({ children, className, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
58
|
+
TextButton({ children, className, ...props }: TextButtonProps): react_jsx_runtime.JSX.Element;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export { TemplateDialog, TemplateIllustDialog };
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { IconButton, Title, Paragraph, Button, TextButton } from '@liner-fe/prism';
|
|
4
|
+
import { Dialog } from 'radix-ui';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
7
|
+
|
|
8
|
+
// ../icon/lib/index.js
|
|
9
|
+
|
|
10
|
+
// ../../node_modules/@toss/utils/esm/hexToRgba.mjs
|
|
11
|
+
function parseHexValueStr(str) {
|
|
12
|
+
return parseInt(str, 16);
|
|
13
|
+
}
|
|
14
|
+
function isValidHexValue(hex) {
|
|
15
|
+
var regex = /^#?[0-9A-Fa-f]{6}$/;
|
|
16
|
+
return regex.test(hex);
|
|
17
|
+
}
|
|
18
|
+
function isAlphaValue(alpha) {
|
|
19
|
+
return 0 <= alpha && alpha <= 1;
|
|
20
|
+
}
|
|
21
|
+
function hexToRgba(hex) {
|
|
22
|
+
var alpha = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
|
|
23
|
+
if (!isValidHexValue(hex)) {
|
|
24
|
+
throw new Error("Invalid hex value: ".concat(hex));
|
|
25
|
+
}
|
|
26
|
+
if (!isAlphaValue(alpha)) {
|
|
27
|
+
throw new Error("Invalid alpha value(0~1): ".concat(alpha));
|
|
28
|
+
}
|
|
29
|
+
var normalizedHex = hex.startsWith("#") ? hex.slice(1) : hex;
|
|
30
|
+
var r = parseHexValueStr(normalizedHex.slice(0, 2));
|
|
31
|
+
var g = parseHexValueStr(normalizedHex.slice(2, 4));
|
|
32
|
+
var b = parseHexValueStr(normalizedHex.slice(4, 6));
|
|
33
|
+
return "rgba(".concat(r, ",").concat(g, ",").concat(b, ",").concat(alpha, ")");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// ../../internal/design-token-primitive/dist/index.mjs
|
|
37
|
+
var breakpointOrigin = {
|
|
38
|
+
xs: "0px",
|
|
39
|
+
s: "600px",
|
|
40
|
+
m: "1024px",
|
|
41
|
+
l: "1366px",
|
|
42
|
+
xl: "1536px",
|
|
43
|
+
xxl: "1920px",
|
|
44
|
+
xxxl: "2560px"
|
|
45
|
+
};
|
|
46
|
+
var makeBreakpoint = (key) => `@media (max-width: ${breakpointOrigin[key]})`;
|
|
47
|
+
({
|
|
48
|
+
s: makeBreakpoint("s"),
|
|
49
|
+
m: makeBreakpoint("m"),
|
|
50
|
+
l: makeBreakpoint("l"),
|
|
51
|
+
xl: makeBreakpoint("xl"),
|
|
52
|
+
xxl: makeBreakpoint("xxl"),
|
|
53
|
+
xxxl: makeBreakpoint("xxxl")
|
|
54
|
+
});
|
|
55
|
+
var iconSizeMap = {
|
|
56
|
+
xs: 16,
|
|
57
|
+
s: 20,
|
|
58
|
+
m: 24,
|
|
59
|
+
l: 32,
|
|
60
|
+
xl: 40
|
|
61
|
+
};
|
|
62
|
+
var system = {
|
|
63
|
+
// neutral / container
|
|
64
|
+
"neutral-container-lowest": ["lp-pri-achromatic-white", "lp-pri-gray-cool-100"],
|
|
65
|
+
"neutral-container-lowest-hover": ["lp-pri-gray-cool-980", "lp-pri-gray-cool-200"],
|
|
66
|
+
"neutral-container-low": ["lp-pri-gray-cool-980", "lp-pri-gray-cool-200"],
|
|
67
|
+
"neutral-container-low-hover": ["lp-pri-gray-cool-970", "lp-pri-gray-cool-250"],
|
|
68
|
+
"neutral-container-mid": ["lp-pri-gray-cool-970", "lp-pri-gray-cool-250"],
|
|
69
|
+
"neutral-container-mid-hover": ["lp-pri-gray-cool-950", "lp-pri-gray-cool-270"],
|
|
70
|
+
"neutral-container-high": ["lp-pri-gray-cool-940", "lp-pri-gray-cool-250"],
|
|
71
|
+
"neutral-container-high-hover": ["lp-pri-gray-cool-900", "lp-pri-gray-cool-300"],
|
|
72
|
+
"neutral-container-highest": ["lp-pri-gray-cool-920", "lp-pri-gray-cool-300"],
|
|
73
|
+
"neutral-container-static-lowest": ["lp-pri-achromatic-white", "lp-pri-achromatic-white"],
|
|
74
|
+
"neutral-container-static-lowest-hover": ["lp-pri-gray-cool-980", "lp-pri-gray-cool-980"],
|
|
75
|
+
"neutral-container-variation-lowest": ["lp-pri-achromatic-white", "lp-pri-gray-cool-200"],
|
|
76
|
+
// neutral / fill / overlay
|
|
77
|
+
"neutral-fill-overlay-lowest": ["lp-pri-gray-cool-dark-alpha-0", "lp-pri-gray-cool-dark-alpha-0"],
|
|
78
|
+
"neutral-fill-overlay-lowest-hover": [
|
|
79
|
+
"lp-pri-gray-cool-dark-alpha-6",
|
|
80
|
+
"lp-pri-gray-cool-dark-alpha-12"
|
|
81
|
+
],
|
|
82
|
+
"neutral-fill-overlay-low": ["lp-pri-gray-cool-dark-alpha-4", "lp-pri-gray-cool-dark-alpha-8"],
|
|
83
|
+
"neutral-fill-overlay-low-hover": [
|
|
84
|
+
"lp-pri-gray-cool-dark-alpha-8",
|
|
85
|
+
"lp-pri-gray-cool-dark-alpha-20"
|
|
86
|
+
],
|
|
87
|
+
"neutral-fill-overlay-mid": ["lp-pri-gray-cool-dark-alpha-8", "lp-pri-gray-cool-dark-alpha-16"],
|
|
88
|
+
"neutral-fill-overlay-mid-hover": [
|
|
89
|
+
"lp-pri-gray-cool-dark-alpha-16",
|
|
90
|
+
"lp-pri-gray-cool-dark-alpha-32"
|
|
91
|
+
],
|
|
92
|
+
"neutral-fill-overlay-high": ["lp-pri-gray-cool-dark-alpha-20", "lp-pri-gray-cool-dark-alpha-32"],
|
|
93
|
+
"neutral-fill-overlay-high-hover": [
|
|
94
|
+
"lp-pri-gray-cool-dark-alpha-28",
|
|
95
|
+
"lp-pri-gray-cool-dark-alpha-44"
|
|
96
|
+
],
|
|
97
|
+
"neutral-fill-overlay-highest": [
|
|
98
|
+
"lp-pri-gray-cool-dark-alpha-72",
|
|
99
|
+
"lp-pri-gray-cool-dark-alpha-72"
|
|
100
|
+
],
|
|
101
|
+
// neutral / fill / opaque
|
|
102
|
+
"neutral-fill-opaque-lowest": ["lp-pri-achromatic-white", "lp-pri-gray-cool-100"],
|
|
103
|
+
"neutral-fill-opaque-lowest-hover": ["lp-pri-gray-cool-980", "lp-pri-gray-cool-200"],
|
|
104
|
+
"neutral-fill-opaque-low": ["lp-pri-gray-cool-980", "lp-pri-gray-cool-200"],
|
|
105
|
+
"neutral-fill-opaque-low-hover": ["lp-pri-gray-cool-970", "lp-pri-gray-cool-250"],
|
|
106
|
+
"neutral-fill-opaque-static-lowest": ["lp-pri-achromatic-white", "lp-pri-achromatic-white"],
|
|
107
|
+
// neutral / label
|
|
108
|
+
"neutral-label-primary": ["lp-pri-gray-cool-100", "lp-pri-achromatic-white"],
|
|
109
|
+
"neutral-label-secondary": ["lp-pri-gray-cool-dark-alpha-80", "lp-pri-gray-cool-light-alpha-64"],
|
|
110
|
+
"neutral-label-tertiary": ["lp-pri-gray-cool-dark-alpha-48", "lp-pri-gray-cool-light-alpha-32"],
|
|
111
|
+
"neutral-label-quaternary": ["lp-pri-gray-cool-dark-alpha-24", "lp-pri-gray-cool-light-alpha-20"],
|
|
112
|
+
"neutral-label-static-primary": ["lp-pri-gray-cool-100", "lp-pri-gray-cool-100"],
|
|
113
|
+
"neutral-label-static-secondary": [
|
|
114
|
+
"lp-pri-gray-cool-dark-alpha-80",
|
|
115
|
+
"lp-pri-gray-cool-dark-alpha-80"
|
|
116
|
+
],
|
|
117
|
+
// neutral / border
|
|
118
|
+
"neutral-border-overlay-strong": [
|
|
119
|
+
"lp-pri-gray-cool-dark-alpha-64",
|
|
120
|
+
"lp-pri-gray-cool-light-alpha-64"
|
|
121
|
+
],
|
|
122
|
+
"neutral-border-overlay-normal": [
|
|
123
|
+
"lp-pri-gray-cool-dark-alpha-24",
|
|
124
|
+
"lp-pri-gray-cool-light-alpha-28"
|
|
125
|
+
],
|
|
126
|
+
"neutral-border-overlay-subtle": [
|
|
127
|
+
"lp-pri-gray-cool-dark-alpha-16",
|
|
128
|
+
"lp-pri-gray-cool-light-alpha-20"
|
|
129
|
+
],
|
|
130
|
+
"neutral-border-overlay-hint": [
|
|
131
|
+
"lp-pri-gray-cool-dark-alpha-12",
|
|
132
|
+
"lp-pri-gray-cool-light-alpha-12"
|
|
133
|
+
],
|
|
134
|
+
"neutral-border-opaque-strong": ["lp-pri-gray-cool-100", "lp-pri-achromatic-white"],
|
|
135
|
+
"neutral-border-opaque-normal": ["lp-pri-gray-cool-850", "lp-pri-gray-cool-350"],
|
|
136
|
+
"neutral-border-opaque-subtle": ["lp-pri-gray-cool-920", "lp-pri-gray-cool-250"],
|
|
137
|
+
// inverse / container
|
|
138
|
+
"inverse-container-lowest": ["lp-pri-gray-cool-100", "lp-pri-achromatic-white"],
|
|
139
|
+
"inverse-container-lowest-hover": ["lp-pri-gray-cool-200", "lp-pri-gray-cool-980"],
|
|
140
|
+
"inverse-container-low": ["lp-pri-gray-cool-200", "lp-pri-gray-cool-980"],
|
|
141
|
+
"inverse-container-low-hover": ["lp-pri-gray-cool-250", "lp-pri-gray-cool-970"],
|
|
142
|
+
"inverse-container-mid": ["lp-pri-gray-cool-250", "lp-pri-gray-cool-970"],
|
|
143
|
+
"inverse-container-mid-hover": ["lp-pri-gray-cool-270", "lp-pri-gray-cool-950"],
|
|
144
|
+
"inverse-container-high": ["lp-pri-gray-cool-250", "lp-pri-gray-cool-940"],
|
|
145
|
+
"inverse-container-high-hover": ["lp-pri-gray-cool-300", "lp-pri-gray-cool-900"],
|
|
146
|
+
"inverse-container-static-high": ["lp-pri-gray-cool-250", "lp-pri-gray-cool-250"],
|
|
147
|
+
"inverse-container-static-high-hover": ["lp-pri-gray-cool-270", "lp-pri-gray-cool-270"],
|
|
148
|
+
"inverse-container-highest": ["lp-pri-gray-cool-300", "lp-pri-gray-cool-920"],
|
|
149
|
+
// inverse / fill / opaque
|
|
150
|
+
"inverse-fill-opaque-lowest": ["lp-pri-gray-cool-100", "lp-pri-achromatic-white"],
|
|
151
|
+
"inverse-fill-opaque-lowest-hover": ["lp-pri-gray-cool-200", "lp-pri-gray-cool-980"],
|
|
152
|
+
"inverse-fill-opaque-low": ["lp-pri-gray-cool-200", "lp-pri-gray-cool-980"],
|
|
153
|
+
"inverse-fill-opaque-low-hover": ["lp-pri-gray-cool-250", "lp-pri-gray-cool-970"],
|
|
154
|
+
"inverse-fill-opaque-mid": ["lp-pri-gray-cool-250", "lp-pri-gray-cool-970"],
|
|
155
|
+
// inverse / fill
|
|
156
|
+
"inverse-fill-mid": ["lp-pri-achromatic-white", "lp-pri-gray-cool-light-alpha-24"],
|
|
157
|
+
"inverse-fill-mid-hover": ["lp-pri-gray-cool-dark-alpha-32", "lp-pri-gray-cool-dark-alpha-16"],
|
|
158
|
+
// inverse / label
|
|
159
|
+
"inverse-label-primary": ["lp-pri-achromatic-white", "lp-pri-gray-cool-100"],
|
|
160
|
+
"inverse-label-secondary": ["lp-pri-gray-cool-light-alpha-64", "lp-pri-gray-cool-dark-alpha-80"],
|
|
161
|
+
"inverse-label-tertiary": ["lp-pri-gray-cool-light-alpha-32", "lp-pri-gray-cool-dark-alpha-48"],
|
|
162
|
+
"inverse-label-quaternary": ["lp-pri-gray-cool-light-alpha-20", "lp-pri-gray-cool-dark-alpha-24"],
|
|
163
|
+
"inverse-label-static-primary": ["lp-pri-achromatic-white", "lp-pri-achromatic-white"],
|
|
164
|
+
"inverse-label-static-secondary": [
|
|
165
|
+
"lp-pri-gray-cool-light-alpha-64",
|
|
166
|
+
"lp-pri-gray-cool-light-alpha-64"
|
|
167
|
+
],
|
|
168
|
+
// inverse / border
|
|
169
|
+
"inverse-border-overlay-strong": [
|
|
170
|
+
"lp-pri-gray-cool-light-alpha-64",
|
|
171
|
+
"lp-pri-gray-cool-dark-alpha-64"
|
|
172
|
+
],
|
|
173
|
+
"inverse-border-overlay-normal": [
|
|
174
|
+
"lp-pri-gray-cool-light-alpha-28",
|
|
175
|
+
"lp-pri-gray-cool-dark-alpha-24"
|
|
176
|
+
],
|
|
177
|
+
"inverse-border-overlay-subtle": [
|
|
178
|
+
"lp-pri-gray-cool-light-alpha-20",
|
|
179
|
+
"lp-pri-gray-cool-dark-alpha-16"
|
|
180
|
+
],
|
|
181
|
+
"inverse-border-overlay-hint": [
|
|
182
|
+
"lp-pri-gray-cool-light-alpha-12",
|
|
183
|
+
"lp-pri-gray-cool-dark-alpha-12"
|
|
184
|
+
],
|
|
185
|
+
"inverse-border-opaque-strong": ["lp-pri-achromatic-white", "lp-pri-gray-cool-100"],
|
|
186
|
+
"inverse-border-opaque-normal": ["lp-pri-gray-cool-350", "lp-pri-gray-cool-850"],
|
|
187
|
+
"inverse-border-opaque-subtle": ["lp-pri-gray-cool-250", "lp-pri-gray-cool-920"],
|
|
188
|
+
// brand / container
|
|
189
|
+
"brand-container-mid": ["lp-pri-brand-original-200", "lp-pri-brand-variation-380"],
|
|
190
|
+
"brand-container-mid-hover": ["lp-pri-brand-original-150", "lp-pri-brand-variation-420"],
|
|
191
|
+
"brand-container-high": ["lp-pri-brand-original-500", "lp-pri-brand-original-500"],
|
|
192
|
+
// brand / fill
|
|
193
|
+
"brand-fill-mid": ["lp-pri-brand-original-200", "lp-pri-brand-variation-380"],
|
|
194
|
+
"brand-fill-mid-hover": ["lp-pri-brand-original-150", "lp-pri-brand-variation-420"],
|
|
195
|
+
"brand-fill-low": ["lp-pri-brand-original-990", "lp-pri-brand-variation-350"],
|
|
196
|
+
"brand-fill-low-hover": ["lp-pri-brand-original-980", "lp-pri-brand-variation-380"],
|
|
197
|
+
// brand / label
|
|
198
|
+
"brand-label-primary": ["lp-pri-brand-original-500", "lp-pri-brand-variation-950"],
|
|
199
|
+
"brand-label-secondary": ["lp-pri-brand-original-200", "lp-pri-achromatic-white"],
|
|
200
|
+
"brand-label-variation-secondary": ["lp-pri-brand-original-200", "lp-pri-brand-variation-970"],
|
|
201
|
+
// brand / border
|
|
202
|
+
"brand-border-opaque-normal": ["lp-pri-brand-original-200", "lp-pri-achromatic-white"],
|
|
203
|
+
"brand-border-opaque-strong": ["lp-pri-brand-original-500", "lp-pri-brand-variation-950"],
|
|
204
|
+
// brand / inverse label
|
|
205
|
+
"brandinverse-label-primary": ["lp-pri-brand-variation-950", "lp-pri-brand-original-500"],
|
|
206
|
+
"brandinverse-label-secondary": ["lp-pri-achromatic-white", "lp-pri-brand-original-200"],
|
|
207
|
+
"brandinverse-label-static-primary": ["lp-pri-brand-variation-950", "lp-pri-brand-variation-950"],
|
|
208
|
+
// accent / label
|
|
209
|
+
"accent-label-primary": ["lp-pri-rainbow-orange-700", "lp-pri-rainbow-orange-730"],
|
|
210
|
+
"accent-label-yellow": ["lp-pri-rainbow-yellow-500", "lp-pri-rainbow-yellow-600"],
|
|
211
|
+
"accent-label-mint": ["lp-pri-rainbow-mint-500", "lp-pri-rainbow-mint-600"],
|
|
212
|
+
"accent-label-cyan": ["lp-pri-rainbow-cyan-500", "lp-pri-rainbow-cyan-600"],
|
|
213
|
+
"accent-label-purple": ["lp-pri-rainbow-purple-500", "lp-pri-rainbow-purple-600"],
|
|
214
|
+
"accent-label-pink": ["lp-pri-rainbow-pink-500", "lp-pri-rainbow-pink-600"],
|
|
215
|
+
// accent / fill
|
|
216
|
+
"accent-fill-primary": ["lp-pri-rainbow-orange-800", "lp-pri-rainbow-orange-500"],
|
|
217
|
+
// function / fill
|
|
218
|
+
"function-fill-positive-mid": ["lp-pri-rainbow-green-500", "lp-pri-rainbow-green-600"],
|
|
219
|
+
"function-fill-negative-mid": ["lp-pri-rainbow-red-500", "lp-pri-rainbow-red-500"],
|
|
220
|
+
"function-fill-negative-mid-hover": ["lp-pri-rainbow-red-400", "lp-pri-rainbow-red-600"],
|
|
221
|
+
"function-fill-caution": ["lp-pri-rainbow-orange-700", "lp-pri-rainbow-orange-730"],
|
|
222
|
+
"function-fill-highlight": ["lp-pri-rainbow-lime_green-970", "lp-pri-rainbow-lime_green-300"],
|
|
223
|
+
"function-fill-selection": ["lp-pri-brand-original-alpha-8", "lp-pri-achromatic-white-alpha-12"],
|
|
224
|
+
"function-fill-drag": ["lp-pri-brand-original-alpha-12", "lp-pri-achromatic-white-alpha-16"],
|
|
225
|
+
"function-fill-positive-low": ["lp-pri-rainbow-green-900", "lp-pri-rainbow-green-200"],
|
|
226
|
+
"function-fill-negative-low": ["lp-pri-rainbow-red-900", "lp-pri-rainbow-red-200"],
|
|
227
|
+
// function / label
|
|
228
|
+
"function-label-positive": ["lp-pri-rainbow-green-500", "lp-pri-rainbow-green-600"],
|
|
229
|
+
"function-label-negative": ["lp-pri-rainbow-red-500", "lp-pri-rainbow-red-500"],
|
|
230
|
+
"function-label-caution": ["lp-pri-rainbow-orange-700", "lp-pri-rainbow-orange-730"],
|
|
231
|
+
"function-label-link": ["lp-pri-rainbow-cyan-300", "lp-pri-rainbow-cyan-600"],
|
|
232
|
+
// cover
|
|
233
|
+
"cover-dim-page": ["lp-pri-achromatic-black-alpha-48", "lp-pri-achromatic-black-alpha-48"]
|
|
234
|
+
};
|
|
235
|
+
var alphas = [
|
|
236
|
+
80,
|
|
237
|
+
72,
|
|
238
|
+
64,
|
|
239
|
+
56,
|
|
240
|
+
50,
|
|
241
|
+
48,
|
|
242
|
+
44,
|
|
243
|
+
40,
|
|
244
|
+
36,
|
|
245
|
+
32,
|
|
246
|
+
28,
|
|
247
|
+
24,
|
|
248
|
+
20,
|
|
249
|
+
16,
|
|
250
|
+
12,
|
|
251
|
+
8,
|
|
252
|
+
6,
|
|
253
|
+
4,
|
|
254
|
+
1,
|
|
255
|
+
0
|
|
256
|
+
];
|
|
257
|
+
var alphaPrimitive = [
|
|
258
|
+
{ name: "lp-pri-achromatic-white", value: "#FFFFFF" },
|
|
259
|
+
{ name: "lp-pri-gray-cool-dark", value: "#6D6D70" },
|
|
260
|
+
{ name: "lp-pri-gray-cool-light", value: "#E9E9EB" },
|
|
261
|
+
{ name: "lp-pri-brand-original", value: "#14371B" },
|
|
262
|
+
{ name: "lp-pri-brand-variation", value: "#236638" },
|
|
263
|
+
{ name: "lp-pri-achromatic-black", value: "#000000" }
|
|
264
|
+
];
|
|
265
|
+
var generateAlpha = () => {
|
|
266
|
+
alphaPrimitive.forEach(({ name, value }) => {
|
|
267
|
+
alphas.forEach((alpha) => {
|
|
268
|
+
hexToRgba(value.slice(1), alpha / 100);
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
};
|
|
272
|
+
generateAlpha();
|
|
273
|
+
Object.entries(system).map(([key, value]) => {
|
|
274
|
+
value[0];
|
|
275
|
+
value[1];
|
|
276
|
+
});
|
|
277
|
+
var IconClose = /* @__PURE__ */ forwardRef(
|
|
278
|
+
({ fill = false, thick = false, size: size2 = "m", type = "neutral-label-primary", className, fillType = "inverse-label-primary", ...props }, ref) => {
|
|
279
|
+
if (fill && thick) {
|
|
280
|
+
return /* @__PURE__ */ jsx("svg", { width: iconSizeMap[size2], height: iconSizeMap[size2], viewBox: "0 0 48 48", fill: "none", ref, className, ...props, children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M44 24C44 35.0457 35.0457 44 24 44C12.9543 44 4 35.0457 4 24C4 12.9543 12.9543 4 24 4C35.0457 4 44 12.9543 44 24ZM24.0304 21.2242L29.6689 15.5858L32.4973 18.4142L26.8588 24.0527L32.4504 29.6443L29.622 32.4727L24.0304 26.8811L18.4859 32.4256L15.6574 29.5972L21.202 24.0527L15.6106 18.4613L18.439 15.6329L24.0304 21.2242Z", style: { fill: `var(--${type})` } }) });
|
|
281
|
+
} else if (fill) {
|
|
282
|
+
return /* @__PURE__ */ jsx("svg", { width: iconSizeMap[size2], height: iconSizeMap[size2], viewBox: "0 0 48 48", fill: "none", ref, className, ...props, children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M44 24C44 35.0457 35.0457 44 24 44C12.9543 44 4 35.0457 4 24C4 12.9543 12.9543 4 24 4C35.0457 4 44 12.9543 44 24ZM24.0304 21.9314L30.0224 15.9393L32.1437 18.0607L26.1517 24.0527L32.0969 29.9978L29.9756 32.1192L24.0304 26.174L18.1323 32.0721L16.011 29.9508L21.9091 24.0527L15.9641 18.1077L18.0855 15.9864L24.0304 21.9314Z", style: { fill: `var(--${type})` } }) });
|
|
283
|
+
} else if (thick) {
|
|
284
|
+
return /* @__PURE__ */ jsx("svg", { width: iconSizeMap[size2], height: iconSizeMap[size2], viewBox: "0 0 48 48", fill: "none", ref, className, ...props, children: /* @__PURE__ */ jsx("path", { d: "M24.0006 21.1712L12.4153 9.58594L9.58692 12.4144L21.1722 23.9997L9.58691 35.585L12.4153 38.4134L24.0006 26.8281L35.5859 38.4134L38.4144 35.585L26.8291 23.9997L38.4144 12.4144L35.5859 9.58594L24.0006 21.1712Z", style: { fill: `var(--${type})` } }) });
|
|
285
|
+
}
|
|
286
|
+
return /* @__PURE__ */ jsx("svg", { width: iconSizeMap[size2], height: iconSizeMap[size2], viewBox: "0 0 48 48", fill: "none", ref, className, ...props, children: /* @__PURE__ */ jsx("path", { d: "M24.0006 21.8783L12.0618 9.93945L9.94043 12.0608L21.8793 23.9996L9.94043 35.9385L12.0618 38.0598L24.0006 26.1209L35.9395 38.0598L38.0608 35.9385L26.1219 23.9996L38.0608 12.0608L35.9395 9.93946L24.0006 21.8783Z", style: { fill: `var(--${type})` } }) });
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
var tw = (...args) => twMerge(clsx(args));
|
|
290
|
+
var TemplateDialog = ({
|
|
291
|
+
open = false,
|
|
292
|
+
preventEscape = false,
|
|
293
|
+
onOpenChange,
|
|
294
|
+
children
|
|
295
|
+
}) => {
|
|
296
|
+
const handleOpenChange = (open2) => {
|
|
297
|
+
if (preventEscape) {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
onOpenChange?.(open2);
|
|
301
|
+
};
|
|
302
|
+
const handleEscapeKeyDown = (event) => {
|
|
303
|
+
if (!preventEscape) {
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
event.preventDefault();
|
|
307
|
+
};
|
|
308
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Dialog.Root, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [
|
|
309
|
+
/* @__PURE__ */ jsx(Dialog.Overlay, { className: "bg-cover-dim-page fixed inset-0 z-[1000]" }),
|
|
310
|
+
/* @__PURE__ */ jsx(Dialog.Content, { onEscapeKeyDown: handleEscapeKeyDown, children: /* @__PURE__ */ jsx(
|
|
311
|
+
"div",
|
|
312
|
+
{
|
|
313
|
+
className: tw(
|
|
314
|
+
"p-component-600 bg-neutral-container-variation-lowest relative flex flex-col rounded-[16px] shadow-[0_1px_8px_0_rgba(0,0,0,0.06),0_2px_12px_0_rgba(0,0,0,0.08),0_0_1px_0_rgba(0,0,0,0.06)]",
|
|
315
|
+
"max-s:items-center items-start",
|
|
316
|
+
"fixed top-1/2 left-1/2 z-[1000] -translate-x-1/2 -translate-y-1/2",
|
|
317
|
+
"max-s:w-[calc(100%-48px)] w-[400px]",
|
|
318
|
+
"content-animation"
|
|
319
|
+
),
|
|
320
|
+
children
|
|
321
|
+
}
|
|
322
|
+
) })
|
|
323
|
+
] }) }) });
|
|
324
|
+
};
|
|
325
|
+
TemplateDialog.Close = ({ onClose }) => /* @__PURE__ */ jsx(
|
|
326
|
+
IconButton,
|
|
327
|
+
{
|
|
328
|
+
icon: { icon: IconClose },
|
|
329
|
+
size: "m",
|
|
330
|
+
level: "tertiary",
|
|
331
|
+
fill: false,
|
|
332
|
+
className: tw("absolute", "max-s:top-[12px] max-s:right-[12px] top-[16px] right-[16px]"),
|
|
333
|
+
onClick: () => {
|
|
334
|
+
onClose?.();
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
);
|
|
338
|
+
TemplateDialog.Title = ({
|
|
339
|
+
children,
|
|
340
|
+
className
|
|
341
|
+
}) => /* @__PURE__ */ jsx(Dialog.Title, { asChild: true, children: /* @__PURE__ */ jsx(Title, { type: "accent", weight: "bold", size: 4, className: tw(className), children }) });
|
|
342
|
+
TemplateDialog.Description = ({
|
|
343
|
+
children,
|
|
344
|
+
className
|
|
345
|
+
}) => /* @__PURE__ */ jsx(Dialog.Description, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
346
|
+
Paragraph,
|
|
347
|
+
{
|
|
348
|
+
type: "normal",
|
|
349
|
+
weight: "regular",
|
|
350
|
+
size: 4,
|
|
351
|
+
className: tw("mt-component-200 text-neutral-label-primary/90!", className),
|
|
352
|
+
children
|
|
353
|
+
}
|
|
354
|
+
) });
|
|
355
|
+
TemplateDialog.Buttons = ({
|
|
356
|
+
children,
|
|
357
|
+
className
|
|
358
|
+
}) => /* @__PURE__ */ jsx(
|
|
359
|
+
"div",
|
|
360
|
+
{
|
|
361
|
+
className: tw(
|
|
362
|
+
"gap-x-positive-200 flex w-full",
|
|
363
|
+
"max-s:mt-component-600 mt-component-500",
|
|
364
|
+
"max-s:justify-center justify-end",
|
|
365
|
+
className
|
|
366
|
+
),
|
|
367
|
+
children
|
|
368
|
+
}
|
|
369
|
+
);
|
|
370
|
+
TemplateDialog.Button = ({ children, ...props }) => /* @__PURE__ */ jsx(Button, { ...props, className: tw("max-s:flex-1! w-fit!", props.className), children });
|
|
371
|
+
var TemplateIllustDialog = ({
|
|
372
|
+
open = false,
|
|
373
|
+
preventEscape = false,
|
|
374
|
+
onOpenChange,
|
|
375
|
+
children
|
|
376
|
+
}) => {
|
|
377
|
+
const handleOpenChange = (open2) => {
|
|
378
|
+
if (preventEscape) {
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
onOpenChange?.(open2);
|
|
382
|
+
};
|
|
383
|
+
const handleEscapeKeyDown = (event) => {
|
|
384
|
+
if (!preventEscape) {
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
event.preventDefault();
|
|
388
|
+
};
|
|
389
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Dialog.Root, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [
|
|
390
|
+
/* @__PURE__ */ jsx(Dialog.Overlay, { className: "bg-cover-dim-page fixed inset-0 z-[1000]" }),
|
|
391
|
+
/* @__PURE__ */ jsx(Dialog.Content, { onEscapeKeyDown: handleEscapeKeyDown, children: /* @__PURE__ */ jsx(
|
|
392
|
+
"div",
|
|
393
|
+
{
|
|
394
|
+
className: tw(
|
|
395
|
+
"p-component-600 bg-neutral-container-variation-lowest relative flex flex-col rounded-[16px] shadow-[0_1px_8px_0_rgba(0,0,0,0.06),0_2px_12px_0_rgba(0,0,0,0.08),0_0_1px_0_rgba(0,0,0,0.06)]",
|
|
396
|
+
"items-center",
|
|
397
|
+
"fixed top-1/2 left-1/2 z-[1000] -translate-x-1/2 -translate-y-1/2",
|
|
398
|
+
"max-s:w-[calc(100%-48px)] w-[400px]",
|
|
399
|
+
"content-animation"
|
|
400
|
+
),
|
|
401
|
+
children
|
|
402
|
+
}
|
|
403
|
+
) })
|
|
404
|
+
] }) }) });
|
|
405
|
+
};
|
|
406
|
+
TemplateIllustDialog.Close = ({ onClose }) => /* @__PURE__ */ jsx(
|
|
407
|
+
IconButton,
|
|
408
|
+
{
|
|
409
|
+
icon: { icon: IconClose },
|
|
410
|
+
size: "m",
|
|
411
|
+
level: "tertiary",
|
|
412
|
+
fill: false,
|
|
413
|
+
className: tw("absolute", "max-s:top-[12px] max-s:right-[12px] top-[16px] right-[16px]"),
|
|
414
|
+
onClick: () => {
|
|
415
|
+
onClose?.();
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
);
|
|
419
|
+
TemplateIllustDialog.IllustContainer = ({
|
|
420
|
+
children,
|
|
421
|
+
className
|
|
422
|
+
}) => /* @__PURE__ */ jsx("div", { className: tw("pt-component-300", className), children });
|
|
423
|
+
TemplateIllustDialog.Title = ({
|
|
424
|
+
children,
|
|
425
|
+
className
|
|
426
|
+
}) => /* @__PURE__ */ jsx(Dialog.Title, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
427
|
+
Title,
|
|
428
|
+
{
|
|
429
|
+
type: "accent",
|
|
430
|
+
weight: "bold",
|
|
431
|
+
size: 4,
|
|
432
|
+
className: tw("mt-component-500 pt-component-100", className),
|
|
433
|
+
children
|
|
434
|
+
}
|
|
435
|
+
) });
|
|
436
|
+
TemplateIllustDialog.Description = ({
|
|
437
|
+
children,
|
|
438
|
+
className
|
|
439
|
+
}) => /* @__PURE__ */ jsx(Dialog.Description, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
440
|
+
Paragraph,
|
|
441
|
+
{
|
|
442
|
+
type: "normal",
|
|
443
|
+
weight: "regular",
|
|
444
|
+
size: 4,
|
|
445
|
+
className: tw("mt-component-200 pb-component-100 text-neutral-label-primary/90!", className),
|
|
446
|
+
children
|
|
447
|
+
}
|
|
448
|
+
) });
|
|
449
|
+
TemplateIllustDialog.Buttons = ({
|
|
450
|
+
children,
|
|
451
|
+
className
|
|
452
|
+
}) => /* @__PURE__ */ jsx(
|
|
453
|
+
"div",
|
|
454
|
+
{
|
|
455
|
+
className: tw(
|
|
456
|
+
"mt-component-600 gap-y-component-400 flex w-full flex-col justify-center",
|
|
457
|
+
className
|
|
458
|
+
),
|
|
459
|
+
children
|
|
460
|
+
}
|
|
461
|
+
);
|
|
462
|
+
TemplateIllustDialog.Button = ({ children, className, ...props }) => /* @__PURE__ */ jsx(Button, { ...props, className: tw("w-full!", className), children });
|
|
463
|
+
TemplateIllustDialog.TextButton = ({ children, className, ...props }) => /* @__PURE__ */ jsx(TextButton, { ...props, className: tw(className), children });
|
|
464
|
+
|
|
465
|
+
export { TemplateDialog, TemplateIllustDialog };
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@liner-fe/design-library",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"lint": "eslint .",
|
|
7
|
+
"preview": "vite preview",
|
|
8
|
+
"storybook": "storybook dev -p 6006",
|
|
9
|
+
"build-storybook": "storybook build",
|
|
10
|
+
"build": "yarn tsup --config ./tsup.config.ts",
|
|
11
|
+
"build:package": "yarn build",
|
|
12
|
+
"prepack": "yarn build"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@liner-fe/design-token": "workspace:^",
|
|
16
|
+
"@liner-fe/prism": "workspace:^",
|
|
17
|
+
"@tailwindcss/vite": "^4.1.14",
|
|
18
|
+
"clsx": "^2.1.1",
|
|
19
|
+
"radix-ui": "^1.4.3",
|
|
20
|
+
"react": "18.2.0",
|
|
21
|
+
"react-dom": "18.2.0",
|
|
22
|
+
"tailwind-merge": "^3.3.1",
|
|
23
|
+
"tailwindcss": "^4.1.14"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@chromatic-com/storybook": "^4.1.1",
|
|
27
|
+
"@eslint/js": "^9.36.0",
|
|
28
|
+
"@storybook/addon-a11y": "^9.1.13",
|
|
29
|
+
"@storybook/addon-docs": "^9.1.13",
|
|
30
|
+
"@storybook/addon-onboarding": "^9.1.13",
|
|
31
|
+
"@storybook/addon-themes": "^9.1.13",
|
|
32
|
+
"@storybook/addon-vitest": "^9.1.13",
|
|
33
|
+
"@storybook/react-vite": "^9.1.13",
|
|
34
|
+
"@types/node": "^24.6.0",
|
|
35
|
+
"@types/react": "^18.2.12",
|
|
36
|
+
"@types/react-dom": "^18.2.5",
|
|
37
|
+
"@vitejs/plugin-react": "^5.0.4",
|
|
38
|
+
"@vitest/browser": "^3.2.4",
|
|
39
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
40
|
+
"eslint": "^9.36.0",
|
|
41
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
42
|
+
"eslint-plugin-react-refresh": "^0.4.22",
|
|
43
|
+
"eslint-plugin-storybook": "^9.1.13",
|
|
44
|
+
"globals": "^16.4.0",
|
|
45
|
+
"playwright": "^1.56.1",
|
|
46
|
+
"storybook": "^9.1.13",
|
|
47
|
+
"tsup": "^8.5.0",
|
|
48
|
+
"typescript": "~5.9.3",
|
|
49
|
+
"typescript-eslint": "^8.45.0",
|
|
50
|
+
"vite": "^7.1.7",
|
|
51
|
+
"vitest": "^3.2.4"
|
|
52
|
+
},
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"access": "public"
|
|
55
|
+
},
|
|
56
|
+
"files": [
|
|
57
|
+
"lib"
|
|
58
|
+
],
|
|
59
|
+
"main": "./lib/index.js",
|
|
60
|
+
"types": "./lib/index.d.ts"
|
|
61
|
+
}
|