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.
Files changed (110) hide show
  1. package/dist/components/Box/Box.stories.d.ts +7 -0
  2. package/dist/components/Center/Center.stories.d.ts +8 -0
  3. package/dist/components/Cluster/Cluster.stories.d.ts +7 -0
  4. package/dist/components/Columns/Columns.stories.d.ts +8 -0
  5. package/dist/components/Container/Container.stories.d.ts +8 -0
  6. package/dist/components/Dummy/getContent.d.ts +1 -2
  7. package/dist/components/Dummy/getContent.js +6 -7
  8. package/dist/components/Flex/Flex.stories.d.ts +9 -0
  9. package/dist/components/Flow/Flow.stories.d.ts +9 -0
  10. package/dist/components/FluidCols/FluidCols.stories.d.ts +7 -0
  11. package/dist/components/Frame/Frame.stories.d.ts +7 -0
  12. package/dist/components/Grid/Grid.stories.d.ts +8 -0
  13. package/dist/components/Layer/Layer.stories.d.ts +8 -0
  14. package/dist/components/LinkBox/LinkBox.stories.d.ts +7 -0
  15. package/dist/components/Lism/Lism.d.ts +7 -4
  16. package/dist/components/Lism/Lism.stories.d.ts +1 -650
  17. package/dist/components/SideMain/SideMain.stories.d.ts +9 -0
  18. package/dist/components/Stack/Stack.stories.d.ts +8 -0
  19. package/dist/components/SwitchCols/SwitchCols.stories.d.ts +9 -0
  20. package/dist/components/Wrapper/Wrapper.stories.d.ts +10 -0
  21. package/dist/components/atomic/Decorator/Decorator.stories.d.ts +10 -0
  22. package/dist/components/atomic/Decorator/getProps.d.ts +5 -6
  23. package/dist/components/atomic/Divider/Divider.stories.d.ts +8 -0
  24. package/dist/components/atomic/Divider/getProps.d.ts +2 -2
  25. package/dist/components/atomic/Icon/Icon.d.ts +6 -2
  26. package/dist/components/atomic/Icon/Icon.stories.d.ts +15 -0
  27. package/dist/components/atomic/Icon/getProps.d.ts +11 -7
  28. package/dist/components/atomic/Icon/index.d.ts +1 -0
  29. package/dist/components/atomic/Media/Media.d.ts +6 -2
  30. package/dist/components/atomic/Media/Media.stories.d.ts +9 -0
  31. package/dist/components/atomic/Media/getProps.d.ts +6 -6
  32. package/dist/components/atomic/Spacer/Spacer.stories.d.ts +9 -0
  33. package/dist/components/atomic/Spacer/getProps.d.ts +2 -2
  34. package/dist/components/setMaybeTransformStyles.d.ts +2 -2
  35. package/dist/css/base.css +1 -1
  36. package/dist/css/main.css +1 -1
  37. package/dist/css/main_no_layer.css +1 -1
  38. package/dist/lib/getLayoutProps.d.ts +4 -3
  39. package/dist/lib/getLismProps.d.ts +10 -9
  40. package/dist/lib/getLismProps.js +69 -73
  41. package/dist/lib/getMaybeTokenValue.d.ts +2 -2
  42. package/dist/lib/types/LayoutProps.d.ts +26 -26
  43. package/dist/lib/types/ResponsiveProps.d.ts +1 -1
  44. package/dist/lib/types.d.ts +2 -2
  45. package/package.json +16 -10
  46. package/packages/astro/Box/Box.astro +2 -3
  47. package/packages/astro/Center/Center.astro +3 -0
  48. package/packages/astro/Cluster/Cluster.astro +3 -0
  49. package/packages/astro/Columns/Columns.astro +3 -0
  50. package/packages/astro/Container/Container.astro +4 -2
  51. package/packages/astro/Decorator/Decorator.astro +3 -4
  52. package/packages/astro/Divider/Divider.astro +3 -4
  53. package/packages/astro/Dummy/Dummy.astro +8 -4
  54. package/packages/astro/Flex/Flex.astro +3 -0
  55. package/packages/astro/Flow/Flow.astro +3 -0
  56. package/packages/astro/FluidCols/FluidCols.astro +3 -0
  57. package/packages/astro/Frame/Frame.astro +3 -0
  58. package/packages/astro/Grid/Grid.astro +3 -0
  59. package/packages/astro/HTML/a.astro +5 -1
  60. package/packages/astro/HTML/button.astro +5 -1
  61. package/packages/astro/HTML/div.astro +5 -1
  62. package/packages/astro/HTML/h.astro +6 -0
  63. package/packages/astro/HTML/img.astro +5 -1
  64. package/packages/astro/HTML/li.astro +5 -1
  65. package/packages/astro/HTML/ol.astro +5 -1
  66. package/packages/astro/HTML/p.astro +5 -1
  67. package/packages/astro/HTML/span.astro +5 -1
  68. package/packages/astro/HTML/ul.astro +5 -1
  69. package/packages/astro/Icon/Icon.astro +7 -12
  70. package/packages/astro/Layer/Layer.astro +4 -1
  71. package/packages/astro/LinkBox/LinkBox.astro +4 -3
  72. package/packages/astro/Lism/Lism.astro +4 -5
  73. package/packages/astro/Media/Media.astro +7 -3
  74. package/packages/astro/SideMain/SideMain.astro +3 -0
  75. package/packages/astro/Spacer/Spacer.astro +3 -4
  76. package/packages/astro/Stack/Stack.astro +3 -0
  77. package/packages/astro/SwitchCols/SwitchCols.astro +3 -0
  78. package/packages/astro/Wrapper/Wrapper.astro +5 -0
  79. package/packages/astro/env.d.ts +10 -0
  80. package/packages/astro/tsconfig.json +12 -0
  81. package/packages/astro/types.ts +51 -0
  82. package/src/scss/base/tokens/_shadow.scss +1 -0
  83. package/packages/astro/OverlayLink/OverlayLink.astro +0 -10
  84. package/packages/astro/OverlayLink/index.js +0 -1
  85. package/packages/astro/helper.js +0 -6
  86. /package/packages/astro/Box/{index.js → index.ts} +0 -0
  87. /package/packages/astro/Center/{index.js → index.ts} +0 -0
  88. /package/packages/astro/Cluster/{index.js → index.ts} +0 -0
  89. /package/packages/astro/Columns/{index.js → index.ts} +0 -0
  90. /package/packages/astro/Container/{index.js → index.ts} +0 -0
  91. /package/packages/astro/Decorator/{index.js → index.ts} +0 -0
  92. /package/packages/astro/Divider/{index.js → index.ts} +0 -0
  93. /package/packages/astro/Dummy/{index.js → index.ts} +0 -0
  94. /package/packages/astro/Flex/{index.js → index.ts} +0 -0
  95. /package/packages/astro/Flow/{index.js → index.ts} +0 -0
  96. /package/packages/astro/FluidCols/{index.js → index.ts} +0 -0
  97. /package/packages/astro/Frame/{index.js → index.ts} +0 -0
  98. /package/packages/astro/Grid/{index.js → index.ts} +0 -0
  99. /package/packages/astro/HTML/{index.js → index.ts} +0 -0
  100. /package/packages/astro/Icon/{index.js → index.ts} +0 -0
  101. /package/packages/astro/Layer/{index.js → index.ts} +0 -0
  102. /package/packages/astro/LinkBox/{index.js → index.ts} +0 -0
  103. /package/packages/astro/Lism/{index.js → index.ts} +0 -0
  104. /package/packages/astro/Media/{index.js → index.ts} +0 -0
  105. /package/packages/astro/SideMain/{index.js → index.ts} +0 -0
  106. /package/packages/astro/Spacer/{index.js → index.ts} +0 -0
  107. /package/packages/astro/Stack/{index.js → index.ts} +0 -0
  108. /package/packages/astro/SwitchCols/{index.js → index.ts} +0 -0
  109. /package/packages/astro/Wrapper/{index.js → index.ts} +0 -0
  110. /package/packages/astro/{index.js → index.ts} +0 -0
@@ -1,50 +1,47 @@
1
- var V = Object.defineProperty;
2
- var _ = (l, s, t) => s in l ? V(l, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[s] = t;
3
- var a = (l, s, t) => _(l, typeof s != "symbol" ? s + "" : s, t);
4
- import { STATES as C, PROPS as $ } from "../config/index.js";
5
- import A from "./getLayoutProps.js";
6
- import U from "./isPresetValue.js";
7
- import x from "./isTokenValue.js";
8
- import O from "./getUtilKey.js";
9
- import g from "./getMaybeCssVar.js";
10
- import z from "./getBpData.js";
11
- import w from "./helper/atts.js";
12
- import L from "./helper/isEmptyObj.js";
13
- import j from "./helper/filterEmptyObj.js";
14
- import k from "./helper/splitWithComma.js";
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 H {
16
+ class w {
17
+ // propList = {};
18
+ className = "";
19
+ uClasses = [];
20
+ lismState = [];
21
+ styles = {};
22
+ attrs = {};
23
+ _propConfig;
20
24
  constructor(s) {
21
- // propList = {};
22
- a(this, "className", "");
23
- a(this, "uClasses", []);
24
- a(this, "lismState", []);
25
- a(this, "styles", {});
26
- a(this, "attrs", {});
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
- L(y) || (this.attrs = { ...y }, this.analyzeProps()), t && (this.attrs.ref = t), this.className = w(e || i, c, this.lismState, this.uClasses);
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: n, customVar: r, tokenKey: f, setStyles: h } = s;
39
- t === !0 ? this.lismState.push(i) : e && U(e, t) ? this.lismState.push(`${i} ${n}:${String(t)}`) : t && (this.lismState.push(i), f && r ? this.addStyle(r, g(t, f)) : h && typeof t == "string" && this.addStyles(h(t)));
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(C, s)) {
45
- const t = this.extractProp(s), i = C[s];
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($, s)) {
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 = $[s] || null;
59
+ let i = g[s] || null;
64
60
  if (i === null) return;
65
- (r = this._propConfig) != null && r[s] && (i = Object.assign({}, i, this._propConfig[s]));
66
- const { base: e, ...n } = z(t);
67
- this.setAttrs(s, e, i), Object.keys(n).forEach((f) => {
68
- i && this.setAttrs(s, n[f], i, f);
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 n = `--${s}`, r = `-${String(i.utilKey || s)}`;
104
- if (e && (n = `--${s}_${e}`, r += `_${e}`), typeof t == "string" && t.startsWith(":")) {
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: S, tokenClass: E, utils: P, shorthands: b } = i;
110
- if (S && U(S, t)) {
111
- const u = typeof t == "string" || typeof t == "number" ? String(t) : "";
112
- u && this.addUtil(`${r}:${u}`);
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 (E && i.token && x(i.token, t)) {
116
- const u = typeof t == "string" || typeof t == "number" ? String(t) : "";
117
- u && this.addUtil(`${r}:${u}`);
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 d = "";
121
- if (P && typeof t == "string" && (d = O(P, t)), !d && b && typeof t == "string" && (d = O(b, t, !0)), d) {
122
- this.addUtil(`${r}:${d}`);
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: h, alwaysVar: y, token: c, bp: m } = i;
131
- let o;
132
- if (c && (typeof t == "string" || typeof t == "number") ? o = g(t, c) : typeof t == "string" || typeof t == "number" ? o = t : o = JSON.stringify(t), !e) {
133
- if (h) {
134
- this.addStyle(`--${s}`, o);
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 (!m && !y) {
137
- this.addStyle(f, o);
132
+ } else if (!y && !u) {
133
+ this.addStyle(f, n);
138
134
  return;
139
135
  }
140
136
  }
141
- this.addUtil(r), this.addStyle(n, o);
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" ? k(s).forEach((t) => {
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
- k(i).forEach((e) => {
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 = g(i, T(t));
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 Y(l) {
177
- if (Object.keys(l).length === 0)
172
+ function G(a) {
173
+ if (Object.keys(a).length === 0)
178
174
  return {};
179
- const { layout: s, ...t } = l, i = new H(A(s, t));
175
+ const { layout: s, ...t } = a, i = new w(E(s, t));
180
176
  return {
181
- ...j({
177
+ ...O({
182
178
  className: i.className,
183
- style: j(i.styles)
179
+ style: O(i.styles)
184
180
  }),
185
181
  ...i.attrs
186
182
  // data-* などHTMLの標準属性はそのまま渡す
187
183
  };
188
184
  }
189
185
  export {
190
- H as LismPropsData,
191
- Y as default
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
- type TokenConfigValuesObj = {
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 type NoLayoutProps = {
2
+ export interface NoLayoutProps {
3
3
  layout?: undefined;
4
- };
5
- export type BoxProps = {
4
+ }
5
+ export interface BoxProps {
6
6
  layout: 'box';
7
- };
8
- export type CenterProps = {
7
+ }
8
+ export interface CenterProps {
9
9
  layout: 'center';
10
- };
11
- export type ClusterProps = {
10
+ }
11
+ export interface ClusterProps {
12
12
  layout: 'cluster';
13
- };
14
- export type FlexProps = {
13
+ }
14
+ export interface FlexProps {
15
15
  layout: 'flex';
16
- };
17
- export type FrameProps = {
16
+ }
17
+ export interface FrameProps {
18
18
  layout: 'frame';
19
- };
20
- export type GridLayoutProps = {
19
+ }
20
+ export interface GridLayoutProps {
21
21
  layout: 'grid';
22
- };
23
- export type StackProps = {
22
+ }
23
+ export interface StackProps {
24
24
  layout: 'stack';
25
- };
26
- export type ColumnsProps = {
25
+ }
26
+ export interface ColumnsProps {
27
27
  layout: 'columns';
28
- };
29
- export type FlowLayoutProps = {
28
+ }
29
+ export interface FlowLayoutProps {
30
30
  layout: 'flow';
31
31
  flow?: CssValue;
32
- };
33
- export type FluidColsProps = {
32
+ }
33
+ export interface FluidColsProps {
34
34
  layout: 'fluidCols';
35
35
  autoFill?: boolean;
36
- };
37
- export type SideMainProps = {
36
+ }
37
+ export interface SideMainProps {
38
38
  layout: 'sideMain';
39
39
  sideW?: CssValue;
40
40
  mainW?: CssValue;
41
- };
42
- export type SwitchColsProps = {
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
  *
@@ -1,2 +1,2 @@
1
- import { CSSProperties } from 'react';
2
- export type StyleWithCustomProps = CSSProperties & Record<`--${string}`, string | number | undefined>;
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.2",
4
- "description": "A layout-first CSS framework for websites.",
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.js",
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.2.19",
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": "~5.8.3",
90
+ "typescript": "^5.8.3",
88
91
  "unplugin-dts": "1.0.0-beta.6",
89
- "vite": "^6.4.1",
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 typecheck && pnpm vitest",
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 { LismProps } from '../../types';
2
+ import type { AstroLismProps } from '../types';
3
3
  import { Lism } from '../Lism';
4
4
 
5
- // Propsの定義
6
- interface Props extends LismProps {}
5
+ type Props = AstroLismProps;
7
6
  const props = Astro.props || {};
8
7
  ---
9
8
 
@@ -1,5 +1,8 @@
1
1
  ---
2
+ import type { AstroLismProps } from '../types';
2
3
  import { Lism } from '../Lism';
4
+
5
+ type Props = AstroLismProps;
3
6
  ---
4
7
 
5
8
  <Lism layout='center' {...Astro.props}><slot /></Lism>
@@ -1,5 +1,8 @@
1
1
  ---
2
+ import type { AstroLismProps } from '../types';
2
3
  import { Lism } from '../Lism';
4
+
5
+ type Props = AstroLismProps;
3
6
  ---
4
7
 
5
8
  <Lism layout='cluster' {...Astro.props}><slot /></Lism>
@@ -1,5 +1,8 @@
1
1
  ---
2
+ import type { AstroLismProps } from '../types';
2
3
  import { Lism } from '../Lism';
4
+
5
+ type Props = AstroLismProps;
3
6
  ---
4
7
 
5
8
  <Lism layout='columns' {...Astro.props}><slot /></Lism>
@@ -1,8 +1,10 @@
1
1
  ---
2
- import type { LismProps } from '../../types';
2
+ import type { AstroLismProps } from '../types';
3
3
  import { Lism } from '../Lism';
4
4
 
5
- interface Props extends LismProps {}
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 { LismProps } from '../../types';
2
+ import type { DecoratorProps } from 'lism-css/react/atomic/Decorator/getProps';
3
3
  import { Lism } from '../Lism';
4
- import getProps from '../../../dist/components/atomic/Decorator/getProps';
4
+ import getProps from 'lism-css/react/atomic/Decorator/getProps';
5
5
 
6
- // Propsの定義
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 { LismProps } from '../../types';
2
+ import type { AstroLismProps } from '../types';
3
3
  import { Lism } from '../Lism';
4
- import { getDividerProps } from '../../../dist/components/atomic/Divider/getProps';
4
+ import { getDividerProps } from 'lism-css/react/atomic/Divider/getProps';
5
5
 
6
- // Propsの定義
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 { LismProps } from '../../types';
2
+ import type { AstroLismProps } from '../types';
3
3
  import { Lism } from '../Lism';
4
- import getContent from '../../../dist/components/Dummy/getContent';
4
+ import getContent from 'lism-css/react/Dummy/getContent';
5
5
 
6
- // Propsの定義
7
- interface Props extends LismProps {}
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,8 @@
1
1
  ---
2
+ import type { AstroLismProps } from '../types';
2
3
  import { Lism } from '../Lism';
4
+
5
+ type Props = AstroLismProps;
3
6
  ---
4
7
 
5
8
  <Lism layout='flex' {...Astro.props}><slot /></Lism>
@@ -1,5 +1,8 @@
1
1
  ---
2
+ import type { AstroLismProps } from '../types';
2
3
  import { Lism } from '../Lism';
4
+
5
+ type Props = AstroLismProps;
3
6
  ---
4
7
 
5
8
  <Lism layout='flow' {...Astro.props}><slot /></Lism>
@@ -1,5 +1,8 @@
1
1
  ---
2
+ import type { AstroLismProps } from '../types';
2
3
  import { Lism } from '../Lism';
4
+
5
+ type Props = AstroLismProps;
3
6
  ---
4
7
 
5
8
  <Lism layout='fluidCols' {...Astro.props}><slot /></Lism>
@@ -1,5 +1,8 @@
1
1
  ---
2
+ import type { AstroLismProps } from '../types';
2
3
  import { Lism } from '../Lism';
4
+
5
+ type Props = AstroLismProps;
3
6
  ---
4
7
 
5
8
  <Lism layout='frame' {...Astro.props}><slot /></Lism>
@@ -1,5 +1,8 @@
1
1
  ---
2
+ import type { AstroLismProps } from '../types';
2
3
  import { Lism } from '../Lism';
4
+
5
+ type Props = AstroLismProps;
3
6
  ---
4
7
 
5
8
  <Lism layout='grid' {...Astro.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='a' {...Astro.props}><slot /></Lism>
9
+ <Lism as='a' {...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='button' {...Astro.props}><slot /></Lism>
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' {...Astro.props}><slot /></Lism>
9
+ <Lism as='div' {...props}><slot /></Lism>
@@ -1,5 +1,11 @@
1
1
  ---
2
+ import type { AstroLismProps } from '../types';
2
3
  import Lism from '../Lism/Lism.astro';
4
+
5
+ type Props = AstroLismProps & {
6
+ lv?: '1' | '2' | '3' | '4' | '5' | '6';
7
+ };
8
+
3
9
  const { lv = '1', ...props } = Astro.props;
4
10
  ---
5
11
 
@@ -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' {...Astro.props}><slot /></Lism>
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' {...Astro.props}><slot /></Lism>
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' {...Astro.props}><slot /></Lism>
9
+ <Lism as='ol' {...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='p' {...Astro.props}><slot /></Lism>
9
+ <Lism as='p' {...props}><slot /></Lism>