@devalok/shilp-sutra 0.31.0 → 0.33.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/LICENSE +21 -0
- package/dist/_chunks/badge-group.js +123 -172
- package/dist/_chunks/date-time-picker.js +851 -0
- package/dist/_chunks/document-preview.js +92 -0
- package/dist/_chunks/file-preview.js +511 -0
- package/dist/_chunks/image-preview.js +90 -0
- package/dist/_chunks/mention-suggestion.js +362 -0
- package/dist/_chunks/primitives.js +109 -109
- package/dist/_chunks/stat-row.js +144 -124
- package/dist/_chunks/tiptap.js +11595 -7731
- package/dist/_chunks/use-calendar.js +117 -890
- package/dist/_chunks/vendor-client.js +1055 -894
- package/dist/ai/block-renderer.d.ts +2 -1
- package/dist/ai/block-renderer.d.ts.map +1 -1
- package/dist/ai/block-renderer.js +30 -29
- package/dist/ai/blocks/block-table.d.ts.map +1 -1
- package/dist/ai/blocks/confirm.d.ts.map +1 -1
- package/dist/ai/blocks/divider.d.ts.map +1 -1
- package/dist/ai/blocks/error.d.ts.map +1 -1
- package/dist/ai/blocks/info.d.ts.map +1 -1
- package/dist/ai/blocks/loading.d.ts.map +1 -1
- package/dist/ai/blocks/stat-row.d.ts.map +1 -1
- package/dist/ai/blocks/success.d.ts.map +1 -1
- package/dist/ai/blocks/text.d.ts.map +1 -1
- package/dist/ai/command-bar.d.ts +18 -0
- package/dist/ai/command-bar.d.ts.map +1 -1
- package/dist/ai/command-bar.js +126 -125
- package/dist/ai/conversation.d.ts +13 -1
- package/dist/ai/conversation.d.ts.map +1 -1
- package/dist/ai/conversation.js +78 -78
- package/dist/ai/types.d.ts +0 -1
- package/dist/ai/types.d.ts.map +1 -1
- package/dist/ai/types.js +0 -1
- package/dist/composed/bulk-action-bar.d.ts +6 -4
- package/dist/composed/bulk-action-bar.d.ts.map +1 -1
- package/dist/composed/bulk-action-bar.js +102 -58
- package/dist/composed/command-palette.d.ts +9 -0
- package/dist/composed/command-palette.d.ts.map +1 -1
- package/dist/composed/command-palette.js +68 -68
- package/dist/composed/confirm-dialog.d.ts +1 -1
- package/dist/composed/confirm-dialog.d.ts.map +1 -1
- package/dist/composed/confirm-dialog.js +10 -10
- package/dist/composed/date-picker/date-picker.d.ts +11 -1
- package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/index.js +9 -8
- package/dist/composed/date-picker/month-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/year-picker.d.ts.map +1 -1
- package/dist/composed/deadline-indicator.d.ts +1 -1
- package/dist/composed/deadline-indicator.d.ts.map +1 -1
- package/dist/composed/deadline-indicator.js +39 -36
- package/dist/composed/emoji-picker.d.ts +14 -2
- package/dist/composed/emoji-picker.d.ts.map +1 -1
- package/dist/composed/emoji-picker.js +66 -55
- package/dist/composed/error-boundary.d.ts +21 -1
- package/dist/composed/error-boundary.d.ts.map +1 -1
- package/dist/composed/error-boundary.js +47 -32
- package/dist/composed/extensions/emoji-data.d.ts +35 -0
- package/dist/composed/extensions/emoji-data.d.ts.map +1 -0
- package/dist/composed/extensions/emoji-node.d.ts +11 -0
- package/dist/composed/extensions/emoji-node.d.ts.map +1 -0
- package/dist/composed/extensions/emoji-suggestion.d.ts +4 -6
- package/dist/composed/extensions/emoji-suggestion.d.ts.map +1 -1
- package/dist/composed/extensions/slash-command.d.ts +35 -0
- package/dist/composed/extensions/slash-command.d.ts.map +1 -0
- package/dist/composed/file-preview/audio-preview.d.ts +7 -0
- package/dist/composed/file-preview/audio-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/document-preview.d.ts +7 -0
- package/dist/composed/file-preview/document-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/embed-preview.d.ts +7 -0
- package/dist/composed/file-preview/embed-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/image-preview.d.ts +7 -0
- package/dist/composed/file-preview/image-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/shared.d.ts +20 -0
- package/dist/composed/file-preview/shared.d.ts.map +1 -0
- package/dist/composed/file-preview/video-preview.d.ts +6 -0
- package/dist/composed/file-preview/video-preview.d.ts.map +1 -0
- package/dist/composed/file-preview.d.ts.map +1 -1
- package/dist/composed/file-preview.js +10 -662
- package/dist/composed/filter-bar.d.ts +10 -2
- package/dist/composed/filter-bar.d.ts.map +1 -1
- package/dist/composed/filter-bar.js +42 -43
- package/dist/composed/form-section.d.ts +1 -1
- package/dist/composed/form-section.d.ts.map +1 -1
- package/dist/composed/form-section.js +22 -21
- package/dist/composed/index.d.ts +9 -3
- package/dist/composed/index.d.ts.map +1 -1
- package/dist/composed/index.js +79 -69
- package/dist/composed/inline-edit.d.ts +1 -1
- package/dist/composed/inline-edit.d.ts.map +1 -1
- package/dist/composed/inline-edit.js +33 -32
- package/dist/composed/markdown-viewer.d.ts +1 -1
- package/dist/composed/markdown-viewer.d.ts.map +1 -1
- package/dist/composed/markdown-viewer.js +60 -59
- package/dist/composed/master-detail.d.ts +11 -7
- package/dist/composed/master-detail.d.ts.map +1 -1
- package/dist/composed/master-detail.js +123 -84
- package/dist/composed/responsive-overlay.d.ts +8 -0
- package/dist/composed/responsive-overlay.d.ts.map +1 -1
- package/dist/composed/rich-chat-input/attachment-strip.d.ts +15 -0
- package/dist/composed/rich-chat-input/attachment-strip.d.ts.map +1 -0
- package/dist/composed/rich-chat-input/audio-player.d.ts +11 -0
- package/dist/composed/rich-chat-input/audio-player.d.ts.map +1 -0
- package/dist/composed/rich-chat-input/audio-waveform.d.ts +24 -0
- package/dist/composed/rich-chat-input/audio-waveform.d.ts.map +1 -0
- package/dist/composed/rich-chat-input/chat-toolbar.d.ts +51 -0
- package/dist/composed/rich-chat-input/chat-toolbar.d.ts.map +1 -0
- package/dist/composed/rich-chat-input/recording-overlay.d.ts +15 -0
- package/dist/composed/rich-chat-input/recording-overlay.d.ts.map +1 -0
- package/dist/composed/rich-chat-input/reply-banner.d.ts +8 -0
- package/dist/composed/rich-chat-input/reply-banner.d.ts.map +1 -0
- package/dist/composed/rich-chat-input/schedule-send.d.ts +22 -0
- package/dist/composed/rich-chat-input/schedule-send.d.ts.map +1 -0
- package/dist/composed/rich-chat-input/use-voice-recorder.d.ts +18 -0
- package/dist/composed/rich-chat-input/use-voice-recorder.d.ts.map +1 -0
- package/dist/composed/rich-chat-input.d.ts +91 -0
- package/dist/composed/rich-chat-input.d.ts.map +1 -0
- package/dist/composed/rich-chat-input.js +1861 -0
- package/dist/composed/rich-text-editor.d.ts +14 -3
- package/dist/composed/rich-text-editor.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.js +278 -447
- package/dist/composed/schedule-view.d.ts +9 -1
- package/dist/composed/schedule-view.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +8 -4
- package/dist/hooks/use-touch-device.d.ts +12 -0
- package/dist/hooks/use-touch-device.d.ts.map +1 -0
- package/dist/hooks/use-touch-device.js +13 -0
- package/dist/hooks/use-viewport-height.d.ts +11 -0
- package/dist/hooks/use-viewport-height.d.ts.map +1 -0
- package/dist/hooks/use-viewport-height.js +16 -0
- package/dist/shell/bottom-navbar.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.js +72 -63
- package/dist/shell/command-registry.d.ts.map +1 -1
- package/dist/shell/notification-center.d.ts.map +1 -1
- package/dist/shell/notification-center.js +77 -77
- package/dist/shell/top-bar.d.ts +2 -2
- package/dist/shell/top-bar.d.ts.map +1 -1
- package/dist/shell/top-bar.js +61 -60
- package/dist/tailwind/index.cjs +51 -7
- package/dist/tailwind/preset.d.ts.map +1 -1
- package/dist/tailwind/preset.js +51 -7
- package/dist/tokens/primitives.css +3 -1
- package/dist/tokens/semantic.css +16 -13
- package/dist/ui/autocomplete.d.ts.map +1 -1
- package/dist/ui/autocomplete.js +38 -39
- package/dist/ui/badge.d.ts +104 -2
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/banner.d.ts.map +1 -1
- package/dist/ui/banner.js +8 -7
- package/dist/ui/button-group.d.ts +27 -37
- package/dist/ui/button-group.d.ts.map +1 -1
- package/dist/ui/button-group.js +95 -29
- package/dist/ui/button.d.ts +2 -2
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +118 -134
- package/dist/ui/card.js +24 -24
- package/dist/ui/charts/area-chart.d.ts +2 -0
- package/dist/ui/charts/area-chart.d.ts.map +1 -1
- package/dist/ui/charts/bar-chart.d.ts +2 -0
- package/dist/ui/charts/bar-chart.d.ts.map +1 -1
- package/dist/ui/charts/chart-container.d.ts +2 -0
- package/dist/ui/charts/chart-container.d.ts.map +1 -1
- package/dist/ui/charts/index.js +583 -577
- package/dist/ui/charts/line-chart.d.ts +2 -0
- package/dist/ui/charts/line-chart.d.ts.map +1 -1
- package/dist/ui/charts/pie-chart.d.ts +2 -0
- package/dist/ui/charts/pie-chart.d.ts.map +1 -1
- package/dist/ui/charts/radar-chart.d.ts +2 -0
- package/dist/ui/charts/radar-chart.d.ts.map +1 -1
- package/dist/ui/checkbox.d.ts +2 -0
- package/dist/ui/checkbox.d.ts.map +1 -1
- package/dist/ui/checkbox.js +36 -27
- package/dist/ui/color-input.js +5 -5
- package/dist/ui/combobox.d.ts +6 -1
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +1 -1
- package/dist/ui/context-menu.js +1 -1
- package/dist/ui/data-table-body.d.ts +12 -0
- package/dist/ui/data-table-body.d.ts.map +1 -0
- package/dist/ui/data-table-body.js +219 -0
- package/dist/ui/data-table-bulk-actions.d.ts +19 -0
- package/dist/ui/data-table-bulk-actions.d.ts.map +1 -0
- package/dist/ui/data-table-bulk-actions.js +61 -0
- package/dist/ui/data-table-card.d.ts +9 -0
- package/dist/ui/data-table-card.d.ts.map +1 -0
- package/dist/ui/data-table-card.js +73 -0
- package/dist/ui/data-table-context.d.ts +62 -0
- package/dist/ui/data-table-context.d.ts.map +1 -0
- package/dist/ui/data-table-context.js +48 -0
- package/dist/ui/data-table-header.d.ts +10 -0
- package/dist/ui/data-table-header.d.ts.map +1 -0
- package/dist/ui/data-table-header.js +141 -0
- package/dist/ui/data-table-pagination.d.ts +13 -0
- package/dist/ui/data-table-pagination.d.ts.map +1 -0
- package/dist/ui/data-table-pagination.js +84 -0
- package/dist/ui/data-table.d.ts +11 -9
- package/dist/ui/data-table.d.ts.map +1 -1
- package/dist/ui/data-table.js +258 -573
- package/dist/ui/dialog.d.ts +6 -2
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +84 -82
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/hover-card.d.ts +7 -0
- package/dist/ui/hover-card.d.ts.map +1 -1
- package/dist/ui/hover-card.js +3 -3
- package/dist/ui/icon-group.d.ts +2 -4
- package/dist/ui/icon-group.d.ts.map +1 -1
- package/dist/ui/icon-group.js +22 -23
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +324 -327
- package/dist/ui/label.js +1 -1
- package/dist/ui/lib/bottom-sheet.d.ts +16 -0
- package/dist/ui/lib/bottom-sheet.d.ts.map +1 -0
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/menubar.js +64 -73
- package/dist/ui/navigation-menu.d.ts.map +1 -1
- package/dist/ui/navigation-menu.js +40 -44
- package/dist/ui/number-input.d.ts.map +1 -1
- package/dist/ui/number-input.js +19 -17
- package/dist/ui/popover.d.ts.map +1 -1
- package/dist/ui/popover.js +107 -32
- package/dist/ui/progress-ring.d.ts.map +1 -1
- package/dist/ui/progress-ring.js +80 -80
- package/dist/ui/progress.js +4 -4
- package/dist/ui/radio.d.ts +5 -2
- package/dist/ui/radio.d.ts.map +1 -1
- package/dist/ui/radio.js +29 -20
- package/dist/ui/search-input.d.ts.map +1 -1
- package/dist/ui/search-input.js +13 -12
- package/dist/ui/segmented-control.d.ts +6 -108
- package/dist/ui/segmented-control.d.ts.map +1 -1
- package/dist/ui/segmented-control.js +86 -272
- package/dist/ui/select.js +5 -5
- package/dist/ui/separator.js +5 -5
- package/dist/ui/sheet.d.ts +2 -0
- package/dist/ui/sheet.d.ts.map +1 -1
- package/dist/ui/sheet.js +102 -84
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +200 -175
- package/dist/ui/slider.js +14 -14
- package/dist/ui/split-button.d.ts +45 -0
- package/dist/ui/split-button.d.ts.map +1 -0
- package/dist/ui/split-button.js +282 -0
- package/dist/ui/status-dot.js +8 -8
- package/dist/ui/stepper.d.ts.map +1 -1
- package/dist/ui/stepper.js +33 -31
- package/dist/ui/switch.js +3 -3
- package/dist/ui/tabs.js +6 -6
- package/dist/ui/toast-types.d.ts +0 -1
- package/dist/ui/toast-types.d.ts.map +1 -1
- package/dist/ui/toast-types.js +0 -1
- package/dist/ui/toast.d.ts.map +1 -1
- package/dist/ui/toast.js +156 -150
- package/dist/ui/toggle-group.js +1 -1
- package/dist/ui/toggle.js +1 -1
- package/dist/ui/tooltip.js +3 -3
- package/docs/components/composed/emoji-picker.md +9 -0
- package/docs/components/composed/rich-chat-input.md +88 -0
- package/docs/components/composed/rich-text-editor.md +5 -0
- package/docs/components/ui/button-group.md +9 -0
- package/docs/components/ui/button.md +4 -0
- package/docs/components/ui/data-table-body.md +13 -0
- package/docs/components/ui/data-table-bulk-actions.md +13 -0
- package/docs/components/ui/data-table-card.md +13 -0
- package/docs/components/ui/data-table-context.md +13 -0
- package/docs/components/ui/data-table-header.md +13 -0
- package/docs/components/ui/data-table-pagination.md +13 -0
- package/docs/components/ui/split-button.md +41 -0
- package/llms-full.txt +235 -48
- package/llms.txt +54 -2
- package/package.json +30 -31
- package/dist/ui/chip.d.ts +0 -19
- package/dist/ui/chip.d.ts.map +0 -1
- package/dist/ui/chip.js +0 -14
- package/dist/ui/lib/use-ripple.d.ts +0 -14
- package/dist/ui/lib/use-ripple.d.ts.map +0 -1
package/dist/ui/banner.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e, jsxs as x } from "react/jsx-runtime";
|
|
3
|
-
import { IconInfoCircle as
|
|
3
|
+
import { IconInfoCircle as o, IconAlertCircle as h, IconAlertTriangle as v, IconCircleCheck as w, IconX as I } from "@tabler/icons-react";
|
|
4
4
|
import * as r from "react";
|
|
5
5
|
import { a as N } from "../_chunks/vendor-utils.js";
|
|
6
6
|
import { cn as C } from "./lib/utils.js";
|
|
@@ -22,14 +22,14 @@ const B = N(
|
|
|
22
22
|
defaultVariants: { color: "info" }
|
|
23
23
|
}
|
|
24
24
|
), V = {
|
|
25
|
-
info:
|
|
25
|
+
info: o,
|
|
26
26
|
success: w,
|
|
27
27
|
warning: v,
|
|
28
28
|
error: h,
|
|
29
|
-
neutral:
|
|
29
|
+
neutral: o
|
|
30
30
|
}, j = r.forwardRef(
|
|
31
|
-
({ className: a, color: s = "info", action: c, actions:
|
|
32
|
-
const
|
|
31
|
+
({ className: a, color: s = "info", action: c, actions: l, onDismiss: n, children: d, ...m }, f) => {
|
|
32
|
+
const t = l ?? c, u = V[s ?? "info"], [b, p] = r.useState(!0), g = r.useCallback(() => {
|
|
33
33
|
p(!1);
|
|
34
34
|
}, []);
|
|
35
35
|
return /* @__PURE__ */ e(A, { onExitComplete: n, children: b && /* @__PURE__ */ x(
|
|
@@ -44,8 +44,8 @@ const B = N(
|
|
|
44
44
|
...k(m),
|
|
45
45
|
children: [
|
|
46
46
|
/* @__PURE__ */ e(i, { icon: u, size: "md", className: "shrink-0" }),
|
|
47
|
-
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children:
|
|
48
|
-
|
|
47
|
+
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: d }),
|
|
48
|
+
t && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-ds-02 [&_button]:transition-colors [&_button]:duration-moderate-01 [&_button]:ease-productive-standard [&_button:hover]:bg-current/10", children: t }),
|
|
49
49
|
n && /* @__PURE__ */ e(
|
|
50
50
|
"button",
|
|
51
51
|
{
|
|
@@ -53,6 +53,7 @@ const B = N(
|
|
|
53
53
|
onClick: g,
|
|
54
54
|
className: "shrink-0 min-h-ds-xs min-w-ds-xs flex items-center justify-center rounded-ds-sm transition-colors duration-moderate-01 ease-productive-standard hover:bg-current/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-9",
|
|
55
55
|
"aria-label": "Dismiss",
|
|
56
|
+
title: "Dismiss",
|
|
56
57
|
children: /* @__PURE__ */ e(i, { icon: I, size: "sm" })
|
|
57
58
|
}
|
|
58
59
|
)
|
|
@@ -1,60 +1,50 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ButtonProps } from './button';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
export type ButtonGroupPosition = 'first' | 'middle' | 'last' | 'only';
|
|
4
5
|
interface ButtonGroupContextValue {
|
|
5
6
|
variant?: ButtonProps['variant'];
|
|
6
7
|
color?: ButtonProps['color'];
|
|
7
8
|
weight?: ButtonProps['weight'];
|
|
8
9
|
shape?: ButtonProps['shape'];
|
|
9
10
|
size?: ButtonProps['size'];
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
orientation?: 'horizontal' | 'vertical';
|
|
13
|
+
attached?: boolean;
|
|
14
|
+
/** Internal: signals Button children to stretch to fill available width */
|
|
15
|
+
_stretch?: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface ButtonGroupItemContext {
|
|
18
|
+
position: ButtonGroupPosition;
|
|
10
19
|
}
|
|
20
|
+
declare const ButtonGroupItemContext: React.Context<ButtonGroupItemContext | null>;
|
|
11
21
|
export declare function useButtonGroup(): ButtonGroupContextValue;
|
|
22
|
+
export declare function useButtonGroupItem(): ButtonGroupItemContext | null;
|
|
12
23
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* **Context propagation:** Child `<Button>` components automatically inherit `variant`, `color`,
|
|
17
|
-
* `weight`, `shape`, and `size` from ButtonGroup. Individual children can still override any prop.
|
|
18
|
-
*
|
|
19
|
-
* **Visual joining:** Adjacent button borders are merged with negative margins and border-radius overrides.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* // Horizontal toolbar action group (outline variant shared):
|
|
23
|
-
* <ButtonGroup variant="outline" size="sm">
|
|
24
|
-
* <Button startIcon={<Icon icon={IconBold} />}>Bold</Button>
|
|
25
|
-
* <Button startIcon={<Icon icon={IconItalic} />}>Italic</Button>
|
|
26
|
-
* <Button startIcon={<Icon icon={IconUnderline} />}>Underline</Button>
|
|
27
|
-
* </ButtonGroup>
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* // Vertical action group for a sidebar panel:
|
|
31
|
-
* <ButtonGroup orientation="vertical" variant="ghost" size="md">
|
|
32
|
-
* <Button>Profile</Button>
|
|
33
|
-
* <Button>Settings</Button>
|
|
34
|
-
* <Button variant="ghost" color="error">Danger zone</Button>
|
|
35
|
-
* </ButtonGroup>
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* // Split button pattern (solid action + dropdown trigger):
|
|
39
|
-
* <ButtonGroup variant="solid" size="md">
|
|
40
|
-
* <Button onClick={handlePublish}>Publish</Button>
|
|
41
|
-
* <Button size="icon-md" aria-label="More publish options"><IconChevronDown /></Button>
|
|
42
|
-
* </ButtonGroup>
|
|
43
|
-
* // These are just a few ways — feel free to combine props creatively!
|
|
24
|
+
* Returns inline style for border-radius AND border-collapse based on position
|
|
25
|
+
* in an attached ButtonGroup. Inner borders are removed (not overlapped) to
|
|
26
|
+
* guarantee consistent 1px borders regardless of wrapper nesting.
|
|
44
27
|
*/
|
|
28
|
+
export declare function getGroupPositionStyle(position: ButtonGroupPosition, orientation: 'horizontal' | 'vertical'): React.CSSProperties | undefined;
|
|
45
29
|
export interface ButtonGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'> {
|
|
46
|
-
/** Shared variant applied to all child Buttons (children can override) */
|
|
30
|
+
/** Shared variant applied to all child Buttons (children can override). */
|
|
47
31
|
variant?: ButtonProps['variant'];
|
|
48
|
-
/** Shared color applied to all child Buttons (children can override) */
|
|
32
|
+
/** Shared color applied to all child Buttons (children can override). */
|
|
49
33
|
color?: ButtonProps['color'];
|
|
50
|
-
/** Shared weight applied to all child Buttons (children can override) */
|
|
34
|
+
/** Shared weight applied to all child Buttons (children can override). */
|
|
51
35
|
weight?: ButtonProps['weight'];
|
|
52
|
-
/** Shared shape applied to all child Buttons (children can override) */
|
|
36
|
+
/** Shared shape applied to all child Buttons (children can override). */
|
|
53
37
|
shape?: ButtonProps['shape'];
|
|
54
|
-
/** Shared size applied to all child Buttons (children can override) */
|
|
38
|
+
/** Shared size applied to all child Buttons (children can override). */
|
|
55
39
|
size?: ButtonProps['size'];
|
|
56
|
-
/**
|
|
40
|
+
/** Disable all child Buttons. */
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
/** Layout direction. @default 'horizontal' */
|
|
57
43
|
orientation?: 'horizontal' | 'vertical';
|
|
44
|
+
/** Whether buttons are visually attached (merged) or spaced apart. @default true */
|
|
45
|
+
attached?: boolean;
|
|
46
|
+
/** Stretch to full width of parent container. */
|
|
47
|
+
fullWidth?: boolean;
|
|
58
48
|
}
|
|
59
49
|
declare const ButtonGroup: React.ForwardRefExoticComponent<ButtonGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
50
|
export { ButtonGroup };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../src/ui/button-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../src/ui/button-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAI3C,MAAM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AC,CAAA;IAC5B,wEAAwE;IACxE,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC1B,iCAAiC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IACvC,oFAAoF;IACpF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iDAAiD;IACjD,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAyBD,QAAA,MAAM,WAAW,yFA6DhB,CAAA;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
package/dist/ui/button-group.js
CHANGED
|
@@ -1,42 +1,108 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
4
|
-
import { cn as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
return
|
|
2
|
+
import { jsx as i, jsxs as y } from "react/jsx-runtime";
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
import { cn as R } from "./lib/utils.js";
|
|
5
|
+
const x = t.createContext({}), B = t.createContext(null);
|
|
6
|
+
function j() {
|
|
7
|
+
return t.useContext(x);
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
function D() {
|
|
10
|
+
return t.useContext(B);
|
|
11
|
+
}
|
|
12
|
+
function I(o, r) {
|
|
13
|
+
if (o !== "only")
|
|
14
|
+
if (r === "horizontal")
|
|
15
|
+
switch (o) {
|
|
16
|
+
case "first":
|
|
17
|
+
return { borderTopRightRadius: 0, borderBottomRightRadius: 0, borderRightWidth: 0 };
|
|
18
|
+
case "middle":
|
|
19
|
+
return { borderRadius: 0, borderRightWidth: 0 };
|
|
20
|
+
case "last":
|
|
21
|
+
return { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 };
|
|
22
|
+
}
|
|
23
|
+
else
|
|
24
|
+
switch (o) {
|
|
25
|
+
case "first":
|
|
26
|
+
return { borderBottomLeftRadius: 0, borderBottomRightRadius: 0, borderBottomWidth: 0 };
|
|
27
|
+
case "middle":
|
|
28
|
+
return { borderRadius: 0, borderBottomWidth: 0 };
|
|
29
|
+
case "last":
|
|
30
|
+
return { borderTopLeftRadius: 0, borderTopRightRadius: 0 };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function L(o, r) {
|
|
34
|
+
if (o === "solid") {
|
|
35
|
+
const e = {
|
|
36
|
+
accent: "bg-accent-11/20",
|
|
37
|
+
error: "bg-error-11/20",
|
|
38
|
+
success: "bg-success-11/20",
|
|
39
|
+
warning: "bg-warning-11/20",
|
|
40
|
+
neutral: "bg-neutral-8/30"
|
|
41
|
+
};
|
|
42
|
+
return e[r ?? "accent"] ?? e.accent;
|
|
43
|
+
}
|
|
44
|
+
if (o === "soft") {
|
|
45
|
+
const e = {
|
|
46
|
+
accent: "bg-accent-5",
|
|
47
|
+
error: "bg-error-5",
|
|
48
|
+
success: "bg-success-5",
|
|
49
|
+
warning: "bg-warning-5",
|
|
50
|
+
neutral: "bg-neutral-4"
|
|
51
|
+
};
|
|
52
|
+
return e[r ?? "accent"] ?? e.accent;
|
|
53
|
+
}
|
|
54
|
+
return "bg-surface-border";
|
|
55
|
+
}
|
|
56
|
+
const P = t.forwardRef(
|
|
57
|
+
({ className: o, variant: r, color: e, weight: a, shape: l, size: f, disabled: g, orientation: n = "horizontal", attached: s = !0, fullWidth: c, children: m, ...v }, w) => {
|
|
58
|
+
const h = c || n === "vertical", C = t.useMemo(
|
|
59
|
+
() => ({ variant: r, color: e, weight: a, shape: l, size: f, disabled: g, orientation: n, attached: s, _stretch: h }),
|
|
60
|
+
[r, e, a, l, f, g, n, s, h]
|
|
61
|
+
), b = t.Children.toArray(m).filter(t.isValidElement), p = b.length;
|
|
62
|
+
function G(u) {
|
|
63
|
+
return p === 1 ? "only" : u === 0 ? "first" : u === p - 1 ? "last" : "middle";
|
|
64
|
+
}
|
|
65
|
+
return /* @__PURE__ */ i(x.Provider, { value: C, children: /* @__PURE__ */ i(
|
|
13
66
|
"div",
|
|
14
67
|
{
|
|
15
|
-
ref:
|
|
68
|
+
ref: w,
|
|
16
69
|
role: "group",
|
|
17
|
-
className:
|
|
70
|
+
className: R(
|
|
18
71
|
"inline-flex",
|
|
19
|
-
c
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
]
|
|
25
|
-
|
|
26
|
-
"[&>*:not(:first-child)]:rounded-t-none",
|
|
27
|
-
"[&>*:not(:last-child)]:rounded-b-none",
|
|
28
|
-
"[&>*:not(:first-child)]:-mt-px"
|
|
29
|
-
],
|
|
30
|
-
i
|
|
72
|
+
c && "w-full",
|
|
73
|
+
c && n === "horizontal" && "[&>*]:flex-1",
|
|
74
|
+
n === "horizontal" ? "flex-row" : "flex-col items-stretch",
|
|
75
|
+
!s && "gap-ds-02",
|
|
76
|
+
// Focus isolation — lift focused/hovered button above siblings
|
|
77
|
+
"[&>*:focus-within]:z-10 [&>*:hover]:z-10",
|
|
78
|
+
o
|
|
31
79
|
),
|
|
32
|
-
...
|
|
33
|
-
children: s
|
|
80
|
+
...v,
|
|
81
|
+
children: s ? b.map((u, d) => {
|
|
82
|
+
const z = d > 0 && r !== "outline";
|
|
83
|
+
return /* @__PURE__ */ y(t.Fragment, { children: [
|
|
84
|
+
z && /* @__PURE__ */ i(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
"aria-hidden": !0,
|
|
88
|
+
className: R(
|
|
89
|
+
"shrink-0 self-stretch",
|
|
90
|
+
n === "horizontal" ? "w-px" : "h-px",
|
|
91
|
+
L(r ?? void 0, e ?? void 0)
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ i(B.Provider, { value: { position: G(d) }, children: u })
|
|
96
|
+
] }, d);
|
|
97
|
+
}) : m
|
|
34
98
|
}
|
|
35
99
|
) });
|
|
36
100
|
}
|
|
37
101
|
);
|
|
38
|
-
|
|
102
|
+
P.displayName = "ButtonGroup";
|
|
39
103
|
export {
|
|
40
|
-
|
|
41
|
-
|
|
104
|
+
P as ButtonGroup,
|
|
105
|
+
I as getGroupPositionStyle,
|
|
106
|
+
j as useButtonGroup,
|
|
107
|
+
D as useButtonGroupItem
|
|
42
108
|
};
|
package/dist/ui/button.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
export declare const buttonVariants: (props?: ({
|
|
5
|
-
variant?: "link" | "outline" | "
|
|
6
|
-
color?: "
|
|
5
|
+
variant?: "link" | "outline" | "solid" | "soft" | "ghost" | null | undefined;
|
|
6
|
+
color?: "accent" | "success" | "error" | "warning" | "neutral" | null | undefined;
|
|
7
7
|
weight?: "normal" | "semibold" | null | undefined;
|
|
8
8
|
size?: "xs" | "sm" | "md" | "lg" | "icon" | "compact-xs" | "compact-sm" | "compact-md" | "icon-xs" | "icon-sm" | "icon-md" | "icon-lg" | null | undefined;
|
|
9
9
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
package/dist/ui/button.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/ui/button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAW9B,eAAO,MAAM,cAAc;;;;;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/ui/button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAW9B,eAAO,MAAM,cAAc;;;;;8EAiF1B,CAAA;AAoDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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