lism-css 0.10.5 → 0.12.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.ja.md +5 -5
- package/README.md +7 -7
- package/config/defaults/props.ts +16 -26
- package/config/defaults/states.ts +0 -28
- package/config/defaults/tokens.ts +2 -2
- package/dist/components/{atomic/Media → Media}/Media.d.ts +2 -2
- package/dist/components/{atomic/Media → Media}/index.js +1 -1
- package/dist/components/atomic/Icon/getProps.d.ts +1 -1
- package/dist/components/atomic/Icon/index.d.ts +1 -1
- package/dist/components/index.d.ts +18 -18
- package/dist/components/index.js +62 -62
- package/dist/components/{Box → layout/Box}/Box.d.ts +2 -2
- package/dist/components/{Box → layout/Box}/index.js +1 -1
- package/dist/components/{Center → layout/Center}/Center.d.ts +2 -2
- package/dist/components/{Center → layout/Center}/index.js +1 -1
- package/dist/components/{Cluster → layout/Cluster}/Cluster.d.ts +2 -2
- package/dist/components/{Cluster → layout/Cluster}/index.js +1 -1
- package/dist/components/{Columns → layout/Columns}/Columns.d.ts +2 -2
- package/dist/components/{Columns → layout/Columns}/index.js +1 -1
- package/dist/components/{Flex → layout/Flex}/Flex.d.ts +2 -2
- package/dist/components/{Flex → layout/Flex}/index.js +1 -1
- package/dist/components/{Flow → layout/Flow}/Flow.d.ts +2 -2
- package/dist/components/{Flow → layout/Flow}/index.js +1 -1
- package/dist/components/{FluidCols → layout/FluidCols}/FluidCols.d.ts +2 -2
- package/dist/components/{FluidCols → layout/FluidCols}/index.js +1 -1
- package/dist/components/{Frame → layout/Frame}/Frame.d.ts +2 -2
- package/dist/components/{Frame → layout/Frame}/index.js +1 -1
- package/dist/components/{Grid → layout/Grid}/Grid.d.ts +2 -2
- package/dist/components/{Grid → layout/Grid}/index.js +1 -1
- package/dist/components/{SideMain → layout/SideMain}/SideMain.d.ts +2 -2
- package/dist/components/{SideMain → layout/SideMain}/index.js +1 -1
- package/dist/components/{Stack → layout/Stack}/Stack.d.ts +2 -2
- package/dist/components/{Stack → layout/Stack}/index.js +1 -1
- package/dist/components/{SwitchCols → layout/SwitchCols}/SwitchCols.d.ts +2 -2
- package/dist/components/{SwitchCols → layout/SwitchCols}/index.js +1 -1
- package/dist/components/layout/TileGrid/TileGrid.d.ts +4 -0
- package/dist/components/layout/TileGrid/index.d.ts +1 -0
- package/dist/components/layout/TileGrid/index.js +8 -0
- package/dist/components/{Container → state/Container}/Container.d.ts +1 -1
- package/dist/components/{Container → state/Container}/index.js +1 -1
- package/dist/components/{Layer → state/Layer}/Layer.d.ts +1 -1
- package/dist/components/{Layer → state/Layer}/index.js +1 -1
- package/dist/components/{LinkBox → state/LinkBox}/LinkBox.d.ts +1 -1
- package/dist/components/{LinkBox → state/LinkBox}/index.js +1 -1
- package/dist/components/{Wrapper → state/Wrapper}/Wrapper.d.ts +1 -1
- package/dist/components/{Wrapper → state/Wrapper}/index.js +1 -1
- package/dist/config/default-config.d.ts +26 -73
- package/dist/config/defaults/props.d.ts +24 -58
- package/dist/config/defaults/props.js +16 -26
- package/dist/config/defaults/states.d.ts +0 -13
- package/dist/config/defaults/states.js +3 -23
- package/dist/config/defaults/tokens.d.ts +2 -2
- package/dist/config/defaults/tokens.js +2 -2
- package/dist/config/index.d.ts +52 -146
- package/dist/css/base.css +1 -1
- package/dist/css/main.css +1 -1
- package/dist/css/main_no_layer.css +1 -1
- package/dist/css/modules/layout.css +1 -1
- package/dist/css/props.css +1 -1
- package/dist/css/utility.css +1 -1
- package/dist/lib/getLayoutProps.js +12 -15
- package/dist/lib/getLismProps.d.ts +3 -2
- package/dist/lib/getLismProps.js +91 -89
- package/dist/lib/helper/mergeSet.d.ts +5 -0
- package/dist/lib/helper/mergeSet.js +14 -0
- package/dist/lib/helper/mergeSet.test.d.ts +1 -0
- package/dist/lib/types/LayoutProps.d.ts +4 -1
- package/dist/lib/types/StateProps.d.ts +5 -3
- package/package.json +1 -1
- package/packages/astro/{Decorator → atomic/Decorator}/Decorator.astro +1 -1
- package/packages/astro/{Divider → atomic/Divider}/Divider.astro +2 -2
- package/packages/astro/{Icon → atomic/Icon}/Icon.astro +1 -1
- package/packages/astro/{Spacer → atomic/Spacer}/Spacer.astro +2 -2
- package/packages/astro/index.ts +26 -22
- package/packages/astro/{Box → layout/Box}/Box.astro +2 -2
- package/packages/astro/{Center → layout/Center}/Center.astro +2 -2
- package/packages/astro/{Cluster → layout/Cluster}/Cluster.astro +2 -2
- package/packages/astro/{Columns → layout/Columns}/Columns.astro +2 -2
- package/packages/astro/{Flex → layout/Flex}/Flex.astro +2 -2
- package/packages/astro/{Flow → layout/Flow}/Flow.astro +2 -2
- package/packages/astro/{FluidCols → layout/FluidCols}/FluidCols.astro +2 -2
- package/packages/astro/{Frame → layout/Frame}/Frame.astro +2 -2
- package/packages/astro/{Grid → layout/Grid}/Grid.astro +2 -2
- package/packages/astro/{SideMain → layout/SideMain}/SideMain.astro +2 -2
- package/packages/astro/{Stack → layout/Stack}/Stack.astro +2 -2
- package/packages/astro/{SwitchCols → layout/SwitchCols}/SwitchCols.astro +2 -2
- package/packages/astro/layout/TileGrid/TileGrid.astro +11 -0
- package/packages/astro/layout/TileGrid/index.ts +1 -0
- package/packages/astro/{Container → state/Container}/Container.astro +2 -2
- package/packages/astro/{Layer → state/Layer}/Layer.astro +2 -2
- package/packages/astro/{LinkBox → state/LinkBox}/LinkBox.astro +2 -2
- package/packages/astro/{Wrapper → state/Wrapper}/Wrapper.astro +2 -2
- package/src/scss/_auto_output.scss +1 -1
- package/src/scss/_prop-config.scss +24 -30
- package/src/scss/_with_layer.scss +4 -4
- package/src/scss/base/_html.scss +9 -9
- package/src/scss/base/tokens/_shadow.scss +5 -8
- package/src/scss/base/tokens/_tokens.scss +5 -10
- package/src/scss/modules/layout/_grid.scss +0 -5
- package/src/scss/modules/layout/_tileGrid.scss +4 -0
- package/src/scss/modules/layout/index.scss +1 -0
- package/src/scss/props/index.scss +1 -1
- package/src/scss/utility/_cbox.scss +3 -3
- package/src/scss/utility/_clipText.scss +1 -0
- package/src/scss/utility/_hidden.scss +2 -2
- package/src/scss/utility/_trimHL.scss +4 -1
- package/config/helper/getSvgUrl.ts +0 -26
- package/dist/components/HTML/HTML.d.ts +0 -26
- package/dist/components/HTML/index.d.ts +0 -14
- package/dist/components/HTML/index.js +0 -5
- package/dist/components/HTML/index2.js +0 -45
- package/dist/config/helper/getSvgUrl.d.ts +0 -5
- package/dist/config/helper/getSvgUrl.js +0 -4
- package/packages/astro/HTML/_index_memo.js +0 -29
- package/packages/astro/HTML/a.astro +0 -10
- package/packages/astro/HTML/button.astro +0 -10
- package/packages/astro/HTML/div.astro +0 -10
- package/packages/astro/HTML/h.astro +0 -13
- package/packages/astro/HTML/img.astro +0 -10
- package/packages/astro/HTML/index.ts +0 -12
- package/packages/astro/HTML/li.astro +0 -10
- package/packages/astro/HTML/ol.astro +0 -10
- package/packages/astro/HTML/p.astro +0 -10
- package/packages/astro/HTML/span.astro +0 -10
- package/packages/astro/HTML/ul.astro +0 -10
- /package/dist/components/{atomic/Media → Media}/Media.stories.d.ts +0 -0
- /package/dist/components/{atomic/Media → Media}/index.d.ts +0 -0
- /package/dist/components/{Box → layout/Box}/Box.stories.d.ts +0 -0
- /package/dist/components/{Box → layout/Box}/index.d.ts +0 -0
- /package/dist/components/{Center → layout/Center}/Center.stories.d.ts +0 -0
- /package/dist/components/{Center → layout/Center}/index.d.ts +0 -0
- /package/dist/components/{Cluster → layout/Cluster}/Cluster.stories.d.ts +0 -0
- /package/dist/components/{Cluster → layout/Cluster}/index.d.ts +0 -0
- /package/dist/components/{Columns → layout/Columns}/Columns.stories.d.ts +0 -0
- /package/dist/components/{Columns → layout/Columns}/index.d.ts +0 -0
- /package/dist/components/{Flex → layout/Flex}/Flex.stories.d.ts +0 -0
- /package/dist/components/{Flex → layout/Flex}/index.d.ts +0 -0
- /package/dist/components/{Flow → layout/Flow}/Flow.stories.d.ts +0 -0
- /package/dist/components/{Flow → layout/Flow}/index.d.ts +0 -0
- /package/dist/components/{FluidCols → layout/FluidCols}/FluidCols.stories.d.ts +0 -0
- /package/dist/components/{FluidCols → layout/FluidCols}/index.d.ts +0 -0
- /package/dist/components/{Frame → layout/Frame}/Frame.stories.d.ts +0 -0
- /package/dist/components/{Frame → layout/Frame}/index.d.ts +0 -0
- /package/dist/components/{Grid → layout/Grid}/Grid.stories.d.ts +0 -0
- /package/dist/components/{Grid → layout/Grid}/index.d.ts +0 -0
- /package/dist/components/{SideMain → layout/SideMain}/SideMain.stories.d.ts +0 -0
- /package/dist/components/{SideMain → layout/SideMain}/index.d.ts +0 -0
- /package/dist/components/{Stack → layout/Stack}/Stack.stories.d.ts +0 -0
- /package/dist/components/{Stack → layout/Stack}/index.d.ts +0 -0
- /package/dist/components/{SwitchCols → layout/SwitchCols}/SwitchCols.stories.d.ts +0 -0
- /package/dist/components/{SwitchCols → layout/SwitchCols}/index.d.ts +0 -0
- /package/dist/components/{Container → state/Container}/Container.stories.d.ts +0 -0
- /package/dist/components/{Container → state/Container}/index.d.ts +0 -0
- /package/dist/components/{Layer → state/Layer}/Layer.stories.d.ts +0 -0
- /package/dist/components/{Layer → state/Layer}/Layer.test.d.ts +0 -0
- /package/dist/components/{Layer → state/Layer}/index.d.ts +0 -0
- /package/dist/components/{LinkBox → state/LinkBox}/LinkBox.stories.d.ts +0 -0
- /package/dist/components/{LinkBox → state/LinkBox}/index.d.ts +0 -0
- /package/dist/components/{LinkBox → state/LinkBox}/script.d.ts +0 -0
- /package/dist/components/{Wrapper → state/Wrapper}/Wrapper.stories.d.ts +0 -0
- /package/dist/components/{Wrapper → state/Wrapper}/index.d.ts +0 -0
- /package/packages/astro/{Decorator → atomic/Decorator}/index.ts +0 -0
- /package/packages/astro/{Divider → atomic/Divider}/index.ts +0 -0
- /package/packages/astro/{Icon → atomic/Icon}/SVG.astro +0 -0
- /package/packages/astro/{Icon → atomic/Icon}/index.ts +0 -0
- /package/packages/astro/{Spacer → atomic/Spacer}/index.ts +0 -0
- /package/packages/astro/{Box → layout/Box}/index.ts +0 -0
- /package/packages/astro/{Center → layout/Center}/index.ts +0 -0
- /package/packages/astro/{Cluster → layout/Cluster}/index.ts +0 -0
- /package/packages/astro/{Columns → layout/Columns}/index.ts +0 -0
- /package/packages/astro/{Flex → layout/Flex}/index.ts +0 -0
- /package/packages/astro/{Flow → layout/Flow}/index.ts +0 -0
- /package/packages/astro/{FluidCols → layout/FluidCols}/index.ts +0 -0
- /package/packages/astro/{Frame → layout/Frame}/index.ts +0 -0
- /package/packages/astro/{Grid → layout/Grid}/index.ts +0 -0
- /package/packages/astro/{SideMain → layout/SideMain}/index.ts +0 -0
- /package/packages/astro/{Stack → layout/Stack}/index.ts +0 -0
- /package/packages/astro/{SwitchCols → layout/SwitchCols}/index.ts +0 -0
- /package/packages/astro/{Container → state/Container}/index.ts +0 -0
- /package/packages/astro/{Layer → state/Layer}/index.ts +0 -0
- /package/packages/astro/{LinkBox → state/LinkBox}/index.ts +0 -0
- /package/packages/astro/{Wrapper → state/Wrapper}/index.ts +0 -0
package/dist/lib/getLismProps.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { STATES as b, PROPS as g } from "../config/index.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import p from "./getLayoutProps.js";
|
|
3
|
+
import U from "./isPresetValue.js";
|
|
4
|
+
import E from "./isTokenValue.js";
|
|
5
|
+
import C from "./getUtilKey.js";
|
|
6
6
|
import S from "./getMaybeCssVar.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
7
|
+
import V from "./getBpData.js";
|
|
8
|
+
import x from "./helper/atts.js";
|
|
9
|
+
import _ from "./helper/isEmptyObj.js";
|
|
10
10
|
import O from "./helper/filterEmptyObj.js";
|
|
11
|
+
import w from "./helper/mergeSet.js";
|
|
11
12
|
import j from "./helper/splitWithComma.js";
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
return
|
|
13
|
+
const A = (f) => {
|
|
14
|
+
const i = g[f];
|
|
15
|
+
return i && i?.token || "";
|
|
15
16
|
};
|
|
16
|
-
class
|
|
17
|
+
class z {
|
|
17
18
|
// propList = {};
|
|
18
19
|
className = "";
|
|
19
20
|
uClasses = [];
|
|
@@ -21,101 +22,102 @@ class w {
|
|
|
21
22
|
styles = {};
|
|
22
23
|
attrs = {};
|
|
23
24
|
_propConfig;
|
|
24
|
-
constructor(
|
|
25
|
-
const { forwardedRef: t, class:
|
|
26
|
-
this.styles = { ...
|
|
27
|
-
let
|
|
25
|
+
constructor(i) {
|
|
26
|
+
const { forwardedRef: t, class: s, className: e, lismClass: l, variant: r, style: o = {}, _propConfig: m = {}, ...u } = i;
|
|
27
|
+
this.styles = { ...o }, this._propConfig = { ...m };
|
|
28
|
+
let a = l || "";
|
|
28
29
|
if (r && l) {
|
|
29
|
-
const
|
|
30
|
-
|
|
30
|
+
const d = l.split(" "), n = d[0], y = `${n}--${r}`;
|
|
31
|
+
a = [n, y, ...d.slice(1)].join(" ");
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
+
_(u) || (this.attrs = { ...u }, this.analyzeProps()), t && (this.attrs.ref = t), this.className = x(e || s, a, this.lismState, this.uClasses);
|
|
33
34
|
}
|
|
34
|
-
analyzeState(
|
|
35
|
-
const { className:
|
|
36
|
-
t === !0 ? this.lismState.push(
|
|
35
|
+
analyzeState(i, t) {
|
|
36
|
+
const { className: s, preset: e, presetClass: l, customVar: r, tokenKey: o } = i;
|
|
37
|
+
t === !0 ? this.lismState.push(s) : e && U(e, t) ? this.lismState.push(`${s} ${l}:${String(t)}`) : t && (this.lismState.push(s), o && r && this.addStyle(r, S(t, o)));
|
|
37
38
|
}
|
|
38
39
|
// prop解析
|
|
39
40
|
analyzeProps() {
|
|
41
|
+
const i = this.extractProp("set"), t = this.extractProp("unset");
|
|
40
42
|
Object.keys(this.attrs).forEach((s) => {
|
|
41
43
|
if (Object.hasOwn(b, s)) {
|
|
42
|
-
const
|
|
43
|
-
typeof
|
|
44
|
+
const e = this.extractProp(s), l = b[s];
|
|
45
|
+
typeof l == "string" ? e && this.lismState.push(l) : this.analyzeState(l, e);
|
|
44
46
|
} else if (Object.hasOwn(g, s)) {
|
|
45
|
-
const
|
|
46
|
-
delete this.attrs[s], this.analyzeLismProp(s,
|
|
47
|
+
const e = this.attrs[s];
|
|
48
|
+
delete this.attrs[s], this.analyzeLismProp(s, e);
|
|
47
49
|
} else if (s === "hov") {
|
|
48
|
-
const
|
|
49
|
-
this.setHovProps(
|
|
50
|
+
const e = this.extractProp(s);
|
|
51
|
+
this.setHovProps(e);
|
|
50
52
|
} else if (s === "css") {
|
|
51
|
-
const
|
|
52
|
-
this.addStyles(
|
|
53
|
+
const e = this.extractProp("css");
|
|
54
|
+
this.addStyles(e);
|
|
53
55
|
}
|
|
54
|
-
});
|
|
56
|
+
}), w(void 0, i, t).forEach((s) => this.lismState.push(`set--${s}`));
|
|
55
57
|
}
|
|
56
58
|
// Lism Prop 解析
|
|
57
|
-
analyzeLismProp(
|
|
59
|
+
analyzeLismProp(i, t) {
|
|
58
60
|
if (t == null) return;
|
|
59
|
-
let
|
|
60
|
-
if (
|
|
61
|
-
this._propConfig?.[
|
|
62
|
-
const { base: e, ...l } =
|
|
63
|
-
this.setAttrs(
|
|
64
|
-
|
|
61
|
+
let s = g[i] || null;
|
|
62
|
+
if (s === null) return;
|
|
63
|
+
this._propConfig?.[i] && (s = Object.assign({}, s, this._propConfig[i]));
|
|
64
|
+
const { base: e, ...l } = V(t);
|
|
65
|
+
this.setAttrs(i, e, s), Object.keys(l).forEach((r) => {
|
|
66
|
+
s && this.setAttrs(i, l[r], s, r);
|
|
65
67
|
});
|
|
66
68
|
}
|
|
67
|
-
addUtil(
|
|
68
|
-
this.uClasses.push(
|
|
69
|
+
addUtil(i) {
|
|
70
|
+
this.uClasses.push(i);
|
|
69
71
|
}
|
|
70
|
-
addUtils(
|
|
71
|
-
this.uClasses.push(...
|
|
72
|
+
addUtils(i) {
|
|
73
|
+
this.uClasses.push(...i);
|
|
72
74
|
}
|
|
73
75
|
// addState(state) {
|
|
74
76
|
// this.stateClasses.push(state);
|
|
75
77
|
// }
|
|
76
|
-
addStyle(
|
|
77
|
-
this.styles[
|
|
78
|
+
addStyle(i, t) {
|
|
79
|
+
this.styles[i] = t;
|
|
78
80
|
}
|
|
79
|
-
addStyles(
|
|
80
|
-
this.styles = { ...this.styles, ...
|
|
81
|
+
addStyles(i) {
|
|
82
|
+
this.styles = { ...this.styles, ...i };
|
|
81
83
|
}
|
|
82
|
-
addAttrs(
|
|
83
|
-
this.addStyles(
|
|
84
|
+
addAttrs(i) {
|
|
85
|
+
this.addStyles(i.styles || {}), this.addUtils(i.utils || []);
|
|
84
86
|
}
|
|
85
|
-
extractProp(
|
|
86
|
-
const t = this.attrs[
|
|
87
|
-
return this.attrs[
|
|
87
|
+
extractProp(i) {
|
|
88
|
+
const t = this.attrs[i];
|
|
89
|
+
return this.attrs[i] === void 0 ? null : (delete this.attrs[i], t);
|
|
88
90
|
}
|
|
89
|
-
extractProps(
|
|
91
|
+
extractProps(i) {
|
|
90
92
|
const t = {};
|
|
91
|
-
return
|
|
92
|
-
this.attrs[
|
|
93
|
+
return i.forEach((s) => {
|
|
94
|
+
this.attrs[s] !== void 0 && (t[s] = this.attrs[s], delete this.attrs[s]);
|
|
93
95
|
}), t;
|
|
94
96
|
}
|
|
95
97
|
// utilクラスを追加するか、styleにセットするかの分岐処理 @base
|
|
96
98
|
// 値が null, undefined, '', false の時はスキップ
|
|
97
|
-
setAttrs(
|
|
99
|
+
setAttrs(i, t, s = {}, e = "") {
|
|
98
100
|
if (t == null || t === "" || t === !1) return;
|
|
99
|
-
let l = `--${
|
|
100
|
-
if (e && (l = `--${
|
|
101
|
+
let l = `--${i}`, r = `-${String(s.utilKey || i)}`;
|
|
102
|
+
if (e && (l = `--${i}_${e}`, r += `_${e}`), typeof t == "string" && t.startsWith(":")) {
|
|
101
103
|
this.addUtil(`${r}:${t.replace(":", "")}`);
|
|
102
104
|
return;
|
|
103
105
|
}
|
|
104
106
|
if (!e) {
|
|
105
|
-
const { presets:
|
|
106
|
-
if (
|
|
107
|
-
const
|
|
108
|
-
|
|
107
|
+
const { presets: y, tokenClass: k, utils: $, shorthands: P } = s;
|
|
108
|
+
if (y && U(y, t)) {
|
|
109
|
+
const c = typeof t == "string" || typeof t == "number" ? String(t) : "";
|
|
110
|
+
c && this.addUtil(`${r}:${c}`);
|
|
109
111
|
return;
|
|
110
112
|
}
|
|
111
|
-
if (k &&
|
|
112
|
-
const
|
|
113
|
-
|
|
113
|
+
if (k && s.token && E(s.token, t)) {
|
|
114
|
+
const c = typeof t == "string" || typeof t == "number" ? String(t) : "";
|
|
115
|
+
c && this.addUtil(`${r}:${c}`);
|
|
114
116
|
return;
|
|
115
117
|
}
|
|
116
|
-
let
|
|
117
|
-
if ($ && typeof t == "string" && (
|
|
118
|
-
this.addUtil(`${r}:${
|
|
118
|
+
let h = "";
|
|
119
|
+
if ($ && typeof t == "string" && (h = C($, t)), !h && P && typeof t == "string" && (h = C(P, t, !0)), h) {
|
|
120
|
+
this.addUtil(`${r}:${h}`);
|
|
119
121
|
return;
|
|
120
122
|
}
|
|
121
123
|
}
|
|
@@ -123,14 +125,14 @@ class w {
|
|
|
123
125
|
this.addUtil(r);
|
|
124
126
|
return;
|
|
125
127
|
}
|
|
126
|
-
const { prop:
|
|
128
|
+
const { prop: o, isVar: m, alwaysVar: u, token: a, bp: d } = s;
|
|
127
129
|
let n;
|
|
128
|
-
if (
|
|
129
|
-
if (
|
|
130
|
-
this.addStyle(`--${
|
|
130
|
+
if (a && (typeof t == "string" || typeof t == "number") ? n = S(t, a) : typeof t == "string" || typeof t == "number" ? n = t : n = JSON.stringify(t), !e) {
|
|
131
|
+
if (m) {
|
|
132
|
+
this.addStyle(`--${i}`, n);
|
|
131
133
|
return;
|
|
132
|
-
} else if (!
|
|
133
|
-
this.addStyle(
|
|
134
|
+
} else if (!d && !u) {
|
|
135
|
+
this.addStyle(o, n);
|
|
134
136
|
return;
|
|
135
137
|
}
|
|
136
138
|
}
|
|
@@ -149,40 +151,40 @@ class w {
|
|
|
149
151
|
// this.addStyle(`--pass_${propName}`, value);
|
|
150
152
|
// });
|
|
151
153
|
// }
|
|
152
|
-
setHovProps(
|
|
153
|
-
|
|
154
|
+
setHovProps(i) {
|
|
155
|
+
i && (i === "-" || i === !0 ? this.addUtil("-hov") : typeof i == "string" ? j(i).forEach((t) => {
|
|
154
156
|
this.addUtil(`-hov:${t}`);
|
|
155
|
-
}) : typeof
|
|
156
|
-
const
|
|
157
|
-
if (!(
|
|
158
|
-
if (
|
|
157
|
+
}) : typeof i == "object" && Object.keys(i).forEach((t) => {
|
|
158
|
+
const s = i[t];
|
|
159
|
+
if (!(s == null || s === "" || s === !1)) {
|
|
160
|
+
if (s === "-" || s === !0)
|
|
159
161
|
this.addUtil(`-hov:${t}`);
|
|
160
162
|
else if (t === "class")
|
|
161
|
-
j(
|
|
163
|
+
j(s).forEach((e) => {
|
|
162
164
|
this.addUtil(`-hov:${e}`);
|
|
163
165
|
});
|
|
164
|
-
else if (typeof
|
|
165
|
-
const e = S(
|
|
166
|
+
else if (typeof s == "string" || typeof s == "number") {
|
|
167
|
+
const e = S(s, A(t));
|
|
166
168
|
this.addUtil(`-hov:${t}`), this.addStyle(`--hov-${t}`, e);
|
|
167
169
|
}
|
|
168
170
|
}
|
|
169
171
|
}));
|
|
170
172
|
}
|
|
171
173
|
}
|
|
172
|
-
function
|
|
173
|
-
if (Object.keys(
|
|
174
|
+
function Q(f) {
|
|
175
|
+
if (Object.keys(f).length === 0)
|
|
174
176
|
return {};
|
|
175
|
-
const { layout:
|
|
177
|
+
const { layout: i, ...t } = f, s = new z(p(i, t));
|
|
176
178
|
return {
|
|
177
179
|
...O({
|
|
178
|
-
className:
|
|
179
|
-
style: O(
|
|
180
|
+
className: s.className,
|
|
181
|
+
style: O(s.styles)
|
|
180
182
|
}),
|
|
181
|
-
...
|
|
183
|
+
...s.attrs
|
|
182
184
|
// data-* などHTMLの標準属性はそのまま渡す
|
|
183
185
|
};
|
|
184
186
|
}
|
|
185
187
|
export {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
+
z as LismPropsData,
|
|
189
|
+
Q as default
|
|
188
190
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function r(t) {
|
|
2
|
+
return t ? Array.isArray(t) ? t.flatMap((e) => r(e)) : typeof t == "string" ? t.split(/[,\s]+/).map((e) => e.trim()).filter(Boolean) : [] : [];
|
|
3
|
+
}
|
|
4
|
+
function u(t, e, f) {
|
|
5
|
+
const n = [.../* @__PURE__ */ new Set([...r(t), ...r(e)])];
|
|
6
|
+
if (n.length === 0) return [];
|
|
7
|
+
const i = r(f);
|
|
8
|
+
if (i.length === 0) return n;
|
|
9
|
+
const s = new Set(i);
|
|
10
|
+
return n.filter((o) => !s.has(o));
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
u as default
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -26,6 +26,9 @@ export interface StackProps {
|
|
|
26
26
|
export interface ColumnsProps {
|
|
27
27
|
layout: 'columns';
|
|
28
28
|
}
|
|
29
|
+
export interface TileGridProps {
|
|
30
|
+
layout: 'tileGrid';
|
|
31
|
+
}
|
|
29
32
|
export interface FlowLayoutProps {
|
|
30
33
|
layout: 'flow';
|
|
31
34
|
flow?: CssValue;
|
|
@@ -43,7 +46,7 @@ export interface SwitchColsProps {
|
|
|
43
46
|
layout: 'switchCols';
|
|
44
47
|
breakSize?: CssValue;
|
|
45
48
|
}
|
|
46
|
-
export type LayoutSpecificProps = NoLayoutProps | BoxProps | CenterProps | ClusterProps | ColumnsProps | FlexProps | FlowLayoutProps | FluidColsProps | FrameProps | GridLayoutProps | StackProps | SideMainProps | SwitchColsProps;
|
|
49
|
+
export type LayoutSpecificProps = NoLayoutProps | BoxProps | CenterProps | ClusterProps | ColumnsProps | FlexProps | FlowLayoutProps | FluidColsProps | FrameProps | GridLayoutProps | StackProps | SideMainProps | SwitchColsProps | TileGridProps;
|
|
47
50
|
export type LayoutType = Exclude<LayoutSpecificProps, NoLayoutProps>['layout'];
|
|
48
51
|
export interface LayoutProps {
|
|
49
52
|
layout?: LayoutType;
|
|
@@ -14,9 +14,7 @@ type PresetElement<T> = T extends {
|
|
|
14
14
|
*/
|
|
15
15
|
type ExtractStateValue<T> = T extends string ? boolean : T extends {
|
|
16
16
|
preset: readonly unknown[];
|
|
17
|
-
} ? WithArbitraryString<PresetElement<T>> | boolean :
|
|
18
|
-
setStyles: unknown;
|
|
19
|
-
} ? string : never;
|
|
17
|
+
} ? WithArbitraryString<PresetElement<T>> | boolean : never;
|
|
20
18
|
/**
|
|
21
19
|
* config/index.ts の STATES から自動生成される State Props の型
|
|
22
20
|
* config/index.ts の STATES に新しいステートを追加すると自動的に反映される
|
|
@@ -24,4 +22,8 @@ type ExtractStateValue<T> = T extends string ? boolean : T extends {
|
|
|
24
22
|
export type StateProps = {
|
|
25
23
|
[K in keyof StatesConfig]?: ExtractStateValue<StatesConfig[K]>;
|
|
26
24
|
};
|
|
25
|
+
/** set / unset prop で使われるプリセット値(エディタ補完用) */
|
|
26
|
+
type SetPreset = 'gutter' | 'shadow' | 'hov' | 'transition' | 'mask' | 'plain' | 'innerRs' | 'bp';
|
|
27
|
+
/** set / unset prop の値の型: プリセット値がサジェストされつつ、任意の文字列も受け付ける */
|
|
28
|
+
export type SetPropValue = WithArbitraryString<SetPreset> | WithArbitraryString<SetPreset>[];
|
|
27
29
|
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
3
|
import type { DecoratorProps } from 'lism-css/react/atomic/Decorator/getProps';
|
|
4
|
-
import { Lism } from '
|
|
4
|
+
import { Lism } from '../../Lism';
|
|
5
5
|
import getProps from 'lism-css/react/atomic/Decorator/getProps';
|
|
6
6
|
|
|
7
7
|
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> &
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
-
import type { AstroLismBaseProps } from '
|
|
4
|
-
import { Lism } from '
|
|
3
|
+
import type { AstroLismBaseProps } from '../../types';
|
|
4
|
+
import { Lism } from '../../Lism';
|
|
5
5
|
import { getDividerProps } from 'lism-css/react/atomic/Divider/getProps';
|
|
6
6
|
|
|
7
7
|
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
3
|
import type { ElementType } from 'react';
|
|
4
4
|
import type { IconProps, IconOwnProps } from 'lism-css/react/atomic/Icon/getProps';
|
|
5
|
-
import type { AstroLismBaseProps } from '
|
|
5
|
+
import type { AstroLismBaseProps } from '../../types';
|
|
6
6
|
import getLismProps from 'lism-css/lib/getLismProps';
|
|
7
7
|
import getProps from 'lism-css/react/atomic/Icon/getProps';
|
|
8
8
|
import SVG from './SVG.astro';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
-
import type { AstroLismBaseProps } from '
|
|
4
|
-
import { Lism } from '
|
|
3
|
+
import type { AstroLismBaseProps } from '../../types';
|
|
4
|
+
import { Lism } from '../../Lism';
|
|
5
5
|
import getProps from 'lism-css/react/atomic/Spacer/getProps';
|
|
6
6
|
|
|
7
7
|
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
package/packages/astro/index.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
export * from './Lism';
|
|
6
|
-
export { default as HTML } from './HTML';
|
|
7
6
|
/** @deprecated DummyText / DummyImage (@lism-css/ui) を使用してください */
|
|
8
7
|
export * from './Dummy';
|
|
9
8
|
|
|
@@ -14,26 +13,31 @@ export * from './Group';
|
|
|
14
13
|
export * from './Heading';
|
|
15
14
|
export * from './Link';
|
|
16
15
|
export * from './List';
|
|
17
|
-
export * from './
|
|
18
|
-
export * from './Flow';
|
|
19
|
-
export * from './Flex';
|
|
20
|
-
export * from './Cluster';
|
|
21
|
-
export * from './Stack';
|
|
22
|
-
export * from './Grid';
|
|
23
|
-
export * from './FluidCols';
|
|
24
|
-
export * from './SwitchCols';
|
|
25
|
-
export * from './Columns';
|
|
26
|
-
export * from './Center';
|
|
27
|
-
export * from './SideMain';
|
|
28
|
-
export * from './Frame';
|
|
16
|
+
export * from './Media';
|
|
29
17
|
|
|
30
|
-
|
|
31
|
-
export * from './
|
|
32
|
-
export * from './
|
|
33
|
-
export * from './
|
|
18
|
+
// layout (l--)
|
|
19
|
+
export * from './layout/Box';
|
|
20
|
+
export * from './layout/Center';
|
|
21
|
+
export * from './layout/Cluster';
|
|
22
|
+
export * from './layout/Columns';
|
|
23
|
+
export * from './layout/Flex';
|
|
24
|
+
export * from './layout/Flow';
|
|
25
|
+
export * from './layout/FluidCols';
|
|
26
|
+
export * from './layout/Frame';
|
|
27
|
+
export * from './layout/Grid';
|
|
28
|
+
export * from './layout/SideMain';
|
|
29
|
+
export * from './layout/Stack';
|
|
30
|
+
export * from './layout/SwitchCols';
|
|
31
|
+
export * from './layout/TileGrid';
|
|
34
32
|
|
|
35
|
-
|
|
36
|
-
export * from './
|
|
37
|
-
export * from './
|
|
38
|
-
export * from './
|
|
39
|
-
export * from './
|
|
33
|
+
// state (is--)
|
|
34
|
+
export * from './state/Container';
|
|
35
|
+
export * from './state/Layer';
|
|
36
|
+
export * from './state/LinkBox';
|
|
37
|
+
export * from './state/Wrapper';
|
|
38
|
+
|
|
39
|
+
// atomic (a--)
|
|
40
|
+
export * from './atomic/Decorator';
|
|
41
|
+
export * from './atomic/Divider';
|
|
42
|
+
export * from './atomic/Icon';
|
|
43
|
+
export * from './atomic/Spacer';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
-
import type { AstroLismFixedLayoutProps } from '
|
|
4
|
-
import { Lism } from '
|
|
3
|
+
import type { AstroLismFixedLayoutProps } from '../../types';
|
|
4
|
+
import { Lism } from '../../Lism';
|
|
5
5
|
|
|
6
6
|
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps;
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
-
import type { AstroLismFixedLayoutProps } from '
|
|
4
|
-
import { Lism } from '
|
|
3
|
+
import type { AstroLismFixedLayoutProps } from '../../types';
|
|
4
|
+
import { Lism } from '../../Lism';
|
|
5
5
|
|
|
6
6
|
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps;
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
-
import type { AstroLismFixedLayoutProps } from '
|
|
4
|
-
import { Lism } from '
|
|
3
|
+
import type { AstroLismFixedLayoutProps } from '../../types';
|
|
4
|
+
import { Lism } from '../../Lism';
|
|
5
5
|
|
|
6
6
|
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps;
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
-
import type { AstroLismFixedLayoutProps } from '
|
|
4
|
-
import { Lism } from '
|
|
3
|
+
import type { AstroLismFixedLayoutProps } from '../../types';
|
|
4
|
+
import { Lism } from '../../Lism';
|
|
5
5
|
|
|
6
6
|
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps;
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
-
import type { AstroLismFixedLayoutProps } from '
|
|
4
|
-
import { Lism } from '
|
|
3
|
+
import type { AstroLismFixedLayoutProps } from '../../types';
|
|
4
|
+
import { Lism } from '../../Lism';
|
|
5
5
|
|
|
6
6
|
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps;
|
|
7
7
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
-
import type { AstroLismFixedLayoutProps } from '
|
|
3
|
+
import type { AstroLismFixedLayoutProps } from '../../types';
|
|
4
4
|
import type { FlowLayoutProps } from 'lism-css/lib/types/LayoutProps';
|
|
5
|
-
import { Lism } from '
|
|
5
|
+
import { Lism } from '../../Lism';
|
|
6
6
|
|
|
7
7
|
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps & Omit<FlowLayoutProps, 'layout'>;
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
-
import type { AstroLismFixedLayoutProps } from '
|
|
3
|
+
import type { AstroLismFixedLayoutProps } from '../../types';
|
|
4
4
|
import type { FluidColsProps } from 'lism-css/lib/types/LayoutProps';
|
|
5
|
-
import { Lism } from '
|
|
5
|
+
import { Lism } from '../../Lism';
|
|
6
6
|
|
|
7
7
|
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps & Omit<FluidColsProps, 'layout'>;
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
-
import type { AstroLismFixedLayoutProps } from '
|
|
4
|
-
import { Lism } from '
|
|
3
|
+
import type { AstroLismFixedLayoutProps } from '../../types';
|
|
4
|
+
import { Lism } from '../../Lism';
|
|
5
5
|
|
|
6
6
|
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps;
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
-
import type { AstroLismFixedLayoutProps } from '
|
|
4
|
-
import { Lism } from '
|
|
3
|
+
import type { AstroLismFixedLayoutProps } from '../../types';
|
|
4
|
+
import { Lism } from '../../Lism';
|
|
5
5
|
|
|
6
6
|
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps;
|
|
7
7
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
-
import type { AstroLismFixedLayoutProps } from '
|
|
3
|
+
import type { AstroLismFixedLayoutProps } from '../../types';
|
|
4
4
|
import type { SideMainProps } from 'lism-css/lib/types/LayoutProps';
|
|
5
|
-
import { Lism } from '
|
|
5
|
+
import { Lism } from '../../Lism';
|
|
6
6
|
|
|
7
7
|
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps & Omit<SideMainProps, 'layout'>;
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
-
import type { AstroLismFixedLayoutProps } from '
|
|
4
|
-
import { Lism } from '
|
|
3
|
+
import type { AstroLismFixedLayoutProps } from '../../types';
|
|
4
|
+
import { Lism } from '../../Lism';
|
|
5
5
|
|
|
6
6
|
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps;
|
|
7
7
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
-
import type { AstroLismFixedLayoutProps } from '
|
|
3
|
+
import type { AstroLismFixedLayoutProps } from '../../types';
|
|
4
4
|
import type { SwitchColsProps } from 'lism-css/lib/types/LayoutProps';
|
|
5
|
-
import { Lism } from '
|
|
5
|
+
import { Lism } from '../../Lism';
|
|
6
6
|
|
|
7
7
|
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps & Omit<SwitchColsProps, 'layout'>;
|
|
8
8
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismFixedLayoutProps } from '../../types';
|
|
4
|
+
import { Lism } from '../../Lism';
|
|
5
|
+
|
|
6
|
+
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps;
|
|
7
|
+
|
|
8
|
+
const props = Astro.props;
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<Lism layout="tileGrid" {...props}><slot /></Lism>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as TileGrid } from './TileGrid.astro';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
-
import type { AstroLismBaseProps } from '
|
|
4
|
-
import { Lism } from '
|
|
3
|
+
import type { AstroLismBaseProps } from '../../types';
|
|
4
|
+
import { Lism } from '../../Lism';
|
|
5
5
|
|
|
6
6
|
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> &
|
|
7
7
|
AstroLismBaseProps & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
-
import type { AstroLismBaseProps } from '
|
|
4
|
-
import { Lism } from '
|
|
3
|
+
import type { AstroLismBaseProps } from '../../types';
|
|
4
|
+
import { Lism } from '../../Lism';
|
|
5
5
|
|
|
6
6
|
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
-
import type { AstroLismBaseProps } from '
|
|
4
|
-
import { Lism } from '
|
|
3
|
+
import type { AstroLismBaseProps } from '../../types';
|
|
4
|
+
import { Lism } from '../../Lism';
|
|
5
5
|
|
|
6
6
|
type Props<Tag extends HTMLTag = 'a'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
7
7
|
|