@vkzstudio/muza-ui 1.0.42 → 1.0.44
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/Accordion/Accordion.d.ts +42 -6
- package/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts +74 -12
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +60 -55
- package/dist/components/Button/Button.stories.d.ts +2 -0
- package/dist/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.d.ts +52 -15
- package/dist/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +69 -36
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.stories.d.ts.map +1 -1
- package/dist/components/EdgeButton/EdgeButton.d.ts +16 -12
- package/dist/components/EdgeButton/EdgeButton.d.ts.map +1 -1
- package/dist/components/EdgeButton/EdgeButton.js +70 -46
- package/dist/components/EdgeButton/EdgeButton.stories.d.ts +2 -0
- package/dist/components/EdgeButton/EdgeButton.stories.d.ts.map +1 -1
- package/dist/components/ExpandableTable/ExpandableTable.d.ts +73 -8
- package/dist/components/ExpandableTable/ExpandableTable.d.ts.map +1 -1
- package/dist/components/ExpandableTable/ExpandableTable.stories.d.ts +3 -0
- package/dist/components/ExpandableTable/ExpandableTable.stories.d.ts.map +1 -1
- package/dist/components/ExpandableTable/index.d.ts +1 -1
- package/dist/components/ExpandableTable/index.d.ts.map +1 -1
- package/dist/components/FileUpload/FileItem.d.ts +16 -0
- package/dist/components/FileUpload/FileItem.d.ts.map +1 -1
- package/dist/components/FileUpload/FileUpload.d.ts +105 -42
- package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/components/FileUpload/index.d.ts +1 -1
- package/dist/components/FileUpload/index.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts +33 -34
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +50 -23
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/Reorderable/Reorderable.d.ts +48 -1
- package/dist/components/Reorderable/Reorderable.d.ts.map +1 -1
- package/dist/components/ReorderableTable/ReorderableTable.d.ts +34 -17
- package/dist/components/ReorderableTable/ReorderableTable.d.ts.map +1 -1
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +38 -21
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/TextEditor/TextEditor.d.ts +82 -46
- package/dist/components/TextEditor/TextEditor.d.ts.map +1 -1
- package/dist/components/TextEditor/TextEditor.stories.d.ts.map +1 -1
- package/dist/components/TextEditor/index.d.ts +1 -1
- package/dist/components/TextEditor/index.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +41 -10
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.stories.d.ts.map +1 -1
- package/dist/muza-ui.css +1 -1
- package/package.json +1 -1
|
@@ -62,20 +62,56 @@ export interface AccordionMultipleProps extends RadixAccordionMultipleProps {
|
|
|
62
62
|
* <Accordion type="single" variant="default" collapsible>
|
|
63
63
|
*/
|
|
64
64
|
export type AccordionProps = AccordionSingleProps | AccordionMultipleProps;
|
|
65
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Props for the AccordionItem component.
|
|
67
|
+
* Represents a single expandable section within an Accordion.
|
|
68
|
+
*/
|
|
66
69
|
export interface AccordionItemProps extends React.ComponentProps<typeof AccordionPrimitive.Item> {
|
|
67
|
-
/** Unique string identifying this item within the accordion. */
|
|
70
|
+
/** Unique string identifying this item within the accordion. Must be unique across sibling items. */
|
|
68
71
|
value: string;
|
|
69
72
|
/** Prevents interaction with this specific item. @default false */
|
|
70
73
|
disabled?: boolean;
|
|
71
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* When true, clicking anywhere on the item (not just the header) toggles the open state.
|
|
76
|
+
* Set to false for items whose content contains interactive elements (forms, inputs, switches)
|
|
77
|
+
* so inner clicks don't collapse the section.
|
|
78
|
+
*
|
|
79
|
+
* @default true
|
|
80
|
+
* @example
|
|
81
|
+
* <AccordionItem value="settings" clickableContent={false}>
|
|
82
|
+
* <AccordionHeader>Settings</AccordionHeader>
|
|
83
|
+
* <AccordionContent>
|
|
84
|
+
* <Input />
|
|
85
|
+
* <Switch />
|
|
86
|
+
* </AccordionContent>
|
|
87
|
+
* </AccordionItem>
|
|
88
|
+
*/
|
|
72
89
|
clickableContent?: boolean;
|
|
73
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* When true, the item is always expanded, non-interactive, and the chevron is hidden.
|
|
92
|
+
* The header renders as a plain element instead of a button so it stays accessible
|
|
93
|
+
* when no toggle action is available.
|
|
94
|
+
*
|
|
95
|
+
* @default false
|
|
96
|
+
* @example
|
|
97
|
+
* <AccordionItem value="always-visible" static>
|
|
98
|
+
* <AccordionHeader>Always visible</AccordionHeader>
|
|
99
|
+
* <AccordionContent>This content is always shown.</AccordionContent>
|
|
100
|
+
* </AccordionItem>
|
|
101
|
+
*/
|
|
74
102
|
static?: boolean;
|
|
75
103
|
}
|
|
76
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Props for the AccordionHeader component.
|
|
106
|
+
* Renders the clickable header area that toggles content visibility.
|
|
107
|
+
* Wraps and behaves as Radix's `Accordion.Header` + `Accordion.Trigger`.
|
|
108
|
+
*/
|
|
77
109
|
export type AccordionHeaderProps = React.ComponentProps<typeof AccordionPrimitive.Header>;
|
|
78
|
-
/**
|
|
110
|
+
/**
|
|
111
|
+
* Props for the AccordionContent component.
|
|
112
|
+
* Collapsible content area with built-in slide-up/slide-down animation.
|
|
113
|
+
* Wraps Radix's `Accordion.Content`.
|
|
114
|
+
*/
|
|
79
115
|
export type AccordionContentProps = React.ComponentProps<typeof AccordionPrimitive.Content>;
|
|
80
116
|
declare const accordionItemVariants: (props?: ({
|
|
81
117
|
variant?: "default" | "branded" | "settings" | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAA;AAC/D,OAAO,EACL,KAAK,sBAAsB,IAAI,2BAA2B,EAC1D,KAAK,oBAAoB,IAAI,yBAAyB,EACvD,MAAM,2BAA2B,CAAA;AAKlC;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAA;AAEjE,mEAAmE;AACnE,MAAM,WAAW,oBAAqB,SAAQ,yBAAyB;IACrE,yDAAyD;IACzD,IAAI,EAAE,QAAQ,CAAA;IACd;;;;OAIG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAA;IAC1B,iFAAiF;IACjF,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,gFAAgF;AAChF,MAAM,WAAW,sBAAuB,SAAQ,2BAA2B;IACzE,sEAAsE;IACtE,IAAI,EAAE,UAAU,CAAA;IAChB;;;;OAIG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAA;IAC1B,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,qDAAqD;IACrD,YAAY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GAAI,mCAIvB,qBAAqB,4CA6BvB,CAAA;AAED,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,wBAAwB,EACxB,6BAA6B,GAC9B,CAAA"}
|
|
@@ -3,40 +3,102 @@ import { buttonVariants } from './buttonVariants';
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
/**
|
|
5
5
|
* Props for the Button component.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
*
|
|
7
|
+
* Extends standard button HTML attributes. CVA's inferred `iconOnly` and `size`
|
|
8
|
+
* variants are omitted from `VariantProps` and re-declared below with explicit
|
|
9
|
+
* union types so consumers see the allowed values in `.d.ts` output.
|
|
8
10
|
*/
|
|
9
11
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, Omit<VariantProps<typeof buttonVariants>, 'iconOnly' | 'size'> {
|
|
10
12
|
/**
|
|
11
|
-
* Visual style variant
|
|
12
|
-
*
|
|
13
|
+
* Visual style variant.
|
|
14
|
+
*
|
|
15
|
+
* - `primary` — brand-colored solid button for the main call-to-action.
|
|
16
|
+
* - `secondary` — outlined button for secondary actions.
|
|
17
|
+
* - `tertiary` — subtle button for low-emphasis actions.
|
|
18
|
+
* - `invert` — inverted colors for dark backgrounds.
|
|
19
|
+
* - `dashed` — dashed-border button, typically for add/create actions.
|
|
20
|
+
* - `link` / `linkInvert` — text-only link-styled button.
|
|
21
|
+
*
|
|
13
22
|
* @default 'primary'
|
|
14
23
|
*/
|
|
15
24
|
variant?: 'primary' | 'secondary' | 'tertiary' | 'invert' | 'dashed' | 'link' | 'linkInvert';
|
|
16
25
|
/**
|
|
17
26
|
* Controls height and padding. The `icon` size renders a compact icon-only
|
|
18
27
|
* button with ghost styling (no background, border, or border radius).
|
|
28
|
+
*
|
|
19
29
|
* @default 'md'
|
|
20
30
|
*/
|
|
21
31
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'icon';
|
|
22
|
-
/** Stretches button to fill its container width. @default false */
|
|
32
|
+
/** Stretches the button to fill its container width. @default false */
|
|
23
33
|
fullWidth?: boolean;
|
|
24
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Renders the single child as the root element via Radix `Slot`, merging
|
|
36
|
+
* Button's props, styles, ref, and event handlers onto it. Use for
|
|
37
|
+
* polymorphic rendering — e.g. a router `Link`, a plain `<a>`, a `<label>`,
|
|
38
|
+
* or a `<button type="submit">` — while keeping full Button styling.
|
|
39
|
+
*
|
|
40
|
+
* Icons and the `loading` spinner are injected as siblings of the child's
|
|
41
|
+
* original content.
|
|
42
|
+
*
|
|
43
|
+
* Note: the `disabled` attribute is inert on non-`<button>` children
|
|
44
|
+
* (e.g. `<a>`). Use `aria-disabled` on the child instead.
|
|
45
|
+
*
|
|
46
|
+
* @default false
|
|
47
|
+
* @example
|
|
48
|
+
* <Button asChild variant="primary">
|
|
49
|
+
* <Link href="/dashboard">Go to dashboard</Link>
|
|
50
|
+
* </Button>
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* <Button asChild variant="primary">
|
|
54
|
+
* <button type="submit">Submit form</button>
|
|
55
|
+
* </Button>
|
|
56
|
+
*/
|
|
25
57
|
asChild?: boolean;
|
|
26
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* Icon node rendered alongside the label. Position is controlled by
|
|
60
|
+
* `iconPosition`. Omit `children` to render an icon-only button (provide
|
|
61
|
+
* `aria-label` for accessibility).
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* <Button icon={<DownloadIcon />}>Download</Button>
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* <Button icon={<PlusIcon />} aria-label="Add" />
|
|
68
|
+
*/
|
|
27
69
|
icon?: React.ReactNode;
|
|
28
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Places `icon` before (`'start'`) or after (`'end'`) the button text.
|
|
72
|
+
* Ignored when `secondIcon` is provided.
|
|
73
|
+
*
|
|
74
|
+
* @default 'start'
|
|
75
|
+
*/
|
|
29
76
|
iconPosition?: 'start' | 'end';
|
|
30
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* Optional trailing icon. When set, `icon` is always rendered at the start
|
|
79
|
+
* and `secondIcon` at the end, overriding `iconPosition`.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* <Button icon={<PlusIcon />} secondIcon={<ArrowRightIcon />}>Add and continue</Button>
|
|
83
|
+
*/
|
|
31
84
|
secondIcon?: React.ReactNode;
|
|
32
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* Removes background and border, showing only text and icon with hover
|
|
87
|
+
* effects. The `icon` size always renders as ghost regardless of this prop.
|
|
88
|
+
*
|
|
89
|
+
* @default false
|
|
90
|
+
*/
|
|
33
91
|
ghost?: boolean;
|
|
34
92
|
/** Applies destructive/error styling for delete or dangerous actions. @default false */
|
|
35
93
|
danger?: boolean;
|
|
36
94
|
/**
|
|
37
|
-
* Shows a spinner overlay and disables interaction.
|
|
38
|
-
*
|
|
95
|
+
* Shows a spinner overlay and disables interaction. The label fades out but
|
|
96
|
+
* the button keeps its width, preventing layout shift during async actions.
|
|
97
|
+
*
|
|
39
98
|
* @default false
|
|
99
|
+
* @example
|
|
100
|
+
* const [saving, setSaving] = useState(false)
|
|
101
|
+
* <Button loading={saving} onClick={handleSave}>Save</Button>
|
|
40
102
|
*/
|
|
41
103
|
loading?: boolean;
|
|
42
104
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAI5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD;;;;;;GAMG;AACH,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,IAAI,CAAC,YAAY,CAAC,OAAO,cAAc,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAChE;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EACJ,SAAS,GACT,WAAW,GACX,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,YAAY,CAAA;IAChB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAA;IACzC,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IAC9B;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,wFAAwF;IACxF,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,QAAA,MAAM,MAAM,uFAqFX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -1,71 +1,76 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as j, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import { Slot as v, Slottable as u } from "@radix-ui/react-slot";
|
|
3
4
|
import "class-variance-authority";
|
|
4
|
-
import { ButtonLoader as
|
|
5
|
-
import { buttonVariants as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Typography as
|
|
8
|
-
const
|
|
5
|
+
import { ButtonLoader as w } from "./ButtonLoader.js";
|
|
6
|
+
import { buttonVariants as E } from "./buttonVariants.js";
|
|
7
|
+
import { cn as c } from "../../utils/cn.js";
|
|
8
|
+
import { Typography as R } from "../Typography/Typography.js";
|
|
9
|
+
const S = m.forwardRef(
|
|
9
10
|
({
|
|
10
|
-
className:
|
|
11
|
-
variant:
|
|
12
|
-
size:
|
|
13
|
-
fullWidth:
|
|
14
|
-
asChild:
|
|
15
|
-
icon:
|
|
16
|
-
iconPosition:
|
|
11
|
+
className: y,
|
|
12
|
+
variant: b,
|
|
13
|
+
size: a,
|
|
14
|
+
fullWidth: x,
|
|
15
|
+
asChild: p = !1,
|
|
16
|
+
icon: r,
|
|
17
|
+
iconPosition: n = "start",
|
|
17
18
|
secondIcon: s,
|
|
18
|
-
ghost:
|
|
19
|
-
danger:
|
|
20
|
-
loading:
|
|
21
|
-
children:
|
|
19
|
+
ghost: d = !1,
|
|
20
|
+
danger: f = !1,
|
|
21
|
+
loading: e = !1,
|
|
22
|
+
children: t,
|
|
22
23
|
...h
|
|
23
|
-
},
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
b,
|
|
24
|
+
}, N) => {
|
|
25
|
+
const g = p ? v : "button", i = a === "icon" || d, l = (L) => /* @__PURE__ */ o(
|
|
26
|
+
R,
|
|
27
27
|
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
variant: "cta",
|
|
29
|
+
size: a === "sm" || a === "xs" ? "sm" : "base",
|
|
30
|
+
weight: "medium",
|
|
31
|
+
component: "span",
|
|
32
|
+
fixY: !0,
|
|
33
|
+
className: c("transition-opacity", {
|
|
34
|
+
"opacity-0": e
|
|
35
|
+
}),
|
|
36
|
+
children: L
|
|
37
|
+
}
|
|
38
|
+
), B = () => p ? m.isValidElement(t) ? /* @__PURE__ */ o(u, { children: m.cloneElement(
|
|
39
|
+
t,
|
|
40
|
+
void 0,
|
|
41
|
+
l(t.props.children)
|
|
42
|
+
) }) : /* @__PURE__ */ o(u, { children: t }) : t && l(t);
|
|
43
|
+
return /* @__PURE__ */ j(
|
|
44
|
+
g,
|
|
45
|
+
{
|
|
46
|
+
className: c(
|
|
47
|
+
E({
|
|
48
|
+
variant: b,
|
|
49
|
+
size: a,
|
|
50
|
+
fullWidth: x,
|
|
51
|
+
iconOnly: a === "icon" || !t,
|
|
52
|
+
ghost: i,
|
|
53
|
+
danger: f,
|
|
54
|
+
loading: e,
|
|
55
|
+
className: y
|
|
38
56
|
})
|
|
39
57
|
),
|
|
40
|
-
ref:
|
|
41
|
-
"data-ghost":
|
|
42
|
-
"data-danger":
|
|
58
|
+
ref: N,
|
|
59
|
+
"data-ghost": i,
|
|
60
|
+
"data-danger": f,
|
|
43
61
|
...h,
|
|
44
62
|
children: [
|
|
45
|
-
|
|
46
|
-
(s ||
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
{
|
|
50
|
-
variant: "cta",
|
|
51
|
-
size: t == "sm" || t == "xs" ? "sm" : "base",
|
|
52
|
-
weight: "medium",
|
|
53
|
-
component: "span",
|
|
54
|
-
fixY: !0,
|
|
55
|
-
className: f("transition-opacity", {
|
|
56
|
-
"opacity-0": o
|
|
57
|
-
}),
|
|
58
|
-
children: r
|
|
59
|
-
}
|
|
60
|
-
),
|
|
61
|
-
s || p === "end" && a
|
|
63
|
+
e && /* @__PURE__ */ o("span", { className: "absolute", children: /* @__PURE__ */ o(w, {}) }),
|
|
64
|
+
(s || n === "start") && r,
|
|
65
|
+
B(),
|
|
66
|
+
s || n === "end" && r
|
|
62
67
|
]
|
|
63
68
|
}
|
|
64
69
|
);
|
|
65
70
|
}
|
|
66
71
|
);
|
|
67
|
-
|
|
72
|
+
S.displayName = "Button";
|
|
68
73
|
export {
|
|
69
|
-
|
|
70
|
-
|
|
74
|
+
S as Button,
|
|
75
|
+
E as buttonVariants
|
|
71
76
|
};
|
|
@@ -13,5 +13,7 @@ export declare const AllSizes: Story;
|
|
|
13
13
|
export declare const InteractiveStates: Story;
|
|
14
14
|
export declare const IconExamples: Story;
|
|
15
15
|
export declare const WithSecondIcon: Story;
|
|
16
|
+
export declare const AsChildAnchor: Story;
|
|
17
|
+
export declare const AsChildEdgeCases: Story;
|
|
16
18
|
export declare const ResponsiveExample: Story;
|
|
17
19
|
//# sourceMappingURL=Button.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.stories.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAW3D,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAA;AAoBnD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAqF7B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAA;AAEpC,eAAO,MAAM,OAAO,EAAE,KAarB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAetB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAe7B,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAoCtB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAgBvB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAyCzB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAkDtB,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAmF/B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KA8D1B,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAgB5B,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAgB3B,CAAA;AAaD,eAAO,MAAM,gBAAgB,EAAE,KAmL9B,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAgC/B,CAAA"}
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
/**
|
|
4
|
+
* CVA variants for the DataTable body cells. Controls background color
|
|
5
|
+
* (`variant`) and rounded-corner/border treatment based on the cell's
|
|
6
|
+
* position in the row (`position`).
|
|
7
|
+
*/
|
|
3
8
|
declare const dataTableCellVariants: (props?: ({
|
|
4
9
|
variant?: "default" | "white" | null | undefined;
|
|
5
10
|
position?: "first" | "last" | "middle" | null | undefined;
|
|
6
11
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
12
|
/**
|
|
8
|
-
* Column definition for the DataTable component.
|
|
13
|
+
* Column definition for the DataTable component. Describes how a single column
|
|
14
|
+
* pulls its value from each row object, how its header renders, and optionally
|
|
15
|
+
* how each cell renders.
|
|
16
|
+
*
|
|
9
17
|
* @typeParam T - The type of data objects in each row
|
|
10
18
|
*
|
|
11
19
|
* @example
|
|
@@ -16,20 +24,24 @@ declare const dataTableCellVariants: (props?: ({
|
|
|
16
24
|
* ]
|
|
17
25
|
*/
|
|
18
26
|
export interface DataTableColumn<T> {
|
|
19
|
-
/** Property key
|
|
27
|
+
/** Property key on each row object whose value is displayed in this column. */
|
|
20
28
|
dataKey: keyof T;
|
|
21
|
-
/** Header label for the column. */
|
|
29
|
+
/** Header label for the column. Pass an empty string to render a blank header (e.g. an actions column). */
|
|
22
30
|
title: ReactNode;
|
|
23
|
-
/**
|
|
31
|
+
/** Extra CSS class applied to both the header cell (`<th>`) and body cells (`<td>`) of this column. */
|
|
24
32
|
className?: string;
|
|
25
33
|
/**
|
|
26
|
-
* Truncates cell text to the specified number of lines.
|
|
27
|
-
*
|
|
34
|
+
* Truncates default cell text to the specified number of lines. Has no
|
|
35
|
+
* effect when a custom `render` is provided.
|
|
36
|
+
* - `true` or `1` clamps to one line
|
|
37
|
+
* - `2` clamps to two lines
|
|
28
38
|
*/
|
|
29
39
|
lineClamp?: boolean | 1 | 2;
|
|
30
40
|
/**
|
|
31
41
|
* Custom render function for cell content. When omitted, the raw value
|
|
32
|
-
* is displayed inside a Typography component.
|
|
42
|
+
* at `dataKey` is displayed inside a Typography component. The function
|
|
43
|
+
* receives the raw value, the full row object, the row index, and the
|
|
44
|
+
* table's `disabled` state so custom cells can mirror the disabled styling.
|
|
33
45
|
*
|
|
34
46
|
* @example
|
|
35
47
|
* render: (value, rowData, rowIndex, disabled) => (
|
|
@@ -40,26 +52,51 @@ export interface DataTableColumn<T> {
|
|
|
40
52
|
}
|
|
41
53
|
/**
|
|
42
54
|
* Props for the DataTable component.
|
|
43
|
-
* Extends standard table attributes except `children` (content is driven by
|
|
55
|
+
* Extends standard table attributes except `children` (content is driven by
|
|
56
|
+
* `data` and `columns` rather than JSX children).
|
|
57
|
+
*
|
|
44
58
|
* @typeParam T - The type of data objects in each row
|
|
45
59
|
*/
|
|
46
60
|
export interface DataTableProps<T> extends Omit<React.HTMLAttributes<HTMLTableElement>, 'children'>, Omit<VariantProps<typeof dataTableCellVariants>, 'variant' | 'position'> {
|
|
47
|
-
/** Array of data objects to display as table
|
|
61
|
+
/** Array of data objects to display. Each item renders as one table row. */
|
|
48
62
|
data: T[];
|
|
49
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* Column definitions describing headers, cell rendering, and per-column styling.
|
|
65
|
+
* @see DataTableColumn
|
|
66
|
+
*/
|
|
50
67
|
columns: DataTableColumn<T>[];
|
|
51
68
|
/** Controls visibility of the table header row. @default true */
|
|
52
69
|
showHeader?: boolean;
|
|
53
|
-
/**
|
|
70
|
+
/** Extra CSS class applied to the `<table>` element. */
|
|
54
71
|
className?: string;
|
|
55
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* Visual style variant for row background.
|
|
74
|
+
* - `'default'` uses the primary surface color
|
|
75
|
+
* - `'white'` uses the secondary surface color (for nested/alt backgrounds)
|
|
76
|
+
*
|
|
77
|
+
* @default 'default'
|
|
78
|
+
*/
|
|
56
79
|
variant?: 'default' | 'white';
|
|
57
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* Prevents row-click interaction and applies muted text colors. The value
|
|
82
|
+
* is also forwarded to every column's `render` callback so custom cells
|
|
83
|
+
* can reflect the disabled state.
|
|
84
|
+
*
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
58
87
|
disabled?: boolean;
|
|
59
88
|
/**
|
|
60
89
|
* Fires when a row is clicked (pointer only — rows are not keyboard-activatable).
|
|
61
|
-
* When provided and not `disabled`, rows get a pointer cursor
|
|
62
|
-
* hover/focus-within border on cells.
|
|
90
|
+
* When provided and the table is not `disabled`, rows get a pointer cursor
|
|
91
|
+
* and a hover/focus-within border on cells. Inner interactive elements
|
|
92
|
+
* should call `event.stopPropagation()` to prevent the row handler from firing.
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* <DataTable
|
|
96
|
+
* data={users}
|
|
97
|
+
* columns={columns}
|
|
98
|
+
* onRowClick={(rowData, rowIndex) => openDetail(rowData.id)}
|
|
99
|
+
* />
|
|
63
100
|
*/
|
|
64
101
|
onRowClick?: (rowData: T, rowIndex: number) => void;
|
|
65
102
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,qBAAqB;;;8EAmB1B,CAAA;AAED
|
|
1
|
+
{"version":3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