@lism-css/ui 0.11.0 → 0.13.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 +1 -1
- package/dist/components/Accordion/Accordion.stories.d.ts +7 -0
- package/dist/components/Accordion/getProps.d.ts +55 -42
- package/dist/components/Accordion/getProps.js +36 -32
- package/dist/components/Accordion/react/AccIcon.d.ts +2 -1
- package/dist/components/Accordion/react/Accordion.d.ts +12 -21
- package/dist/components/Accordion/react/Accordion.js +30 -29
- package/dist/components/Accordion/react/index.d.ts +10 -11
- package/dist/components/Accordion/setAccordion.d.ts +6 -3
- package/dist/components/Accordion/setAccordion.js +12 -10
- package/dist/components/Alert/Alert.stories.d.ts +13 -0
- package/dist/components/Alert/getProps.d.ts +6 -4
- package/dist/components/Alert/react/Alert.d.ts +3 -4
- package/dist/components/Alert/react/Alert.js +2 -2
- package/dist/components/Avatar/Avatar.stories.d.ts +8 -0
- package/dist/components/Avatar/react/Avatar.d.ts +10 -6
- package/dist/components/Avatar/react/Avatar.js +1 -1
- package/dist/components/Badge/Badge.stories.d.ts +8 -0
- package/dist/components/Badge/react/Badge.d.ts +3 -1
- package/dist/components/Badge/react/Badge.js +5 -8
- package/dist/components/Button/Button.stories.d.ts +8 -0
- package/dist/components/Button/react/Button.d.ts +3 -1
- package/dist/components/Button/react/Button.js +3 -6
- package/dist/components/Callout/Callout.stories.d.ts +12 -0
- package/dist/components/Callout/getProps.d.ts +3 -2
- package/dist/components/Callout/react/Callout.d.ts +3 -4
- package/dist/components/Callout/react/Callout.js +4 -4
- package/dist/components/Chat/Chat.stories.d.ts +9 -0
- package/dist/components/Chat/getProps.d.ts +43 -44
- package/dist/components/Chat/getProps.js +2 -2
- package/dist/components/Chat/react/Chat.d.ts +11 -7
- package/dist/components/Chat/react/Chat.js +10 -10
- package/dist/components/Details/Details.stories.d.ts +6 -0
- package/dist/components/Details/getProps.d.ts +34 -35
- package/dist/components/Details/getProps.js +17 -7
- package/dist/components/Details/react/Details.d.ts +11 -20
- package/dist/components/Details/react/Details.js +15 -15
- package/dist/components/Details/react/index.d.ts +7 -7
- package/dist/components/DummyImage/DummyImage.stories.d.ts +7 -0
- package/dist/components/DummyText/DummyText.stories.d.ts +9 -0
- package/dist/components/Modal/Modal.stories.d.ts +6 -0
- package/dist/components/Modal/getProps.d.ts +35 -36
- package/dist/components/Modal/getProps.js +34 -15
- package/dist/components/Modal/react/Body.d.ts +2 -4
- package/dist/components/Modal/react/CloseBtn.d.ts +9 -7
- package/dist/components/Modal/react/CloseBtn.js +5 -5
- package/dist/components/Modal/react/Inner.d.ts +3 -4
- package/dist/components/Modal/react/Modal.d.ts +4 -4
- package/dist/components/Modal/react/Modal.js +11 -9
- package/dist/components/Modal/react/OpenBtn.d.ts +7 -5
- package/dist/components/Modal/react/OpenBtn.js +4 -4
- package/dist/components/Modal/react/index.d.ts +7 -8
- package/dist/components/NavMenu/NavMenu.stories.d.ts +7 -0
- package/dist/components/NavMenu/getProps.d.ts +31 -29
- package/dist/components/NavMenu/react/NavMenu.d.ts +6 -16
- package/dist/components/NavMenu/react/NavMenu.js +21 -17
- package/dist/components/NavMenu/react/index.d.ts +6 -6
- package/dist/components/ShapeDivider/ShapeDivider.stories.d.ts +10 -0
- package/dist/components/ShapeDivider/getProps.d.ts +16 -11
- package/dist/components/ShapeDivider/getProps.js +10 -12
- package/dist/components/ShapeDivider/react/ShapeDivider.d.ts +3 -4
- package/dist/components/ShapeDivider/react/ShapeDivider.js +3 -3
- package/dist/components/Tabs/Tabs.stories.d.ts +6 -0
- package/dist/components/Tabs/getProps.d.ts +11 -4
- package/dist/components/Tabs/getProps.js +15 -5
- package/dist/components/Tabs/react/Tab.d.ts +8 -6
- package/dist/components/Tabs/react/Tab.js +15 -6
- package/dist/components/Tabs/react/TabItem.d.ts +7 -4
- package/dist/components/Tabs/react/TabList.d.ts +2 -1
- package/dist/components/Tabs/react/TabPanel.d.ts +8 -6
- package/dist/components/Tabs/react/Tabs.d.ts +9 -7
- package/dist/components/Tabs/react/Tabs.js +50 -36
- package/dist/components/Tabs/react/index.d.ts +8 -8
- package/dist/components/Tabs/setTabs.d.ts +1 -1
- package/dist/components/Tabs/setTabs.js +25 -15
- package/dist/lism-css/dist/components/{Center → layout/Center}/index.js +1 -1
- package/dist/lism-css/dist/components/{Flex → layout/Flex}/index.js +1 -1
- package/dist/lism-css/dist/components/{Flow → layout/Flow}/index.js +1 -1
- package/dist/lism-css/dist/components/{Frame → layout/Frame}/index.js +1 -1
- package/dist/lism-css/dist/components/{Grid → layout/Grid}/index.js +1 -1
- package/dist/lism-css/dist/components/{Stack → layout/Stack}/index.js +1 -1
- package/dist/lism-css/dist/config/default-config.js +6 -6
- package/dist/lism-css/dist/config/defaults/props.js +16 -26
- package/dist/lism-css/dist/config/defaults/traits.js +19 -0
- package/dist/lism-css/dist/config/index.js +9 -9
- package/dist/lism-css/dist/lib/getLayoutProps.js +6 -9
- package/dist/lism-css/dist/lib/getLismProps.js +116 -104
- package/dist/lism-css/dist/lib/helper/mergeSet.js +14 -0
- package/dist/style.css +1 -1
- package/dist/ui.css +1 -1
- package/package.json +14 -7
- package/src/components/Accordion/Accordion.stories.tsx +105 -0
- package/src/components/Accordion/_style.css +1 -1
- package/src/components/Accordion/astro/Button.astro +2 -2
- package/src/components/Accordion/getProps.ts +91 -0
- package/src/components/Accordion/react/{AccIcon.jsx → AccIcon.tsx} +2 -2
- package/src/components/Accordion/react/{Accordion.jsx → Accordion.tsx} +33 -11
- package/src/components/Accordion/setAccordion.ts +120 -0
- package/src/components/Alert/Alert.stories.tsx +64 -0
- package/src/components/Alert/getProps.ts +5 -3
- package/src/components/Alert/react/Alert.tsx +3 -3
- package/src/components/Avatar/Avatar.stories.tsx +42 -0
- package/src/components/Avatar/react/Avatar.tsx +17 -0
- package/src/components/Badge/Badge.stories.tsx +40 -0
- package/src/components/Badge/_style.css +1 -1
- package/src/components/Badge/astro/Badge.astro +1 -7
- package/src/components/Badge/react/Badge.tsx +7 -0
- package/src/components/Button/Button.stories.tsx +44 -0
- package/src/components/Button/_style.css +1 -1
- package/src/components/Button/astro/Button.astro +1 -7
- package/src/components/Button/react/Button.tsx +7 -0
- package/src/components/Callout/Callout.stories.tsx +55 -0
- package/src/components/Callout/getProps.ts +3 -2
- package/src/components/Callout/react/Callout.tsx +3 -3
- package/src/components/Chat/Chat.stories.tsx +58 -0
- package/src/components/Chat/_style.css +6 -6
- package/src/components/Chat/{getProps.js → getProps.ts} +10 -4
- package/src/components/Chat/react/{Chat.jsx → Chat.tsx} +13 -3
- package/src/components/Details/Details.stories.tsx +61 -0
- package/src/components/Details/_style.css +1 -1
- package/src/components/Details/astro/Title.astro +2 -2
- package/src/components/Details/{getProps.js → getProps.ts} +19 -6
- package/src/components/Details/react/Details.tsx +69 -0
- package/src/components/DummyImage/DummyImage.stories.tsx +23 -0
- package/src/components/DummyText/DummyText.stories.tsx +48 -0
- package/src/components/Modal/Modal.stories.tsx +67 -0
- package/src/components/Modal/_style.css +1 -1
- package/src/components/Modal/astro/CloseBtn.astro +2 -2
- package/src/components/Modal/astro/OpenBtn.astro +2 -3
- package/src/components/Modal/getProps.ts +64 -0
- package/src/components/Modal/react/Body.tsx +10 -0
- package/src/components/Modal/react/CloseBtn.tsx +24 -0
- package/src/components/Modal/react/Inner.tsx +6 -0
- package/src/components/Modal/react/Modal.tsx +24 -0
- package/src/components/Modal/react/OpenBtn.tsx +15 -0
- package/src/components/Modal/{script.js → script.ts} +1 -1
- package/src/components/NavMenu/NavMenu.stories.tsx +68 -0
- package/src/components/NavMenu/_style.css +1 -1
- package/src/components/NavMenu/getProps.ts +60 -0
- package/src/components/NavMenu/react/NavMenu.tsx +40 -0
- package/src/components/ShapeDivider/ShapeDivider.stories.tsx +87 -0
- package/src/components/ShapeDivider/_style.css +1 -1
- package/src/components/ShapeDivider/getProps.ts +36 -0
- package/src/components/ShapeDivider/react/{ShapeDivider.jsx → ShapeDivider.tsx} +4 -4
- package/src/components/Tabs/Tabs.stories.tsx +79 -0
- package/src/components/Tabs/_style.css +1 -1
- package/src/components/Tabs/astro/Tab.astro +2 -1
- package/src/components/Tabs/astro/{transformTabitems.js → transformTabitems.ts} +9 -9
- package/src/components/Tabs/getProps.ts +23 -0
- package/src/components/Tabs/react/Tab.tsx +21 -0
- package/src/components/Tabs/react/TabItem.tsx +13 -0
- package/src/components/Tabs/react/TabList.tsx +5 -0
- package/src/components/Tabs/react/{TabPanel.jsx → TabPanel.tsx} +8 -3
- package/src/components/Tabs/react/{Tabs.jsx → Tabs.tsx} +27 -12
- package/src/components/Tabs/{script.js → script.ts} +2 -2
- package/src/components/Tabs/setTabs.ts +65 -0
- package/src/helper/{uuid.js → uuid.ts} +2 -2
- package/src/vite-env.d.ts +1 -0
- package/dist/components/Accordion/astro/__setEvent.d.ts +0 -1
- package/dist/components/Accordion/astro/index.d.ts +0 -15
- package/dist/components/Alert/astro/index.d.ts +0 -1
- package/dist/components/Callout/astro/index.d.ts +0 -1
- package/dist/components/Details/astro/index.d.ts +0 -13
- package/dist/components/DummyImage/astro/index.d.ts +0 -1
- package/dist/components/DummyText/astro/index.d.ts +0 -1
- package/dist/components/Modal/astro/index.d.ts +0 -13
- package/dist/components/NavMenu/astro/index.d.ts +0 -11
- package/dist/components/Tabs/astro/index.d.ts +0 -13
- package/dist/components/Tabs/astro/transformTabitems.d.ts +0 -4
- package/dist/components/astro.d.ts +0 -14
- package/dist/lism-css/dist/config/defaults/states.js +0 -38
- package/dist/lism-css/dist/config/helper/getSvgUrl.js +0 -4
- package/src/components/Accordion/getProps.js +0 -77
- package/src/components/Accordion/setAccordion.js +0 -146
- package/src/components/Avatar/astro/index.js +0 -1
- package/src/components/Avatar/react/Avatar.jsx +0 -9
- package/src/components/Badge/astro/index.js +0 -1
- package/src/components/Badge/react/Badge.jsx +0 -12
- package/src/components/Button/astro/index.js +0 -1
- package/src/components/Button/react/Button.jsx +0 -12
- package/src/components/Chat/astro/index.js +0 -1
- package/src/components/Details/react/Details.jsx +0 -66
- package/src/components/Modal/getProps.js +0 -30
- package/src/components/Modal/react/Body.jsx +0 -10
- package/src/components/Modal/react/CloseBtn.jsx +0 -20
- package/src/components/Modal/react/Inner.jsx +0 -6
- package/src/components/Modal/react/Modal.jsx +0 -23
- package/src/components/Modal/react/OpenBtn.jsx +0 -11
- package/src/components/NavMenu/getProps.js +0 -65
- package/src/components/NavMenu/react/NavMenu.jsx +0 -19
- package/src/components/ShapeDivider/astro/index.js +0 -1
- package/src/components/ShapeDivider/getProps.js +0 -40
- package/src/components/Tabs/getProps.js +0 -8
- package/src/components/Tabs/react/Tab.jsx +0 -10
- package/src/components/Tabs/react/TabItem.jsx +0 -5
- package/src/components/Tabs/react/TabList.jsx +0 -6
- package/src/components/Tabs/setTabs.js +0 -87
- /package/src/components/Accordion/astro/{index.js → index.ts} +0 -0
- /package/src/components/Accordion/react/{index.js → index.ts} +0 -0
- /package/src/components/Accordion/{script.js → script.ts} +0 -0
- /package/{dist/components/Avatar/astro/index.d.ts → src/components/Avatar/astro/index.ts} +0 -0
- /package/src/components/Avatar/react/{index.js → index.ts} +0 -0
- /package/{dist/components/Badge/astro/index.d.ts → src/components/Badge/astro/index.ts} +0 -0
- /package/src/components/Badge/react/{index.js → index.ts} +0 -0
- /package/{dist/components/Button/astro/index.d.ts → src/components/Button/astro/index.ts} +0 -0
- /package/src/components/Button/react/{index.js → index.ts} +0 -0
- /package/{dist/components/Chat/astro/index.d.ts → src/components/Chat/astro/index.ts} +0 -0
- /package/src/components/Chat/react/{index.js → index.ts} +0 -0
- /package/src/components/Details/astro/{index.js → index.ts} +0 -0
- /package/src/components/Details/react/{index.js → index.ts} +0 -0
- /package/src/components/Modal/astro/{index.js → index.ts} +0 -0
- /package/src/components/Modal/react/{index.js → index.ts} +0 -0
- /package/src/components/NavMenu/astro/{index.js → index.ts} +0 -0
- /package/src/components/NavMenu/react/{index.js → index.ts} +0 -0
- /package/{dist/components/ShapeDivider/astro/index.d.ts → src/components/ShapeDivider/astro/index.ts} +0 -0
- /package/src/components/ShapeDivider/react/{index.js → index.ts} +0 -0
- /package/src/components/Tabs/astro/{index.js → index.ts} +0 -0
- /package/src/components/Tabs/react/{index.js → index.ts} +0 -0
|
@@ -1,28 +1,38 @@
|
|
|
1
|
-
function
|
|
1
|
+
function d(t) {
|
|
2
2
|
t.preventDefault();
|
|
3
|
-
const
|
|
4
|
-
|
|
3
|
+
const s = t.currentTarget;
|
|
4
|
+
u(s);
|
|
5
5
|
}
|
|
6
|
-
const
|
|
6
|
+
const u = (t) => {
|
|
7
7
|
if (t.getAttribute("aria-selected") === "true") return;
|
|
8
|
-
const e = t.getAttribute("aria-controls")
|
|
9
|
-
if (
|
|
10
|
-
const
|
|
11
|
-
|
|
8
|
+
const e = t.getAttribute("aria-controls");
|
|
9
|
+
if (!e) return;
|
|
10
|
+
const i = document.getElementById(e);
|
|
11
|
+
if (i === null) return;
|
|
12
|
+
const o = t.parentNode?.parentNode;
|
|
13
|
+
if (!o) return;
|
|
14
|
+
const a = o.querySelector('[aria-selected="true"]');
|
|
15
|
+
if (!a) return;
|
|
16
|
+
const r = a.getAttribute("aria-controls");
|
|
17
|
+
if (!r) return;
|
|
18
|
+
const n = document.getElementById(r);
|
|
19
|
+
t.setAttribute("aria-selected", "true"), a.setAttribute("aria-selected", "false"), n?.setAttribute("aria-hidden", "true"), i.setAttribute("aria-hidden", "false");
|
|
12
20
|
};
|
|
13
|
-
function
|
|
14
|
-
t.querySelectorAll('button[role="tab"]').forEach((
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
function f(t) {
|
|
22
|
+
t.querySelectorAll('button[role="tab"]').forEach((c) => {
|
|
23
|
+
c.addEventListener("click", function(l) {
|
|
24
|
+
d(l);
|
|
17
25
|
});
|
|
18
26
|
});
|
|
19
27
|
const e = window?.location?.href;
|
|
20
28
|
if (!e || !(e.indexOf("?lism-tab=") !== -1)) return;
|
|
21
|
-
const
|
|
22
|
-
|
|
29
|
+
const r = new URL(e).searchParams.get("lism-tab");
|
|
30
|
+
if (!r) return;
|
|
31
|
+
const n = t.querySelector(`[aria-controls="${r}"]`);
|
|
32
|
+
n && (t.dataset.hasTabLink = "1", u(n), setTimeout(() => {
|
|
23
33
|
delete t.dataset.hasTabLink;
|
|
24
34
|
}, 10));
|
|
25
35
|
}
|
|
26
36
|
export {
|
|
27
|
-
|
|
37
|
+
f as default
|
|
28
38
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import o from "./defaults/tokens.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
2
|
+
import r from "./defaults/props.js";
|
|
3
|
+
import t from "./defaults/traits.js";
|
|
4
|
+
const s = {
|
|
5
5
|
tokens: o,
|
|
6
|
-
props:
|
|
7
|
-
|
|
6
|
+
props: r,
|
|
7
|
+
traits: t
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
s as default
|
|
11
11
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e = ["start", "center", "end"], r =
|
|
1
|
+
const e = ["start", "center", "end"], r = ["flex-start", "flex-end"], p = { s: "start", e: "end", c: "center", fs: "flex-start", fe: "flex-end" }, o = {
|
|
2
2
|
f: { prop: "font", presets: ["inherit"] },
|
|
3
3
|
fz: { prop: "fontSize", token: "fz", tokenClass: 1, bp: 1, alwaysVar: 1 },
|
|
4
4
|
fw: {
|
|
@@ -30,8 +30,7 @@ const e = ["start", "center", "end"], r = { "flex-s": "flex-start", "flex-e": "f
|
|
|
30
30
|
// tsh: { prop: 'textShadow' },
|
|
31
31
|
d: {
|
|
32
32
|
prop: "display",
|
|
33
|
-
presets: ["none", "block"],
|
|
34
|
-
utils: { "in-flex": "inline-flex" },
|
|
33
|
+
presets: ["none", "block", "flex", "inline-flex", "grid", "inline-grid", "inline", "inline-block"],
|
|
35
34
|
bp: 1
|
|
36
35
|
},
|
|
37
36
|
o: { prop: "opacity", presets: ["0"], token: "o", tokenClass: 1 },
|
|
@@ -108,7 +107,7 @@ const e = ["start", "center", "end"], r = { "flex-s": "flex-start", "flex-e": "f
|
|
|
108
107
|
bdc: {
|
|
109
108
|
isVar: 1,
|
|
110
109
|
presets: ["brand", "accent", "divider", "inherit", "transparent"],
|
|
111
|
-
utils: {
|
|
110
|
+
utils: { current: "currentColor" },
|
|
112
111
|
token: "color"
|
|
113
112
|
},
|
|
114
113
|
bdw: { isVar: 1, bp: 1 },
|
|
@@ -144,8 +143,7 @@ const e = ["start", "center", "end"], r = { "flex-s": "flex-start", "flex-e": "f
|
|
|
144
143
|
// position
|
|
145
144
|
pos: {
|
|
146
145
|
prop: "position",
|
|
147
|
-
presets: ["static", "fixed", "sticky"]
|
|
148
|
-
utils: { rel: "relative", abs: "absolute" }
|
|
146
|
+
presets: ["static", "fixed", "sticky", "relative", "absolute"]
|
|
149
147
|
},
|
|
150
148
|
z: { prop: "zIndex", presets: ["-1", "0", "1", "99"] },
|
|
151
149
|
t: { prop: "top", utils: { 0: "0%" }, presets: ["50%", "100%"], token: "space" },
|
|
@@ -208,14 +206,14 @@ const e = ["start", "center", "end"], r = { "flex-s": "flex-start", "flex-e": "f
|
|
|
208
206
|
overwriteBaseVar: 1,
|
|
209
207
|
bp: 1
|
|
210
208
|
},
|
|
211
|
-
|
|
212
|
-
|
|
209
|
+
cg: { prop: "columnGap", token: "space", bp: 1 },
|
|
210
|
+
rg: { prop: "rowGap", token: "space", bp: 1 },
|
|
213
211
|
cols: { isVar: 1, bp: 1 },
|
|
214
212
|
rows: { isVar: 1, bp: 1 },
|
|
215
213
|
// flex
|
|
216
214
|
fxf: { prop: "flexFlow" },
|
|
217
215
|
fxw: { prop: "flexWrap", presets: ["wrap"], bp: 1 },
|
|
218
|
-
fxd: { prop: "flexDirection",
|
|
216
|
+
fxd: { prop: "flexDirection", presets: ["column", "column-reverse", "row-reverse"], bp: 1 },
|
|
219
217
|
fx: { prop: "flex", presets: ["1"], bp: 1 },
|
|
220
218
|
fxg: { prop: "flexGrow", presets: ["1"] },
|
|
221
219
|
fxsh: { prop: "flexShrink", presets: ["0"] },
|
|
@@ -224,12 +222,6 @@ const e = ["start", "center", "end"], r = { "flex-s": "flex-start", "flex-e": "f
|
|
|
224
222
|
// gd: { prop: 'grid' },
|
|
225
223
|
gt: {
|
|
226
224
|
prop: "gridTemplate",
|
|
227
|
-
presets: ["repeat"],
|
|
228
|
-
exUtility: {
|
|
229
|
-
repeat: {
|
|
230
|
-
"grid-template": "repeat(var(--rows,1), 1fr) / repeat(var(--cols,1), 1fr)"
|
|
231
|
-
}
|
|
232
|
-
},
|
|
233
225
|
bp: 1
|
|
234
226
|
},
|
|
235
227
|
gta: { prop: "gridTemplateAreas", bp: 1 },
|
|
@@ -244,7 +236,7 @@ const e = ["start", "center", "end"], r = { "flex-s": "flex-start", "flex-e": "f
|
|
|
244
236
|
// exUtility: { repeat: { '--rows': '1', '--gtr': 'repeat(var(--rows), 1fr)' } },
|
|
245
237
|
bp: 1
|
|
246
238
|
},
|
|
247
|
-
gaf: { prop: "gridAutoFlow",
|
|
239
|
+
gaf: { prop: "gridAutoFlow", presets: ["row", "column"], bp: 1 },
|
|
248
240
|
//dense
|
|
249
241
|
gac: { prop: "gridAutoColumns" },
|
|
250
242
|
gar: { prop: "gridAutoRows" },
|
|
@@ -260,29 +252,27 @@ const e = ["start", "center", "end"], r = { "flex-s": "flex-start", "flex-e": "f
|
|
|
260
252
|
// -(ai|ac|ji|jc|aslf|jslf): / -$1:
|
|
261
253
|
ai: {
|
|
262
254
|
prop: "alignItems",
|
|
263
|
-
presets: [...e, "stretch"],
|
|
264
|
-
utils: r,
|
|
255
|
+
presets: [...e, "stretch", ...r],
|
|
265
256
|
shorthands: p,
|
|
266
257
|
bp: 1
|
|
267
258
|
},
|
|
268
259
|
ac: {
|
|
269
260
|
prop: "alignContent",
|
|
270
|
-
presets: e,
|
|
271
|
-
utils: {
|
|
261
|
+
presets: [...e, ...r],
|
|
262
|
+
utils: { between: "space-between" },
|
|
272
263
|
shorthands: p,
|
|
273
264
|
bp: 1
|
|
274
265
|
},
|
|
275
266
|
ji: {
|
|
276
267
|
prop: "justifyItems",
|
|
277
|
-
presets: [...e, "stretch"],
|
|
278
|
-
utils: r,
|
|
268
|
+
presets: [...e, "stretch", ...r],
|
|
279
269
|
shorthands: p,
|
|
280
270
|
bp: 1
|
|
281
271
|
},
|
|
282
272
|
jc: {
|
|
283
273
|
prop: "justifyContent",
|
|
284
|
-
presets: e,
|
|
285
|
-
utils: {
|
|
274
|
+
presets: [...e, ...r],
|
|
275
|
+
utils: { between: "space-between" },
|
|
286
276
|
shorthands: p,
|
|
287
277
|
bp: 1
|
|
288
278
|
},
|
|
@@ -328,7 +318,7 @@ const e = ["start", "center", "end"], r = { "flex-s": "flex-start", "flex-e": "f
|
|
|
328
318
|
// },
|
|
329
319
|
// },
|
|
330
320
|
// others
|
|
331
|
-
ovwrap: { prop: "overflowWrap",
|
|
321
|
+
ovwrap: { prop: "overflowWrap", presets: ["anywhere"] },
|
|
332
322
|
whspace: { prop: "whiteSpace", presets: ["nowrap"] },
|
|
333
323
|
// wordbreak: { prop: 'wordBreak', utils: { keep: 'keep-all', all: 'break-all' } },
|
|
334
324
|
float: { prop: "float", presets: ["left", "right"] },
|
|
@@ -336,5 +326,5 @@ const e = ["start", "center", "end"], r = { "flex-s": "flex-start", "flex-e": "f
|
|
|
336
326
|
isolation: { prop: "isolation", presets: ["isolate"] }
|
|
337
327
|
};
|
|
338
328
|
export {
|
|
339
|
-
|
|
329
|
+
o as default
|
|
340
330
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const i = {
|
|
2
|
+
isContainer: "is--container",
|
|
3
|
+
isWrapper: {
|
|
4
|
+
className: "is--wrapper",
|
|
5
|
+
preset: ["s", "l"],
|
|
6
|
+
presetClass: "-contentSize",
|
|
7
|
+
customVar: "--contentSize",
|
|
8
|
+
tokenKey: "sz"
|
|
9
|
+
},
|
|
10
|
+
isLayer: "is--layer",
|
|
11
|
+
isBoxLink: "is--boxLink",
|
|
12
|
+
isCoverLink: "is--coverLink",
|
|
13
|
+
isSide: "is--side",
|
|
14
|
+
isSkipFlow: "is--skipFlow",
|
|
15
|
+
isVertical: "is--vertical"
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
i as default
|
|
19
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import r from "./default-config.js";
|
|
2
2
|
import a from "lism-css/config.js";
|
|
3
|
-
import { objDeepMerge as
|
|
4
|
-
let
|
|
5
|
-
typeof window < "u" && window._LISM_CSS_CONFIG_ && (
|
|
6
|
-
const S =
|
|
3
|
+
import { objDeepMerge as s, arrayConvertToSet as t } from "./helper.js";
|
|
4
|
+
let e = s(r, a);
|
|
5
|
+
typeof window < "u" && window._LISM_CSS_CONFIG_ && (e = s(e, window._LISM_CSS_CONFIG_));
|
|
6
|
+
const S = e, { tokens: o, props: _, traits: l } = S, p = {
|
|
7
7
|
color: [...o.c.values, ...o.palette.values],
|
|
8
8
|
...o
|
|
9
|
-
},
|
|
9
|
+
}, u = t(structuredClone(p)), I = t(structuredClone(_)), c = l, i = ["sm", "md", "lg", "xl"], O = ["base", ...i];
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
i as BREAK_POINTS,
|
|
12
12
|
O as BREAK_POINTS_ALL,
|
|
13
13
|
S as CONFIG,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
c as
|
|
14
|
+
I as PROPS,
|
|
15
|
+
u as TOKENS,
|
|
16
|
+
c as TRAITS
|
|
17
17
|
};
|
|
@@ -7,22 +7,19 @@ function w(l, t) {
|
|
|
7
7
|
...t,
|
|
8
8
|
lismClass: i(t.lismClass, `l--${l}`)
|
|
9
9
|
};
|
|
10
|
-
return l === "flow" ? e(s) : l === "
|
|
10
|
+
return l === "flow" ? e(s) : l === "sideMain" ? u(s) : l === "fluidCols" ? f(s) : l === "switchCols" ? m(s) : s;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
12
|
+
function u({ sideW: l, mainW: t, style: s, ...r }) {
|
|
13
|
+
const n = { ...s };
|
|
14
|
+
return l != null && (n["--sideW"] = o(l, "sz")), t != null && (n["--mainW"] = o(t, "sz")), { ...r, style: n };
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
-
const r = { ...s };
|
|
17
|
-
return l != null && (r["--sideW"] = o(l, "sz")), t != null && (r["--mainW"] = o(t, "sz")), { ...n, style: r };
|
|
18
|
-
}
|
|
19
|
-
function m({ autoFill: l, style: t, ...s }) {
|
|
16
|
+
function f({ autoFill: l, style: t, ...s }) {
|
|
20
17
|
return l ? { ...s, style: { ...t, "--autoMode": "auto-fill" } } : { ...s, style: t };
|
|
21
18
|
}
|
|
22
19
|
function e({ flow: l, style: t, ...s }) {
|
|
23
20
|
return a("flow", l) ? s.lismClass = i(s.lismClass, `-flow:${l}`) : l && (s.lismClass = i(s.lismClass, "-flow:"), t = { ...t, "--flow": o(l, "space") }), { ...s, style: t };
|
|
24
21
|
}
|
|
25
|
-
function
|
|
22
|
+
function m({ breakSize: l, style: t, ...s }) {
|
|
26
23
|
return l ? { ...s, style: { ...t, "--breakSize": o(l, "sz") } } : { ...s, style: t };
|
|
27
24
|
}
|
|
28
25
|
export {
|
|
@@ -1,140 +1,152 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TRAITS as C, PROPS as u } from "../config/index.js";
|
|
2
2
|
import j from "./getLayoutProps.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
3
|
+
import P from "./isPresetValue.js";
|
|
4
|
+
import N from "./isTokenValue.js";
|
|
5
|
+
import S from "./getUtilKey.js";
|
|
6
|
+
import c from "./getMaybeCssVar.js";
|
|
7
|
+
import x from "./getBpData.js";
|
|
8
8
|
import E from "./helper/atts.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
9
|
+
import _ from "./helper/isEmptyObj.js";
|
|
10
|
+
import U from "./helper/filterEmptyObj.js";
|
|
11
|
+
import v from "./helper/mergeSet.js";
|
|
11
12
|
import k from "./helper/splitWithComma.js";
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
return
|
|
13
|
+
const z = (o) => {
|
|
14
|
+
const r = u[o];
|
|
15
|
+
return r && r?.token || "";
|
|
15
16
|
};
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
function w(o, r) {
|
|
18
|
+
if (!o) return "";
|
|
19
|
+
if (!r) return o;
|
|
20
|
+
const t = o.split(" "), s = t[0];
|
|
21
|
+
return [s, `${s}--${r}`, ...t.slice(1)].join(" ");
|
|
22
|
+
}
|
|
23
|
+
class A {
|
|
24
|
+
// 最終出力 className
|
|
18
25
|
className = "";
|
|
26
|
+
// 出力順のためのクラスバケット: [lismClass] [lismTrait] [uClasses]
|
|
27
|
+
// - lismClass : コンポーネント基底クラス + variant + l--{layout}(getLayoutProps 側で付与済み)
|
|
28
|
+
// - lismTrait : is--* 等の trait クラス
|
|
29
|
+
// - uClasses : set--* → u--* → -property の順で push される utility クラス
|
|
30
|
+
lismClass = "";
|
|
31
|
+
lismTrait = [];
|
|
19
32
|
uClasses = [];
|
|
20
|
-
lismState = [];
|
|
21
33
|
styles = {};
|
|
22
34
|
attrs = {};
|
|
23
35
|
_propConfig;
|
|
24
|
-
constructor(
|
|
25
|
-
const { forwardedRef: t, class:
|
|
26
|
-
this.styles = { ...l }, this._propConfig = { ...
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
N(c) || (this.attrs = { ...c }, this.analyzeProps()), t && (this.attrs.ref = t), this.className = E(i || e, f, this.lismState, this.uClasses);
|
|
36
|
+
constructor(r) {
|
|
37
|
+
const { forwardedRef: t, class: s, className: e, lismClass: a, variant: i, style: l = {}, _propConfig: d = {}, ...p } = r;
|
|
38
|
+
this.styles = { ...l }, this._propConfig = { ...d }, this.lismClass = w(a, i), _(p) || (this.attrs = { ...p }, this.analyzeProps()), t && (this.attrs.ref = t), this.className = this.buildClassName(e, s);
|
|
39
|
+
}
|
|
40
|
+
// 最終クラス文字列の組み立て(出力順の唯一の確定地点)
|
|
41
|
+
// 出力順: [user/astro className] [lismClass] [lismTrait] [uClasses]
|
|
42
|
+
buildClassName(r, t) {
|
|
43
|
+
return E(r || t, this.lismClass, this.lismTrait, this.uClasses);
|
|
33
44
|
}
|
|
34
|
-
|
|
35
|
-
const { className:
|
|
36
|
-
t === !0 ? this.
|
|
45
|
+
analyzeTrait(r, t) {
|
|
46
|
+
const { className: s, preset: e, presetClass: a, customVar: i, tokenKey: l } = r;
|
|
47
|
+
t === !0 ? this.lismTrait.push(s) : e && P(e, t) ? this.lismTrait.push(`${s} ${a}:${String(t)}`) : t && (this.lismTrait.push(s), l && i && this.addStyle(i, c(t, l)));
|
|
37
48
|
}
|
|
38
49
|
// prop解析
|
|
39
50
|
analyzeProps() {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
51
|
+
const r = this.extractProp("set"), t = this.extractProp("util");
|
|
52
|
+
v(void 0, r).forEach((s) => this.addUtil(`set--${s}`)), v(void 0, t).forEach((s) => this.addUtil(`u--${s}`)), Object.keys(this.attrs).forEach((s) => {
|
|
53
|
+
if (Object.hasOwn(C, s)) {
|
|
54
|
+
const e = this.extractProp(s), a = C[s];
|
|
55
|
+
typeof a == "string" ? e && this.lismTrait.push(a) : this.analyzeTrait(a, e);
|
|
56
|
+
} else if (Object.hasOwn(u, s)) {
|
|
57
|
+
const e = this.attrs[s];
|
|
58
|
+
delete this.attrs[s], this.analyzeLismProp(s, e);
|
|
47
59
|
} else if (s === "hov") {
|
|
48
|
-
const
|
|
49
|
-
this.setHovProps(
|
|
60
|
+
const e = this.extractProp(s);
|
|
61
|
+
this.setHovProps(e);
|
|
50
62
|
} else if (s === "css") {
|
|
51
|
-
const
|
|
52
|
-
this.addStyles(
|
|
63
|
+
const e = this.extractProp("css");
|
|
64
|
+
this.addStyles(e);
|
|
53
65
|
}
|
|
54
66
|
});
|
|
55
67
|
}
|
|
56
68
|
// Lism Prop 解析
|
|
57
|
-
analyzeLismProp(
|
|
69
|
+
analyzeLismProp(r, t) {
|
|
58
70
|
if (t == null) return;
|
|
59
|
-
let
|
|
60
|
-
if (
|
|
61
|
-
this._propConfig?.[
|
|
62
|
-
const { base:
|
|
63
|
-
this.setAttrs(
|
|
64
|
-
|
|
71
|
+
let s = u[r] || null;
|
|
72
|
+
if (s === null) return;
|
|
73
|
+
this._propConfig?.[r] && (s = Object.assign({}, s, this._propConfig[r]));
|
|
74
|
+
const { base: e, ...a } = x(t);
|
|
75
|
+
this.setAttrs(r, e, s), Object.keys(a).forEach((i) => {
|
|
76
|
+
s && this.setAttrs(r, a[i], s, i);
|
|
65
77
|
});
|
|
66
78
|
}
|
|
67
|
-
addUtil(
|
|
68
|
-
this.uClasses.push(
|
|
79
|
+
addUtil(r) {
|
|
80
|
+
this.uClasses.push(r);
|
|
69
81
|
}
|
|
70
|
-
addUtils(
|
|
71
|
-
this.uClasses.push(...
|
|
82
|
+
addUtils(r) {
|
|
83
|
+
this.uClasses.push(...r);
|
|
72
84
|
}
|
|
73
85
|
// addState(state) {
|
|
74
86
|
// this.stateClasses.push(state);
|
|
75
87
|
// }
|
|
76
|
-
addStyle(
|
|
77
|
-
this.styles[
|
|
88
|
+
addStyle(r, t) {
|
|
89
|
+
this.styles[r] = t;
|
|
78
90
|
}
|
|
79
|
-
addStyles(
|
|
80
|
-
this.styles = { ...this.styles, ...
|
|
91
|
+
addStyles(r) {
|
|
92
|
+
this.styles = { ...this.styles, ...r };
|
|
81
93
|
}
|
|
82
|
-
addAttrs(
|
|
83
|
-
this.addStyles(
|
|
94
|
+
addAttrs(r) {
|
|
95
|
+
this.addStyles(r.styles || {}), this.addUtils(r.utils || []);
|
|
84
96
|
}
|
|
85
|
-
extractProp(
|
|
86
|
-
const t = this.attrs[
|
|
87
|
-
return this.attrs[
|
|
97
|
+
extractProp(r) {
|
|
98
|
+
const t = this.attrs[r];
|
|
99
|
+
return this.attrs[r] === void 0 ? null : (delete this.attrs[r], t);
|
|
88
100
|
}
|
|
89
|
-
extractProps(
|
|
101
|
+
extractProps(r) {
|
|
90
102
|
const t = {};
|
|
91
|
-
return
|
|
92
|
-
this.attrs[
|
|
103
|
+
return r.forEach((s) => {
|
|
104
|
+
this.attrs[s] !== void 0 && (t[s] = this.attrs[s], delete this.attrs[s]);
|
|
93
105
|
}), t;
|
|
94
106
|
}
|
|
95
107
|
// utilクラスを追加するか、styleにセットするかの分岐処理 @base
|
|
96
108
|
// 値が null, undefined, '', false の時はスキップ
|
|
97
|
-
setAttrs(
|
|
109
|
+
setAttrs(r, t, s = {}, e = "") {
|
|
98
110
|
if (t == null || t === "" || t === !1) return;
|
|
99
|
-
let
|
|
100
|
-
if (
|
|
101
|
-
this.addUtil(`${
|
|
111
|
+
let a = `--${r}`, i = `-${String(s.utilKey || r)}`;
|
|
112
|
+
if (e && (a = `--${r}_${e}`, i += `_${e}`), typeof t == "string" && t.startsWith(":")) {
|
|
113
|
+
this.addUtil(`${i}:${t.replace(":", "")}`);
|
|
102
114
|
return;
|
|
103
115
|
}
|
|
104
|
-
if (!
|
|
105
|
-
const { presets:
|
|
106
|
-
if (
|
|
107
|
-
const
|
|
108
|
-
|
|
116
|
+
if (!e) {
|
|
117
|
+
const { presets: y, tokenClass: T, utils: g, shorthands: b } = s;
|
|
118
|
+
if (y && P(y, t)) {
|
|
119
|
+
const f = typeof t == "string" || typeof t == "number" ? String(t) : "";
|
|
120
|
+
f && this.addUtil(`${i}:${f}`);
|
|
109
121
|
return;
|
|
110
122
|
}
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
113
|
-
|
|
123
|
+
if (T && s.token && N(s.token, t)) {
|
|
124
|
+
const f = typeof t == "string" || typeof t == "number" ? String(t) : "";
|
|
125
|
+
f && this.addUtil(`${i}:${f}`);
|
|
114
126
|
return;
|
|
115
127
|
}
|
|
116
|
-
let
|
|
117
|
-
if (g && typeof t == "string" && (
|
|
118
|
-
this.addUtil(`${
|
|
128
|
+
let h = "";
|
|
129
|
+
if (g && typeof t == "string" && (h = S(g, t)), !h && b && typeof t == "string" && (h = S(b, t, !0)), h) {
|
|
130
|
+
this.addUtil(`${i}:${h}`);
|
|
119
131
|
return;
|
|
120
132
|
}
|
|
121
133
|
}
|
|
122
134
|
if (t === !0 || t === "-") {
|
|
123
|
-
this.addUtil(
|
|
135
|
+
this.addUtil(i);
|
|
124
136
|
return;
|
|
125
137
|
}
|
|
126
|
-
const { prop: l, isVar:
|
|
127
|
-
let
|
|
128
|
-
if (
|
|
129
|
-
if (
|
|
130
|
-
this.addStyle(`--${
|
|
138
|
+
const { prop: l, isVar: d, alwaysVar: p, token: m, bp: O } = s;
|
|
139
|
+
let n;
|
|
140
|
+
if (m && (typeof t == "string" || typeof t == "number") ? n = c(t, m) : typeof t == "string" || typeof t == "number" ? n = t : n = JSON.stringify(t), !e) {
|
|
141
|
+
if (d) {
|
|
142
|
+
this.addStyle(`--${r}`, n);
|
|
131
143
|
return;
|
|
132
|
-
} else if (!
|
|
133
|
-
this.addStyle(l,
|
|
144
|
+
} else if (!O && !p) {
|
|
145
|
+
this.addStyle(l, n);
|
|
134
146
|
return;
|
|
135
147
|
}
|
|
136
148
|
}
|
|
137
|
-
this.addUtil(
|
|
149
|
+
this.addUtil(i), this.addStyle(a, n);
|
|
138
150
|
}
|
|
139
151
|
// setPassProps(passVars) {
|
|
140
152
|
// let dataList = [];
|
|
@@ -149,40 +161,40 @@ class x {
|
|
|
149
161
|
// this.addStyle(`--pass_${propName}`, value);
|
|
150
162
|
// });
|
|
151
163
|
// }
|
|
152
|
-
setHovProps(
|
|
153
|
-
|
|
164
|
+
setHovProps(r) {
|
|
165
|
+
r && (r === "-" || r === !0 ? this.addUtil("-hov") : typeof r == "string" ? k(r).forEach((t) => {
|
|
154
166
|
this.addUtil(`-hov:${t}`);
|
|
155
|
-
}) : typeof
|
|
156
|
-
const
|
|
157
|
-
if (!(
|
|
158
|
-
if (
|
|
167
|
+
}) : typeof r == "object" && Object.keys(r).forEach((t) => {
|
|
168
|
+
const s = r[t];
|
|
169
|
+
if (!(s == null || s === "" || s === !1)) {
|
|
170
|
+
if (s === "-" || s === !0)
|
|
159
171
|
this.addUtil(`-hov:${t}`);
|
|
160
172
|
else if (t === "class")
|
|
161
|
-
k(
|
|
162
|
-
this.addUtil(`-hov:${
|
|
173
|
+
k(s).forEach((e) => {
|
|
174
|
+
this.addUtil(`-hov:${e}`);
|
|
163
175
|
});
|
|
164
|
-
else if (typeof
|
|
165
|
-
const
|
|
166
|
-
this.addUtil(`-hov:${t}`), this.addStyle(`--hov-${t}`,
|
|
176
|
+
else if (typeof s == "string" || typeof s == "number") {
|
|
177
|
+
const e = c(s, z(t));
|
|
178
|
+
this.addUtil(`-hov:${t}`), this.addStyle(`--hov-${t}`, e);
|
|
167
179
|
}
|
|
168
180
|
}
|
|
169
181
|
}));
|
|
170
182
|
}
|
|
171
183
|
}
|
|
172
|
-
function
|
|
173
|
-
if (Object.keys(
|
|
184
|
+
function B(o) {
|
|
185
|
+
if (Object.keys(o).length === 0)
|
|
174
186
|
return {};
|
|
175
|
-
const { layout:
|
|
187
|
+
const { layout: r, ...t } = o, s = new A(j(r, t));
|
|
176
188
|
return {
|
|
177
|
-
...
|
|
178
|
-
className:
|
|
179
|
-
style:
|
|
189
|
+
...U({
|
|
190
|
+
className: s.className,
|
|
191
|
+
style: U(s.styles)
|
|
180
192
|
}),
|
|
181
|
-
...
|
|
193
|
+
...s.attrs
|
|
182
194
|
// data-* などHTMLの標準属性はそのまま渡す
|
|
183
195
|
};
|
|
184
196
|
}
|
|
185
197
|
export {
|
|
186
|
-
|
|
187
|
-
|
|
198
|
+
A as LismPropsData,
|
|
199
|
+
B as default
|
|
188
200
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function e(r) {
|
|
2
|
+
return r ? Array.isArray(r) ? r.flatMap((n) => e(n)) : typeof r != "string" ? [] : r.split(/[,\s]+/).map((n) => n.trim()).filter(Boolean) : [];
|
|
3
|
+
}
|
|
4
|
+
function a(r, n) {
|
|
5
|
+
const i = [...e(r), ...e(n)];
|
|
6
|
+
if (i.length === 0) return [];
|
|
7
|
+
const s = [], o = /* @__PURE__ */ new Set();
|
|
8
|
+
for (const t of i)
|
|
9
|
+
t.startsWith("-") ? o.add(t.slice(1)) : s.includes(t) || s.push(t);
|
|
10
|
+
return s.filter((t) => !o.has(t));
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
a as default
|
|
14
|
+
};
|