wimui 0.29.10 → 0.31.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 +11 -10
- package/README.md +10 -7
- package/dist/components/_internal/IndicatorBase.cjs +1 -1
- package/dist/components/_internal/IndicatorBase.d.ts +1 -1
- package/dist/components/_internal/IndicatorBase.js +1 -1
- package/dist/components/_internal/StatusContent.cjs +1 -1
- package/dist/components/_internal/StatusContent.d.ts +9 -2
- package/dist/components/_internal/StatusContent.js +4 -2
- package/dist/components/_internal/status-content.module.cjs +1 -1
- package/dist/components/_internal/status-content.module.js +11 -9
- package/dist/components/data-display/Card/Card.cjs +1 -1
- package/dist/components/data-display/Card/Card.js +1 -1
- package/dist/components/data-display/Carousel/Carousel.cjs +1 -1
- package/dist/components/data-display/Carousel/Carousel.d.ts +6 -0
- package/dist/components/data-display/Carousel/Carousel.js +92 -92
- package/dist/components/data-display/Carousel/carousel.module.cjs +1 -1
- package/dist/components/data-display/Carousel/carousel.module.js +14 -13
- package/dist/components/data-display/Chip/Chip.cjs +1 -1
- package/dist/components/data-display/Chip/Chip.js +1 -1
- package/dist/components/data-display/EmptyState/EmptyState.cjs +1 -1
- package/dist/components/data-display/EmptyState/EmptyState.d.ts +7 -1
- package/dist/components/data-display/EmptyState/EmptyState.js +4 -3
- package/dist/components/data-display/Marquee/Marquee.cjs +1 -1
- package/dist/components/data-display/Marquee/Marquee.d.ts +4 -1
- package/dist/components/data-display/Marquee/Marquee.js +4 -2
- package/dist/components/data-display/Marquee/marquee.module.cjs +1 -1
- package/dist/components/data-display/Marquee/marquee.module.js +1 -1
- package/dist/components/data-display/Stats/Stats.cjs +1 -1
- package/dist/components/data-display/Stats/Stats.d.ts +14 -3
- package/dist/components/data-display/Stats/Stats.js +13 -7
- package/dist/components/data-display/Stats/stats.module.cjs +1 -1
- package/dist/components/data-display/Stats/stats.module.js +4 -4
- package/dist/components/feedback/Skeleton/skeleton.module.cjs +1 -1
- package/dist/components/feedback/Skeleton/skeleton.module.js +3 -3
- package/dist/components/form/RichTextEditor/commands.d.ts +1 -1
- package/dist/components/layout/BentoGrid/BentoGrid.cjs +1 -1
- package/dist/components/layout/BentoGrid/BentoGrid.d.ts +12 -1
- package/dist/components/layout/BentoGrid/BentoGrid.js +3 -3
- package/dist/components/layout/BentoGrid/bento-grid.module.cjs +1 -1
- package/dist/components/layout/BentoGrid/bento-grid.module.js +6 -1
- package/dist/components/media/Audio/audio.module.cjs +1 -1
- package/dist/components/media/Audio/audio.module.js +2 -2
- package/dist/components/overlay/Dropdown/Dropdown.cjs +1 -1
- package/dist/components/overlay/Dropdown/Dropdown.d.ts +14 -0
- package/dist/components/overlay/Dropdown/Dropdown.js +99 -93
- package/dist/llms-full.txt +31 -8
- package/dist/llms.txt +15 -4
- package/dist/styles.css +2 -2
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +5 -5
- package/package.json +60 -24
package/README.ja.md
CHANGED
|
@@ -245,7 +245,7 @@ import { WimProvider } from "wimui";
|
|
|
245
245
|
|
|
246
246
|
- `primary-rgb` は `rgb(...)` で包まない(`11, 110, 79` の形)。
|
|
247
247
|
- ダークの塗り面などで `primary-fill` を独自にしている場合は、必要ならそれも上書きする。
|
|
248
|
-
- トークン一覧は Storybook **Token → Colors** / `
|
|
248
|
+
- トークン一覧は Storybook **Token → Colors** / `docs/design/color.md` を参照。
|
|
249
249
|
|
|
250
250
|
## UI 密度(Density)
|
|
251
251
|
|
|
@@ -426,7 +426,7 @@ npm run scaffold -- <Name> <category> [categoryId]
|
|
|
426
426
|
# 例: npm run scaffold -- MyInput form basic-inputs
|
|
427
427
|
```
|
|
428
428
|
|
|
429
|
-
`src/components/<category>/<Name>/` と `stories/<category>/<Name>/` のボイラープレートを生成します。続けて `src/<category>.ts` への export 追加、翻訳キー、MDX 記述が必要です(詳細は `
|
|
429
|
+
`src/components/<category>/<Name>/` と `stories/<category>/<Name>/` のボイラープレートを生成します。続けて `src/<category>.ts` への export 追加、翻訳キー、MDX 記述が必要です(詳細は `AGENTS.md` / `docs/rules/new-component.md`)。
|
|
430
430
|
|
|
431
431
|
### パッケージバージョン確認
|
|
432
432
|
|
|
@@ -617,14 +617,14 @@ git commit -m "commit message" --no-verify
|
|
|
617
617
|
## コーディングルール
|
|
618
618
|
|
|
619
619
|
- スタイリング:新規コンポーネントは CSS Modules(`*.module.scss`)を推奨
|
|
620
|
-
- CSSクラス名:従来のグローバルクラスは `wim-` プレフィックスを使用(詳細は `
|
|
620
|
+
- CSSクラス名:従来のグローバルクラスは `wim-` プレフィックスを使用(詳細は `docs/rules/tokens.md` を参照)
|
|
621
621
|
|
|
622
622
|
|
|
623
623
|
## ドキュメントの自動抽出 (Docgen)
|
|
624
624
|
|
|
625
625
|
WIM UI では、コンポーネントの仕様(Props、デザイントークン、構成要素)を自動抽出し、MDX に埋め込む仕組みを構築しています。
|
|
626
626
|
Vite の開発サーバー起動時やファイル保存時に `src/data/docgen_*.json` が自動更新されるため、手動でスクリプトを実行する必要はありません(生成物は gitignore され、Storybook の Vite プラグインが出力します)。
|
|
627
|
-
MDX の記述方法の詳細は `
|
|
627
|
+
MDX の記述方法の詳細は `docs/rules/mdx.md` を参照してください。
|
|
628
628
|
|
|
629
629
|
## デザイントークン
|
|
630
630
|
|
|
@@ -647,13 +647,14 @@ npm run tokens:build # Style Dictionary + intent 生成(SCSS / TypeScript)
|
|
|
647
647
|
|
|
648
648
|
このコマンドにより、コンポーネント開発時に最新のトークンが型補完として利用可能になります。
|
|
649
649
|
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
650
|
## ワークフロー
|
|
655
651
|
|
|
652
|
+
`main` は保護されているので、変更はブランチと PR 経由で入れます([CONTRIBUTING.md](./CONTRIBUTING.md))。
|
|
653
|
+
|
|
654
|
+
```bash
|
|
655
|
+
git switch -c feat/my-change
|
|
656
656
|
git add .
|
|
657
657
|
git commit -m "..."
|
|
658
|
-
git
|
|
659
|
-
|
|
658
|
+
git push -u origin feat/my-change
|
|
659
|
+
gh pr create
|
|
660
|
+
```
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# wimui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**English** · [日本語](./README.ja.md)
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/wimui) [](./LICENSE)
|
|
6
6
|
|
|
@@ -243,7 +243,7 @@ Many derivatives (`primary-hover` / `primary-active` / `primary-muted` / `primar
|
|
|
243
243
|
|
|
244
244
|
- Do not wrap `primary-rgb` in `rgb(...)` (use the `11, 110, 79` form).
|
|
245
245
|
- If you customize `primary-fill` (e.g. for dark-mode fills), override it too if needed.
|
|
246
|
-
- For the full token list, see Storybook **Token → Colors** / `
|
|
246
|
+
- For the full token list, see Storybook **Token → Colors** / `docs/design/color.md`.
|
|
247
247
|
|
|
248
248
|
## UI density
|
|
249
249
|
|
|
@@ -424,7 +424,7 @@ npm run scaffold -- <Name> <category> [categoryId]
|
|
|
424
424
|
# e.g. npm run scaffold -- MyInput form basic-inputs
|
|
425
425
|
```
|
|
426
426
|
|
|
427
|
-
Generates boilerplate under `src/components/<category>/<Name>/` and `stories/<category>/<Name>/`. You then need to add the export to `src/<category>.ts`, add translation keys, and write the MDX (see `
|
|
427
|
+
Generates boilerplate under `src/components/<category>/<Name>/` and `stories/<category>/<Name>/`. You then need to add the export to `src/<category>.ts`, add translation keys, and write the MDX (see `AGENTS.md` / `docs/rules/new-component.md`).
|
|
428
428
|
|
|
429
429
|
### Check package versions
|
|
430
430
|
|
|
@@ -615,13 +615,13 @@ git commit -m "commit message" --no-verify
|
|
|
615
615
|
## Coding rules
|
|
616
616
|
|
|
617
617
|
- Styling: new components should use CSS Modules (`*.module.scss`)
|
|
618
|
-
- CSS class names: legacy global classes use the `wim-` prefix (see `
|
|
618
|
+
- CSS class names: legacy global classes use the `wim-` prefix (see `docs/rules/tokens.md` for details)
|
|
619
619
|
|
|
620
620
|
## Automatic documentation extraction (Docgen)
|
|
621
621
|
|
|
622
622
|
WIM UI extracts component specs (Props, design tokens, anatomy) automatically and embeds them into MDX.
|
|
623
623
|
`src/data/docgen_*.json` is refreshed automatically when the Vite dev server starts or on file save, so you don't need to run a script manually (the output is gitignored and produced by Storybook's Vite plugin).
|
|
624
|
-
For details on writing MDX, see `
|
|
624
|
+
For details on writing MDX, see `docs/rules/mdx.md`.
|
|
625
625
|
|
|
626
626
|
## Design tokens
|
|
627
627
|
|
|
@@ -646,9 +646,12 @@ This makes the latest tokens available as type completions during component deve
|
|
|
646
646
|
|
|
647
647
|
## Workflow
|
|
648
648
|
|
|
649
|
+
`main` is protected: changes land through a branch and a pull request (see [CONTRIBUTING.md](./CONTRIBUTING.md)).
|
|
650
|
+
|
|
649
651
|
```bash
|
|
652
|
+
git switch -c feat/my-change
|
|
650
653
|
git add .
|
|
651
654
|
git commit -m "..."
|
|
652
|
-
git
|
|
653
|
-
|
|
655
|
+
git push -u origin feat/my-change
|
|
656
|
+
gh pr create
|
|
654
657
|
```
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../node_modules/@radix-ui/react-slot/dist/index.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("classnames");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=n.default.forwardRef(({asChild:e=!1,children:n,content:a,icon:o,intent:s=`
|
|
2
|
+
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../node_modules/@radix-ui/react-slot/dist/index.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("classnames");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=n.default.forwardRef(({asChild:e=!1,children:n,content:a,icon:o,intent:s=`neutral`,variant:c=`solid`,size:l=`md`,styles:u,interactive:d=!1,as:f,className:p,...m},h)=>{let g=e?t.Root:f||`span`,_=a??n,v=(0,r.default)(u?.root,u?.[s],u?.[c],u?.[l],d&&u?.interactive,p),y=u?.icon;return(0,i.jsxs)(g,{ref:h,className:v,...m,children:[o&&(0,i.jsx)(`span`,{className:y,children:o}),(0,i.jsx)(t.Slottable,{children:_})]})});a.displayName=`IndicatorBase`,exports.IndicatorBase=a;
|
|
@@ -3,7 +3,7 @@ import { Root as e, Slottable as t } from "../../node_modules/@radix-ui/react-sl
|
|
|
3
3
|
import n from "react";
|
|
4
4
|
import r from "classnames";
|
|
5
5
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
-
var o = n.forwardRef(({ asChild: n = !1, children: o, content: s, icon: c, intent: l = "
|
|
6
|
+
var o = n.forwardRef(({ asChild: n = !1, children: o, content: s, icon: c, intent: l = "neutral", variant: u = "solid", size: d = "md", styles: f, interactive: p = !1, as: m, className: h, ...g }, _) => {
|
|
7
7
|
let v = n ? e : m || "span", y = s ?? o, b = r(f?.root, f?.[l], f?.[u], f?.[d], p && f?.interactive, h), x = f?.icon;
|
|
8
8
|
return /* @__PURE__ */ a(v, {
|
|
9
9
|
ref: _,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("./status-content.module.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("classnames");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=({icon:e,title:n,description:a,actions:o,children:s,className:c,size:l=`md`,prefixCls:
|
|
2
|
+
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("./status-content.module.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("classnames");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=({icon:e,title:n,description:a,actions:o,children:s,className:c,size:l=`md`,align:u=`start`,prefixCls:d,...f})=>(0,i.jsxs)(`div`,{...f,"data-align":u,className:(0,r.default)(t.default.root,t.default[l],u===`center`?t.default.alignCenter:t.default.alignStart,d,c),children:[(0,i.jsxs)(`div`,{className:t.default.container,children:[e&&(0,i.jsx)(`div`,{className:t.default.icon,children:e}),(0,i.jsxs)(`div`,{className:t.default.content,children:[n&&(0,i.jsx)(`div`,{className:t.default.title,children:n}),a&&(0,i.jsx)(`div`,{className:t.default.description,children:a})]})]}),s&&(0,i.jsx)(`div`,{className:t.default.body,children:s}),o&&(0,i.jsx)(`div`,{className:t.default.actions,children:o})]});exports.StatusContent=a;
|
|
@@ -3,7 +3,7 @@ import { ComponentSize } from '../../types/tokens';
|
|
|
3
3
|
/**
|
|
4
4
|
* Props for the StatusContent component.
|
|
5
5
|
*/
|
|
6
|
-
export type StatusContentProps = {
|
|
6
|
+
export type StatusContentProps = Omit<React.ComponentPropsWithoutRef<"div">, "title" | "children"> & {
|
|
7
7
|
/**
|
|
8
8
|
* Main icon representing the status or state.
|
|
9
9
|
*/
|
|
@@ -33,6 +33,13 @@ export type StatusContentProps = {
|
|
|
33
33
|
* @default "md"
|
|
34
34
|
*/
|
|
35
35
|
size?: ComponentSize;
|
|
36
|
+
/**
|
|
37
|
+
* Horizontal alignment of the icon, text, and actions. Start-aligned reads as
|
|
38
|
+
* part of the surrounding content; use `"center"` only when the status is the
|
|
39
|
+
* only thing in its region (for example, a full-page empty result).
|
|
40
|
+
* @default "start"
|
|
41
|
+
*/
|
|
42
|
+
align?: "start" | "center";
|
|
36
43
|
/**
|
|
37
44
|
* Custom class name prefix for the root element.
|
|
38
45
|
*/
|
|
@@ -47,4 +54,4 @@ export type StatusContentProps = {
|
|
|
47
54
|
* - Ensures consistent spacing and typography across different status displays.
|
|
48
55
|
* - Supports responsive sizing via the `size` prop.
|
|
49
56
|
*/
|
|
50
|
-
export declare const StatusContent: ({ icon, title, description, actions, children, className, size, prefixCls, }: StatusContentProps) => React.JSX.Element;
|
|
57
|
+
export declare const StatusContent: ({ icon, title, description, actions, children, className, size, align, prefixCls, ...rest }: StatusContentProps) => React.JSX.Element;
|
|
@@ -4,8 +4,10 @@ import "react";
|
|
|
4
4
|
import t from "classnames";
|
|
5
5
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/_internal/StatusContent.tsx
|
|
7
|
-
var i = ({ icon: i, title: a, description: o, actions: s, children: c, className: l, size: u = "md",
|
|
8
|
-
|
|
7
|
+
var i = ({ icon: i, title: a, description: o, actions: s, children: c, className: l, size: u = "md", align: d = "start", prefixCls: f, ...p }) => /* @__PURE__ */ r("div", {
|
|
8
|
+
...p,
|
|
9
|
+
"data-align": d,
|
|
10
|
+
className: t(e.root, e[u], d === "center" ? e.alignCenter : e.alignStart, f, l),
|
|
9
11
|
children: [
|
|
10
12
|
/* @__PURE__ */ r("div", {
|
|
11
13
|
className: e.container,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_a7t1s_3`,t=`_alignStart_a7t1s_11`,n=`_container_a7t1s_15`,r=`_actions_a7t1s_18`,i=`_alignCenter_a7t1s_21`,a=`_sm_a7t1s_35`,o=`_icon_a7t1s_44`,s=`_title_a7t1s_52`,c=`_description_a7t1s_55`,l=`_content_a7t1s_66`,u=`_body_a7t1s_103`,d={root:e,alignStart:t,container:n,actions:r,alignCenter:i,sm:a,icon:o,title:s,description:c,content:l,body:u};exports.actions=r,exports.alignCenter=i,exports.alignStart=t,exports.body=u,exports.container=n,exports.content=l,exports.default=d,exports.description=c,exports.icon=o,exports.root=e,exports.sm=a,exports.title=s;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/_internal/status-content.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_a7t1s_3", t = "_alignStart_a7t1s_11", n = "_container_a7t1s_15", r = "_actions_a7t1s_18", i = "_alignCenter_a7t1s_21", a = "_sm_a7t1s_35", o = "_icon_a7t1s_44", s = "_title_a7t1s_52", c = "_description_a7t1s_55", l = "_content_a7t1s_66", u = "_body_a7t1s_103", d = {
|
|
4
4
|
root: e,
|
|
5
|
-
|
|
5
|
+
alignStart: t,
|
|
6
6
|
container: n,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
actions: r,
|
|
8
|
+
alignCenter: i,
|
|
9
|
+
sm: a,
|
|
10
|
+
icon: o,
|
|
11
|
+
title: s,
|
|
12
|
+
description: c,
|
|
13
|
+
content: l,
|
|
14
|
+
body: u
|
|
13
15
|
};
|
|
14
16
|
//#endregion
|
|
15
|
-
export {
|
|
17
|
+
export { r as actions, i as alignCenter, t as alignStart, u as body, n as container, l as content, d as default, c as description, o as icon, e as root, a as sm, s as title };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../utilities/warn-unstyled-value.cjs"),r=require("./styled-values.cjs"),i=require("./card.module.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=a.default.forwardRef(({asChild:e=!1,variant:a=`
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../utilities/warn-unstyled-value.cjs"),r=require("./styled-values.cjs"),i=require("./card.module.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=a.default.forwardRef(({asChild:e=!1,variant:a=`outline`,padding:c=`md`,radius:l=`lg`,interactive:u=!1,className:d,children:f,...p},m)=>{let h=e?t.Root:`div`;return r.CARD_STYLED_PADDING.includes(c)||n.warnUnstyledValue(`Card`,`padding`,c,r.CARD_STYLED_PADDING),r.CARD_STYLED_RADIUS.includes(l)||n.warnUnstyledValue(`Card`,`radius`,l,r.CARD_STYLED_RADIUS),(0,s.jsx)(h,{ref:m,className:(0,o.default)(`wim-card`,i.default.root,i.default[a],i.default[`padding-${c}`],i.default[`radius-${l}`],u&&i.default.interactive,d),...p,children:f})});c.displayName=`Card`;var l=({className:e,children:t,...n})=>(0,s.jsx)(`div`,{className:(0,o.default)(i.default.header,e),...n,children:t}),u=({className:e,children:t,...n})=>(0,s.jsx)(`div`,{className:(0,o.default)(i.default.body,e),...n,children:t}),d=({className:e,children:t,...n})=>(0,s.jsx)(`div`,{className:(0,o.default)(i.default.footer,e),...n,children:t});l.displayName=`Card.Header`,u.displayName=`Card.Body`,d.displayName=`Card.Footer`,c.Header=l,c.Body=u,c.Footer=d,exports.Card=c,exports.default=c,exports.CardBody=u,exports.CardFooter=d,exports.CardHeader=l;
|
|
@@ -6,7 +6,7 @@ import i from "./card.module.js";
|
|
|
6
6
|
import a from "react";
|
|
7
7
|
import o from "classnames";
|
|
8
8
|
import { jsx as s } from "react/jsx-runtime";
|
|
9
|
-
var c = a.forwardRef(({ asChild: a = !1, variant: c = "
|
|
9
|
+
var c = a.forwardRef(({ asChild: a = !1, variant: c = "outline", padding: l = "md", radius: u = "lg", interactive: d = !1, className: f, children: p, ...m }, h) => {
|
|
10
10
|
let g = a ? e : "div";
|
|
11
11
|
return n.includes(l) || t("Card", "padding", l, n), r.includes(u) || t("Card", "radius", u, r), /* @__PURE__ */ s(g, {
|
|
12
12
|
ref: h,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../icon/chevron-left.cjs"),r=require("../../../icon/chevron-right.cjs"),i=require("../../media/Icon/Icon.cjs"),a=require("./carousel.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l={slideLabel:e=>`Slide ${e}`,prevSlide:`Previous slide`,nextSlide:`Next slide`,goToSlide:e=>`Go to slide ${e}`},u=(e,t)=>typeof e==`number`?e:e?t>=1280&&e.xl?e.xl:t>=1024&&e.lg?e.lg:t>=768&&e.md?e.md:t>=640&&e.sm?e.sm:e.base||1:1,d=(0,o.forwardRef)(({children:e,autoPlay:d=!1,interval:f=5e3,showIndicators:p=!0,showControls:m=!0,loop:
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../icon/chevron-left.cjs"),r=require("../../../icon/chevron-right.cjs"),i=require("../../media/Icon/Icon.cjs"),a=require("./carousel.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l={slideLabel:e=>`Slide ${e}`,prevSlide:`Previous slide`,nextSlide:`Next slide`,goToSlide:e=>`Go to slide ${e}`},u=(e,t)=>typeof e==`number`?e:e?t>=1280&&e.xl?e.xl:t>=1024&&e.lg?e.lg:t>=768&&e.md?e.md:t>=640&&e.sm?e.sm:e.base||1:1,d=(0,o.forwardRef)(({children:e,autoPlay:d=!1,interval:f=5e3,showIndicators:p=!0,showControls:m=!0,controlsPlacement:h=`overlay`,loop:g=!0,slidesToShow:_=1,aspectRatio:v,objectFit:y=`cover`,labels:b,className:x,asChild:S,...C},w)=>{let T=S?t.Root:`div`,E={...l,...b},D=(0,o.useMemo)(()=>o.default.Children.toArray(e),[e]),O=D.length,[k,A]=(0,o.useState)(typeof window<`u`?window.innerWidth:0),[j,M]=(0,o.useState)(g?O:0),[N,P]=(0,o.useState)(!1),[F,I]=(0,o.useState)(!1),L=u(_,k),R=(0,o.useRef)(null),z=(0,o.useRef)(null),B=(0,o.useRef)(null),V=(0,o.useRef)(null);(0,o.useEffect)(()=>{let e=()=>A(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let H=(0,o.useMemo)(()=>!g||O===0?D:[...D,...D,...D],[D,g,O]),U=(0,o.useCallback)(()=>{if(!N){if(!g){M(e=>Math.min(e+1,O-L));return}P(!0),M(e=>e+1)}},[N,g,O,L]),W=(0,o.useCallback)(()=>{if(!N){if(!g){M(e=>Math.max(e-1,0));return}P(!0),M(e=>e-1)}},[N,g]),G=e=>{N||(g?(P(!0),M(e+O)):M(e))},K=()=>{g&&(P(!1),j>=O*2?M(j-O):j<O&&M(j+O))};(0,o.useEffect)(()=>(d&&!F&&O>L&&(R.current=window.setInterval(U,f)),()=>{R.current&&window.clearInterval(R.current)}),[d,f,U,O,L,F]);let q=e=>{e.key===`ArrowLeft`?W():e.key===`ArrowRight`&&U()},J=e=>{B.current=e.targetTouches[0].clientX},Y=e=>{V.current=e.targetTouches[0].clientX},X=()=>{if(!B.current||!V.current)return;let e=B.current-V.current;e>50?U():e<-50&&W(),B.current=null,V.current=null};if(O===0)return null;let Z=100/L,Q=-j*Z;return(0,c.jsxs)(T,{ref:w,className:(0,s.default)(`wim-carousel`,a.default.root,h===`outside`&&a.default.controlsOutside,x),onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),onFocus:()=>I(!0),onBlur:()=>I(!1),onKeyDown:q,tabIndex:0,role:`region`,"aria-roledescription":`carousel`,...C,children:[(0,c.jsx)(`div`,{className:a.default.viewport,children:(0,c.jsx)(`div`,{ref:z,className:(0,s.default)(a.default.track,N&&a.default.transition),style:{transform:`translateX(${Q}%)`},onTransitionEnd:K,onTouchStart:J,onTouchMove:Y,onTouchEnd:X,children:H.map((e,t)=>(0,c.jsx)(`div`,{className:(0,s.default)(a.default.item,v&&a.default.hasAspectRatio),style:{flex:`0 0 ${Z}%`,width:`${Z}%`,...v?{aspectRatio:v,"--wim-carousel-object-fit":y}:{}},role:`group`,"aria-roledescription":`slide`,"aria-label":E.slideLabel(t%O+1),children:e},t))})}),m&&O>L&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`button`,{className:(0,s.default)(a.default.control,a.default.prev),onClick:W,"aria-label":E.prevSlide,disabled:!g&&j===0,tabIndex:-1,children:(0,c.jsx)(i.Icon,{component:n.default,size:`md`})}),(0,c.jsx)(`button`,{className:(0,s.default)(a.default.control,a.default.next),onClick:U,"aria-label":E.nextSlide,disabled:!g&&j>=O-L,tabIndex:-1,children:(0,c.jsx)(i.Icon,{component:r.default,size:`md`})})]}),p&&O>1&&(0,c.jsx)(`div`,{className:a.default.indicators,children:D.map((e,t)=>{let n=g?j%O===t:j===t;return(0,c.jsx)(`button`,{className:(0,s.default)(a.default.indicator,n&&a.default.active),onClick:()=>G(t),"aria-label":E.goToSlide(t+1),"aria-current":n?`true`:`false`},t)})})]})});d.displayName=`Carousel`,exports.Carousel=d;
|
|
@@ -23,6 +23,12 @@ export type CarouselProps = {
|
|
|
23
23
|
showIndicators?: boolean;
|
|
24
24
|
/** Whether to show the previous/next buttons */
|
|
25
25
|
showControls?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Where the arrows and indicators sit. `overlay` (default) places them on top of the
|
|
28
|
+
* slide, which suits full-bleed images. `outside` moves the arrows beside the viewport
|
|
29
|
+
* and the indicators below it, so they never cover a slide made of text.
|
|
30
|
+
*/
|
|
31
|
+
controlsPlacement?: "overlay" | "outside";
|
|
26
32
|
/** Whether to loop infinitely (seamless transitions) */
|
|
27
33
|
loop?: boolean;
|
|
28
34
|
/** Number of slides to show at once. A number or an object per breakpoint. */
|
|
@@ -6,148 +6,148 @@ import { Icon as r } from "../../media/Icon/Icon.js";
|
|
|
6
6
|
import i from "./carousel.module.js";
|
|
7
7
|
import a, { forwardRef as o, useCallback as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
8
8
|
import f from "classnames";
|
|
9
|
-
import { Fragment as
|
|
9
|
+
import { Fragment as ee, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
10
|
//#region src/components/data-display/Carousel/Carousel.tsx
|
|
11
|
-
var
|
|
11
|
+
var h = {
|
|
12
12
|
slideLabel: (e) => `Slide ${e}`,
|
|
13
13
|
prevSlide: "Previous slide",
|
|
14
14
|
nextSlide: "Next slide",
|
|
15
15
|
goToSlide: (e) => `Go to slide ${e}`
|
|
16
|
-
},
|
|
17
|
-
let
|
|
18
|
-
...
|
|
19
|
-
...
|
|
20
|
-
},
|
|
16
|
+
}, g = (e, t) => typeof e == "number" ? e : e ? t >= 1280 && e.xl ? e.xl : t >= 1024 && e.lg ? e.lg : t >= 768 && e.md ? e.md : t >= 640 && e.sm ? e.sm : e.base || 1 : 1, _ = o(({ children: o, autoPlay: _ = !1, interval: v = 5e3, showIndicators: y = !0, showControls: b = !0, controlsPlacement: x = "overlay", loop: S = !0, slidesToShow: C = 1, aspectRatio: w, objectFit: T = "cover", labels: E, className: D, asChild: O, ...k }, A) => {
|
|
17
|
+
let j = O ? e : "div", M = {
|
|
18
|
+
...h,
|
|
19
|
+
...E
|
|
20
|
+
}, N = l(() => a.Children.toArray(o), [o]), P = N.length, [F, I] = d(typeof window < "u" ? window.innerWidth : 0), [L, R] = d(S ? P : 0), [z, B] = d(!1), [V, H] = d(!1), U = g(C, F), W = u(null), G = u(null), K = u(null), q = u(null);
|
|
21
21
|
c(() => {
|
|
22
|
-
let e = () =>
|
|
22
|
+
let e = () => I(window.innerWidth);
|
|
23
23
|
return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
24
24
|
}, []);
|
|
25
|
-
let
|
|
26
|
-
...
|
|
27
|
-
...
|
|
28
|
-
...
|
|
25
|
+
let J = l(() => !S || P === 0 ? N : [
|
|
26
|
+
...N,
|
|
27
|
+
...N,
|
|
28
|
+
...N
|
|
29
29
|
], [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
]),
|
|
34
|
-
if (!
|
|
35
|
-
if (!
|
|
36
|
-
|
|
30
|
+
N,
|
|
31
|
+
S,
|
|
32
|
+
P
|
|
33
|
+
]), Y = s(() => {
|
|
34
|
+
if (!z) {
|
|
35
|
+
if (!S) {
|
|
36
|
+
R((e) => Math.min(e + 1, P - U));
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
B(!0), R((e) => e + 1);
|
|
40
40
|
}
|
|
41
41
|
}, [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
]),
|
|
47
|
-
if (!
|
|
48
|
-
if (!
|
|
49
|
-
|
|
42
|
+
z,
|
|
43
|
+
S,
|
|
44
|
+
P,
|
|
45
|
+
U
|
|
46
|
+
]), X = s(() => {
|
|
47
|
+
if (!z) {
|
|
48
|
+
if (!S) {
|
|
49
|
+
R((e) => Math.max(e - 1, 0));
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
B(!0), R((e) => e - 1);
|
|
53
53
|
}
|
|
54
|
-
}, [
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
|
|
54
|
+
}, [z, S]), Z = (e) => {
|
|
55
|
+
z || (S ? (B(!0), R(e + P)) : R(e));
|
|
56
|
+
}, Q = () => {
|
|
57
|
+
S && (B(!1), L >= P * 2 ? R(L - P) : L < P && R(L + P));
|
|
58
58
|
};
|
|
59
|
-
c(() => (
|
|
60
|
-
|
|
59
|
+
c(() => (_ && !V && P > U && (W.current = window.setInterval(Y, v)), () => {
|
|
60
|
+
W.current && window.clearInterval(W.current);
|
|
61
61
|
}), [
|
|
62
|
+
_,
|
|
62
63
|
v,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
B
|
|
64
|
+
Y,
|
|
65
|
+
P,
|
|
66
|
+
U,
|
|
67
|
+
V
|
|
68
68
|
]);
|
|
69
|
-
let
|
|
70
|
-
e.key === "ArrowLeft" ?
|
|
71
|
-
}, te = (e) => {
|
|
72
|
-
G.current = e.targetTouches[0].clientX;
|
|
69
|
+
let te = (e) => {
|
|
70
|
+
e.key === "ArrowLeft" ? X() : e.key === "ArrowRight" && Y();
|
|
73
71
|
}, ne = (e) => {
|
|
74
72
|
K.current = e.targetTouches[0].clientX;
|
|
75
|
-
}, re = () => {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
}, re = (e) => {
|
|
74
|
+
q.current = e.targetTouches[0].clientX;
|
|
75
|
+
}, ie = () => {
|
|
76
|
+
if (!K.current || !q.current) return;
|
|
77
|
+
let e = K.current - q.current;
|
|
78
|
+
e > 50 ? Y() : e < -50 && X(), K.current = null, q.current = null;
|
|
79
79
|
};
|
|
80
|
-
if (
|
|
81
|
-
let $ = 100 /
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
-
ref:
|
|
84
|
-
className: f("wim-carousel", i.root,
|
|
85
|
-
onMouseEnter: () =>
|
|
86
|
-
onMouseLeave: () =>
|
|
87
|
-
onFocus: () =>
|
|
88
|
-
onBlur: () =>
|
|
89
|
-
onKeyDown:
|
|
80
|
+
if (P === 0) return null;
|
|
81
|
+
let $ = 100 / U, ae = -L * $;
|
|
82
|
+
return /* @__PURE__ */ m(j, {
|
|
83
|
+
ref: A,
|
|
84
|
+
className: f("wim-carousel", i.root, x === "outside" && i.controlsOutside, D),
|
|
85
|
+
onMouseEnter: () => H(!0),
|
|
86
|
+
onMouseLeave: () => H(!1),
|
|
87
|
+
onFocus: () => H(!0),
|
|
88
|
+
onBlur: () => H(!1),
|
|
89
|
+
onKeyDown: te,
|
|
90
90
|
tabIndex: 0,
|
|
91
91
|
role: "region",
|
|
92
92
|
"aria-roledescription": "carousel",
|
|
93
|
-
...
|
|
93
|
+
...k,
|
|
94
94
|
children: [
|
|
95
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ p("div", {
|
|
96
96
|
className: i.viewport,
|
|
97
|
-
children: /* @__PURE__ */
|
|
98
|
-
ref:
|
|
99
|
-
className: f(i.track,
|
|
100
|
-
style: { transform: `translateX(${
|
|
101
|
-
onTransitionEnd:
|
|
102
|
-
onTouchStart:
|
|
103
|
-
onTouchMove:
|
|
104
|
-
onTouchEnd:
|
|
105
|
-
children:
|
|
106
|
-
className: f(i.item,
|
|
97
|
+
children: /* @__PURE__ */ p("div", {
|
|
98
|
+
ref: G,
|
|
99
|
+
className: f(i.track, z && i.transition),
|
|
100
|
+
style: { transform: `translateX(${ae}%)` },
|
|
101
|
+
onTransitionEnd: Q,
|
|
102
|
+
onTouchStart: ne,
|
|
103
|
+
onTouchMove: re,
|
|
104
|
+
onTouchEnd: ie,
|
|
105
|
+
children: J.map((e, t) => /* @__PURE__ */ p("div", {
|
|
106
|
+
className: f(i.item, w && i.hasAspectRatio),
|
|
107
107
|
style: {
|
|
108
108
|
flex: `0 0 ${$}%`,
|
|
109
109
|
width: `${$}%`,
|
|
110
|
-
...
|
|
111
|
-
aspectRatio:
|
|
112
|
-
"--wim-carousel-object-fit":
|
|
110
|
+
...w ? {
|
|
111
|
+
aspectRatio: w,
|
|
112
|
+
"--wim-carousel-object-fit": T
|
|
113
113
|
} : {}
|
|
114
114
|
},
|
|
115
115
|
role: "group",
|
|
116
116
|
"aria-roledescription": "slide",
|
|
117
|
-
"aria-label":
|
|
117
|
+
"aria-label": M.slideLabel(t % P + 1),
|
|
118
118
|
children: e
|
|
119
119
|
}, t))
|
|
120
120
|
})
|
|
121
121
|
}),
|
|
122
|
-
|
|
122
|
+
b && P > U && /* @__PURE__ */ m(ee, { children: [/* @__PURE__ */ p("button", {
|
|
123
123
|
className: f(i.control, i.prev),
|
|
124
|
-
onClick:
|
|
125
|
-
"aria-label":
|
|
126
|
-
disabled: !
|
|
124
|
+
onClick: X,
|
|
125
|
+
"aria-label": M.prevSlide,
|
|
126
|
+
disabled: !S && L === 0,
|
|
127
127
|
tabIndex: -1,
|
|
128
|
-
children: /* @__PURE__ */
|
|
128
|
+
children: /* @__PURE__ */ p(r, {
|
|
129
129
|
component: t,
|
|
130
130
|
size: "md"
|
|
131
131
|
})
|
|
132
|
-
}), /* @__PURE__ */
|
|
132
|
+
}), /* @__PURE__ */ p("button", {
|
|
133
133
|
className: f(i.control, i.next),
|
|
134
|
-
onClick:
|
|
135
|
-
"aria-label":
|
|
136
|
-
disabled: !
|
|
134
|
+
onClick: Y,
|
|
135
|
+
"aria-label": M.nextSlide,
|
|
136
|
+
disabled: !S && L >= P - U,
|
|
137
137
|
tabIndex: -1,
|
|
138
|
-
children: /* @__PURE__ */
|
|
138
|
+
children: /* @__PURE__ */ p(r, {
|
|
139
139
|
component: n,
|
|
140
140
|
size: "md"
|
|
141
141
|
})
|
|
142
142
|
})] }),
|
|
143
|
-
|
|
143
|
+
y && P > 1 && /* @__PURE__ */ p("div", {
|
|
144
144
|
className: i.indicators,
|
|
145
|
-
children:
|
|
146
|
-
let n =
|
|
147
|
-
return /* @__PURE__ */
|
|
145
|
+
children: N.map((e, t) => {
|
|
146
|
+
let n = S ? L % P === t : L === t;
|
|
147
|
+
return /* @__PURE__ */ p("button", {
|
|
148
148
|
className: f(i.indicator, n && i.active),
|
|
149
|
-
onClick: () =>
|
|
150
|
-
"aria-label":
|
|
149
|
+
onClick: () => Z(t),
|
|
150
|
+
"aria-label": M.goToSlide(t + 1),
|
|
151
151
|
"aria-current": n ? "true" : "false"
|
|
152
152
|
}, t);
|
|
153
153
|
})
|
|
@@ -155,6 +155,6 @@ var g = {
|
|
|
155
155
|
]
|
|
156
156
|
});
|
|
157
157
|
});
|
|
158
|
-
|
|
158
|
+
_.displayName = "Carousel";
|
|
159
159
|
//#endregion
|
|
160
|
-
export {
|
|
160
|
+
export { _ as Carousel };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_lyyrv_3`,t=`_controlsOutside_lyyrv_15`,n=`_viewport_lyyrv_21`,r=`_control_lyyrv_15`,i=`_prev_lyyrv_45`,a=`_next_lyyrv_48`,o=`_indicators_lyyrv_51`,s=`_indicator_lyyrv_51`,c=`_track_lyyrv_66`,l=`_transition_lyyrv_70`,u=`_item_lyyrv_73`,d=`_hasAspectRatio_lyyrv_78`,f=`_active_lyyrv_154`,p={root:e,controlsOutside:t,viewport:n,control:r,prev:i,next:a,indicators:o,indicator:s,track:c,transition:l,item:u,hasAspectRatio:d,active:f};exports.active=f,exports.control=r,exports.controlsOutside=t,exports.default=p,exports.hasAspectRatio=d,exports.indicator=s,exports.indicators=o,exports.item=u,exports.next=a,exports.prev=i,exports.root=e,exports.track=c,exports.transition=l,exports.viewport=n;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/data-display/Carousel/carousel.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_lyyrv_3", t = "_controlsOutside_lyyrv_15", n = "_viewport_lyyrv_21", r = "_control_lyyrv_15", i = "_prev_lyyrv_45", a = "_next_lyyrv_48", o = "_indicators_lyyrv_51", s = "_indicator_lyyrv_51", c = "_track_lyyrv_66", l = "_transition_lyyrv_70", u = "_item_lyyrv_73", d = "_hasAspectRatio_lyyrv_78", f = "_active_lyyrv_154", p = {
|
|
4
4
|
root: e,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
controlsOutside: t,
|
|
6
|
+
viewport: n,
|
|
7
|
+
control: r,
|
|
8
|
+
prev: i,
|
|
9
|
+
next: a,
|
|
10
|
+
indicators: o,
|
|
11
|
+
indicator: s,
|
|
12
|
+
track: c,
|
|
13
|
+
transition: l,
|
|
14
|
+
item: u,
|
|
15
|
+
hasAspectRatio: d,
|
|
16
|
+
active: f
|
|
16
17
|
};
|
|
17
18
|
//#endregion
|
|
18
|
-
export {
|
|
19
|
+
export { f as active, r as control, t as controlsOutside, p as default, d as hasAspectRatio, s as indicator, o as indicators, u as item, a as next, i as prev, e as root, c as track, l as transition, n as viewport };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../../icon/close.cjs"),i=require("../../media/Icon/Icon.cjs"),a=require("../../_internal/mergeRefs.cjs"),o=require("./chip.module.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime");var u=s.default.forwardRef(({asChild:e=!1,children:s,content:u,onClick:d,onDelete:f,avatar:p,icon:m,selected:h=!1,disabled:g=!1,intent:_=`
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../../icon/close.cjs"),i=require("../../media/Icon/Icon.cjs"),a=require("../../_internal/mergeRefs.cjs"),o=require("./chip.module.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime");var u=s.default.forwardRef(({asChild:e=!1,children:s,content:u,onClick:d,onDelete:f,avatar:p,icon:m,selected:h=!1,disabled:g=!1,intent:_=`neutral`,variant:v=`solid`,size:y=`md`,deleteAriaLabel:b,className:x,...S},C)=>{let{t:w}=n.useWimTranslation(`common`),T=b??w(`a11y.delete`);if(e&&f)throw Error("[wimui] Chip: `asChild` cannot be combined with `onDelete`. Use a removable Chip without asChild, or put the delete control on the slotted child yourself.");let E=e?t.Root:d?`button`:`span`,D=u??s;return(0,l.jsxs)(E,{ref:a.mergeRefs(C),className:(0,c.default)(`wim-chip`,o.default.root,o.default[_],o.default[v],o.default[y],h&&o.default.selected,d&&!g&&o.default.clickable,g&&o.default.disabled,x),onClick:g?void 0:d,...!e&&d?{disabled:g}:{},type:e?void 0:d?`button`:void 0,...S,children:[p&&(0,l.jsx)(`span`,{className:o.default.avatar,children:p}),!p&&m&&(0,l.jsx)(`span`,{className:o.default.icon,children:m}),e?(0,l.jsx)(t.Slottable,{children:D}):(0,l.jsx)(`span`,{className:o.default.label,children:D}),f&&!g&&(0,l.jsx)(`button`,{type:`button`,className:o.default.delete,"data-chip-delete":!0,onClick:e=>{e.stopPropagation(),f(e)},"aria-label":T,children:(0,l.jsx)(i.Icon,{component:r.default,size:`sm`})})]})});u.displayName=`Chip`,exports.Chip=u;
|
|
@@ -9,7 +9,7 @@ import s from "react";
|
|
|
9
9
|
import c from "classnames";
|
|
10
10
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
11
11
|
//#region src/components/data-display/Chip/Chip.tsx
|
|
12
|
-
var d = s.forwardRef(({ asChild: s = !1, children: d, content: f, onClick: p, onDelete: m, avatar: h, icon: g, selected: _ = !1, disabled: v = !1, intent: y = "
|
|
12
|
+
var d = s.forwardRef(({ asChild: s = !1, children: d, content: f, onClick: p, onDelete: m, avatar: h, icon: g, selected: _ = !1, disabled: v = !1, intent: y = "neutral", variant: b = "solid", size: x = "md", deleteAriaLabel: S, className: C, ...w }, T) => {
|
|
13
13
|
let { t: E } = n("common"), D = S ?? E("a11y.delete");
|
|
14
14
|
if (s && m) throw Error("[wimui] Chip: `asChild` cannot be combined with `onDelete`. Use a removable Chip without asChild, or put the delete control on the slotted child yourself.");
|
|
15
15
|
let O = s ? e : p ? "button" : "span", k = f ?? d;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../_internal/StatusContent.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("classnames");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=({title:e,description:n,icon:a,extra:o,className:
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../_internal/StatusContent.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("classnames");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=({title:e,description:n,icon:a,extra:o,align:s=`start`,className:c,...l})=>(0,i.jsx)(t.StatusContent,{title:e,description:n,icon:a,actions:o,align:s,className:(0,r.default)(`wim-empty-state`,c),...l});exports.EmptyState=a;
|