@lism-css/ui 0.9.2 → 0.10.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 +137 -0
- package/README.md +93 -5
- package/dist/components/Accordion/getProps.js +53 -0
- package/dist/components/Accordion/react/AccIcon.js +9 -0
- package/dist/components/Accordion/react/Accordion.d.ts +5 -6
- package/dist/components/Accordion/react/Accordion.js +45 -0
- package/dist/components/Accordion/react/index.js +6 -0
- package/dist/components/Alert/getProps.js +20 -0
- package/dist/components/Alert/presets.js +29 -0
- package/dist/components/Alert/react/Alert.js +16 -0
- package/dist/components/Avatar/react/Avatar.js +8 -0
- package/dist/components/Badge/react/Badge.js +12 -0
- package/dist/components/Button/react/Button.js +12 -0
- package/dist/components/Callout/getProps.js +22 -0
- package/dist/components/Callout/presets.js +29 -0
- package/dist/components/Callout/react/Callout.js +20 -0
- package/dist/components/Chat/getProps.js +47 -0
- package/dist/components/Chat/react/Chat.js +22 -0
- package/dist/components/Details/getProps.js +15 -0
- package/dist/components/Details/react/Details.js +28 -0
- package/dist/components/Details/react/index.js +5 -0
- package/dist/components/DummyImage/astro/index.d.ts +1 -0
- package/dist/components/DummyImage/react/DummyImage.d.ts +2 -0
- package/dist/components/DummyImage/react/DummyImage.js +8 -0
- package/dist/components/DummyImage/react/index.d.ts +1 -0
- package/dist/components/DummyText/astro/index.d.ts +1 -0
- package/dist/components/DummyText/getContent.d.ts +11 -0
- package/dist/components/DummyText/getContent.js +9 -0
- package/dist/components/DummyText/react/DummyText.d.ts +10 -0
- package/dist/components/DummyText/react/DummyText.js +10 -0
- package/dist/components/DummyText/react/index.d.ts +1 -0
- package/dist/components/DummyText/texts.d.ts +22 -0
- package/dist/components/DummyText/texts.js +39 -0
- package/dist/components/Modal/getProps.js +25 -0
- package/dist/components/Modal/react/Body.js +9 -0
- package/dist/components/Modal/react/CloseBtn.js +13 -0
- package/dist/components/Modal/react/Inner.js +9 -0
- package/dist/components/Modal/react/Modal.d.ts +1 -2
- package/dist/components/Modal/react/Modal.js +17 -0
- package/dist/components/Modal/react/OpenBtn.js +9 -0
- package/dist/components/Modal/react/index.js +9 -0
- package/dist/components/Modal/setModal.js +16 -17
- package/dist/components/NavMenu/getProps.js +40 -0
- package/dist/components/NavMenu/react/NavMenu.js +24 -0
- package/dist/components/NavMenu/react/index.js +5 -0
- package/dist/components/ShapeDivider/getProps.js +22 -0
- package/dist/components/ShapeDivider/react/ShapeDivider.js +26 -0
- package/dist/components/Tabs/getProps.js +10 -0
- package/dist/components/Tabs/react/Tab.js +9 -0
- package/dist/components/Tabs/react/TabItem.js +7 -0
- package/dist/components/Tabs/react/TabList.js +8 -0
- package/dist/components/Tabs/react/TabPanel.js +9 -0
- package/dist/components/Tabs/react/Tabs.d.ts +1 -2
- package/dist/components/Tabs/react/Tabs.js +48 -0
- package/dist/components/Tabs/react/index.js +9 -0
- package/dist/components/Tabs/setTabs.js +10 -11
- package/dist/components/astro.d.ts +2 -0
- package/dist/components/react.d.ts +2 -0
- package/dist/components/react.js +30 -0
- package/dist/lism-css/dist/components/Center/index.js +8 -0
- package/dist/lism-css/dist/components/Flex/index.js +8 -0
- package/dist/lism-css/dist/components/Flow/index.js +8 -0
- package/dist/lism-css/dist/components/Frame/index.js +8 -0
- package/dist/lism-css/dist/components/Grid/index.js +8 -0
- package/dist/lism-css/dist/components/Lism/index.js +8 -0
- package/dist/lism-css/dist/components/Stack/index.js +8 -0
- package/dist/lism-css/dist/components/atomic/Decorator/getProps.js +15 -0
- package/dist/lism-css/dist/components/atomic/Decorator/index.js +9 -0
- package/dist/lism-css/dist/components/atomic/Icon/SVG.js +22 -0
- package/dist/lism-css/dist/components/atomic/Icon/getProps.js +56 -0
- package/dist/lism-css/dist/components/atomic/Icon/index.js +12 -0
- package/dist/lism-css/dist/components/atomic/Icon/presets.js +276 -0
- package/dist/lism-css/dist/config/default-config.js +11 -0
- package/dist/lism-css/dist/config/defaults/props.js +340 -0
- package/dist/lism-css/dist/config/defaults/states.js +39 -0
- package/dist/lism-css/dist/config/defaults/tokens.js +30 -0
- package/dist/lism-css/dist/config/helper/getSvgUrl.js +4 -0
- package/dist/lism-css/dist/config/helper.js +27 -0
- package/dist/lism-css/dist/config/index.js +17 -0
- package/dist/lism-css/dist/lib/getBpData.js +19 -0
- package/dist/lism-css/dist/lib/getLayoutProps.js +30 -0
- package/dist/lism-css/dist/lib/getLismProps.js +188 -0
- package/dist/lism-css/dist/lib/getMaybeCssVar.js +42 -0
- package/dist/lism-css/dist/lib/getMaybeTokenValue.js +26 -0
- package/dist/lism-css/dist/lib/getUtilKey.js +13 -0
- package/dist/lism-css/dist/lib/helper/atts.js +11 -0
- package/dist/lism-css/dist/lib/helper/filterEmptyObj.js +10 -0
- package/dist/lism-css/dist/lib/helper/hasSomeKeys.js +6 -0
- package/dist/lism-css/dist/lib/helper/isEmptyObj.js +6 -0
- package/dist/lism-css/dist/lib/helper/isNumStr.js +6 -0
- package/dist/lism-css/dist/lib/helper/splitWithComma.js +6 -0
- package/dist/lism-css/dist/lib/isPresetValue.js +13 -0
- package/dist/lism-css/dist/lib/isTokenValue.js +27 -0
- package/dist/style.css +1 -1
- package/dist/ui.css +1 -0
- package/package.json +9 -7
- package/src/components/Accordion/_style.css +69 -69
- package/src/components/Accordion/astro/Button.astro +2 -2
- package/src/components/Accordion/astro/Heading.astro +1 -1
- package/src/components/Accordion/astro/Item.astro +7 -7
- package/src/components/Accordion/astro/Panel.astro +3 -3
- package/src/components/Accordion/astro/Root.astro +3 -3
- package/src/components/Accordion/getProps.js +54 -54
- package/src/components/Accordion/react/AccIcon.jsx +1 -1
- package/src/components/Accordion/react/Accordion.jsx +37 -36
- package/src/components/Accordion/script.js +1 -1
- package/src/components/Accordion/setAccordion.js +93 -93
- package/src/components/Alert/astro/Alert.astro +6 -6
- package/src/components/Alert/getProps.ts +22 -22
- package/src/components/Alert/presets.ts +26 -26
- package/src/components/Alert/react/Alert.tsx +9 -9
- package/src/components/Avatar/astro/Avatar.astro +2 -2
- package/src/components/Avatar/react/Avatar.jsx +5 -5
- package/src/components/Badge/_style.css +14 -14
- package/src/components/Badge/astro/Badge.astro +4 -4
- package/src/components/Badge/react/Badge.jsx +6 -6
- package/src/components/Button/_style.css +29 -29
- package/src/components/Button/astro/Button.astro +4 -4
- package/src/components/Button/react/Button.jsx +6 -6
- package/src/components/Callout/astro/Callout.astro +13 -13
- package/src/components/Callout/getProps.ts +24 -24
- package/src/components/Callout/presets.ts +26 -26
- package/src/components/Callout/react/Callout.tsx +16 -16
- package/src/components/Chat/_style.css +49 -49
- package/src/components/Chat/astro/Chat.astro +27 -27
- package/src/components/Chat/getProps.js +40 -45
- package/src/components/Chat/react/Chat.jsx +17 -17
- package/src/components/Details/_style.css +39 -39
- package/src/components/Details/astro/Content.astro +3 -3
- package/src/components/Details/astro/Details.astro +1 -1
- package/src/components/Details/astro/Icon.astro +1 -1
- package/src/components/Details/astro/Summary.astro +2 -2
- package/src/components/Details/astro/Title.astro +1 -1
- package/src/components/Details/getProps.js +7 -7
- package/src/components/Details/react/Details.jsx +24 -24
- package/src/components/DummyImage/astro/DummyImage.astro +7 -0
- package/src/components/DummyImage/astro/index.ts +1 -0
- package/src/components/DummyImage/react/DummyImage.tsx +5 -0
- package/src/components/DummyImage/react/index.ts +1 -0
- package/src/components/DummyText/astro/DummyText.astro +9 -0
- package/src/components/DummyText/astro/index.ts +1 -0
- package/src/components/DummyText/getContent.ts +39 -0
- package/src/components/DummyText/react/DummyText.tsx +15 -0
- package/src/components/DummyText/react/index.ts +1 -0
- package/src/components/DummyText/texts.ts +39 -0
- package/src/components/Modal/_style.css +34 -34
- package/src/components/Modal/astro/Body.astro +1 -1
- package/src/components/Modal/astro/CloseBtn.astro +10 -10
- package/src/components/Modal/astro/Inner.astro +1 -1
- package/src/components/Modal/astro/Modal.astro +3 -3
- package/src/components/Modal/astro/OpenBtn.astro +1 -1
- package/src/components/Modal/getProps.js +19 -19
- package/src/components/Modal/react/Body.jsx +5 -5
- package/src/components/Modal/react/CloseBtn.jsx +13 -13
- package/src/components/Modal/react/Inner.jsx +1 -1
- package/src/components/Modal/react/Modal.jsx +12 -11
- package/src/components/Modal/react/OpenBtn.jsx +5 -5
- package/src/components/Modal/script.js +1 -1
- package/src/components/Modal/setModal.ts +92 -92
- package/src/components/NavMenu/_style.css +17 -17
- package/src/components/NavMenu/astro/Item.astro +1 -1
- package/src/components/NavMenu/astro/Link.astro +1 -1
- package/src/components/NavMenu/astro/Nest.astro +1 -1
- package/src/components/NavMenu/astro/Root.astro +1 -1
- package/src/components/NavMenu/getProps.js +28 -28
- package/src/components/NavMenu/react/NavMenu.jsx +4 -4
- package/src/components/ShapeDivider/_style.css +51 -51
- package/src/components/ShapeDivider/astro/ShapeDivider.astro +20 -20
- package/src/components/ShapeDivider/getProps.js +23 -23
- package/src/components/ShapeDivider/react/ShapeDivider.jsx +24 -24
- package/src/components/Tabs/_style.css +29 -29
- package/src/components/Tabs/astro/Tab.astro +2 -2
- package/src/components/Tabs/astro/TabItem.astro +1 -1
- package/src/components/Tabs/astro/TabList.astro +2 -2
- package/src/components/Tabs/astro/TabPanel.astro +2 -2
- package/src/components/Tabs/astro/Tabs.astro +20 -20
- package/src/components/Tabs/astro/transformTabitems.js +30 -30
- package/src/components/Tabs/getProps.js +4 -4
- package/src/components/Tabs/react/Tab.jsx +4 -12
- package/src/components/Tabs/react/TabItem.jsx +1 -1
- package/src/components/Tabs/react/TabList.jsx +2 -2
- package/src/components/Tabs/react/TabPanel.jsx +2 -2
- package/src/components/Tabs/react/Tabs.jsx +46 -47
- package/src/components/Tabs/script.js +4 -4
- package/src/components/Tabs/setTabs.js +70 -70
- package/src/components/astro.ts +2 -0
- package/src/components/react.ts +2 -0
- package/src/helper/animation.ts +10 -10
- package/src/helper/uuid.js +3 -3
package/README.ja.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# @lism-css/ui
|
|
2
|
+
|
|
3
|
+
[English](./README.md) | [日本語](./README.ja.md)
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@lism-css/ui)
|
|
6
|
+
[](https://github.com/lism-css/lism-css/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
## @lism-css/ui とは?
|
|
9
|
+
|
|
10
|
+
`@lism-css/ui` は、[lism-css](https://www.npmjs.com/package/lism-css) の上に構築されたインタラクティブな UI コンポーネントライブラリです。アコーディオン、モーダル、タブなど、よく使う UI パターンの React / Astro コンポーネントを提供します。
|
|
11
|
+
|
|
12
|
+
すべてのコンポーネントは Lism CSS のレイアウトシステムとデザイントークンを前提としています。
|
|
13
|
+
|
|
14
|
+
## 利用可能なコンポーネント
|
|
15
|
+
|
|
16
|
+
| コンポーネント | 説明 |
|
|
17
|
+
|---------------|------|
|
|
18
|
+
| **Accordion** | ネイティブ `<details>` 要素を使った展開可能なコンテンツセクション |
|
|
19
|
+
| **Alert** | アイコンとカラーバリエーション付きのコンテキストフィードバックメッセージ |
|
|
20
|
+
| **Avatar** | ユーザープロフィール用の円形画像表示 |
|
|
21
|
+
| **Badge** | 小さなステータスラベルやカウンター |
|
|
22
|
+
| **Button** | バリエーションとサイズ付きのスタイル付きボタン |
|
|
23
|
+
| **Callout** | ヒント、警告、注意書き用のハイライトコンテンツブロック |
|
|
24
|
+
| **Chat** | 会話形式のレイアウト用チャットバブル UI |
|
|
25
|
+
| **Details** | スタイル付きネイティブ `<details>` / `<summary>` 要素 |
|
|
26
|
+
| **Modal** | バックドロップ付きダイアログオーバーレイ |
|
|
27
|
+
| **NavMenu** | ネストアイテム対応のナビゲーションメニュー |
|
|
28
|
+
| **ShapeDivider** | SVG シェイプによる装飾的なセクションディバイダー |
|
|
29
|
+
| **Tabs** | タブ付きコンテンツパネル |
|
|
30
|
+
| **DummyText** | プロトタイピング用のプレースホルダーテキスト |
|
|
31
|
+
| **DummyImage** | プロトタイピング用のプレースホルダー画像 |
|
|
32
|
+
|
|
33
|
+
## インストール
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm i @lism-css/ui lism-css
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
または
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pnpm add @lism-css/ui lism-css
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
> `lism-css` は必須のピア依存関係です。
|
|
46
|
+
|
|
47
|
+
## セットアップ
|
|
48
|
+
|
|
49
|
+
グローバルスタイルとして CSS をインポートします:
|
|
50
|
+
|
|
51
|
+
```js
|
|
52
|
+
import 'lism-css/main.css';
|
|
53
|
+
import '@lism-css/ui/style.css';
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Astro** の場合は、`astro.config.js` に以下も追加します:
|
|
57
|
+
|
|
58
|
+
```js
|
|
59
|
+
export default defineConfig({
|
|
60
|
+
vite: {
|
|
61
|
+
ssr: {
|
|
62
|
+
noExternal: ['lism-css', '@lism-css/ui'],
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 使い方
|
|
69
|
+
|
|
70
|
+
### React
|
|
71
|
+
|
|
72
|
+
```jsx
|
|
73
|
+
import { Accordion, Modal, Tabs, Button } from '@lism-css/ui/react';
|
|
74
|
+
import { Stack, Text } from 'lism-css/react';
|
|
75
|
+
|
|
76
|
+
<Stack g="20">
|
|
77
|
+
<Accordion>
|
|
78
|
+
<Accordion.Header>FAQ の質問</Accordion.Header>
|
|
79
|
+
<Accordion.Body>
|
|
80
|
+
<Text>回答の内容がここに入ります。</Text>
|
|
81
|
+
</Accordion.Body>
|
|
82
|
+
</Accordion>
|
|
83
|
+
|
|
84
|
+
<Button href="/about" variant="outline">
|
|
85
|
+
詳しく見る
|
|
86
|
+
</Button>
|
|
87
|
+
</Stack>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Astro
|
|
91
|
+
|
|
92
|
+
```astro
|
|
93
|
+
---
|
|
94
|
+
import { Accordion, Modal, Tabs, Button } from '@lism-css/ui/astro';
|
|
95
|
+
import { Stack, Text } from 'lism-css/astro';
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
<Stack g="20">
|
|
99
|
+
<Accordion>
|
|
100
|
+
<Accordion.Header>FAQ の質問</Accordion.Header>
|
|
101
|
+
<Accordion.Body>
|
|
102
|
+
<Text>回答の内容がここに入ります。</Text>
|
|
103
|
+
</Accordion.Body>
|
|
104
|
+
</Accordion>
|
|
105
|
+
|
|
106
|
+
<Button href="/about" variant="outline">
|
|
107
|
+
詳しく見る
|
|
108
|
+
</Button>
|
|
109
|
+
</Stack>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## lism-css との関係
|
|
113
|
+
|
|
114
|
+
Lism CSS は2つのパッケージで構成されています:
|
|
115
|
+
|
|
116
|
+
- **[lism-css](https://www.npmjs.com/package/lism-css)** — レイアウトコンポーネント(Box、Flex、Stack、Grid など)、デザイントークン、プロップクラス、レスポンシブシステムを提供するコア CSS フレームワーク。
|
|
117
|
+
- **@lism-css/ui**(このパッケージ)— コアのレイアウトシステムを拡張し、すぐに使えるインターフェースパターン(Accordion、Modal、Tabs など)を提供するインタラクティブ UI コンポーネント。
|
|
118
|
+
|
|
119
|
+
`@lism-css/ui` を使用するには `lism-css` のインストールが必要です。
|
|
120
|
+
|
|
121
|
+
## AI ツール連携
|
|
122
|
+
|
|
123
|
+
AI コーディングツールが Lism CSS のドキュメントを参照するための MCP サーバーが利用可能です:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
claude mcp add lism-css -- npx -y @lism-css/mcp
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
その他のセットアップ方法については、[lism-css README](https://www.npmjs.com/package/lism-css#ai-tool-integration) を参照してください。
|
|
130
|
+
|
|
131
|
+
## ドキュメント
|
|
132
|
+
|
|
133
|
+
詳細なドキュメントは [lism-css.com](https://lism-css.com) をご覧ください。
|
|
134
|
+
|
|
135
|
+
## ライセンス
|
|
136
|
+
|
|
137
|
+
MIT
|
package/README.md
CHANGED
|
@@ -1,9 +1,34 @@
|
|
|
1
1
|
# @lism-css/ui
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
Provides both **React** and **Astro** components.
|
|
3
|
+
[English](./README.md) | [日本語](./README.ja.md)
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@lism-css/ui)
|
|
6
|
+
[](https://github.com/lism-css/lism-css/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
## What is @lism-css/ui?
|
|
9
|
+
|
|
10
|
+
`@lism-css/ui` is an interactive UI component library built on top of [lism-css](https://www.npmjs.com/package/lism-css). It provides React and Astro components for frequently used UI patterns such as accordions, modals, and tabs.
|
|
11
|
+
|
|
12
|
+
All components are based on the layout system and design tokens of Lism CSS.
|
|
13
|
+
|
|
14
|
+
## Available Components
|
|
15
|
+
|
|
16
|
+
| Component | Description |
|
|
17
|
+
|-----------|-------------|
|
|
18
|
+
| **Accordion** | Expandable content sections using native `<details>` element |
|
|
19
|
+
| **Alert** | Contextual feedback messages with icon and color variants |
|
|
20
|
+
| **Avatar** | Circular image display for user profiles |
|
|
21
|
+
| **Badge** | Small status labels and counters |
|
|
22
|
+
| **Button** | Styled button with variants and sizes |
|
|
23
|
+
| **Callout** | Highlighted content blocks for tips, warnings, and notes |
|
|
24
|
+
| **Chat** | Chat bubble UI for conversational layouts |
|
|
25
|
+
| **Details** | Styled native `<details>` / `<summary>` element |
|
|
26
|
+
| **Modal** | Dialog overlay with backdrop |
|
|
27
|
+
| **NavMenu** | Navigation menu with nested item support |
|
|
28
|
+
| **ShapeDivider** | Decorative section dividers with SVG shapes |
|
|
29
|
+
| **Tabs** | Tabbed content panels |
|
|
30
|
+
| **DummyText** | Placeholder text for prototyping |
|
|
31
|
+
| **DummyImage** | Placeholder image for prototyping |
|
|
7
32
|
|
|
8
33
|
## Installation
|
|
9
34
|
|
|
@@ -28,22 +53,85 @@ import 'lism-css/main.css';
|
|
|
28
53
|
import '@lism-css/ui/style.css';
|
|
29
54
|
```
|
|
30
55
|
|
|
56
|
+
For **Astro**, also add the following to `astro.config.js`:
|
|
57
|
+
|
|
58
|
+
```js
|
|
59
|
+
export default defineConfig({
|
|
60
|
+
vite: {
|
|
61
|
+
ssr: {
|
|
62
|
+
noExternal: ['lism-css', '@lism-css/ui'],
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
31
68
|
## Usage
|
|
32
69
|
|
|
33
70
|
### React
|
|
34
71
|
|
|
35
72
|
```jsx
|
|
36
|
-
import { Accordion, Modal } from '@lism-css/ui/react';
|
|
73
|
+
import { Accordion, Modal, Tabs, Button } from '@lism-css/ui/react';
|
|
74
|
+
import { Stack, Text } from 'lism-css/react';
|
|
75
|
+
|
|
76
|
+
<Stack g="20">
|
|
77
|
+
<Accordion>
|
|
78
|
+
<Accordion.Header>FAQ Question</Accordion.Header>
|
|
79
|
+
<Accordion.Body>
|
|
80
|
+
<Text>Answer content goes here.</Text>
|
|
81
|
+
</Accordion.Body>
|
|
82
|
+
</Accordion>
|
|
83
|
+
|
|
84
|
+
<Button href="/about" variant="outline">
|
|
85
|
+
Learn More
|
|
86
|
+
</Button>
|
|
87
|
+
</Stack>
|
|
37
88
|
```
|
|
38
89
|
|
|
39
90
|
### Astro
|
|
40
91
|
|
|
41
92
|
```astro
|
|
42
93
|
---
|
|
43
|
-
import { Accordion, Modal } from '@lism-css/ui/astro';
|
|
94
|
+
import { Accordion, Modal, Tabs, Button } from '@lism-css/ui/astro';
|
|
95
|
+
import { Stack, Text } from 'lism-css/astro';
|
|
44
96
|
---
|
|
97
|
+
|
|
98
|
+
<Stack g="20">
|
|
99
|
+
<Accordion>
|
|
100
|
+
<Accordion.Header>FAQ Question</Accordion.Header>
|
|
101
|
+
<Accordion.Body>
|
|
102
|
+
<Text>Answer content goes here.</Text>
|
|
103
|
+
</Accordion.Body>
|
|
104
|
+
</Accordion>
|
|
105
|
+
|
|
106
|
+
<Button href="/about" variant="outline">
|
|
107
|
+
Learn More
|
|
108
|
+
</Button>
|
|
109
|
+
</Stack>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Relationship to lism-css
|
|
113
|
+
|
|
114
|
+
Lism CSS is organized into two packages:
|
|
115
|
+
|
|
116
|
+
- **[lism-css](https://www.npmjs.com/package/lism-css)** — Core CSS framework providing layout components (Box, Flex, Stack, Grid, etc.), design tokens, prop classes, and the responsive system.
|
|
117
|
+
- **@lism-css/ui** (this package) — Interactive UI components (Accordion, Modal, Tabs, etc.) that extend the core layout system with ready-to-use interface patterns.
|
|
118
|
+
|
|
119
|
+
You need `lism-css` installed to use `@lism-css/ui`.
|
|
120
|
+
|
|
121
|
+
## AI Tool Integration
|
|
122
|
+
|
|
123
|
+
An MCP server is available for AI coding tools to reference Lism CSS documentation:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
claude mcp add lism-css -- npx -y @lism-css/mcp
|
|
45
127
|
```
|
|
46
128
|
|
|
129
|
+
For more setup options, see the [lism-css README](https://www.npmjs.com/package/lism-css#ai-tool-integration).
|
|
130
|
+
|
|
131
|
+
## Documentation
|
|
132
|
+
|
|
133
|
+
For full documentation, visit [lism-css.com](https://lism-css.com).
|
|
134
|
+
|
|
47
135
|
## License
|
|
48
136
|
|
|
49
137
|
MIT
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import e from "../../lism-css/dist/lib/helper/atts.js";
|
|
2
|
+
function r({ lismClass: o, allowMultiple: t, ...n }) {
|
|
3
|
+
return n.lismClass = e(o, "c--accordion"), t && (n["data-allow-multiple"] = ""), n;
|
|
4
|
+
}
|
|
5
|
+
function d({ lismClass: o, ...t }) {
|
|
6
|
+
return t.lismClass = e(o, "c--accordion_item"), t;
|
|
7
|
+
}
|
|
8
|
+
function u(o) {
|
|
9
|
+
const n = { ...{
|
|
10
|
+
lismClass: "c--accordion_heading",
|
|
11
|
+
as: "div",
|
|
12
|
+
setPlain: 1
|
|
13
|
+
}, ...o };
|
|
14
|
+
return n.as === "div" && (n.role = "heading"), n;
|
|
15
|
+
}
|
|
16
|
+
function f({ lismClass: o, _contextID: t, accID: n = "__LISM_ACC_ID__", isOpen: i = !1, ...s }) {
|
|
17
|
+
const a = {
|
|
18
|
+
lismClass: e(o, "c--accordion_panel"),
|
|
19
|
+
id: t || n,
|
|
20
|
+
hidden: i ? void 0 : "until-found",
|
|
21
|
+
pos: "relative",
|
|
22
|
+
ov: "hidden"
|
|
23
|
+
}, c = { lismClass: "c--accordion_content", layout: "flow", ...s };
|
|
24
|
+
return { panelProps: a, contentProps: c };
|
|
25
|
+
}
|
|
26
|
+
const P = {
|
|
27
|
+
// header: { lismClass: 'c--accordion_header' },
|
|
28
|
+
button: {
|
|
29
|
+
lismClass: "c--accordion_button",
|
|
30
|
+
as: "button",
|
|
31
|
+
layout: "flex",
|
|
32
|
+
setPlain: 1,
|
|
33
|
+
g: "10",
|
|
34
|
+
w: "100%",
|
|
35
|
+
ai: "center",
|
|
36
|
+
jc: "between"
|
|
37
|
+
},
|
|
38
|
+
icon: {
|
|
39
|
+
lismClass: "c--accordion_icon a--icon",
|
|
40
|
+
as: "span",
|
|
41
|
+
// d: 'grid',
|
|
42
|
+
pi: "center",
|
|
43
|
+
fxsh: "0",
|
|
44
|
+
"aria-hidden": "true"
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
P as defaultProps,
|
|
49
|
+
u as getHeadingProps,
|
|
50
|
+
d as getItemProps,
|
|
51
|
+
f as getPanelProps,
|
|
52
|
+
r as getRootProps
|
|
53
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import t from "../../../lism-css/dist/components/Lism/index.js";
|
|
3
|
+
import { defaultProps as f } from "../getProps.js";
|
|
4
|
+
function n(o) {
|
|
5
|
+
return /* @__PURE__ */ r(t, { ...f.icon, ...o });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
n as default
|
|
9
|
+
};
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
/**
|
|
3
2
|
* 複数の AccordionItem をラップするルート要素
|
|
4
3
|
*/
|
|
5
4
|
export function AccordionRoot({ children, ...props }: {
|
|
6
5
|
[x: string]: any;
|
|
7
6
|
children: any;
|
|
8
|
-
}):
|
|
7
|
+
}): import("react").JSX.Element;
|
|
9
8
|
/**
|
|
10
9
|
* 個別のアコーディオンアイテム(<div> ベース、setEvent で開閉イベントを登録)
|
|
11
10
|
*/
|
|
12
11
|
export function AccordionItem({ children, ...props }: {
|
|
13
12
|
[x: string]: any;
|
|
14
13
|
children: any;
|
|
15
|
-
}):
|
|
14
|
+
}): import("react").JSX.Element;
|
|
16
15
|
/**
|
|
17
16
|
* 見出しエリアのラッパー(デフォルトは <div role="heading">)
|
|
18
17
|
* as に h2〜h6 を指定すると role は付与されない
|
|
@@ -20,7 +19,7 @@ export function AccordionItem({ children, ...props }: {
|
|
|
20
19
|
export function Heading({ children, ...props }: {
|
|
21
20
|
[x: string]: any;
|
|
22
21
|
children: any;
|
|
23
|
-
}):
|
|
22
|
+
}): import("react").JSX.Element;
|
|
24
23
|
/**
|
|
25
24
|
* 開閉トリガーボタン
|
|
26
25
|
* accID: Context から取得できればそれを優先、なければ props / プレースホルダー
|
|
@@ -29,11 +28,11 @@ export function Button({ children, accID: _accID, ...props }: {
|
|
|
29
28
|
[x: string]: any;
|
|
30
29
|
children: any;
|
|
31
30
|
accID?: string | undefined;
|
|
32
|
-
}):
|
|
31
|
+
}): import("react").JSX.Element;
|
|
33
32
|
/**
|
|
34
33
|
* パネル
|
|
35
34
|
*/
|
|
36
35
|
export function Panel({ children, ...props }: {
|
|
37
36
|
[x: string]: any;
|
|
38
37
|
children: any;
|
|
39
|
-
}):
|
|
38
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as f, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { useContext as u, useRef as p, useId as m, useEffect as a, createContext as l } from "react";
|
|
4
|
+
import d from "../../../lism-css/dist/lib/getLismProps.js";
|
|
5
|
+
import s from "../../../lism-css/dist/components/Lism/index.js";
|
|
6
|
+
import I from "../../../lism-css/dist/components/Stack/index.js";
|
|
7
|
+
import { defaultProps as P, getPanelProps as x, getHeadingProps as D, getItemProps as _, getRootProps as g } from "../getProps.js";
|
|
8
|
+
import { setEvent as A } from "../setAccordion.js";
|
|
9
|
+
import C from "./AccIcon.js";
|
|
10
|
+
/* empty css */
|
|
11
|
+
const i = l(null);
|
|
12
|
+
function L({ children: t, ...o }) {
|
|
13
|
+
const r = g(o);
|
|
14
|
+
return /* @__PURE__ */ n(I, { ...r, children: t });
|
|
15
|
+
}
|
|
16
|
+
function M({ children: t, ...o }) {
|
|
17
|
+
const r = p(null), e = m();
|
|
18
|
+
a(() => {
|
|
19
|
+
if (r.current)
|
|
20
|
+
return A(r.current);
|
|
21
|
+
}, []);
|
|
22
|
+
const c = d(_(o));
|
|
23
|
+
return /* @__PURE__ */ n(i.Provider, { value: { accID: e }, children: /* @__PURE__ */ n("div", { ref: r, ...c, children: t }) });
|
|
24
|
+
}
|
|
25
|
+
function S({ children: t, ...o }) {
|
|
26
|
+
return /* @__PURE__ */ n(s, { ...D(o), children: t });
|
|
27
|
+
}
|
|
28
|
+
function $({ children: t, accID: o = "__LISM_ACC_ID__", ...r }) {
|
|
29
|
+
const c = u(i)?.accID || o;
|
|
30
|
+
return /* @__PURE__ */ f(s, { ...P.button, ...r, "aria-controls": c, "aria-expanded": "false", children: [
|
|
31
|
+
t,
|
|
32
|
+
/* @__PURE__ */ n(C, {})
|
|
33
|
+
] });
|
|
34
|
+
}
|
|
35
|
+
function k({ children: t, ...o }) {
|
|
36
|
+
const r = u(i), { panelProps: e, contentProps: c } = x({ _contextID: r?.accID, ...o });
|
|
37
|
+
return /* @__PURE__ */ n(s, { ...e, children: /* @__PURE__ */ n(s, { ...c, children: t }) });
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
M as AccordionItem,
|
|
41
|
+
L as AccordionRoot,
|
|
42
|
+
$ as Button,
|
|
43
|
+
S as Heading,
|
|
44
|
+
k as Panel
|
|
45
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import i from "./presets.js";
|
|
2
|
+
function f({ type: o = "alert", keycolor: t, layout: c = "flex", icon: e, flow: l = "s", ...n }) {
|
|
3
|
+
const r = o ? i[o] : null, s = e || r?.icon || "info", a = t || r?.color || "currentColor";
|
|
4
|
+
return {
|
|
5
|
+
icon: s,
|
|
6
|
+
layout: c,
|
|
7
|
+
flow: l,
|
|
8
|
+
lismClass: "c--alert u--cbox",
|
|
9
|
+
keycolor: a,
|
|
10
|
+
ai: "center",
|
|
11
|
+
p: "15",
|
|
12
|
+
g: "15",
|
|
13
|
+
bd: !0,
|
|
14
|
+
bdrs: "10",
|
|
15
|
+
...n
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
f as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const o = {
|
|
2
|
+
alert: {
|
|
3
|
+
icon: "alert",
|
|
4
|
+
color: "red"
|
|
5
|
+
},
|
|
6
|
+
point: {
|
|
7
|
+
icon: "lightbulb",
|
|
8
|
+
color: "orange"
|
|
9
|
+
},
|
|
10
|
+
warning: {
|
|
11
|
+
icon: "warning",
|
|
12
|
+
color: "yellow"
|
|
13
|
+
},
|
|
14
|
+
check: {
|
|
15
|
+
icon: "check-circle",
|
|
16
|
+
color: "green"
|
|
17
|
+
},
|
|
18
|
+
help: {
|
|
19
|
+
icon: "question",
|
|
20
|
+
color: "purple"
|
|
21
|
+
},
|
|
22
|
+
info: {
|
|
23
|
+
icon: "info",
|
|
24
|
+
color: "blue"
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
o as default
|
|
29
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import s from "../../../lism-css/dist/components/Center/index.js";
|
|
3
|
+
import n from "../../../lism-css/dist/components/Flow/index.js";
|
|
4
|
+
import p from "../../../lism-css/dist/components/atomic/Icon/index.js";
|
|
5
|
+
import c from "../../../lism-css/dist/components/Lism/index.js";
|
|
6
|
+
import x from "../getProps.js";
|
|
7
|
+
function A({ children: t, ...i }) {
|
|
8
|
+
const { icon: e, layout: o, flow: f, ...m } = x(i);
|
|
9
|
+
return /* @__PURE__ */ l(c, { layout: o, ...m, children: [
|
|
10
|
+
/* @__PURE__ */ r(s, { isSide: o === "sideMain", c: "keycolor", fz: "xl", fxsh: "0", children: /* @__PURE__ */ r(p, { icon: e }) }),
|
|
11
|
+
/* @__PURE__ */ r(n, { flow: f, children: t })
|
|
12
|
+
] });
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
A as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import m from "../../../lism-css/dist/components/Frame/index.js";
|
|
3
|
+
function d({ size: a = "1.5em", src: t = "", alt: i = "", ...e }) {
|
|
4
|
+
return /* @__PURE__ */ r(m, { lismClass: "c--avatar", ar: "1/1", w: a, bdrs: "99", ...e, children: /* @__PURE__ */ r("img", { src: t, alt: i, width: "100%", height: "100%", decoding: "async" }) });
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
d as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import o from "../../../lism-css/dist/components/Lism/index.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
function n(r) {
|
|
5
|
+
return /* @__PURE__ */ s(o, { lismClass: "c--badge", as: "span", d: "inline-flex", fz: "xs", lh: "xs", py: "5", px: "10", bdrs: "10", _propConfig: {
|
|
6
|
+
c: { isVar: 1 },
|
|
7
|
+
bgc: { isVar: 1 }
|
|
8
|
+
}, ...r });
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
n as default
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import t from "../../../lism-css/dist/components/Flex/index.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
function a(o) {
|
|
5
|
+
return /* @__PURE__ */ r(t, { lismClass: "c--button", as: "a", lh: "s", py: "10", px: "20", hov: "o", _propConfig: {
|
|
6
|
+
c: { isVar: 1 },
|
|
7
|
+
bgc: { isVar: 1 }
|
|
8
|
+
}, ...o });
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
a as default
|
|
12
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import a from "./presets.js";
|
|
2
|
+
function i({ type: o = "note", keycolor: l, icon: t, title: n, flow: s = "s", ...r }) {
|
|
3
|
+
const c = o ? a[o] : null, e = t || c?.icon || "note", u = l || c?.color || null;
|
|
4
|
+
return {
|
|
5
|
+
icon: e,
|
|
6
|
+
title: n,
|
|
7
|
+
flow: s,
|
|
8
|
+
lismClass: "c--callout u--cbox",
|
|
9
|
+
keycolor: u,
|
|
10
|
+
p: "20",
|
|
11
|
+
g: "10",
|
|
12
|
+
bdc: "keycolor",
|
|
13
|
+
"bd-x-s": "-",
|
|
14
|
+
bdw: "4px",
|
|
15
|
+
bxsh: "10",
|
|
16
|
+
bdrs: "5",
|
|
17
|
+
...r
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
i as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const o = {
|
|
2
|
+
alert: {
|
|
3
|
+
icon: "alert",
|
|
4
|
+
color: "red"
|
|
5
|
+
},
|
|
6
|
+
point: {
|
|
7
|
+
icon: "lightbulb",
|
|
8
|
+
color: "orange"
|
|
9
|
+
},
|
|
10
|
+
warning: {
|
|
11
|
+
icon: "warning",
|
|
12
|
+
color: "yellow"
|
|
13
|
+
},
|
|
14
|
+
check: {
|
|
15
|
+
icon: "check-circle",
|
|
16
|
+
color: "green"
|
|
17
|
+
},
|
|
18
|
+
help: {
|
|
19
|
+
icon: "question",
|
|
20
|
+
color: "purple"
|
|
21
|
+
},
|
|
22
|
+
note: {
|
|
23
|
+
icon: "note",
|
|
24
|
+
color: "blue"
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
o as default
|
|
29
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsxs as r, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import i from "../../../lism-css/dist/components/Center/index.js";
|
|
3
|
+
import s from "../../../lism-css/dist/components/Flex/index.js";
|
|
4
|
+
import f from "../../../lism-css/dist/components/Flow/index.js";
|
|
5
|
+
import n from "../../../lism-css/dist/components/atomic/Icon/index.js";
|
|
6
|
+
import p from "../../../lism-css/dist/components/Stack/index.js";
|
|
7
|
+
import u from "../getProps.js";
|
|
8
|
+
function j({ children: t, ...c }) {
|
|
9
|
+
const { icon: a, title: l, flow: m, ...e } = u(c);
|
|
10
|
+
return /* @__PURE__ */ r(p, { ...e, children: [
|
|
11
|
+
l && /* @__PURE__ */ r(s, { className: "c--callout_head", c: "keycolor", fw: "bold", ai: "center", g: "10", children: [
|
|
12
|
+
/* @__PURE__ */ o(i, { className: "c--callout_icon", fz: "xl", children: /* @__PURE__ */ o(n, { icon: a }) }),
|
|
13
|
+
/* @__PURE__ */ o("span", { className: "c--callout_title", children: l })
|
|
14
|
+
] }),
|
|
15
|
+
/* @__PURE__ */ o(f, { className: "c--callout_body", flow: m, children: t })
|
|
16
|
+
] });
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
j as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const l = {
|
|
2
|
+
avatar: {
|
|
3
|
+
lismClass: "c--chat_avatar",
|
|
4
|
+
bgc: "base",
|
|
5
|
+
ar: "1/1",
|
|
6
|
+
bdrs: "99",
|
|
7
|
+
"aria-hidden": "true"
|
|
8
|
+
},
|
|
9
|
+
name: {
|
|
10
|
+
lismClass: "c--chat_name",
|
|
11
|
+
c: "text-2",
|
|
12
|
+
fs: "italic",
|
|
13
|
+
fz: "2xs",
|
|
14
|
+
lh: "1",
|
|
15
|
+
py: "5",
|
|
16
|
+
px: "10",
|
|
17
|
+
aslf: "end"
|
|
18
|
+
},
|
|
19
|
+
body: {
|
|
20
|
+
lismClass: "c--chat_body",
|
|
21
|
+
pos: "rel"
|
|
22
|
+
},
|
|
23
|
+
deco: {
|
|
24
|
+
lismClass: "c--chat_deco",
|
|
25
|
+
pos: "abs"
|
|
26
|
+
},
|
|
27
|
+
content: {
|
|
28
|
+
lismClass: "c--chat_content",
|
|
29
|
+
bdrs: "30",
|
|
30
|
+
p: "20",
|
|
31
|
+
lh: "s"
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
function e({ variant: s = "speak", direction: a = "start", keycolor: t = "gray", ...c }) {
|
|
35
|
+
return {
|
|
36
|
+
lismClass: "c--chat",
|
|
37
|
+
variant: s,
|
|
38
|
+
keycolor: t,
|
|
39
|
+
"data-chat-dir": a,
|
|
40
|
+
ji: a,
|
|
41
|
+
...c
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
e as default,
|
|
46
|
+
l as defaultProps
|
|
47
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsxs as s, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import f from "../../../lism-css/dist/components/atomic/Decorator/index.js";
|
|
3
|
+
import n from "../../../lism-css/dist/components/Flow/index.js";
|
|
4
|
+
import h from "../../../lism-css/dist/components/Frame/index.js";
|
|
5
|
+
import l from "../../../lism-css/dist/components/Grid/index.js";
|
|
6
|
+
import m from "../../../lism-css/dist/components/Lism/index.js";
|
|
7
|
+
import u, { defaultProps as r } from "../getProps.js";
|
|
8
|
+
/* empty css */
|
|
9
|
+
function N({ name: i, avatar: t, flow: e = "s", children: a, ...d }) {
|
|
10
|
+
const { "data-chat-dir": c, ...p } = u(d);
|
|
11
|
+
return /* @__PURE__ */ s(l, { "data-chat-dir": c, ...p, children: [
|
|
12
|
+
t && /* @__PURE__ */ o(h, { ...r.avatar, src: t, alt: "", children: /* @__PURE__ */ o("img", { src: t, alt: "", width: "60", height: "60", decoding: "async" }) }),
|
|
13
|
+
i && /* @__PURE__ */ o(m, { ...r.name, children: i }),
|
|
14
|
+
/* @__PURE__ */ s(m, { ...r.body, children: [
|
|
15
|
+
/* @__PURE__ */ o(f, { ...r.deco, className: "u--cbox is--skipFlow" }),
|
|
16
|
+
/* @__PURE__ */ o(n, { ...r.content, className: "u--cbox", flow: e, jslf: c, children: a })
|
|
17
|
+
] })
|
|
18
|
+
] });
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
N as default
|
|
22
|
+
};
|