lism-css 0.9.2 → 0.9.4
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/dist/components/Box/Box.stories.d.ts +7 -0
- package/dist/components/Center/Center.stories.d.ts +8 -0
- package/dist/components/Cluster/Cluster.stories.d.ts +7 -0
- package/dist/components/Columns/Columns.stories.d.ts +8 -0
- package/dist/components/Container/Container.stories.d.ts +8 -0
- package/dist/components/Dummy/getContent.d.ts +1 -2
- package/dist/components/Dummy/getContent.js +6 -7
- package/dist/components/Flex/Flex.stories.d.ts +9 -0
- package/dist/components/Flow/Flow.stories.d.ts +9 -0
- package/dist/components/FluidCols/FluidCols.stories.d.ts +7 -0
- package/dist/components/Frame/Frame.stories.d.ts +7 -0
- package/dist/components/Grid/Grid.stories.d.ts +8 -0
- package/dist/components/Layer/Layer.stories.d.ts +8 -0
- package/dist/components/LinkBox/LinkBox.stories.d.ts +7 -0
- package/dist/components/Lism/Lism.d.ts +7 -4
- package/dist/components/Lism/Lism.stories.d.ts +1 -650
- package/dist/components/SideMain/SideMain.stories.d.ts +9 -0
- package/dist/components/Stack/Stack.stories.d.ts +8 -0
- package/dist/components/SwitchCols/SwitchCols.stories.d.ts +9 -0
- package/dist/components/Wrapper/Wrapper.stories.d.ts +10 -0
- package/dist/components/atomic/Decorator/Decorator.stories.d.ts +10 -0
- package/dist/components/atomic/Decorator/getProps.d.ts +5 -6
- package/dist/components/atomic/Divider/Divider.stories.d.ts +8 -0
- package/dist/components/atomic/Divider/getProps.d.ts +2 -2
- package/dist/components/atomic/Icon/Icon.d.ts +6 -2
- package/dist/components/atomic/Icon/Icon.stories.d.ts +15 -0
- package/dist/components/atomic/Icon/getProps.d.ts +11 -7
- package/dist/components/atomic/Icon/index.d.ts +1 -0
- package/dist/components/atomic/Media/Media.d.ts +6 -2
- package/dist/components/atomic/Media/Media.stories.d.ts +9 -0
- package/dist/components/atomic/Media/getProps.d.ts +6 -6
- package/dist/components/atomic/Spacer/Spacer.stories.d.ts +9 -0
- package/dist/components/atomic/Spacer/getProps.d.ts +2 -2
- package/dist/components/setMaybeTransformStyles.d.ts +2 -2
- 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/lib/getLayoutProps.d.ts +4 -3
- package/dist/lib/getLismProps.d.ts +10 -9
- package/dist/lib/getLismProps.js +69 -73
- package/dist/lib/getMaybeTokenValue.d.ts +2 -2
- package/dist/lib/types/LayoutProps.d.ts +26 -26
- package/dist/lib/types/ResponsiveProps.d.ts +1 -1
- package/dist/lib/types.d.ts +2 -2
- package/package.json +16 -10
- package/packages/astro/Box/Box.astro +2 -3
- package/packages/astro/Center/Center.astro +3 -0
- package/packages/astro/Cluster/Cluster.astro +3 -0
- package/packages/astro/Columns/Columns.astro +3 -0
- package/packages/astro/Container/Container.astro +4 -2
- package/packages/astro/Decorator/Decorator.astro +3 -4
- package/packages/astro/Divider/Divider.astro +3 -4
- package/packages/astro/Dummy/Dummy.astro +8 -4
- package/packages/astro/Flex/Flex.astro +3 -0
- package/packages/astro/Flow/Flow.astro +3 -0
- package/packages/astro/FluidCols/FluidCols.astro +3 -0
- package/packages/astro/Frame/Frame.astro +3 -0
- package/packages/astro/Grid/Grid.astro +3 -0
- package/packages/astro/HTML/a.astro +5 -1
- package/packages/astro/HTML/button.astro +5 -1
- package/packages/astro/HTML/div.astro +5 -1
- package/packages/astro/HTML/h.astro +6 -0
- package/packages/astro/HTML/img.astro +5 -1
- package/packages/astro/HTML/li.astro +5 -1
- package/packages/astro/HTML/ol.astro +5 -1
- package/packages/astro/HTML/p.astro +5 -1
- package/packages/astro/HTML/span.astro +5 -1
- package/packages/astro/HTML/ul.astro +5 -1
- package/packages/astro/Icon/Icon.astro +7 -12
- package/packages/astro/Layer/Layer.astro +4 -1
- package/packages/astro/LinkBox/LinkBox.astro +4 -3
- package/packages/astro/Lism/Lism.astro +4 -5
- package/packages/astro/Media/Media.astro +7 -3
- package/packages/astro/SideMain/SideMain.astro +3 -0
- package/packages/astro/Spacer/Spacer.astro +3 -4
- package/packages/astro/Stack/Stack.astro +3 -0
- package/packages/astro/SwitchCols/SwitchCols.astro +3 -0
- package/packages/astro/Wrapper/Wrapper.astro +5 -0
- package/packages/astro/env.d.ts +10 -0
- package/packages/astro/tsconfig.json +12 -0
- package/packages/astro/types.ts +51 -0
- package/src/scss/base/tokens/_shadow.scss +1 -0
- package/packages/astro/OverlayLink/OverlayLink.astro +0 -10
- package/packages/astro/OverlayLink/index.js +0 -1
- package/packages/astro/helper.js +0 -6
- /package/packages/astro/Box/{index.js → index.ts} +0 -0
- /package/packages/astro/Center/{index.js → index.ts} +0 -0
- /package/packages/astro/Cluster/{index.js → index.ts} +0 -0
- /package/packages/astro/Columns/{index.js → index.ts} +0 -0
- /package/packages/astro/Container/{index.js → index.ts} +0 -0
- /package/packages/astro/Decorator/{index.js → index.ts} +0 -0
- /package/packages/astro/Divider/{index.js → index.ts} +0 -0
- /package/packages/astro/Dummy/{index.js → index.ts} +0 -0
- /package/packages/astro/Flex/{index.js → index.ts} +0 -0
- /package/packages/astro/Flow/{index.js → index.ts} +0 -0
- /package/packages/astro/FluidCols/{index.js → index.ts} +0 -0
- /package/packages/astro/Frame/{index.js → index.ts} +0 -0
- /package/packages/astro/Grid/{index.js → index.ts} +0 -0
- /package/packages/astro/HTML/{index.js → index.ts} +0 -0
- /package/packages/astro/Icon/{index.js → index.ts} +0 -0
- /package/packages/astro/Layer/{index.js → index.ts} +0 -0
- /package/packages/astro/LinkBox/{index.js → index.ts} +0 -0
- /package/packages/astro/Lism/{index.js → index.ts} +0 -0
- /package/packages/astro/Media/{index.js → index.ts} +0 -0
- /package/packages/astro/SideMain/{index.js → index.ts} +0 -0
- /package/packages/astro/Spacer/{index.js → index.ts} +0 -0
- /package/packages/astro/Stack/{index.js → index.ts} +0 -0
- /package/packages/astro/SwitchCols/{index.js → index.ts} +0 -0
- /package/packages/astro/Wrapper/{index.js → index.ts} +0 -0
- /package/packages/astro/{index.js → index.ts} +0 -0
package/dist/lib/getLismProps.js
CHANGED
|
@@ -1,50 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const T = (l) => {
|
|
16
|
-
const s = $[l];
|
|
17
|
-
return s && (s == null ? void 0 : s.token) || "";
|
|
1
|
+
import { STATES as b, PROPS as g } from "../config/index.js";
|
|
2
|
+
import E from "./getLayoutProps.js";
|
|
3
|
+
import C from "./isPresetValue.js";
|
|
4
|
+
import V from "./isTokenValue.js";
|
|
5
|
+
import U from "./getUtilKey.js";
|
|
6
|
+
import S from "./getMaybeCssVar.js";
|
|
7
|
+
import _ from "./getBpData.js";
|
|
8
|
+
import A from "./helper/atts.js";
|
|
9
|
+
import x from "./helper/isEmptyObj.js";
|
|
10
|
+
import O from "./helper/filterEmptyObj.js";
|
|
11
|
+
import j from "./helper/splitWithComma.js";
|
|
12
|
+
const z = (a) => {
|
|
13
|
+
const s = g[a];
|
|
14
|
+
return s && s?.token || "";
|
|
18
15
|
};
|
|
19
|
-
class
|
|
16
|
+
class w {
|
|
17
|
+
// propList = {};
|
|
18
|
+
className = "";
|
|
19
|
+
uClasses = [];
|
|
20
|
+
lismState = [];
|
|
21
|
+
styles = {};
|
|
22
|
+
attrs = {};
|
|
23
|
+
_propConfig;
|
|
20
24
|
constructor(s) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
a(this, "_propConfig");
|
|
28
|
-
const { forwardedRef: t, class: i, className: e, lismClass: n, variant: r, style: f = {}, _propConfig: h = {}, ...y } = s;
|
|
29
|
-
this.styles = { ...f }, this._propConfig = { ...h };
|
|
30
|
-
let c = n || "";
|
|
31
|
-
if (r && n) {
|
|
32
|
-
const m = n.split(" "), o = m[0], S = `${o}--${r}`;
|
|
33
|
-
c = [o, S, ...m.slice(1)].join(" ");
|
|
25
|
+
const { forwardedRef: t, class: i, className: e, lismClass: l, variant: r, style: f = {}, _propConfig: o = {}, ...u } = s;
|
|
26
|
+
this.styles = { ...f }, this._propConfig = { ...o };
|
|
27
|
+
let h = l || "";
|
|
28
|
+
if (r && l) {
|
|
29
|
+
const y = l.split(" "), n = y[0], m = `${n}--${r}`;
|
|
30
|
+
h = [n, m, ...y.slice(1)].join(" ");
|
|
34
31
|
}
|
|
35
|
-
|
|
32
|
+
x(u) || (this.attrs = { ...u }, this.analyzeProps()), t && (this.attrs.ref = t), this.className = A(e || i, h, this.lismState, this.uClasses);
|
|
36
33
|
}
|
|
37
34
|
analyzeState(s, t) {
|
|
38
|
-
const { className: i, preset: e, presetClass:
|
|
39
|
-
t === !0 ? this.lismState.push(i) : e &&
|
|
35
|
+
const { className: i, preset: e, presetClass: l, customVar: r, tokenKey: f, setStyles: o } = s;
|
|
36
|
+
t === !0 ? this.lismState.push(i) : e && C(e, t) ? this.lismState.push(`${i} ${l}:${String(t)}`) : t && (this.lismState.push(i), f && r ? this.addStyle(r, S(t, f)) : o && typeof t == "string" && this.addStyles(o(t)));
|
|
40
37
|
}
|
|
41
38
|
// prop解析
|
|
42
39
|
analyzeProps() {
|
|
43
40
|
Object.keys(this.attrs).forEach((s) => {
|
|
44
|
-
if (Object.hasOwn(
|
|
45
|
-
const t = this.extractProp(s), i =
|
|
41
|
+
if (Object.hasOwn(b, s)) {
|
|
42
|
+
const t = this.extractProp(s), i = b[s];
|
|
46
43
|
typeof i == "string" ? t && this.lismState.push(i) : this.analyzeState(i, t);
|
|
47
|
-
} else if (Object.hasOwn(
|
|
44
|
+
} else if (Object.hasOwn(g, s)) {
|
|
48
45
|
const t = this.attrs[s];
|
|
49
46
|
delete this.attrs[s], this.analyzeLismProp(s, t);
|
|
50
47
|
} else if (s === "hov") {
|
|
@@ -58,14 +55,13 @@ class H {
|
|
|
58
55
|
}
|
|
59
56
|
// Lism Prop 解析
|
|
60
57
|
analyzeLismProp(s, t) {
|
|
61
|
-
var r;
|
|
62
58
|
if (t == null) return;
|
|
63
|
-
let i =
|
|
59
|
+
let i = g[s] || null;
|
|
64
60
|
if (i === null) return;
|
|
65
|
-
|
|
66
|
-
const { base: e, ...
|
|
67
|
-
this.setAttrs(s, e, i), Object.keys(
|
|
68
|
-
i && this.setAttrs(s,
|
|
61
|
+
this._propConfig?.[s] && (i = Object.assign({}, i, this._propConfig[s]));
|
|
62
|
+
const { base: e, ...l } = _(t);
|
|
63
|
+
this.setAttrs(s, e, i), Object.keys(l).forEach((r) => {
|
|
64
|
+
i && this.setAttrs(s, l[r], i, r);
|
|
69
65
|
});
|
|
70
66
|
}
|
|
71
67
|
addUtil(s) {
|
|
@@ -100,26 +96,26 @@ class H {
|
|
|
100
96
|
// 値が null, undefined, '', false の時はスキップ
|
|
101
97
|
setAttrs(s, t, i = {}, e = "") {
|
|
102
98
|
if (t == null || t === "" || t === !1) return;
|
|
103
|
-
let
|
|
104
|
-
if (e && (
|
|
99
|
+
let l = `--${s}`, r = `-${String(i.utilKey || s)}`;
|
|
100
|
+
if (e && (l = `--${s}_${e}`, r += `_${e}`), typeof t == "string" && t.startsWith(":")) {
|
|
105
101
|
this.addUtil(`${r}:${t.replace(":", "")}`);
|
|
106
102
|
return;
|
|
107
103
|
}
|
|
108
104
|
if (!e) {
|
|
109
|
-
const { presets:
|
|
110
|
-
if (
|
|
111
|
-
const
|
|
112
|
-
|
|
105
|
+
const { presets: m, tokenClass: k, utils: $, shorthands: P } = i;
|
|
106
|
+
if (m && C(m, t)) {
|
|
107
|
+
const d = typeof t == "string" || typeof t == "number" ? String(t) : "";
|
|
108
|
+
d && this.addUtil(`${r}:${d}`);
|
|
113
109
|
return;
|
|
114
110
|
}
|
|
115
|
-
if (
|
|
116
|
-
const
|
|
117
|
-
|
|
111
|
+
if (k && i.token && V(i.token, t)) {
|
|
112
|
+
const d = typeof t == "string" || typeof t == "number" ? String(t) : "";
|
|
113
|
+
d && this.addUtil(`${r}:${d}`);
|
|
118
114
|
return;
|
|
119
115
|
}
|
|
120
|
-
let
|
|
121
|
-
if (
|
|
122
|
-
this.addUtil(`${r}:${
|
|
116
|
+
let c = "";
|
|
117
|
+
if ($ && typeof t == "string" && (c = U($, t)), !c && P && typeof t == "string" && (c = U(P, t, !0)), c) {
|
|
118
|
+
this.addUtil(`${r}:${c}`);
|
|
123
119
|
return;
|
|
124
120
|
}
|
|
125
121
|
}
|
|
@@ -127,18 +123,18 @@ class H {
|
|
|
127
123
|
this.addUtil(r);
|
|
128
124
|
return;
|
|
129
125
|
}
|
|
130
|
-
const { prop: f, isVar:
|
|
131
|
-
let
|
|
132
|
-
if (
|
|
133
|
-
if (
|
|
134
|
-
this.addStyle(`--${s}`,
|
|
126
|
+
const { prop: f, isVar: o, alwaysVar: u, token: h, bp: y } = i;
|
|
127
|
+
let n;
|
|
128
|
+
if (h && (typeof t == "string" || typeof t == "number") ? n = S(t, h) : typeof t == "string" || typeof t == "number" ? n = t : n = JSON.stringify(t), !e) {
|
|
129
|
+
if (o) {
|
|
130
|
+
this.addStyle(`--${s}`, n);
|
|
135
131
|
return;
|
|
136
|
-
} else if (!
|
|
137
|
-
this.addStyle(f,
|
|
132
|
+
} else if (!y && !u) {
|
|
133
|
+
this.addStyle(f, n);
|
|
138
134
|
return;
|
|
139
135
|
}
|
|
140
136
|
}
|
|
141
|
-
this.addUtil(r), this.addStyle(
|
|
137
|
+
this.addUtil(r), this.addStyle(l, n);
|
|
142
138
|
}
|
|
143
139
|
// setPassProps(passVars) {
|
|
144
140
|
// let dataList = [];
|
|
@@ -154,7 +150,7 @@ class H {
|
|
|
154
150
|
// });
|
|
155
151
|
// }
|
|
156
152
|
setHovProps(s) {
|
|
157
|
-
s && (s === "-" || s === !0 ? this.addUtil("-hov") : typeof s == "string" ?
|
|
153
|
+
s && (s === "-" || s === !0 ? this.addUtil("-hov") : typeof s == "string" ? j(s).forEach((t) => {
|
|
158
154
|
this.addUtil(`-hov:${t}`);
|
|
159
155
|
}) : typeof s == "object" && Object.keys(s).forEach((t) => {
|
|
160
156
|
const i = s[t];
|
|
@@ -162,31 +158,31 @@ class H {
|
|
|
162
158
|
if (i === "-" || i === !0)
|
|
163
159
|
this.addUtil(`-hov:${t}`);
|
|
164
160
|
else if (t === "class")
|
|
165
|
-
|
|
161
|
+
j(i).forEach((e) => {
|
|
166
162
|
this.addUtil(`-hov:${e}`);
|
|
167
163
|
});
|
|
168
164
|
else if (typeof i == "string" || typeof i == "number") {
|
|
169
|
-
const e =
|
|
165
|
+
const e = S(i, z(t));
|
|
170
166
|
this.addUtil(`-hov:${t}`), this.addStyle(`--hov-${t}`, e);
|
|
171
167
|
}
|
|
172
168
|
}
|
|
173
169
|
}));
|
|
174
170
|
}
|
|
175
171
|
}
|
|
176
|
-
function
|
|
177
|
-
if (Object.keys(
|
|
172
|
+
function G(a) {
|
|
173
|
+
if (Object.keys(a).length === 0)
|
|
178
174
|
return {};
|
|
179
|
-
const { layout: s, ...t } =
|
|
175
|
+
const { layout: s, ...t } = a, i = new w(E(s, t));
|
|
180
176
|
return {
|
|
181
|
-
...
|
|
177
|
+
...O({
|
|
182
178
|
className: i.className,
|
|
183
|
-
style:
|
|
179
|
+
style: O(i.styles)
|
|
184
180
|
}),
|
|
185
181
|
...i.attrs
|
|
186
182
|
// data-* などHTMLの標準属性はそのまま渡す
|
|
187
183
|
};
|
|
188
184
|
}
|
|
189
185
|
export {
|
|
190
|
-
|
|
191
|
-
|
|
186
|
+
w as LismPropsData,
|
|
187
|
+
G as default
|
|
192
188
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
type TokenValue = string | number;
|
|
2
2
|
type TokenConfigValues = Set<string> | string[] | readonly string[];
|
|
3
|
-
|
|
3
|
+
interface TokenConfigValuesObj {
|
|
4
4
|
pre?: string;
|
|
5
5
|
values?: TokenConfigValues;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
7
|
type TokenConfigProp = TokenConfigValues | TokenConfigValuesObj;
|
|
8
8
|
type TokensConfig = Record<string, TokenConfigProp>;
|
|
9
9
|
/**
|
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
export type CssValue = string | number;
|
|
2
|
-
export
|
|
2
|
+
export interface NoLayoutProps {
|
|
3
3
|
layout?: undefined;
|
|
4
|
-
}
|
|
5
|
-
export
|
|
4
|
+
}
|
|
5
|
+
export interface BoxProps {
|
|
6
6
|
layout: 'box';
|
|
7
|
-
}
|
|
8
|
-
export
|
|
7
|
+
}
|
|
8
|
+
export interface CenterProps {
|
|
9
9
|
layout: 'center';
|
|
10
|
-
}
|
|
11
|
-
export
|
|
10
|
+
}
|
|
11
|
+
export interface ClusterProps {
|
|
12
12
|
layout: 'cluster';
|
|
13
|
-
}
|
|
14
|
-
export
|
|
13
|
+
}
|
|
14
|
+
export interface FlexProps {
|
|
15
15
|
layout: 'flex';
|
|
16
|
-
}
|
|
17
|
-
export
|
|
16
|
+
}
|
|
17
|
+
export interface FrameProps {
|
|
18
18
|
layout: 'frame';
|
|
19
|
-
}
|
|
20
|
-
export
|
|
19
|
+
}
|
|
20
|
+
export interface GridLayoutProps {
|
|
21
21
|
layout: 'grid';
|
|
22
|
-
}
|
|
23
|
-
export
|
|
22
|
+
}
|
|
23
|
+
export interface StackProps {
|
|
24
24
|
layout: 'stack';
|
|
25
|
-
}
|
|
26
|
-
export
|
|
25
|
+
}
|
|
26
|
+
export interface ColumnsProps {
|
|
27
27
|
layout: 'columns';
|
|
28
|
-
}
|
|
29
|
-
export
|
|
28
|
+
}
|
|
29
|
+
export interface FlowLayoutProps {
|
|
30
30
|
layout: 'flow';
|
|
31
31
|
flow?: CssValue;
|
|
32
|
-
}
|
|
33
|
-
export
|
|
32
|
+
}
|
|
33
|
+
export interface FluidColsProps {
|
|
34
34
|
layout: 'fluidCols';
|
|
35
35
|
autoFill?: boolean;
|
|
36
|
-
}
|
|
37
|
-
export
|
|
36
|
+
}
|
|
37
|
+
export interface SideMainProps {
|
|
38
38
|
layout: 'sideMain';
|
|
39
39
|
sideW?: CssValue;
|
|
40
40
|
mainW?: CssValue;
|
|
41
|
-
}
|
|
42
|
-
export
|
|
41
|
+
}
|
|
42
|
+
export interface SwitchColsProps {
|
|
43
43
|
layout: 'switchCols';
|
|
44
44
|
breakSize?: CssValue;
|
|
45
|
-
}
|
|
45
|
+
}
|
|
46
46
|
export type LayoutSpecificProps = NoLayoutProps | BoxProps | CenterProps | ClusterProps | ColumnsProps | FlexProps | FlowLayoutProps | FluidColsProps | FrameProps | GridLayoutProps | StackProps | SideMainProps | SwitchColsProps;
|
|
47
47
|
export type LayoutType = Exclude<LayoutSpecificProps, NoLayoutProps>['layout'];
|
|
48
48
|
export interface LayoutProps {
|
|
@@ -5,7 +5,7 @@ type BreakpointKey = (typeof BREAK_POINTS_ALL)[number];
|
|
|
5
5
|
/** ブレイクポイント数(5: base, sm, md, lg, xl) */
|
|
6
6
|
type BreakpointCount = (typeof BREAK_POINTS_ALL)['length'];
|
|
7
7
|
/** ブレイクポイント数を上限とする配列型(1〜5要素) */
|
|
8
|
-
type ResponsiveArray<T> = LimitedArray<T, BreakpointCount>;
|
|
8
|
+
type ResponsiveArray<T> = LimitedArray<T | null, BreakpointCount>;
|
|
9
9
|
/**
|
|
10
10
|
* プロパティ値をレスポンシブ対応の型に変換するユーティリティ型
|
|
11
11
|
*
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export type StyleWithCustomProps =
|
|
1
|
+
import type * as CSS from 'csstype';
|
|
2
|
+
export type StyleWithCustomProps = CSS.Properties<string | number> & CSS.PropertiesHyphen<string | number> & Record<`--${string}`, string | number | undefined>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lism-css",
|
|
3
|
-
"version": "0.9.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.9.4",
|
|
4
|
+
"description": "Lism CSS is a layout-first CSS framework for websites.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "ddryo",
|
|
7
7
|
"url": "https://github.com/ddryo"
|
|
@@ -54,8 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"./next-js/*": "./packages/next-js/*",
|
|
56
56
|
"./astro": {
|
|
57
|
-
"import": "./packages/astro/index.
|
|
58
|
-
"types": "./packages/types/index.d.ts"
|
|
57
|
+
"import": "./packages/astro/index.ts"
|
|
59
58
|
},
|
|
60
59
|
"./astro/*": "./packages/astro/*",
|
|
61
60
|
"./scss/*": "./src/scss/*",
|
|
@@ -75,20 +74,27 @@
|
|
|
75
74
|
"@babel/preset-env": "^7.29.0",
|
|
76
75
|
"@babel/preset-react": "^7.28.5",
|
|
77
76
|
"@rollup/plugin-babel": "^6.1.0",
|
|
78
|
-
"@storybook/react-vite": "^10.
|
|
77
|
+
"@storybook/react-vite": "^10.3.3",
|
|
79
78
|
"@testing-library/jest-dom": "^6.9.1",
|
|
80
79
|
"@testing-library/react": "^16.3.2",
|
|
81
80
|
"@types/node": "^25.5.0",
|
|
82
81
|
"@vitejs/plugin-react-swc": "^3.11.0",
|
|
82
|
+
"astro": "^6.1.1",
|
|
83
|
+
"eslint": "^9.39.4",
|
|
83
84
|
"glob": "^13.0.6",
|
|
84
85
|
"jsdom": "^27.4.0",
|
|
86
|
+
"lucide-react": "^0.577.0",
|
|
85
87
|
"rollup": "^4.59.0",
|
|
88
|
+
"stylelint": "^17.4.0",
|
|
86
89
|
"tsx": "^4.21.0",
|
|
87
|
-
"typescript": "
|
|
90
|
+
"typescript": "^5.8.3",
|
|
88
91
|
"unplugin-dts": "1.0.0-beta.6",
|
|
89
|
-
"vite": "^
|
|
92
|
+
"vite": "^7.3.1",
|
|
90
93
|
"vitest": "^4.1.0"
|
|
91
94
|
},
|
|
95
|
+
"dependencies": {
|
|
96
|
+
"csstype": "^3.2.3"
|
|
97
|
+
},
|
|
92
98
|
"peerDependencies": {
|
|
93
99
|
"@types/react": "*",
|
|
94
100
|
"@types/react-dom": "*",
|
|
@@ -98,14 +104,14 @@
|
|
|
98
104
|
"sideEffects": false,
|
|
99
105
|
"scripts": {
|
|
100
106
|
"dev": "vite",
|
|
101
|
-
"test": "pnpm
|
|
107
|
+
"test": "pnpm vitest",
|
|
102
108
|
"vitest": "vitest run",
|
|
103
|
-
"typecheck": "tsc --noEmit",
|
|
109
|
+
"typecheck": "tsc --noEmit && astro check --tsconfig packages/astro/tsconfig.json",
|
|
104
110
|
"build": "pnpm build:js && pnpm build:css",
|
|
105
111
|
"build:js": "vite build && pnpm exec tsc -p config/tsconfig.json",
|
|
106
112
|
"build:css": "tsx bin/script-build-css.js",
|
|
107
113
|
"lint": "pnpm lint:eslint && pnpm lint:style",
|
|
108
|
-
"lint:eslint": "eslint '**/*.{js,mjs,ts,tsx}'",
|
|
114
|
+
"lint:eslint": "eslint '**/*.{js,mjs,ts,tsx,astro}'",
|
|
109
115
|
"lint:style": "stylelint '**/*.{css,scss}'",
|
|
110
116
|
"preview": "vite preview"
|
|
111
117
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLismProps } from '../types';
|
|
3
3
|
import { Lism } from '../Lism';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
interface Props extends LismProps {}
|
|
5
|
+
type Props = AstroLismProps;
|
|
7
6
|
const props = Astro.props || {};
|
|
8
7
|
---
|
|
9
8
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLismProps } from '../types';
|
|
3
3
|
import { Lism } from '../Lism';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
type Props = AstroLismProps & {
|
|
6
|
+
size?: string;
|
|
7
|
+
};
|
|
6
8
|
|
|
7
9
|
const { size, ...props } = Astro.props || {};
|
|
8
10
|
---
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { DecoratorProps } from 'lism-css/react/atomic/Decorator/getProps';
|
|
3
3
|
import { Lism } from '../Lism';
|
|
4
|
-
import getProps from '
|
|
4
|
+
import getProps from 'lism-css/react/atomic/Decorator/getProps';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
interface Props extends LismProps {}
|
|
6
|
+
type Props = DecoratorProps;
|
|
8
7
|
const props = Astro.props || {};
|
|
9
8
|
---
|
|
10
9
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLismProps } from '../types';
|
|
3
3
|
import { Lism } from '../Lism';
|
|
4
|
-
import { getDividerProps } from '
|
|
4
|
+
import { getDividerProps } from 'lism-css/react/atomic/Divider/getProps';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
interface Props extends LismProps {}
|
|
6
|
+
type Props = AstroLismProps;
|
|
8
7
|
|
|
9
8
|
const props = Astro.props || {};
|
|
10
9
|
---
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLismProps } from '../types';
|
|
3
3
|
import { Lism } from '../Lism';
|
|
4
|
-
import getContent from '
|
|
4
|
+
import getContent from 'lism-css/react/Dummy/getContent';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
type Props = AstroLismProps & {
|
|
7
|
+
pre?: string;
|
|
8
|
+
length?: string;
|
|
9
|
+
lang?: 'ja' | 'en' | 'ar';
|
|
10
|
+
offset?: number;
|
|
11
|
+
};
|
|
8
12
|
const { as: tagName = 'p', pre = '', length = 'm', lang = 'en', offset = 0, ...props } = Astro.props || {};
|
|
9
13
|
const content = getContent({ tag: tagName, pre, lang, length, offset });
|
|
10
14
|
---
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
+
import type { AstroLismProps } from '../types';
|
|
2
3
|
import Lism from '../Lism/Lism.astro';
|
|
4
|
+
|
|
5
|
+
type Props = AstroLismProps;
|
|
6
|
+
const props = Astro.props || {};
|
|
3
7
|
---
|
|
4
8
|
|
|
5
|
-
<Lism as='button' {...
|
|
9
|
+
<Lism as='button' {...props}><slot /></Lism>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
+
import type { AstroLismProps } from '../types';
|
|
2
3
|
import Lism from '../Lism/Lism.astro';
|
|
4
|
+
|
|
5
|
+
type Props = AstroLismProps;
|
|
6
|
+
const props = Astro.props || {};
|
|
3
7
|
---
|
|
4
8
|
|
|
5
|
-
<Lism as='div' {...
|
|
9
|
+
<Lism as='div' {...props}><slot /></Lism>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
+
import type { AstroLismProps } from '../types';
|
|
2
3
|
import Lism from '../Lism/Lism.astro';
|
|
4
|
+
|
|
5
|
+
type Props = AstroLismProps;
|
|
6
|
+
const props = Astro.props || {};
|
|
3
7
|
---
|
|
4
8
|
|
|
5
|
-
<Lism as='img' {...
|
|
9
|
+
<Lism as='img' {...props}><slot /></Lism>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
+
import type { AstroLismProps } from '../types';
|
|
2
3
|
import Lism from '../Lism/Lism.astro';
|
|
4
|
+
|
|
5
|
+
type Props = AstroLismProps;
|
|
6
|
+
const props = Astro.props || {};
|
|
3
7
|
---
|
|
4
8
|
|
|
5
|
-
<Lism as='li' {...
|
|
9
|
+
<Lism as='li' {...props}><slot /></Lism>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
+
import type { AstroLismProps } from '../types';
|
|
2
3
|
import Lism from '../Lism/Lism.astro';
|
|
4
|
+
|
|
5
|
+
type Props = AstroLismProps;
|
|
6
|
+
const props = Astro.props || {};
|
|
3
7
|
---
|
|
4
8
|
|
|
5
|
-
<Lism as='ol' {...
|
|
9
|
+
<Lism as='ol' {...props}><slot /></Lism>
|