@likelion-design/ui 0.1.7 → 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 +29 -11
- package/dist/chunk-H3TEQK57.mjs +2 -0
- package/dist/colors.css.css +2 -0
- package/dist/colors.css.css.map +1 -0
- package/dist/colors.css.d.mts +2 -0
- package/dist/colors.css.d.ts +2 -0
- package/dist/index.css +1 -1215
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +245 -5
- package/dist/index.d.ts +245 -5
- package/dist/index.js +1 -406
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -19
- package/dist/index.mjs.map +1 -1
- package/dist/tailwind-preset.d.mts +320 -4
- package/dist/tailwind-preset.d.ts +320 -4
- package/dist/tailwind-preset.js +1 -57
- package/dist/tailwind-preset.js.map +1 -1
- package/dist/tailwind-preset.mjs +1 -64
- package/dist/tailwind-preset.mjs.map +1 -1
- package/package.json +20 -25
- package/dist/Button.css +0 -415
- package/dist/Button.css.map +0 -1
- package/dist/Button.d.mts +0 -63
- package/dist/Button.d.ts +0 -63
- package/dist/Button.js +0 -232
- package/dist/Button.js.map +0 -1
- package/dist/Button.mjs +0 -12
- package/dist/Header.css +0 -450
- package/dist/Header.css.map +0 -1
- package/dist/Header.d.mts +0 -14
- package/dist/Header.d.ts +0 -14
- package/dist/Header.js +0 -160
- package/dist/Header.js.map +0 -1
- package/dist/Header.mjs +0 -9
- package/dist/Header.mjs.map +0 -1
- package/dist/Page.css +0 -516
- package/dist/Page.css.map +0 -1
- package/dist/Page.d.mts +0 -5
- package/dist/Page.d.ts +0 -5
- package/dist/Page.js +0 -262
- package/dist/Page.js.map +0 -1
- package/dist/Page.mjs +0 -10
- package/dist/Page.mjs.map +0 -1
- package/dist/chunk-22Q3FVTV.mjs +0 -43
- package/dist/chunk-22Q3FVTV.mjs.map +0 -1
- package/dist/chunk-4T4Z32IO.mjs +0 -102
- package/dist/chunk-4T4Z32IO.mjs.map +0 -1
- package/dist/chunk-6BR7YIWI.mjs +0 -181
- package/dist/chunk-6BR7YIWI.mjs.map +0 -1
- package/dist/chunk-DDHQ5ZFF.mjs +0 -75
- package/dist/chunk-DDHQ5ZFF.mjs.map +0 -1
- /package/dist/{Button.mjs.map → chunk-H3TEQK57.mjs.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,407 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __defProps = Object.defineProperties;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
-
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b || (b = {}))
|
|
15
|
-
if (__hasOwnProp.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
if (__getOwnPropSymbols)
|
|
18
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
-
if (__propIsEnum.call(b, prop))
|
|
20
|
-
__defNormalProp(a, prop, b[prop]);
|
|
21
|
-
}
|
|
22
|
-
return a;
|
|
23
|
-
};
|
|
24
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
-
var __objRest = (source, exclude) => {
|
|
26
|
-
var target = {};
|
|
27
|
-
for (var prop in source)
|
|
28
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
if (source != null && __getOwnPropSymbols)
|
|
31
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
-
target[prop] = source[prop];
|
|
34
|
-
}
|
|
35
|
-
return target;
|
|
36
|
-
};
|
|
37
|
-
var __export = (target, all) => {
|
|
38
|
-
for (var name in all)
|
|
39
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
|
-
};
|
|
41
|
-
var __copyProps = (to, from, except, desc) => {
|
|
42
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
43
|
-
for (let key of __getOwnPropNames(from))
|
|
44
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
45
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
46
|
-
}
|
|
47
|
-
return to;
|
|
48
|
-
};
|
|
49
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
50
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
51
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
52
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
53
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
54
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
55
|
-
mod
|
|
56
|
-
));
|
|
57
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
-
|
|
59
|
-
// src/index.ts
|
|
60
|
-
var src_exports = {};
|
|
61
|
-
__export(src_exports, {
|
|
62
|
-
ActionButton: () => ActionButton,
|
|
63
|
-
Button: () => Button,
|
|
64
|
-
Header: () => Header,
|
|
65
|
-
IconButton: () => IconButton,
|
|
66
|
-
Page: () => Page
|
|
67
|
-
});
|
|
68
|
-
module.exports = __toCommonJS(src_exports);
|
|
69
|
-
|
|
70
|
-
// src/stories/button.module.css
|
|
71
|
-
var button_default = {};
|
|
72
|
-
|
|
73
|
-
// src/stories/Button.tsx
|
|
74
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
75
|
-
var ActionButton = (_a) => {
|
|
76
|
-
var _b = _a, {
|
|
77
|
-
size = "medium",
|
|
78
|
-
variant = "primary",
|
|
79
|
-
shape = "solid",
|
|
80
|
-
state = "enabled",
|
|
81
|
-
children,
|
|
82
|
-
prefixIcon,
|
|
83
|
-
suffixIcon,
|
|
84
|
-
loading = false,
|
|
85
|
-
className = "",
|
|
86
|
-
disabled
|
|
87
|
-
} = _b, props = __objRest(_b, [
|
|
88
|
-
"size",
|
|
89
|
-
"variant",
|
|
90
|
-
"shape",
|
|
91
|
-
"state",
|
|
92
|
-
"children",
|
|
93
|
-
"prefixIcon",
|
|
94
|
-
"suffixIcon",
|
|
95
|
-
"loading",
|
|
96
|
-
"className",
|
|
97
|
-
"disabled"
|
|
98
|
-
]);
|
|
99
|
-
const isDisabled = disabled || state === "disabled" || loading;
|
|
100
|
-
const actualState = loading ? "loading" : state;
|
|
101
|
-
const baseClasses = [
|
|
102
|
-
button_default["action-button"],
|
|
103
|
-
button_default[`action-button--${size}`],
|
|
104
|
-
button_default[`action-button--${variant}`],
|
|
105
|
-
button_default[`action-button--${shape}`],
|
|
106
|
-
button_default[`action-button--${actualState}`],
|
|
107
|
-
className
|
|
108
|
-
].filter(Boolean).join(" ");
|
|
109
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
110
|
-
"button",
|
|
111
|
-
__spreadProps(__spreadValues({
|
|
112
|
-
type: "button",
|
|
113
|
-
className: baseClasses,
|
|
114
|
-
disabled: isDisabled
|
|
115
|
-
}, props), {
|
|
116
|
-
children: [
|
|
117
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: button_default["action-button__content"], children: [
|
|
118
|
-
prefixIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: button_default["action-button__prefix-icon"], children: prefixIcon }),
|
|
119
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: button_default["action-button__label"], children }),
|
|
120
|
-
suffixIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: button_default["action-button__suffix-icon"], children: suffixIcon })
|
|
121
|
-
] }),
|
|
122
|
-
loading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: button_default["action-button__spinner"], "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
123
|
-
"svg",
|
|
124
|
-
{
|
|
125
|
-
className: button_default["action-button__spinner-svg"],
|
|
126
|
-
viewBox: "0 0 24 24",
|
|
127
|
-
fill: "none",
|
|
128
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
129
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
130
|
-
"circle",
|
|
131
|
-
{
|
|
132
|
-
className: button_default["action-button__spinner-circle"],
|
|
133
|
-
cx: "12",
|
|
134
|
-
cy: "12",
|
|
135
|
-
r: "10",
|
|
136
|
-
stroke: "currentColor",
|
|
137
|
-
strokeWidth: "4",
|
|
138
|
-
strokeLinecap: "round",
|
|
139
|
-
strokeDasharray: "32",
|
|
140
|
-
strokeDashoffset: "32",
|
|
141
|
-
children: [
|
|
142
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
143
|
-
"animate",
|
|
144
|
-
{
|
|
145
|
-
attributeName: "stroke-dasharray",
|
|
146
|
-
dur: "2s",
|
|
147
|
-
values: "0 40;40 40;0 40",
|
|
148
|
-
repeatCount: "indefinite"
|
|
149
|
-
}
|
|
150
|
-
),
|
|
151
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
152
|
-
"animate",
|
|
153
|
-
{
|
|
154
|
-
attributeName: "stroke-dashoffset",
|
|
155
|
-
dur: "2s",
|
|
156
|
-
values: "0;-40;-80",
|
|
157
|
-
repeatCount: "indefinite"
|
|
158
|
-
}
|
|
159
|
-
)
|
|
160
|
-
]
|
|
161
|
-
}
|
|
162
|
-
)
|
|
163
|
-
}
|
|
164
|
-
) })
|
|
165
|
-
]
|
|
166
|
-
})
|
|
167
|
-
);
|
|
168
|
-
};
|
|
169
|
-
var Button = (_a) => {
|
|
170
|
-
var _b = _a, {
|
|
171
|
-
primary = false,
|
|
172
|
-
size = "medium",
|
|
173
|
-
backgroundColor,
|
|
174
|
-
label
|
|
175
|
-
} = _b, props = __objRest(_b, [
|
|
176
|
-
"primary",
|
|
177
|
-
"size",
|
|
178
|
-
"backgroundColor",
|
|
179
|
-
"label"
|
|
180
|
-
]);
|
|
181
|
-
const mode = primary ? button_default["storybook-button--primary"] : button_default["storybook-button--secondary"];
|
|
182
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
183
|
-
"button",
|
|
184
|
-
__spreadProps(__spreadValues({
|
|
185
|
-
type: "button",
|
|
186
|
-
className: [
|
|
187
|
-
button_default["storybook-button"],
|
|
188
|
-
button_default[`storybook-button--${size}`],
|
|
189
|
-
mode
|
|
190
|
-
].join(" "),
|
|
191
|
-
style: { backgroundColor }
|
|
192
|
-
}, props), {
|
|
193
|
-
children: label
|
|
194
|
-
})
|
|
195
|
-
);
|
|
196
|
-
};
|
|
197
|
-
var IconButton = (_a) => {
|
|
198
|
-
var _b = _a, {
|
|
199
|
-
size = "large",
|
|
200
|
-
variant = "primary",
|
|
201
|
-
iconType = "solid",
|
|
202
|
-
state = "enabled",
|
|
203
|
-
icon,
|
|
204
|
-
className = "",
|
|
205
|
-
disabled,
|
|
206
|
-
type = "button"
|
|
207
|
-
} = _b, props = __objRest(_b, [
|
|
208
|
-
"size",
|
|
209
|
-
"variant",
|
|
210
|
-
"iconType",
|
|
211
|
-
"state",
|
|
212
|
-
"icon",
|
|
213
|
-
"className",
|
|
214
|
-
"disabled",
|
|
215
|
-
"type"
|
|
216
|
-
]);
|
|
217
|
-
const isDisabled = disabled || state === "disabled";
|
|
218
|
-
const actualState = iconType === "weak" && isDisabled ? "enabled" : state;
|
|
219
|
-
const baseClasses = [
|
|
220
|
-
button_default["icon-button"],
|
|
221
|
-
button_default[`icon-button--${size}`],
|
|
222
|
-
button_default[`icon-button--${variant}`],
|
|
223
|
-
button_default[`icon-button--${iconType}`],
|
|
224
|
-
button_default[`icon-button--${actualState}`],
|
|
225
|
-
className
|
|
226
|
-
].filter(Boolean).join(" ");
|
|
227
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
228
|
-
"button",
|
|
229
|
-
__spreadProps(__spreadValues({
|
|
230
|
-
type,
|
|
231
|
-
className: baseClasses,
|
|
232
|
-
disabled: isDisabled
|
|
233
|
-
}, props), {
|
|
234
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: button_default["icon-button__icon"], children: icon })
|
|
235
|
-
})
|
|
236
|
-
);
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
// src/stories/header.module.css
|
|
240
|
-
var header_default = {};
|
|
241
|
-
|
|
242
|
-
// src/stories/Header.tsx
|
|
243
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
244
|
-
var Header = ({
|
|
245
|
-
user,
|
|
246
|
-
onLogin,
|
|
247
|
-
onLogout,
|
|
248
|
-
onCreateAccount
|
|
249
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("header", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: header_default["storybook-header"], children: [
|
|
250
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
|
|
251
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
252
|
-
"svg",
|
|
253
|
-
{
|
|
254
|
-
width: "32",
|
|
255
|
-
height: "32",
|
|
256
|
-
viewBox: "0 0 32 32",
|
|
257
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
258
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("g", { fill: "none", fillRule: "evenodd", children: [
|
|
259
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
260
|
-
"path",
|
|
261
|
-
{
|
|
262
|
-
d: "M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z",
|
|
263
|
-
fill: "#FFF"
|
|
264
|
-
}
|
|
265
|
-
),
|
|
266
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
267
|
-
"path",
|
|
268
|
-
{
|
|
269
|
-
d: "M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z",
|
|
270
|
-
fill: "#555AB9"
|
|
271
|
-
}
|
|
272
|
-
),
|
|
273
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
274
|
-
"path",
|
|
275
|
-
{
|
|
276
|
-
d: "M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z",
|
|
277
|
-
fill: "#91BAF8"
|
|
278
|
-
}
|
|
279
|
-
)
|
|
280
|
-
] })
|
|
281
|
-
}
|
|
282
|
-
),
|
|
283
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h1", { children: "Acme" })
|
|
284
|
-
] }),
|
|
285
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { children: user ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
286
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "welcome", children: [
|
|
287
|
-
"Welcome, ",
|
|
288
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("b", { children: user.name }),
|
|
289
|
-
"!"
|
|
290
|
-
] }),
|
|
291
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Button, { size: "small", onClick: onLogout, label: "Log out" })
|
|
292
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
293
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Button, { size: "small", onClick: onLogin, label: "Log in" }),
|
|
294
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
295
|
-
Button,
|
|
296
|
-
{
|
|
297
|
-
primary: true,
|
|
298
|
-
size: "small",
|
|
299
|
-
onClick: onCreateAccount,
|
|
300
|
-
label: "Sign up"
|
|
301
|
-
}
|
|
302
|
-
)
|
|
303
|
-
] }) })
|
|
304
|
-
] }) });
|
|
305
|
-
|
|
306
|
-
// src/stories/Page.tsx
|
|
307
|
-
var import_react = __toESM(require("react"));
|
|
308
|
-
|
|
309
|
-
// src/stories/page.module.css
|
|
310
|
-
var page_default = {};
|
|
311
|
-
|
|
312
|
-
// src/stories/Page.tsx
|
|
313
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
314
|
-
var Page = () => {
|
|
315
|
-
const [user, setUser] = import_react.default.useState();
|
|
316
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("article", { children: [
|
|
317
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
318
|
-
Header,
|
|
319
|
-
{
|
|
320
|
-
user,
|
|
321
|
-
onLogin: () => setUser({ name: "Jane Doe" }),
|
|
322
|
-
onLogout: () => setUser(void 0),
|
|
323
|
-
onCreateAccount: () => setUser({ name: "Jane Doe" })
|
|
324
|
-
}
|
|
325
|
-
),
|
|
326
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { className: page_default["storybook-page"], children: [
|
|
327
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h2", { children: "Pages in Storybook" }),
|
|
328
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { children: [
|
|
329
|
-
"We recommend building UIs with a",
|
|
330
|
-
" ",
|
|
331
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
332
|
-
"a",
|
|
333
|
-
{
|
|
334
|
-
href: "https://componentdriven.org",
|
|
335
|
-
target: "_blank",
|
|
336
|
-
rel: "noopener noreferrer",
|
|
337
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: "component-driven" })
|
|
338
|
-
}
|
|
339
|
-
),
|
|
340
|
-
" ",
|
|
341
|
-
"process starting with atomic components and ending with pages."
|
|
342
|
-
] }),
|
|
343
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: "Render pages with mock data. This makes it easy to build and review page states without needing to navigate to them in your app. Here are some handy patterns for managing page data in Storybook:" }),
|
|
344
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("ul", { children: [
|
|
345
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { children: 'Use a higher-level connected component. Storybook helps you compose such data from the "args" of child component stories' }),
|
|
346
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { children: "Assemble data in the page component from your services. You can mock these services out using Storybook." })
|
|
347
|
-
] }),
|
|
348
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { children: [
|
|
349
|
-
"Get a guided tutorial on component-driven development at",
|
|
350
|
-
" ",
|
|
351
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
352
|
-
"a",
|
|
353
|
-
{
|
|
354
|
-
href: "https://storybook.js.org/tutorials/",
|
|
355
|
-
target: "_blank",
|
|
356
|
-
rel: "noopener noreferrer",
|
|
357
|
-
children: "Storybook tutorials"
|
|
358
|
-
}
|
|
359
|
-
),
|
|
360
|
-
". Read more in the",
|
|
361
|
-
" ",
|
|
362
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
363
|
-
"a",
|
|
364
|
-
{
|
|
365
|
-
href: "https://storybook.js.org/docs",
|
|
366
|
-
target: "_blank",
|
|
367
|
-
rel: "noopener noreferrer",
|
|
368
|
-
children: "docs"
|
|
369
|
-
}
|
|
370
|
-
),
|
|
371
|
-
"."
|
|
372
|
-
] }),
|
|
373
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: page_default["tip-wrapper"], children: [
|
|
374
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: page_default["tip"], children: "Tip" }),
|
|
375
|
-
" Adjust the width of the canvas with the",
|
|
376
|
-
" ",
|
|
377
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
378
|
-
"svg",
|
|
379
|
-
{
|
|
380
|
-
width: "10",
|
|
381
|
-
height: "10",
|
|
382
|
-
viewBox: "0 0 12 12",
|
|
383
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
384
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("g", { fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
385
|
-
"path",
|
|
386
|
-
{
|
|
387
|
-
d: "M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z",
|
|
388
|
-
id: "a",
|
|
389
|
-
fill: "#999"
|
|
390
|
-
}
|
|
391
|
-
) })
|
|
392
|
-
}
|
|
393
|
-
),
|
|
394
|
-
"Viewports addon in the toolbar"
|
|
395
|
-
] })
|
|
396
|
-
] })
|
|
397
|
-
] });
|
|
398
|
-
};
|
|
399
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
400
|
-
0 && (module.exports = {
|
|
401
|
-
ActionButton,
|
|
402
|
-
Button,
|
|
403
|
-
Header,
|
|
404
|
-
IconButton,
|
|
405
|
-
Page
|
|
406
|
-
});
|
|
1
|
+
"use strict";var xo=Object.create;var O=Object.defineProperty,yo=Object.defineProperties,vo=Object.getOwnPropertyDescriptor,Io=Object.getOwnPropertyDescriptors,ko=Object.getOwnPropertyNames,$=Object.getOwnPropertySymbols,wo=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty,ro=Object.prototype.propertyIsEnumerable;var ao=(o,e,t)=>e in o?O(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,h=(o,e)=>{for(var t in e||(e={}))J.call(e,t)&&ao(o,t,e[t]);if($)for(var t of $(e))ro.call(e,t)&&ao(o,t,e[t]);return o},k=(o,e)=>yo(o,Io(e));var y=(o,e)=>{var t={};for(var a in o)J.call(o,a)&&e.indexOf(a)<0&&(t[a]=o[a]);if(o!=null&&$)for(var a of $(o))e.indexOf(a)<0&&ro.call(o,a)&&(t[a]=o[a]);return t};var _o=(o,e)=>{for(var t in e)O(o,t,{get:e[t],enumerable:!0})},io=(o,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ko(e))!J.call(o,i)&&i!==t&&O(o,i,{get:()=>e[i],enumerable:!(a=vo(e,i))||a.enumerable});return o};var F=(o,e,t)=>(t=o!=null?xo(wo(o)):{},io(e||!o||!o.__esModule?O(t,"default",{value:o,enumerable:!0}):t,o)),Co=o=>io(O({},"__esModule",{value:!0}),o);var Do={};_o(Do,{ActionButton:()=>U,Button:()=>U,Chip:()=>V,ChipGroup:()=>q,Dialog:()=>X,IconButton:()=>co,Tab:()=>j,TabGroup:()=>W,useDialog:()=>to});module.exports=Co(Do);var no=F(require("react"));var D=l=>{var n=l,{variant:o,decoration:e="none",as:t,children:a,className:i=""}=n,c=y(n,["variant","decoration","as","children","className"]);let s=(()=>{if(o.startsWith("heading-")){let u=o.split("-")[1];return u.startsWith("d")?"h1":u}return o.startsWith("subtitle-")?"h3":"p"})(),r=t||s,b=["typography",`typography--${o}`,e!=="none"&&`typography--decoration-${e}`,i].filter(Boolean).join(" ");return no.default.createElement(r,h({className:b},c),a)};var w=require("react/jsx-runtime"),U=u=>{var m=u,{size:o="medium",color:e="primary",type:t="solid",state:a="enabled",label:i,prefixIcon:c,suffixIcon:l,loading:n=!1,className:s="",disabled:r}=m,b=y(m,["size","color","type","state","label","prefixIcon","suffixIcon","loading","className","disabled"]);let f=r||a==="disabled",g=a;t==="ghost"?(a==="hovered"||a==="loading"||n)&&(g="enabled"):g=n?"loading":a;let p=["action-button",`action-button--${o}`,`action-button--${e}`,`action-button--${t}`,`action-button--${g}`,s].filter(Boolean).join(" "),x=o==="xlarge"?"heading-h6":o==="large"||o==="medium"?"subtitle-p2":"subtitle-p3";return(0,w.jsxs)("button",k(h({type:"button",className:p,disabled:f},b),{children:[(0,w.jsxs)("span",{className:"action-button__content",children:[c&&(0,w.jsx)("span",{className:"action-button__prefix-icon",children:c}),(0,w.jsx)("p",{className:"action-button__label",children:(0,w.jsx)(D,{variant:x,children:i})}),l&&(0,w.jsx)("span",{className:"action-button__suffix-icon",children:l})]}),n&&t!=="ghost"&&(0,w.jsx)("span",{className:"action-button__spinner","aria-hidden":"true",children:(0,w.jsx)("svg",{className:"action-button__spinner-svg",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,w.jsxs)("circle",{className:"action-button__spinner-circle",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",children:[(0,w.jsx)("animate",{attributeName:"stroke-dasharray",dur:"2s",values:"0 40;40 40;0 40",repeatCount:"indefinite"}),(0,w.jsx)("animate",{attributeName:"stroke-dashoffset",dur:"2s",values:"0;-40;-80",repeatCount:"indefinite"})]})})})]}))};var Y=require("react/jsx-runtime"),co=u=>{var m=u,{size:o="large",color:e="primary",type:t="solid",state:a="enabled",icon:i,className:c="",disabled:l,htmlType:n="button",style:s,customColor:r}=m,b=y(m,["size","color","type","state","icon","className","disabled","htmlType","style","customColor"]);let f=l||a==="disabled",g=t==="weak",p=g&&f?"enabled":a,x=r?"":g?`icon-button--weak-${e}`:`icon-button--${e}`,B=g?"icon-button--weak":`icon-button--${t}`,S=["icon-button",`icon-button--${o}`,x,B,`icon-button--${p}`,c].filter(Boolean).join(" "),d=g&&f,v=h(h({},(r==null?void 0:r.background)&&{backgroundColor:r.background}),(r==null?void 0:r.color)&&{color:r.color});return(0,Y.jsx)("button",k(h({type:n,className:S,disabled:f,style:h(h(h({},s),v),d?{opacity:0,pointerEvents:"none"}:{})},b),{children:(0,Y.jsx)("span",{className:"icon-button__icon",children:i})}))};var z=F(require("react"));var Z=require("react/jsx-runtime"),lo=l=>{var n=l,{type:o="number",variant:e="primary",value:t,maxValue:a=99,className:i=""}=n,c=y(n,["type","variant","value","maxValue","className"]);let s=["badge",`badge--${e}`,`badge--${o}`,i].filter(Boolean).join(" "),r=o==="number"&&t!==void 0?typeof t=="number"&&t>a?`${a}+`:String(t):null;return(0,Z.jsx)("span",k(h({className:s},c),{children:o==="number"&&r&&(0,Z.jsx)(D,{variant:"subtitle-p3",as:"span",children:r})}))};var M=require("react/jsx-runtime"),j=b=>{var u=b,{type:o="round",size:e="large",badge:t=!1,label:a,mode:i=!1,className:c="",selected:l,disabled:n=!1,onClick:s}=u,r=y(u,["type","size","badge","label","mode","className","selected","disabled","onClick"]);let[m,f]=(0,z.useState)(!1),g=l!==void 0,p=g?l:m,x=d=>{n||(g||f(v=>!v),s==null||s(d))},B=n?"disabled":p?"pressed":"enabled",S=["tab",`tab--${o}`,`tab--${e}`,`tab--${B}`,i&&"tab--dark",c].filter(Boolean).join(" ");return(0,M.jsxs)("button",k(h({type:"button",className:S,"aria-pressed":p,disabled:n,onClick:x},r),{children:[(0,M.jsx)("span",{className:"tab__label",children:a}),t&&(0,M.jsx)(lo,{type:"dot",variant:"primary",className:"tab__badge","aria-label":"\uC54C\uB9BC"})]}))},W=({value:o,defaultValue:e,onChange:t,type:a="round",size:i="large",mode:c=!1,disabled:l=!1,children:n,className:s=""})=>{let[r,b]=z.default.useState(e),u=o!==void 0,m=u?o:r,f=["tab-group",`tab-group--${a}`,`tab-group--${i}`,c&&"tab-group--dark",l&&"tab-group--disabled",s].filter(Boolean).join(" "),g=z.default.Children.map(n,p=>{var x,B,S;if(z.default.isValidElement(p)&&p.type===j){let d=p.props.value;if(d===void 0)return console.warn("Tab.Group \uB0B4\uBD80\uC758 Tab\uC740 value prop\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."),p;let v=m===d;return z.default.cloneElement(p,{type:(x=p.props.type)!=null?x:a,size:(B=p.props.size)!=null?B:i,mode:(S=p.props.mode)!=null?S:c,selected:v,disabled:l||p.props.disabled,role:"tab","aria-selected":v,onClick:T=>{var _,A;u||b(d),t==null||t(d),(A=(_=p.props).onClick)==null||A.call(_,T)}})}return p});return(0,M.jsx)("div",{className:f,role:"tablist",children:g})};W.displayName="TabGroup";j.Group=W;var P=F(require("react"));var L=F(require("react"),1);function Bo(i,a){var c=i,{title:o,titleId:e}=c,t=y(c,["title","titleId"]);return L.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":e},t),o?L.createElement("title",{id:e},o):null,L.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}var So=L.forwardRef(Bo),oo=So;var C=require("react/jsx-runtime"),V=S=>{var d=S,{type:o="solid",size:e="medium",variant:t="primary",value:a,onChange:i,checked:c,defaultChecked:l=!1,selectedValue:n,selectedValues:s,label:r,prefixIcon:b,suffixIcon:u,showClose:m=!1,onClose:f,className:g="",disabled:p,onClick:x}=d,B=y(d,["type","size","variant","value","onChange","checked","defaultChecked","selectedValue","selectedValues","label","prefixIcon","suffixIcon","showClose","onClose","className","disabled","onClick"]);let[v,T]=P.default.useState(l),_=c!==void 0,A=P.default.useMemo(()=>_?c:n!=null?n===a:s!==void 0?s.includes(a):v,[_,c,n,s,a,v]),R=b||o==="outline"&&A&&!b&&(0,C.jsx)(oo,{className:"chip__check-icon",style:{width:e==="small"?"14px":"16px",height:e==="small"?"14px":"16px"}}),E=!!R,eo=!!(u||m),uo=E&&eo?"chip--has-prefix-suffix":E?"chip--has-prefix":eo?"chip--has-suffix":"chip--no-icon",mo=["chip",`chip--${o}`,`chip--${e}`,`chip--${t}`,uo,A&&"chip--checked",p&&"chip--disabled",g].filter(Boolean).join(" "),go=H=>{p||(!_&&n===void 0&&s===void 0&&T(bo=>!bo),i&&i(a),x==null||x(H))},ho=H=>{H.stopPropagation(),f&&!p&&f(H)};return(0,C.jsxs)("button",k(h({type:"button",className:mo,disabled:p,onClick:go,"aria-pressed":A},B),{children:[R&&(0,C.jsx)("span",{className:"chip__prefix-icon",children:R}),(0,C.jsx)(D,{variant:e==="small"?"body-p3":"body-p2",children:r}),u&&!m&&(0,C.jsx)("span",{className:"chip__suffix-icon",children:u}),m&&(0,C.jsx)("button",{type:"button",className:"chip__close-button",onClick:ho,disabled:p,"aria-label":"Close",children:(0,C.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:(0,C.jsx)("path",{d:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM10.7803 5.21973C10.4874 4.92683 10.0126 4.92683 9.71973 5.21973L8 6.93945L6.28027 5.21973C5.98738 4.92683 5.51262 4.92683 5.21973 5.21973C4.92683 5.51262 4.92683 5.98738 5.21973 6.28027L6.93945 8L5.21973 9.71973C4.92683 10.0126 4.92683 10.4874 5.21973 10.7803C5.51262 11.0732 5.98738 11.0732 6.28027 10.7803L8 9.06055L9.71973 10.7803C10.0126 11.0732 10.4874 11.0732 10.7803 10.7803C11.0732 10.4874 11.0732 10.0126 10.7803 9.71973L9.06055 8L10.7803 6.28027C11.0732 5.98738 11.0732 5.51262 10.7803 5.21973Z",fill:"currentColor",fillOpacity:"0.56"})})})]}))},q=({value:o,defaultValue:e,onChange:t,multiple:a=!1,type:i="solid",size:c="medium",variant:l="primary",disabled:n=!1,children:s,className:r=""})=>{let[b,u]=P.default.useState(()=>e!=null?e:a?[]:""),m=o!==void 0,f=m?o:b,g=d=>{if(a){let v=Array.isArray(f)?f:[],T=v.includes(d)?v.filter(_=>_!==d):[...v,d];m||u(T),t==null||t(d)}else m||u(d),t==null||t(d)},p=a?void 0:f,x=a?f:void 0,B=["chip-group",r].filter(Boolean).join(" "),S=P.default.Children.map(s,d=>{var v,T,_;return P.default.isValidElement(d)&&d.type===V?d.props.value===void 0?(console.warn("Chip.Group \uB0B4\uBD80\uC758 Chip\uC740 value prop\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."),d):P.default.cloneElement(d,{type:(v=d.props.type)!=null?v:i,size:(T=d.props.size)!=null?T:c,variant:(_=d.props.variant)!=null?_:l,selectedValue:p,selectedValues:x,onChange:K=>{var R,E;g(K),(E=(R=d.props).onChange)==null||E.call(R,K)},disabled:n||d.props.disabled}):d});return(0,C.jsx)("div",{className:B,children:S})};q.displayName="ChipGroup";V.Group=q;var G=F(require("react")),fo=require("react-dom");var N=require("react"),so=(0,N.createContext)(null),ht=so.Provider;function Q(o){return(0,N.useSyncExternalStore)(i=>{let c=window.matchMedia(o);return c.addEventListener("change",i),()=>c.removeEventListener("change",i)},()=>window.matchMedia(o).matches,()=>!1)}function po(){var c,l,n,s;let o=(0,N.useContext)(so),e=Q("(min-width: 375px) and (max-width: 743px)"),t=Q("(min-width: 744px) and (max-width: 1279px)"),a=Q("(min-width: 1280px)"),i=Q("(max-width: 743px)");return{isMobile:(c=o==null?void 0:o.isMobile)!=null?c:e,isTablet:(l=o==null?void 0:o.isTablet)!=null?l:t,isDesktop:(n=o==null?void 0:o.isDesktop)!=null?n:a,isUnderTablet:(s=o==null?void 0:o.isUnderTablet)!=null?s:i}}var I=require("react/jsx-runtime"),X=u=>{var m=u,{open:o=!0,variant:e="confirm",align:t,title:a,description:i,icon:c,actionItems:l,footerLayout:n="horizontal",onActionClose:s,className:r=""}=m,b=y(m,["open","variant","align","title","description","icon","actionItems","footerLayout","onActionClose","className"]);let{isUnderTablet:f}=po();if(!o)return null;let g=t!=null?t:e==="alert"?"left":"center";console.log(e,f);let p=["dialog",`dialog--${e}`,`dialog--${g}`,f?"is-mobile":"",r].filter(Boolean).join(" "),x=["dialog__footer",`dialog__footer--${n}`].filter(Boolean).join(" ");return(0,I.jsxs)("div",k(h({className:p},b),{children:[(c||a)&&(0,I.jsxs)("div",{className:"dialog__header",children:[c&&(0,I.jsx)("span",{className:"dialog__icon",children:c}),a&&(0,I.jsx)(D,{variant:f?"subtitle-p1":"heading-h6",children:a})]}),i&&(0,I.jsx)("div",{className:"dialog__body",children:(0,I.jsx)("div",{className:"body-p2",children:i})}),l&&l.length>0&&(0,I.jsx)("div",{className:x,children:To(f,e,l,n,s)})]}))},To=(o,e,t,a,i)=>{let c=a==="vertical"?"dialog__actions--vertical":"dialog__actions--horizontal",l=e==="confirm"?"100%":"auto",n=e==="alert"?o?"small":"medium":"large",s=e==="alert"?"outline":"solid";return(0,I.jsx)("div",{className:`dialog__actions ${c}`,children:t.map((r,b)=>{var m,f,g;let u=()=>{var p,x;(p=r.onClick)==null||p.call(r),((x=r.closeOnClick)==null||x)&&i&&i()};return(0,I.jsx)(U,{size:(m=r.size)!=null?m:n,color:(f=r.color)!=null?f:"neutral",type:(g=r.type)!=null?g:s,label:r.label,prefixIcon:r.prefixIcon,suffixIcon:r.suffixIcon,loading:r.loading,disabled:r.disabled,onClick:u,style:{width:l}},`${r.label}-${b}`)})})};function to(){let[o,e]=G.default.useState(null),t=G.default.useRef(void 0),a=l=>{e(l)},i=()=>{var l;(l=t.current)==null||l.call(t),e(null)};return G.default.useEffect(()=>{var s;if(!((s=o==null?void 0:o.closeOnEsc)!=null?s:!0))return;let n=r=>{r.key==="Escape"&&i()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[o==null?void 0:o.closeOnEsc]),G.default.useEffect(()=>{t.current=o==null?void 0:o.onClose},[o==null?void 0:o.onClose]),{openDialog:a,closeDialog:i,DialogContainer:()=>{if(!o)return null;let u=o,{actionItems:l,footerLayout:n="horizontal",closeOnOverlayClick:s=!0}=u,r=y(u,["actionItems","footerLayout","closeOnOverlayClick"]),b=(0,I.jsxs)("div",{className:"dialog-overlay",role:"presentation",children:[(0,I.jsx)("button",{type:"button",className:"dialog-overlay__backdrop","aria-label":"Close dialog",onClick:s?i:void 0}),(0,I.jsx)("div",{className:"dialog-overlay__content",role:"dialog","aria-modal":"true",children:(0,I.jsx)(X,k(h({},r),{open:!0,actionItems:l,footerLayout:n,onActionClose:i}))})]});return(0,fo.createPortal)(b,document.body)}}}0&&(module.exports={ActionButton,Button,Chip,ChipGroup,Dialog,IconButton,Tab,TabGroup,useDialog});
|
|
407
2
|
//# sourceMappingURL=index.js.map
|