wimui 0.9.0 → 0.11.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/dist/components/_internal/FieldCharacterCount/field-character-count.module.cjs +1 -1
- package/dist/components/_internal/FieldCharacterCount/field-character-count.module.js +1 -1
- package/dist/components/_internal/accessibleName.cjs +2 -0
- package/dist/components/_internal/accessibleName.d.ts +54 -0
- package/dist/components/_internal/accessibleName.js +7 -0
- package/dist/components/_internal/useIndicator.cjs +1 -1
- package/dist/components/_internal/useIndicator.d.ts +16 -1
- package/dist/components/_internal/useIndicator.js +15 -12
- package/dist/components/ai/CodeBlock/code-block.module.cjs +1 -1
- package/dist/components/ai/CodeBlock/code-block.module.js +1 -1
- package/dist/components/ai/CodeDiffViewer/code-diff-viewer.module.cjs +1 -1
- package/dist/components/ai/CodeDiffViewer/code-diff-viewer.module.js +2 -2
- package/dist/components/ai/MarkdownRenderer/markdown-renderer.module.cjs +1 -1
- package/dist/components/ai/MarkdownRenderer/markdown-renderer.module.js +1 -1
- package/dist/components/ai/StreamingText/streaming-text.module.cjs +1 -1
- package/dist/components/ai/StreamingText/streaming-text.module.js +1 -1
- package/dist/components/ai/Terminal/terminal.module.cjs +1 -1
- package/dist/components/ai/Terminal/terminal.module.js +1 -1
- package/dist/components/data-display/Badge/badge.module.cjs +1 -1
- package/dist/components/data-display/Badge/badge.module.js +1 -1
- package/dist/components/data-display/Calendar/calendar.module.cjs +1 -1
- package/dist/components/data-display/Calendar/calendar.module.js +1 -1
- package/dist/components/data-display/Chip/chip.module.cjs +1 -1
- package/dist/components/data-display/Chip/chip.module.js +2 -2
- package/dist/components/data-display/JsonViewer/json-viewer.module.cjs +1 -1
- package/dist/components/data-display/JsonViewer/json-viewer.module.js +3 -3
- package/dist/components/data-display/Markdown/markdown.module.cjs +1 -1
- package/dist/components/data-display/Markdown/markdown.module.js +1 -1
- package/dist/components/data-display/PullToRefresh/PullToRefresh.cjs +1 -1
- package/dist/components/data-display/PullToRefresh/PullToRefresh.js +22 -20
- package/dist/components/data-display/Stats/stats.module.cjs +1 -1
- package/dist/components/data-display/Stats/stats.module.js +1 -1
- package/dist/components/data-display/Tag/tag.module.cjs +1 -1
- package/dist/components/data-display/Tag/tag.module.js +1 -1
- package/dist/components/data-display/TreeView/tree-view.module.cjs +1 -1
- package/dist/components/data-display/TreeView/tree-view.module.js +2 -2
- package/dist/components/feedback/Alert/alert.module.cjs +1 -1
- package/dist/components/feedback/Alert/alert.module.js +2 -2
- package/dist/components/feedback/ErrorBoundary/errorboundary.module.cjs +1 -1
- package/dist/components/feedback/ErrorBoundary/errorboundary.module.js +1 -1
- package/dist/components/feedback/Notification/notification.module.cjs +1 -1
- package/dist/components/feedback/Notification/notification.module.js +2 -2
- package/dist/components/feedback/Progress/Progress.cjs +1 -1
- package/dist/components/feedback/Progress/Progress.d.ts +15 -6
- package/dist/components/feedback/Progress/Progress.js +29 -28
- package/dist/components/feedback/ProgressRing/ProgressRing.cjs +2 -0
- package/dist/components/feedback/ProgressRing/ProgressRing.d.ts +57 -0
- package/dist/components/feedback/ProgressRing/ProgressRing.js +51 -0
- package/dist/components/feedback/ProgressRing/progress-ring.module.cjs +2 -0
- package/dist/components/feedback/ProgressRing/progress-ring.module.js +25 -0
- package/dist/components/feedback/Result/Result.cjs +1 -1
- package/dist/components/feedback/Result/Result.d.ts +11 -1
- package/dist/components/feedback/Result/Result.js +3 -3
- package/dist/components/feedback/Result/result.module.cjs +1 -1
- package/dist/components/feedback/Result/result.module.js +8 -3
- package/dist/components/form/Cascader/cascader.module.cjs +1 -1
- package/dist/components/form/Cascader/cascader.module.js +6 -6
- package/dist/components/form/SignaturePad/signature-pad.module.cjs +1 -1
- package/dist/components/form/SignaturePad/signature-pad.module.js +6 -6
- package/dist/components/form/SplitButton/SplitButton.cjs +2 -0
- package/dist/components/form/SplitButton/SplitButton.d.ts +78 -0
- package/dist/components/form/SplitButton/SplitButton.js +48 -0
- package/dist/components/form/SplitButton/split-button.module.cjs +2 -0
- package/dist/components/form/SplitButton/split-button.module.js +11 -0
- package/dist/components/form/Transfer/transfer.module.cjs +1 -1
- package/dist/components/form/Transfer/transfer.module.js +6 -6
- package/dist/components/form/TreeSelect/tree-select.module.cjs +1 -1
- package/dist/components/form/TreeSelect/tree-select.module.js +6 -6
- package/dist/components/typography/Code/code.module.cjs +1 -1
- package/dist/components/typography/Code/code.module.js +1 -1
- package/dist/components/typography/Text/Text.cjs +1 -1
- package/dist/components/typography/Text/Text.d.ts +24 -0
- package/dist/components/typography/Text/Text.js +13 -12
- package/dist/components/typography/Text/text.module.cjs +1 -1
- package/dist/components/typography/Text/text.module.js +11 -10
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.d.ts +1 -0
- package/dist/feedback.js +2 -1
- package/dist/form.cjs +1 -1
- package/dist/form.d.ts +1 -0
- package/dist/form.js +2 -1
- package/dist/i18n/generated/keys.d.ts +1 -1
- package/dist/icon/grid.cjs +2 -0
- package/dist/icon/grid.js +72 -0
- package/dist/icon/index.cjs +1 -1
- package/dist/icon/index.d.ts +5 -1
- package/dist/icon/index.js +98 -94
- package/dist/icon/menu.cjs +2 -0
- package/dist/icon/menu.js +36 -0
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +51 -49
- package/dist/index.cjs +1 -1
- package/dist/index.js +218 -214
- package/dist/llms-full.txt +76 -54
- package/dist/llms.txt +50 -41
- package/dist/locales/en/components.json +3 -1
- package/dist/locales/ja/components.json +3 -1
- package/dist/locales/pt/components.json +3 -1
- package/dist/overlay.cjs +1 -1
- package/dist/overlay.js +4 -4
- package/dist/reset.css +1 -1
- package/dist/styles.css +2 -2
- package/dist/types/generated-tokens.d.ts +1 -1
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +5 -5
- package/package.json +32 -5
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/feedback/Alert/alert.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_1ntqy_3", t = "_icon_1ntqy_16", n = "_content_1ntqy_23", r = "_title_1ntqy_29", i = "_description_1ntqy_36", a = "_close_1ntqy_46", o = "_info_1ntqy_84", s = "_success_1ntqy_92", c = "_warning_1ntqy_100", l = "_danger_1ntqy_108", u = {
|
|
4
4
|
root: e,
|
|
5
5
|
icon: t,
|
|
6
6
|
content: n,
|
|
7
7
|
title: r,
|
|
8
8
|
description: i,
|
|
9
9
|
close: a,
|
|
10
|
-
default: "
|
|
10
|
+
default: "_default_1ntqy_77",
|
|
11
11
|
info: o,
|
|
12
12
|
success: s,
|
|
13
13
|
warning: c,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_fallback_1q679_29`,t=`_details_1q679_32`,n={fallback:e,details:t};exports.default=n,exports.details=t,exports.fallback=e;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_cup02_2`,t=`_content_cup02_13`,n=`_icon_cup02_18`,r=`_messageContainer_cup02_21`,i=`_title_cup02_27`,a=`_description_cup02_34`,o=`_close_cup02_39`,s=`_success_cup02_58`,c=`_info_cup02_61`,l=`_warning_cup02_64`,u=`_danger_cup02_67`,d=`_container_cup02_70`,f=`_topRight_cup02_81`,p=`_topLeft_cup02_85`,m=`_bottomRight_cup02_89`,h=`_bottomLeft_cup02_93`,g={root:e,content:t,icon:n,messageContainer:r,title:i,description:a,close:o,default:`_default_cup02_55`,success:s,info:c,warning:l,danger:u,container:d,topRight:f,topLeft:p,bottomRight:m,bottomLeft:h};exports.bottomLeft=h,exports.bottomRight=m,exports.close=o,exports.container=d,exports.content=t,exports.danger=u,exports.default=g,exports.description=a,exports.icon=n,exports.info=c,exports.messageContainer=r,exports.root=e,exports.success=s,exports.title=i,exports.topLeft=p,exports.topRight=f,exports.warning=l;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/feedback/Notification/notification.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_cup02_2", t = "_content_cup02_13", n = "_icon_cup02_18", r = "_messageContainer_cup02_21", i = "_title_cup02_27", a = "_description_cup02_34", o = "_close_cup02_39", s = "_success_cup02_58", c = "_info_cup02_61", l = "_warning_cup02_64", u = "_danger_cup02_67", d = "_container_cup02_70", f = "_topRight_cup02_81", p = "_topLeft_cup02_85", m = "_bottomRight_cup02_89", h = "_bottomLeft_cup02_93", g = {
|
|
4
4
|
root: e,
|
|
5
5
|
content: t,
|
|
6
6
|
icon: n,
|
|
@@ -8,7 +8,7 @@ var e = "_root_1g51c_2", t = "_content_1g51c_14", n = "_icon_1g51c_19", r = "_me
|
|
|
8
8
|
title: i,
|
|
9
9
|
description: a,
|
|
10
10
|
close: o,
|
|
11
|
-
default: "
|
|
11
|
+
default: "_default_cup02_55",
|
|
12
12
|
success: s,
|
|
13
13
|
info: c,
|
|
14
14
|
warning: l,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../_internal/mergeRefs.cjs"),n=require("./progress.module.cjs");let
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../_internal/mergeRefs.cjs"),n=require("../../_internal/accessibleName.cjs"),r=require("./progress.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=i.default.forwardRef(({value:e=0,max:i=100,intent:s=`primary`,size:c=`md`,label:l,showValue:u=!1,indeterminate:d=!1,className:f,"aria-label":p,...m},h)=>{let g=Math.min(Math.max(e/i*100,0),100);return(0,o.jsxs)(`div`,{ref:t.mergeRefs(h),className:(0,a.default)(`wim-progress`,r.default.root,r.default[c],r.default[s],d&&r.default.indeterminate,f),role:`progressbar`,"aria-valuenow":d?void 0:e,"aria-valuemin":0,"aria-valuemax":i,"aria-label":n.resolveAriaLabel(l,p),...m,children:[(l||u)&&(0,o.jsxs)(`div`,{className:r.default.header,children:[l&&(0,o.jsx)(`span`,{className:r.default.label,children:l}),u&&!d&&(0,o.jsxs)(`span`,{className:r.default.value,children:[Math.round(g),`%`]})]}),(0,o.jsx)(`div`,{className:r.default.track,children:(0,o.jsx)(`div`,{className:r.default.bar,style:d?void 0:{"--wim-progress-width":`${g}%`}})})]})});s.displayName=`Progress`,exports.Progress=s;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ComponentSizeBasic, IndicatorIntent } from '../../../types/tokens';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
export declare const Progress: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
import { WithAccessibleName } from '../../_internal/accessibleName';
|
|
4
|
+
type ProgressOwnProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
7
5
|
/**
|
|
8
6
|
* Current value of the progress bar.
|
|
9
7
|
* @default 0
|
|
@@ -25,7 +23,12 @@ export declare const Progress: React.ForwardRefExoticComponent<Omit<React.Detail
|
|
|
25
23
|
*/
|
|
26
24
|
size?: ComponentSizeBasic;
|
|
27
25
|
/**
|
|
28
|
-
* Text label displayed above the bar.
|
|
26
|
+
* Text label displayed above the bar. Also used as the accessible name unless
|
|
27
|
+
* `aria-label` / `aria-labelledby` is given.
|
|
28
|
+
*
|
|
29
|
+
* A progress bar always carries `role="progressbar"`, and a progressbar with no
|
|
30
|
+
* accessible name is a WCAG failure (axe `aria-progressbar-name`, serious). The
|
|
31
|
+
* type therefore requires one of `label` / `aria-label` / `aria-labelledby`.
|
|
29
32
|
*/
|
|
30
33
|
label?: string;
|
|
31
34
|
/**
|
|
@@ -38,4 +41,10 @@ export declare const Progress: React.ForwardRefExoticComponent<Omit<React.Detail
|
|
|
38
41
|
* @default false
|
|
39
42
|
*/
|
|
40
43
|
indeterminate?: boolean;
|
|
41
|
-
}
|
|
44
|
+
};
|
|
45
|
+
export type ProgressProps = WithAccessibleName<ProgressOwnProps>;
|
|
46
|
+
/**
|
|
47
|
+
* Displays a progress bar.
|
|
48
|
+
*/
|
|
49
|
+
export declare const Progress: React.ForwardRefExoticComponent<ProgressProps & React.RefAttributes<HTMLDivElement>>;
|
|
50
|
+
export {};
|
|
@@ -1,39 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { mergeRefs as e } from "../../_internal/mergeRefs.js";
|
|
3
|
-
import t from "
|
|
4
|
-
import n from "
|
|
5
|
-
import r from "
|
|
6
|
-
import
|
|
3
|
+
import { resolveAriaLabel as t } from "../../_internal/accessibleName.js";
|
|
4
|
+
import n from "./progress.module.js";
|
|
5
|
+
import r from "react";
|
|
6
|
+
import i from "classnames";
|
|
7
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
8
|
//#region src/components/feedback/Progress/Progress.tsx
|
|
8
|
-
var
|
|
9
|
-
let
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
ref: e(
|
|
12
|
-
className:
|
|
9
|
+
var s = r.forwardRef(({ value: r = 0, max: s = 100, intent: c = "primary", size: l = "md", label: u, showValue: d = !1, indeterminate: f = !1, className: p, "aria-label": m, ...h }, g) => {
|
|
10
|
+
let _ = Math.min(Math.max(r / s * 100, 0), 100);
|
|
11
|
+
return /* @__PURE__ */ o("div", {
|
|
12
|
+
ref: e(g),
|
|
13
|
+
className: i("wim-progress", n.root, n[l], n[c], f && n.indeterminate, p),
|
|
13
14
|
role: "progressbar",
|
|
14
|
-
"aria-valuenow":
|
|
15
|
+
"aria-valuenow": f ? void 0 : r,
|
|
15
16
|
"aria-valuemin": 0,
|
|
16
|
-
"aria-valuemax":
|
|
17
|
-
"aria-label":
|
|
18
|
-
...
|
|
19
|
-
children: [(
|
|
20
|
-
className:
|
|
21
|
-
children: [
|
|
22
|
-
className:
|
|
23
|
-
children:
|
|
24
|
-
}),
|
|
25
|
-
className:
|
|
26
|
-
children: [Math.round(
|
|
17
|
+
"aria-valuemax": s,
|
|
18
|
+
"aria-label": t(u, m),
|
|
19
|
+
...h,
|
|
20
|
+
children: [(u || d) && /* @__PURE__ */ o("div", {
|
|
21
|
+
className: n.header,
|
|
22
|
+
children: [u && /* @__PURE__ */ a("span", {
|
|
23
|
+
className: n.label,
|
|
24
|
+
children: u
|
|
25
|
+
}), d && !f && /* @__PURE__ */ o("span", {
|
|
26
|
+
className: n.value,
|
|
27
|
+
children: [Math.round(_), "%"]
|
|
27
28
|
})]
|
|
28
|
-
}), /* @__PURE__ */
|
|
29
|
-
className:
|
|
30
|
-
children: /* @__PURE__ */
|
|
31
|
-
className:
|
|
32
|
-
style:
|
|
29
|
+
}), /* @__PURE__ */ a("div", {
|
|
30
|
+
className: n.track,
|
|
31
|
+
children: /* @__PURE__ */ a("div", {
|
|
32
|
+
className: n.bar,
|
|
33
|
+
style: f ? void 0 : { "--wim-progress-width": `${_}%` }
|
|
33
34
|
})
|
|
34
35
|
})]
|
|
35
36
|
});
|
|
36
37
|
});
|
|
37
|
-
|
|
38
|
+
s.displayName = "Progress";
|
|
38
39
|
//#endregion
|
|
39
|
-
export {
|
|
40
|
+
export { s as Progress };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../_internal/accessibleName.cjs"),n=require("./progress-ring.module.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("classnames");i=e.__toESM(i,1);let a=require("react/jsx-runtime");var o=r.default.forwardRef(({value:e=0,max:r=100,intent:o=`primary`,size:s=`md`,label:c,showValue:l=!1,indeterminate:u=!1,className:d,"aria-label":f,...p},m)=>{let h=Math.min(Math.max(e/r*100,0),100);return(0,a.jsxs)(`div`,{ref:m,className:(0,i.default)(`wim-progress-ring`,n.default.root,n.default[s],n.default[o],u&&n.default.indeterminate,d),role:`progressbar`,"aria-valuenow":u?void 0:e,"aria-valuemin":0,"aria-valuemax":r,"aria-label":t.resolveAriaLabel(c,f),...p,children:[(0,a.jsxs)(`div`,{className:n.default.ring,children:[(0,a.jsxs)(`svg`,{className:n.default.svg,viewBox:`0 0 100 100`,"aria-hidden":`true`,children:[(0,a.jsx)(`circle`,{className:n.default.track,cx:`50`,cy:`50`,r:`42`,pathLength:`100`}),(0,a.jsx)(`circle`,{className:n.default.indicator,cx:`50`,cy:`50`,r:`42`,pathLength:`100`,style:u?void 0:{"--wim-progress-ring-value":`${h}`}})]}),l&&!u&&(0,a.jsxs)(`span`,{className:n.default.value,children:[Math.round(h),`%`]})]}),c&&(0,a.jsx)(`span`,{className:n.default.label,children:c})]})});o.displayName=`ProgressRing`,exports.ProgressRing=o;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ComponentSizeBasic, IndicatorIntent } from '../../../types/tokens';
|
|
3
|
+
import { WithAccessibleName } from '../../_internal/accessibleName';
|
|
4
|
+
type ProgressRingOwnProps = Omit<React.ComponentPropsWithoutRef<"div">, "children"> & {
|
|
5
|
+
/**
|
|
6
|
+
* Current value of the progress ring.
|
|
7
|
+
* @default 0
|
|
8
|
+
*/
|
|
9
|
+
value?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Maximum value of the progress ring.
|
|
12
|
+
* @default 100
|
|
13
|
+
*/
|
|
14
|
+
max?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Intent (semantic color) of the ring.
|
|
17
|
+
* @default "primary"
|
|
18
|
+
*/
|
|
19
|
+
intent?: IndicatorIntent;
|
|
20
|
+
/**
|
|
21
|
+
* Size of the ring.
|
|
22
|
+
* @default "md"
|
|
23
|
+
*/
|
|
24
|
+
size?: ComponentSizeBasic;
|
|
25
|
+
/**
|
|
26
|
+
* Text label displayed below the ring. Also used as the accessible name.
|
|
27
|
+
*/
|
|
28
|
+
label?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Whether to display the current value as a percentage inside the ring.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
showValue?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* If true, shows an indeterminate animation instead of a value.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
indeterminate?: boolean;
|
|
39
|
+
};
|
|
40
|
+
export type ProgressRingProps = WithAccessibleName<ProgressRingOwnProps>;
|
|
41
|
+
/**
|
|
42
|
+
* Displays progress as a ring.
|
|
43
|
+
*
|
|
44
|
+
* `Progress` covers the linear case; the props here are deliberately the same
|
|
45
|
+
* vocabulary (`value` / `max` / `intent` / `size` / `label` / `showValue` /
|
|
46
|
+
* `indeterminate`) so that knowing one teaches the other.
|
|
47
|
+
*
|
|
48
|
+
* Composition Contract:
|
|
49
|
+
* - Managed by: App consumption
|
|
50
|
+
* - Scroll lock: No
|
|
51
|
+
*
|
|
52
|
+
* 幾何は SCSS 側の CSS 変数が持ち、SVG には固定長を書かない。ストロークは
|
|
53
|
+
* `pathLength="100"` で描くので `stroke-dasharray` がそのまま「%」になり、
|
|
54
|
+
* サイズごとに半径を変えても TSX 側に計算が要らない。
|
|
55
|
+
*/
|
|
56
|
+
export declare const ProgressRing: React.ForwardRefExoticComponent<ProgressRingProps & React.RefAttributes<HTMLDivElement>>;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { resolveAriaLabel as e } from "../../_internal/accessibleName.js";
|
|
3
|
+
import t from "./progress-ring.module.js";
|
|
4
|
+
import n from "react";
|
|
5
|
+
import r from "classnames";
|
|
6
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/feedback/ProgressRing/ProgressRing.tsx
|
|
8
|
+
var o = n.forwardRef(({ value: n = 0, max: o = 100, intent: s = "primary", size: c = "md", label: l, showValue: u = !1, indeterminate: d = !1, className: f, "aria-label": p, ...m }, h) => {
|
|
9
|
+
let g = Math.min(Math.max(n / o * 100, 0), 100);
|
|
10
|
+
return /* @__PURE__ */ a("div", {
|
|
11
|
+
ref: h,
|
|
12
|
+
className: r("wim-progress-ring", t.root, t[c], t[s], d && t.indeterminate, f),
|
|
13
|
+
role: "progressbar",
|
|
14
|
+
"aria-valuenow": d ? void 0 : n,
|
|
15
|
+
"aria-valuemin": 0,
|
|
16
|
+
"aria-valuemax": o,
|
|
17
|
+
"aria-label": e(l, p),
|
|
18
|
+
...m,
|
|
19
|
+
children: [/* @__PURE__ */ a("div", {
|
|
20
|
+
className: t.ring,
|
|
21
|
+
children: [/* @__PURE__ */ a("svg", {
|
|
22
|
+
className: t.svg,
|
|
23
|
+
viewBox: "0 0 100 100",
|
|
24
|
+
"aria-hidden": "true",
|
|
25
|
+
children: [/* @__PURE__ */ i("circle", {
|
|
26
|
+
className: t.track,
|
|
27
|
+
cx: "50",
|
|
28
|
+
cy: "50",
|
|
29
|
+
r: "42",
|
|
30
|
+
pathLength: "100"
|
|
31
|
+
}), /* @__PURE__ */ i("circle", {
|
|
32
|
+
className: t.indicator,
|
|
33
|
+
cx: "50",
|
|
34
|
+
cy: "50",
|
|
35
|
+
r: "42",
|
|
36
|
+
pathLength: "100",
|
|
37
|
+
style: d ? void 0 : { "--wim-progress-ring-value": `${g}` }
|
|
38
|
+
})]
|
|
39
|
+
}), u && !d && /* @__PURE__ */ a("span", {
|
|
40
|
+
className: t.value,
|
|
41
|
+
children: [Math.round(g), "%"]
|
|
42
|
+
})]
|
|
43
|
+
}), l && /* @__PURE__ */ i("span", {
|
|
44
|
+
className: t.label,
|
|
45
|
+
children: l
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
o.displayName = "ProgressRing";
|
|
50
|
+
//#endregion
|
|
51
|
+
export { o as ProgressRing };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var e=`_root_1hlew_3`,t=`_ring_1hlew_9`,n=`_svg_1hlew_16`,r=`_track_1hlew_21`,i=`_indicator_1hlew_22`,a=`_value_1hlew_34`,o=`_label_1hlew_41`,s=`_sm_1hlew_53`,c=`_md_1hlew_58`,l=`_lg_1hlew_63`,u=`_primary_1hlew_69`,d=`_secondary_1hlew_72`,f=`_success_1hlew_75`,p=`_warning_1hlew_78`,m=`_danger_1hlew_81`,h=`_info_1hlew_84`,g=`_neutral_1hlew_87`,_=`_indeterminate_1hlew_91`,v={root:e,ring:t,svg:n,track:r,indicator:i,value:a,label:o,sm:s,md:c,lg:l,primary:u,secondary:d,success:f,warning:p,danger:m,info:h,neutral:g,indeterminate:_,"ring-spin":`_ring-spin_1hlew_1`};exports.danger=m,exports.default=v,exports.indeterminate=_,exports.indicator=i,exports.info=h,exports.label=o,exports.lg=l,exports.md=c,exports.neutral=g,exports.primary=u,exports.ring=t,exports.root=e,exports.secondary=d,exports.sm=s,exports.success=f,exports.svg=n,exports.track=r,exports.value=a,exports.warning=p;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/components/feedback/ProgressRing/progress-ring.module.scss
|
|
3
|
+
var e = "_root_1hlew_3", t = "_ring_1hlew_9", n = "_svg_1hlew_16", r = "_track_1hlew_21", i = "_indicator_1hlew_22", a = "_value_1hlew_34", o = "_label_1hlew_41", s = "_sm_1hlew_53", c = "_md_1hlew_58", l = "_lg_1hlew_63", u = "_primary_1hlew_69", d = "_secondary_1hlew_72", f = "_success_1hlew_75", p = "_warning_1hlew_78", m = "_danger_1hlew_81", h = "_info_1hlew_84", g = "_neutral_1hlew_87", _ = "_indeterminate_1hlew_91", v = {
|
|
4
|
+
root: e,
|
|
5
|
+
ring: t,
|
|
6
|
+
svg: n,
|
|
7
|
+
track: r,
|
|
8
|
+
indicator: i,
|
|
9
|
+
value: a,
|
|
10
|
+
label: o,
|
|
11
|
+
sm: s,
|
|
12
|
+
md: c,
|
|
13
|
+
lg: l,
|
|
14
|
+
primary: u,
|
|
15
|
+
secondary: d,
|
|
16
|
+
success: f,
|
|
17
|
+
warning: p,
|
|
18
|
+
danger: m,
|
|
19
|
+
info: h,
|
|
20
|
+
neutral: g,
|
|
21
|
+
indeterminate: _,
|
|
22
|
+
"ring-spin": "_ring-spin_1hlew_1"
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { m as danger, v as default, _ as indeterminate, i as indicator, h as info, o as label, l as lg, c as md, g as neutral, u as primary, t as ring, e as root, d as secondary, s as sm, f as success, n as svg, r as track, a as value, p as warning };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../layout/InteractiveArea/InteractiveArea.cjs"),n=require("../../../icon/alert-circle.cjs"),r=require("../../../icon/check.cjs"),i=require("../../../icon/circle.cjs"),a=require("../../../icon/info-circle.cjs"),o=require("../../media/Icon/Icon.cjs"),s=require("./result.module.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime");var d=({intent:e,status:t,className:s})=>{if(t)return(0,u.jsx)(o.Icon,{component:n.default,color:`tertiary`,className:s});switch(e){case`success`:return(0,u.jsx)(o.Icon,{component:r.default,color:`success`,className:s});case`danger`:return(0,u.jsx)(o.Icon,{component:n.default,color:`danger`,className:s});case`warning`:return(0,u.jsx)(o.Icon,{component:n.default,color:`warning`,className:s});case`info`:return(0,u.jsx)(o.Icon,{component:a.default,color:`info`,className:s});default:return(0,u.jsx)(o.Icon,{component:i.default,color:`tertiary`,className:s})}},f=({intent:e=`default`,status:n,title:r,description:i,extra:a,icon:o,
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../layout/InteractiveArea/InteractiveArea.cjs"),n=require("../../../icon/alert-circle.cjs"),r=require("../../../icon/check.cjs"),i=require("../../../icon/circle.cjs"),a=require("../../../icon/info-circle.cjs"),o=require("../../media/Icon/Icon.cjs"),s=require("./result.module.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime");var d=({intent:e,status:t,className:s})=>{if(t)return(0,u.jsx)(o.Icon,{component:n.default,color:`tertiary`,className:s});switch(e){case`success`:return(0,u.jsx)(o.Icon,{component:r.default,color:`success`,className:s});case`danger`:return(0,u.jsx)(o.Icon,{component:n.default,color:`danger`,className:s});case`warning`:return(0,u.jsx)(o.Icon,{component:n.default,color:`warning`,className:s});case`info`:return(0,u.jsx)(o.Icon,{component:a.default,color:`info`,className:s});default:return(0,u.jsx)(o.Icon,{component:i.default,color:`tertiary`,className:s})}},f=({intent:e=`default`,status:n,title:r,description:i,extra:a,icon:o,iconSurface:c=!1,className:f,children:p})=>(0,u.jsx)(t.InteractiveArea,{icon:o||(0,u.jsx)(d,{intent:e,status:n,className:s.default.icon}),title:r??void 0,description:i??void 0,actions:a,variant:`none`,bgVariant:`transparent`,className:(0,l.default)(`wim-result`,s.default.root,e&&s.default[e],n&&s.default[n],c&&s.default.iconSurface,f),styles:{inner:s.default.inner,icon:s.default.icon,content:s.default.content},children:p});exports.Result=f;
|
|
@@ -29,6 +29,16 @@ export type ResultProps = {
|
|
|
29
29
|
* Custom icon
|
|
30
30
|
*/
|
|
31
31
|
icon?: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Sit the icon on a tinted circle in the intent's colour, instead of drawing it bare.
|
|
34
|
+
*
|
|
35
|
+
* Off by default so existing pages keep their look. Turn it on when the icon is
|
|
36
|
+
* the page's main visual — a maintenance or error page, where a bare glyph reads
|
|
37
|
+
* as an afterthought. The tint comes from `--wim-color-<intent>-subtle`, so it
|
|
38
|
+
* follows the theme and never needs a hand-mixed colour.
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
iconSurface?: boolean;
|
|
32
42
|
/**
|
|
33
43
|
* Custom class name
|
|
34
44
|
*/
|
|
@@ -38,4 +48,4 @@ export type ResultProps = {
|
|
|
38
48
|
*/
|
|
39
49
|
children?: ReactNode;
|
|
40
50
|
};
|
|
41
|
-
export declare const Result: ({ intent, status, title, description, extra, icon, className, children, }: ResultProps) => React.JSX.Element;
|
|
51
|
+
export declare const Result: ({ intent, status, title, description, extra, icon, iconSurface, className, children, }: ResultProps) => React.JSX.Element;
|
|
@@ -43,7 +43,7 @@ var l = ({ intent: e, status: o, className: s }) => {
|
|
|
43
43
|
className: s
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
}, u = ({ intent: t = "default", status: n, title: r, description: i, extra: a, icon: u,
|
|
46
|
+
}, u = ({ intent: t = "default", status: n, title: r, description: i, extra: a, icon: u, iconSurface: d = !1, className: f, children: p }) => /* @__PURE__ */ c(e, {
|
|
47
47
|
icon: u || /* @__PURE__ */ c(l, {
|
|
48
48
|
intent: t,
|
|
49
49
|
status: n,
|
|
@@ -54,13 +54,13 @@ var l = ({ intent: e, status: o, className: s }) => {
|
|
|
54
54
|
actions: a,
|
|
55
55
|
variant: "none",
|
|
56
56
|
bgVariant: "transparent",
|
|
57
|
-
className: s("wim-result", o.root, t && o[t], n && o[n], d),
|
|
57
|
+
className: s("wim-result", o.root, t && o[t], n && o[n], d && o.iconSurface, f),
|
|
58
58
|
styles: {
|
|
59
59
|
inner: o.inner,
|
|
60
60
|
icon: o.icon,
|
|
61
61
|
content: o.content
|
|
62
62
|
},
|
|
63
|
-
children:
|
|
63
|
+
children: p
|
|
64
64
|
});
|
|
65
65
|
//#endregion
|
|
66
66
|
export { u as Result };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_1e65t_3`,t=`_inner_1e65t_3`,n=`_icon_1e65t_11`,r=`_content_1e65t_16`,i=`_iconSurface_1e65t_34`,a=`_info_1e65t_47`,o=`_success_1e65t_50`,s=`_warning_1e65t_53`,c=`_danger_1e65t_56`,l={root:e,inner:t,icon:n,content:r,iconSurface:i,info:a,success:o,warning:s,danger:c};exports.content=r,exports.danger=c,exports.default=l,exports.icon=n,exports.iconSurface=i,exports.info=a,exports.inner=t,exports.root=e,exports.success=o,exports.warning=s;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/feedback/Result/result.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_1e65t_3", t = "_inner_1e65t_3", n = "_icon_1e65t_11", r = "_content_1e65t_16", i = "_iconSurface_1e65t_34", a = "_info_1e65t_47", o = "_success_1e65t_50", s = "_warning_1e65t_53", c = "_danger_1e65t_56", l = {
|
|
4
4
|
root: e,
|
|
5
5
|
inner: t,
|
|
6
6
|
icon: n,
|
|
7
|
-
content: r
|
|
7
|
+
content: r,
|
|
8
|
+
iconSurface: i,
|
|
9
|
+
info: a,
|
|
10
|
+
success: o,
|
|
11
|
+
warning: s,
|
|
12
|
+
danger: c
|
|
8
13
|
};
|
|
9
14
|
//#endregion
|
|
10
|
-
export { r as content,
|
|
15
|
+
export { r as content, c as danger, l as default, n as icon, i as iconSurface, a as info, t as inner, e as root, o as success, s as warning };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_rh6l6_249`,t=`_label_rh6l6_254`,n=`_trigger_rh6l6_261`,r=`_disabled_rh6l6_274`,i=`_open_rh6l6_280`,a=`_value_rh6l6_288`,o=`_placeholder_rh6l6_289`,s=`_icon_rh6l6_292`,c=`_clear_rh6l6_312`,l=`_dropdown_rh6l6_324`,u=`_menu_rh6l6_343`,d=`_menuItem_rh6l6_372`,f=`_active_rh6l6_372`,p=`_selected_rh6l6_380`,m={"wim-docs-container":`_wim-docs-container_rh6l6_129`,"wim-t":`_wim-t_rh6l6_216`,"react-flow":`_react-flow_rh6l6_239`,"react-flow__edges":`_react-flow__edges_rh6l6_240`,"react-flow__connectionline":`_react-flow__connectionline_rh6l6_241`,root:e,label:t,trigger:n,disabled:r,open:i,value:a,placeholder:o,icon:s,clear:c,dropdown:l,menu:u,menuItem:d,active:f,selected:p};exports.active=f,exports.clear=c,exports.default=m,exports.disabled=r,exports.dropdown=l,exports.icon=s,exports.label=t,exports.menu=u,exports.menuItem=d,exports.open=i,exports.placeholder=o,exports.root=e,exports.selected=p,exports.trigger=n,exports.value=a;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/form/Cascader/cascader.module.scss
|
|
3
|
-
var e = "
|
|
4
|
-
"wim-docs-container": "_wim-docs-
|
|
5
|
-
"wim-t": "_wim-
|
|
6
|
-
"react-flow": "_react-
|
|
7
|
-
"react-flow__edges": "_react-
|
|
8
|
-
"react-flow__connectionline": "_react-
|
|
3
|
+
var e = "_root_rh6l6_249", t = "_label_rh6l6_254", n = "_trigger_rh6l6_261", r = "_disabled_rh6l6_274", i = "_open_rh6l6_280", a = "_value_rh6l6_288", o = "_placeholder_rh6l6_289", s = "_icon_rh6l6_292", c = "_clear_rh6l6_312", l = "_dropdown_rh6l6_324", u = "_menu_rh6l6_343", d = "_menuItem_rh6l6_372", f = "_active_rh6l6_372", p = "_selected_rh6l6_380", m = {
|
|
4
|
+
"wim-docs-container": "_wim-docs-container_rh6l6_129",
|
|
5
|
+
"wim-t": "_wim-t_rh6l6_216",
|
|
6
|
+
"react-flow": "_react-flow_rh6l6_239",
|
|
7
|
+
"react-flow__edges": "_react-flow__edges_rh6l6_240",
|
|
8
|
+
"react-flow__connectionline": "_react-flow__connectionline_rh6l6_241",
|
|
9
9
|
root: e,
|
|
10
10
|
label: t,
|
|
11
11
|
trigger: n,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_ttjme_261`,t=`_disabled_ttjme_269`,n=`_canvasContainer_ttjme_273`,r=`_danger_ttjme_252`,i=`_canvas_ttjme_273`,a=`_footer_ttjme_297`,o={"wim-docs-container":`_wim-docs-container_ttjme_129`,"wim-t":`_wim-t_ttjme_216`,"react-flow":`_react-flow_ttjme_239`,"react-flow__edges":`_react-flow__edges_ttjme_240`,"react-flow__connectionline":`_react-flow__connectionline_ttjme_241`,root:e,disabled:t,canvasContainer:n,danger:r,canvas:i,footer:a};exports.canvas=i,exports.canvasContainer=n,exports.danger=r,exports.default=o,exports.disabled=t,exports.footer=a,exports.root=e;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/form/SignaturePad/signature-pad.module.scss
|
|
3
|
-
var e = "
|
|
4
|
-
"wim-docs-container": "_wim-docs-
|
|
5
|
-
"wim-t": "_wim-
|
|
6
|
-
"react-flow": "_react-
|
|
7
|
-
"react-flow__edges": "_react-
|
|
8
|
-
"react-flow__connectionline": "_react-
|
|
3
|
+
var e = "_root_ttjme_261", t = "_disabled_ttjme_269", n = "_canvasContainer_ttjme_273", r = "_danger_ttjme_252", i = "_canvas_ttjme_273", a = "_footer_ttjme_297", o = {
|
|
4
|
+
"wim-docs-container": "_wim-docs-container_ttjme_129",
|
|
5
|
+
"wim-t": "_wim-t_ttjme_216",
|
|
6
|
+
"react-flow": "_react-flow_ttjme_239",
|
|
7
|
+
"react-flow__edges": "_react-flow__edges_ttjme_240",
|
|
8
|
+
"react-flow__connectionline": "_react-flow__connectionline_ttjme_241",
|
|
9
9
|
root: e,
|
|
10
10
|
disabled: t,
|
|
11
11
|
canvasContainer: n,
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../media/Icon/Icon.cjs"),n=require("../Button/Button.cjs"),r=require("../../overlay/Dropdown/Dropdown.cjs"),i=require("./split-button.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(({children:e,onClick:a,actions:c,variant:l=`solid`,intent:u=`default`,size:d=`md`,disabled:f=!1,loading:p=!1,toggleLabel:m,className:h,...g},_)=>(0,s.jsxs)(`div`,{ref:_,className:(0,o.default)(`wim-split-button`,i.default.root,i.default[d],h),...g,children:[(0,s.jsx)(n.Button,{className:i.default.main,variant:l,intent:u,size:d,disabled:f,loading:p,onClick:a,children:e}),(0,s.jsxs)(r.Dropdown,{children:[(0,s.jsx)(r.DropdownTrigger,{asChild:!0,children:(0,s.jsx)(n.Button,{className:i.default.toggle,variant:l,intent:u,size:d,disabled:f,"aria-label":m,children:(0,s.jsx)(t.Icon,{name:`ChevronDownIcon`,className:i.default.chevron})})}),(0,s.jsx)(r.DropdownMenu,{children:c.map((e,t)=>(0,s.jsxs)(r.DropdownItem,{disabled:e.disabled,onClick:e.onSelect,children:[e.icon&&(0,s.jsx)(`span`,{className:i.default.itemIcon,children:e.icon}),e.label]},t))})]})]}));c.displayName=`SplitButton`,exports.SplitButton=c;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ButtonIntent } from '../../../types/generated-intents';
|
|
3
|
+
import { ButtonVariant, ComponentSizeBasic } from '../../../types/tokens';
|
|
4
|
+
export type SplitButtonAction = {
|
|
5
|
+
/** Text shown in the menu. */
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
/** Called when the entry is chosen. */
|
|
8
|
+
onSelect?: () => void;
|
|
9
|
+
/** Icon shown before the label. */
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
/** Whether the entry is unavailable. */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type SplitButtonProps = Omit<React.ComponentPropsWithoutRef<"div">, "onSelect" | "children"> & {
|
|
15
|
+
/** Text of the main action. */
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
/** Called when the main action is pressed. */
|
|
18
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
19
|
+
/** Secondary actions listed behind the toggle. */
|
|
20
|
+
actions: SplitButtonAction[];
|
|
21
|
+
/** Visual style, applied to both halves so they read as one control. */
|
|
22
|
+
variant?: ButtonVariant;
|
|
23
|
+
/** Intent (semantic color), applied to both halves. */
|
|
24
|
+
intent?: ButtonIntent;
|
|
25
|
+
/** Size of both halves. */
|
|
26
|
+
size?: ComponentSizeBasic;
|
|
27
|
+
/** Disable the whole control. */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/** Show a loading state on the main action. */
|
|
30
|
+
loading?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Accessible name for the toggle half. The main half is named by its own text,
|
|
33
|
+
* but the toggle only shows a chevron, so it needs one of its own.
|
|
34
|
+
*/
|
|
35
|
+
toggleLabel: string;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* A main action with a menu of related actions behind a toggle.
|
|
39
|
+
*
|
|
40
|
+
* Composition Contract:
|
|
41
|
+
* - Managed by: App consumption
|
|
42
|
+
* - Scroll lock: No
|
|
43
|
+
*
|
|
44
|
+
* `ButtonGroup` + `Dropdown` で組める形ではあるが、**組み方に落とし穴がある**ので
|
|
45
|
+
* 部品にした(T47 ②)。落とし穴は 2 つ:
|
|
46
|
+
*
|
|
47
|
+
* 1. **トグル側にアクセシブル名が無くなる**。矢印しか描かないので、
|
|
48
|
+
* 名前を与えないと `button` が無名になる。`toggleLabel` を必須にして
|
|
49
|
+
* 型で防ぐ(T53 で `Progress` に入れたのと同じ考え方)
|
|
50
|
+
* 2. **2 つのボタンが 1 つのコントロールに見えない**。角丸と枠が二重になるので、
|
|
51
|
+
* 隣り合う辺の角丸を落とし、境界の枠を 1 本に見せる必要がある
|
|
52
|
+
*
|
|
53
|
+
* 主ボタンとトグルは同じ `variant` / `intent` / `size` を受け取る。片方だけ
|
|
54
|
+
* 変えられると「1 つのコントロール」という前提が崩れるため、個別指定は持たない。
|
|
55
|
+
*/
|
|
56
|
+
export declare const SplitButton: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children" | "onSelect"> & {
|
|
57
|
+
/** Text of the main action. */
|
|
58
|
+
children?: React.ReactNode;
|
|
59
|
+
/** Called when the main action is pressed. */
|
|
60
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
61
|
+
/** Secondary actions listed behind the toggle. */
|
|
62
|
+
actions: SplitButtonAction[];
|
|
63
|
+
/** Visual style, applied to both halves so they read as one control. */
|
|
64
|
+
variant?: ButtonVariant;
|
|
65
|
+
/** Intent (semantic color), applied to both halves. */
|
|
66
|
+
intent?: ButtonIntent;
|
|
67
|
+
/** Size of both halves. */
|
|
68
|
+
size?: ComponentSizeBasic;
|
|
69
|
+
/** Disable the whole control. */
|
|
70
|
+
disabled?: boolean;
|
|
71
|
+
/** Show a loading state on the main action. */
|
|
72
|
+
loading?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Accessible name for the toggle half. The main half is named by its own text,
|
|
75
|
+
* but the toggle only shows a chevron, so it needs one of its own.
|
|
76
|
+
*/
|
|
77
|
+
toggleLabel: string;
|
|
78
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Icon as e } from "../../media/Icon/Icon.js";
|
|
3
|
+
import { Button as t } from "../Button/Button.js";
|
|
4
|
+
import { Dropdown as n, DropdownItem as r, DropdownMenu as i, DropdownTrigger as a } from "../../overlay/Dropdown/Dropdown.js";
|
|
5
|
+
import o from "./split-button.module.js";
|
|
6
|
+
import s from "react";
|
|
7
|
+
import c from "classnames";
|
|
8
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/form/SplitButton/SplitButton.tsx
|
|
10
|
+
var d = s.forwardRef(({ children: s, onClick: d, actions: f, variant: p = "solid", intent: m = "default", size: h = "md", disabled: g = !1, loading: _ = !1, toggleLabel: v, className: y, ...b }, x) => /* @__PURE__ */ u("div", {
|
|
11
|
+
ref: x,
|
|
12
|
+
className: c("wim-split-button", o.root, o[h], y),
|
|
13
|
+
...b,
|
|
14
|
+
children: [/* @__PURE__ */ l(t, {
|
|
15
|
+
className: o.main,
|
|
16
|
+
variant: p,
|
|
17
|
+
intent: m,
|
|
18
|
+
size: h,
|
|
19
|
+
disabled: g,
|
|
20
|
+
loading: _,
|
|
21
|
+
onClick: d,
|
|
22
|
+
children: s
|
|
23
|
+
}), /* @__PURE__ */ u(n, { children: [/* @__PURE__ */ l(a, {
|
|
24
|
+
asChild: !0,
|
|
25
|
+
children: /* @__PURE__ */ l(t, {
|
|
26
|
+
className: o.toggle,
|
|
27
|
+
variant: p,
|
|
28
|
+
intent: m,
|
|
29
|
+
size: h,
|
|
30
|
+
disabled: g,
|
|
31
|
+
"aria-label": v,
|
|
32
|
+
children: /* @__PURE__ */ l(e, {
|
|
33
|
+
name: "ChevronDownIcon",
|
|
34
|
+
className: o.chevron
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
}), /* @__PURE__ */ l(i, { children: f.map((e, t) => /* @__PURE__ */ u(r, {
|
|
38
|
+
disabled: e.disabled,
|
|
39
|
+
onClick: e.onSelect,
|
|
40
|
+
children: [e.icon && /* @__PURE__ */ l("span", {
|
|
41
|
+
className: o.itemIcon,
|
|
42
|
+
children: e.icon
|
|
43
|
+
}), e.label]
|
|
44
|
+
}, t)) })] })]
|
|
45
|
+
}));
|
|
46
|
+
d.displayName = "SplitButton";
|
|
47
|
+
//#endregion
|
|
48
|
+
export { d as SplitButton };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/components/form/SplitButton/split-button.module.scss
|
|
3
|
+
var e = "_root_7med7_2", t = "_main_7med7_6", n = "_toggle_7med7_10", r = "_chevron_7med7_26", i = "_itemIcon_7med7_29", a = {
|
|
4
|
+
root: e,
|
|
5
|
+
main: t,
|
|
6
|
+
toggle: n,
|
|
7
|
+
chevron: r,
|
|
8
|
+
itemIcon: i
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { r as chevron, a as default, i as itemIcon, t as main, e as root, n as toggle };
|