@knkcs/anker 0.0.1 → 0.0.2
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/atoms/index.d.ts +48 -12
- package/dist/atoms/index.js +77 -49
- package/dist/atoms/index.js.map +1 -1
- package/dist/{chunk-FGKGX4UF.js → chunk-7UJ4QEUW.js} +4 -3
- package/dist/chunk-7UJ4QEUW.js.map +1 -0
- package/dist/chunk-C4JI3JNA.js +147 -0
- package/dist/chunk-C4JI3JNA.js.map +1 -0
- package/dist/chunk-GJTQLZ4O.js +73 -0
- package/dist/chunk-GJTQLZ4O.js.map +1 -0
- package/dist/chunk-NJFF6S77.js +108 -0
- package/dist/chunk-NJFF6S77.js.map +1 -0
- package/dist/chunk-QU3FF5WI.js +36 -0
- package/dist/chunk-QU3FF5WI.js.map +1 -0
- package/dist/{chunk-4D3EY2W2.js → chunk-YSFUGIQM.js} +388 -34
- package/dist/chunk-YSFUGIQM.js.map +1 -0
- package/dist/components/index.d.ts +124 -12
- package/dist/components/index.js +291 -50
- package/dist/components/index.js.map +1 -1
- package/dist/forms/index.d.ts +2 -13
- package/dist/forms/index.js +81 -119
- package/dist/forms/index.js.map +1 -1
- package/dist/primitives/index.d.ts +142 -90
- package/dist/primitives/index.js +38 -116
- package/dist/primitives/index.js.map +1 -1
- package/dist/theme/index.d.ts +80 -8
- package/dist/theme/index.js +1 -1
- package/package.json +5 -1
- package/dist/chunk-4D3EY2W2.js.map +0 -1
- package/dist/chunk-4T32UC26.js +0 -81
- package/dist/chunk-4T32UC26.js.map +0 -1
- package/dist/chunk-FGKGX4UF.js.map +0 -1
- package/dist/chunk-QSCNXHMU.js +0 -32
- package/dist/chunk-QSCNXHMU.js.map +0 -1
- package/dist/chunk-YXTW5OAJ.js +0 -303
- package/dist/chunk-YXTW5OAJ.js.map +0 -1
package/dist/atoms/index.d.ts
CHANGED
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
3
|
import React__default, { ReactNode } from 'react';
|
|
4
|
-
import { IconButtonProps, BoxProps, useCheckboxGroup, StackProps, UseCheckboxGroupProps, Clipboard, InputProps,
|
|
4
|
+
import { ButtonProps, IconButtonProps, BoxProps, useCheckboxGroup, StackProps, UseCheckboxGroupProps, Clipboard, InputProps, DataList as DataList$1, HTMLChakraProps, TextProps, BadgeProps } from '@chakra-ui/react';
|
|
5
|
+
export { ButtonProps, IconButtonProps } from '@chakra-ui/react';
|
|
5
6
|
import { b as AvatarProps } from '../avatar-DhqkKdqc.js';
|
|
6
7
|
export { S as SearchInput, a as SearchInputProps } from '../search-input-C_Cl2OEx.js';
|
|
7
8
|
import { Props, GroupBase, MultiValue, SingleValue, ActionMeta, SelectInstance, MenuListProps, OptionProps } from 'chakra-react-select';
|
|
8
9
|
export { ActionMeta, Select as ChakraReactSelect, ChakraStylesConfig, CreatableSelect, GroupBase, MenuListProps, MultiValue, OptionProps, SelectInstance, SingleValue, SingleValueProps, StylesConfig, chakraComponents } from 'chakra-react-select';
|
|
9
10
|
|
|
11
|
+
declare const Button: {
|
|
12
|
+
({ ref, ...props }: ButtonProps & {
|
|
13
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
14
|
+
}): react_jsx_runtime.JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
declare const IconButton: {
|
|
19
|
+
({ ref, ...props }: IconButtonProps & {
|
|
20
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
21
|
+
}): react_jsx_runtime.JSX.Element;
|
|
22
|
+
displayName: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
10
25
|
interface ActionProps extends React__default.HTMLAttributes<HTMLButtonElement> {
|
|
11
26
|
cursor?: string;
|
|
12
27
|
}
|
|
@@ -393,22 +408,31 @@ interface PersonaAvatarOptions extends Pick<PersonaProps, "name" | "size"> {
|
|
|
393
408
|
}
|
|
394
409
|
interface PersonaAvatarProps extends PersonaAvatarOptions, Omit<AvatarProps, "size"> {
|
|
395
410
|
}
|
|
396
|
-
declare const PersonaAvatar:
|
|
397
|
-
ref
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
}
|
|
402
|
-
declare const
|
|
403
|
-
ref
|
|
404
|
-
|
|
411
|
+
declare const PersonaAvatar: {
|
|
412
|
+
({ ref, ...props }: PersonaAvatarProps & {
|
|
413
|
+
ref?: React__default.Ref<HTMLDivElement>;
|
|
414
|
+
}): react_jsx_runtime.JSX.Element;
|
|
415
|
+
displayName: string;
|
|
416
|
+
};
|
|
417
|
+
declare const PersonaDetails: {
|
|
418
|
+
({ ref, ...props }: HTMLChakraProps<"div"> & {
|
|
419
|
+
ref?: React__default.Ref<HTMLDivElement>;
|
|
420
|
+
}): react_jsx_runtime.JSX.Element;
|
|
421
|
+
displayName: string;
|
|
422
|
+
};
|
|
423
|
+
declare const PersonaLabel: {
|
|
424
|
+
({ ref, ...props }: HTMLChakraProps<"span"> & {
|
|
425
|
+
ref?: React__default.Ref<HTMLSpanElement>;
|
|
426
|
+
}): react_jsx_runtime.JSX.Element;
|
|
427
|
+
displayName: string;
|
|
428
|
+
};
|
|
405
429
|
|
|
406
430
|
interface BaseOption {
|
|
407
431
|
id: string;
|
|
408
432
|
label: string;
|
|
409
433
|
avatar?: string;
|
|
410
434
|
color?: string;
|
|
411
|
-
icon?:
|
|
435
|
+
icon?: React__default.ReactNode;
|
|
412
436
|
data?: Record<string, unknown>;
|
|
413
437
|
}
|
|
414
438
|
|
|
@@ -493,6 +517,18 @@ declare const createTableMenuComponents: <T extends BaseOption>(options: CreateT
|
|
|
493
517
|
Option: (props: OptionProps<T, boolean, GroupBase<T>>) => react_jsx_runtime.JSX.Element;
|
|
494
518
|
};
|
|
495
519
|
|
|
520
|
+
interface SplitButtonMenuItem {
|
|
521
|
+
label: string;
|
|
522
|
+
onClick: () => void;
|
|
523
|
+
icon?: React__default.ReactNode;
|
|
524
|
+
color?: string;
|
|
525
|
+
}
|
|
526
|
+
interface SplitButtonProps extends ButtonProps {
|
|
527
|
+
label: string;
|
|
528
|
+
menuItems?: SplitButtonMenuItem[];
|
|
529
|
+
}
|
|
530
|
+
declare const SplitButton: React__default.FC<SplitButtonProps>;
|
|
531
|
+
|
|
496
532
|
interface StatProps extends BoxProps {
|
|
497
533
|
/** An icon element rendered as React node (e.g., a lucide-react icon) */
|
|
498
534
|
icon?: React__default.ReactNode;
|
|
@@ -533,4 +569,4 @@ interface TypeBadgeProps extends Omit<BadgeProps, "children"> {
|
|
|
533
569
|
}
|
|
534
570
|
declare const TypeBadge: React__default.FC<TypeBadgeProps>;
|
|
535
571
|
|
|
536
|
-
export { Action, type ActionProps, type BaseOption, BaseSelect, type BaseSelectProps, CheckboxCard, CheckboxCardGroup, type CheckboxCardGroupProps, type CheckboxCardProps, ClipboardButton, type ClipboardButtonProps, ClipboardInput, type ClipboardInputProps, ClipboardLink, type ClipboardLinkProps, Collapse, type CollapseProps, Comment, CommentAction, type CommentActionProps, type CommentFooterProps, type CommentHeaderProps, type CommentProps, CommentReplyBox, type CommentReplyBoxProps, type CreateTableMenuComponentsOptions, DataList, DataListItem, DataListItemLabel, type DataListItemType, DataListItemValue, type DataListProps, type DataListRootProps, type DateFormat, DateInput, type DateInputProps, type DateType, Edit, type EditProps, EmptyState, type EmptyStateProps, Filter, type FilterProps, Handle, type HandleProps, Persona, PersonaAvatar, PersonaContainer, type PersonaContainerProps, PersonaDetails, PersonaLabel, type PersonaProps, RelativeDateTime, type RelativeDateTimeProps, Remove, type RemoveProps, Stat, type StatProps, StatusBadge, type StatusBadgeProps, type TableMenuColumn, TableMenuList, type TableMenuListProps, TableOption, TextInput, type TextInputProps, TextOverflow, type TextOverflowProps, TypeBadge, type TypeBadgeProps, createTableMenuComponents, formatDate, formatDateAndTime, formatMachineReadableDateTime, formatRelativeDateTime, formatRelativeToCurrentWeekDateTime, formatTime, formatWeekdayDate };
|
|
572
|
+
export { Action, type ActionProps, type BaseOption, BaseSelect, type BaseSelectProps, Button, CheckboxCard, CheckboxCardGroup, type CheckboxCardGroupProps, type CheckboxCardProps, ClipboardButton, type ClipboardButtonProps, ClipboardInput, type ClipboardInputProps, ClipboardLink, type ClipboardLinkProps, Collapse, type CollapseProps, Comment, CommentAction, type CommentActionProps, type CommentFooterProps, type CommentHeaderProps, type CommentProps, CommentReplyBox, type CommentReplyBoxProps, type CreateTableMenuComponentsOptions, DataList, DataListItem, DataListItemLabel, type DataListItemType, DataListItemValue, type DataListProps, type DataListRootProps, type DateFormat, DateInput, type DateInputProps, type DateType, Edit, type EditProps, EmptyState, type EmptyStateProps, Filter, type FilterProps, Handle, type HandleProps, IconButton, Persona, PersonaAvatar, PersonaContainer, type PersonaContainerProps, PersonaDetails, PersonaLabel, type PersonaProps, RelativeDateTime, type RelativeDateTimeProps, Remove, type RemoveProps, SplitButton, type SplitButtonMenuItem, type SplitButtonProps, Stat, type StatProps, StatusBadge, type StatusBadgeProps, type TableMenuColumn, TableMenuList, type TableMenuListProps, TableOption, TextInput, type TextInputProps, TextOverflow, type TextOverflowProps, TypeBadge, type TypeBadgeProps, createTableMenuComponents, formatDate, formatDateAndTime, formatMachineReadableDateTime, formatRelativeDateTime, formatRelativeToCurrentWeekDateTime, formatTime, formatWeekdayDate };
|
package/dist/atoms/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { Prose, Avatar } from '../chunk-
|
|
2
|
-
import {
|
|
1
|
+
import { Prose, Avatar, Spinner } from '../chunk-QU3FF5WI.js';
|
|
2
|
+
import { IconButton, formatRelativeToCurrentWeekDateTime, formatRelativeDateTime, Button } from '../chunk-GJTQLZ4O.js';
|
|
3
|
+
export { Button, IconButton, StatusBadge, formatRelativeDateTime, formatRelativeToCurrentWeekDateTime } from '../chunk-GJTQLZ4O.js';
|
|
4
|
+
import { Tooltip, MenuRoot, MenuTrigger, MenuContent, MenuItem } from '../chunk-NJFF6S77.js';
|
|
3
5
|
export { SearchInput, text_input_default as TextInput } from '../chunk-PZCL4M6I.js';
|
|
4
|
-
import { DataList as DataList$1, Text, Box, Icon,
|
|
6
|
+
import { DataList as DataList$1, Text, Box, Icon, Circle, useCheckboxGroup, Stack, Clipboard, IconButton as IconButton$1, Input, chakra, HStack, Textarea, Flex, ButtonGroup, Button as Button$1, Heading, Table, Square, Badge } from '@chakra-ui/react';
|
|
5
7
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
-
import { ChevronRight, ChevronDown, Pencil, Filter as Filter$1, GripVertical, X, Clipboard as Clipboard$1, Check, Link } from 'lucide-react';
|
|
8
|
+
import { ChevronRight, ChevronDown, Pencil, Filter as Filter$1, GripVertical, X, Clipboard as Clipboard$1, Check, Link, Plus } from 'lucide-react';
|
|
7
9
|
import React, { createContext, memo, useRef, useState, useCallback, useEffect, useMemo, useContext } from 'react';
|
|
8
10
|
import dayjs2 from 'dayjs';
|
|
9
11
|
import calendarPlugin from 'dayjs/plugin/calendar.js';
|
|
@@ -11,7 +13,6 @@ import relativeTime from 'dayjs/plugin/relativeTime.js';
|
|
|
11
13
|
import utcPlugin from 'dayjs/plugin/utc.js';
|
|
12
14
|
import { Select, chakraComponents } from 'chakra-react-select';
|
|
13
15
|
export { Select as ChakraReactSelect, CreatableSelect, chakraComponents } from 'chakra-react-select';
|
|
14
|
-
import { readableColor } from 'color2k';
|
|
15
16
|
|
|
16
17
|
var Action = ({
|
|
17
18
|
ref,
|
|
@@ -61,7 +62,17 @@ var Filter = ({
|
|
|
61
62
|
}) => {
|
|
62
63
|
const { activeFilterCount, ...rest } = props;
|
|
63
64
|
return /* @__PURE__ */ jsxs(Box, { position: "relative", children: [
|
|
64
|
-
/* @__PURE__ */ jsx(
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
IconButton,
|
|
67
|
+
{
|
|
68
|
+
variant: "ghost",
|
|
69
|
+
cursor: "pointer",
|
|
70
|
+
ref,
|
|
71
|
+
"aria-label": filterLabel,
|
|
72
|
+
...rest,
|
|
73
|
+
children: /* @__PURE__ */ jsx(Filter$1, {})
|
|
74
|
+
}
|
|
75
|
+
),
|
|
65
76
|
activeFilterCount && activeFilterCount > 0 ? /* @__PURE__ */ jsx(
|
|
66
77
|
Circle,
|
|
67
78
|
{
|
|
@@ -140,7 +151,7 @@ var ClipboardButton = function ClipboardButton2({
|
|
|
140
151
|
...props
|
|
141
152
|
}) {
|
|
142
153
|
const { label = "Copy", ...rest } = props;
|
|
143
|
-
return /* @__PURE__ */ jsx(Clipboard.Root, { ref, ...rest, children: /* @__PURE__ */ jsx(Clipboard.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { variant: "ghost", size: "sm", "aria-label": label, children: /* @__PURE__ */ jsx(Clipboard.Indicator, { copied: /* @__PURE__ */ jsx(Check, { size: 16 }), children: /* @__PURE__ */ jsx(Clipboard$1, { size: 16 }) }) }) }) });
|
|
154
|
+
return /* @__PURE__ */ jsx(Clipboard.Root, { ref, ...rest, children: /* @__PURE__ */ jsx(Clipboard.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(IconButton$1, { variant: "ghost", size: "sm", "aria-label": label, children: /* @__PURE__ */ jsx(Clipboard.Indicator, { copied: /* @__PURE__ */ jsx(Check, { size: 16 }), children: /* @__PURE__ */ jsx(Clipboard$1, { size: 16 }) }) }) }) });
|
|
144
155
|
};
|
|
145
156
|
ClipboardButton.displayName = "ClipboardButton";
|
|
146
157
|
var ClipboardInput = function ClipboardInput2({
|
|
@@ -150,7 +161,7 @@ var ClipboardInput = function ClipboardInput2({
|
|
|
150
161
|
const { inputProps, label = "Copy", ...rest } = props;
|
|
151
162
|
return /* @__PURE__ */ jsx(Clipboard.Root, { ref, ...rest, children: /* @__PURE__ */ jsxs(Clipboard.Control, { children: [
|
|
152
163
|
/* @__PURE__ */ jsx(Clipboard.Input, { asChild: true, children: /* @__PURE__ */ jsx(Input, { readOnly: true, ...inputProps }) }),
|
|
153
|
-
/* @__PURE__ */ jsx(Clipboard.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { variant: "outline", size: "sm", "aria-label": label, children: /* @__PURE__ */ jsx(Clipboard.Indicator, { copied: /* @__PURE__ */ jsx(Check, { size: 16 }), children: /* @__PURE__ */ jsx(Clipboard$1, { size: 16 }) }) }) })
|
|
164
|
+
/* @__PURE__ */ jsx(Clipboard.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(IconButton$1, { variant: "outline", size: "sm", "aria-label": label, children: /* @__PURE__ */ jsx(Clipboard.Indicator, { copied: /* @__PURE__ */ jsx(Check, { size: 16 }), children: /* @__PURE__ */ jsx(Clipboard$1, { size: 16 }) }) }) })
|
|
154
165
|
] }) });
|
|
155
166
|
};
|
|
156
167
|
ClipboardInput.displayName = "ClipboardInput";
|
|
@@ -159,7 +170,7 @@ var ClipboardLink = function ClipboardLink2({
|
|
|
159
170
|
...props
|
|
160
171
|
}) {
|
|
161
172
|
const { label = "Copy Link", ...rest } = props;
|
|
162
|
-
return /* @__PURE__ */ jsx(Clipboard.Root, { ref, ...rest, children: /* @__PURE__ */ jsx(Clipboard.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { variant: "ghost", size: "xs", "aria-label": label, children: /* @__PURE__ */ jsx(Clipboard.Indicator, { copied: /* @__PURE__ */ jsx(Check, { size: 14 }), children: /* @__PURE__ */ jsx(Link, { size: 14 }) }) }) }) });
|
|
173
|
+
return /* @__PURE__ */ jsx(Clipboard.Root, { ref, ...rest, children: /* @__PURE__ */ jsx(Clipboard.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(IconButton$1, { variant: "ghost", size: "xs", "aria-label": label, children: /* @__PURE__ */ jsx(Clipboard.Indicator, { copied: /* @__PURE__ */ jsx(Check, { size: 14 }), children: /* @__PURE__ */ jsx(Link, { size: 14 }) }) }) }) });
|
|
163
174
|
};
|
|
164
175
|
ClipboardLink.displayName = "ClipboardLink";
|
|
165
176
|
dayjs2.extend(utcPlugin);
|
|
@@ -212,21 +223,6 @@ var formatWeekdayDate = (date) => {
|
|
|
212
223
|
dayjs2.extend(utcPlugin);
|
|
213
224
|
dayjs2.extend(relativeTime);
|
|
214
225
|
dayjs2.extend(calendarPlugin);
|
|
215
|
-
function formatRelativeDateTime(date, baseDate = /* @__PURE__ */ new Date()) {
|
|
216
|
-
return dayjs2(date).from(baseDate);
|
|
217
|
-
}
|
|
218
|
-
function formatRelativeToCurrentWeekDateTime(date, baseDate = /* @__PURE__ */ new Date()) {
|
|
219
|
-
const isToday = dayjs2(date).isSame(baseDate, "day");
|
|
220
|
-
if (!isToday) {
|
|
221
|
-
return dayjs2(date).calendar(baseDate, {
|
|
222
|
-
sameElse: "DD MMM YYYY"
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
return formatRelativeDateTime(date, baseDate);
|
|
226
|
-
}
|
|
227
|
-
dayjs2.extend(utcPlugin);
|
|
228
|
-
dayjs2.extend(relativeTime);
|
|
229
|
-
dayjs2.extend(calendarPlugin);
|
|
230
226
|
var RelativeDateTime = (props) => {
|
|
231
227
|
const { date, baseDate, isRelativeToCurrentWeek, ...otherProps } = props;
|
|
232
228
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -241,6 +237,7 @@ var RelativeDateTime = (props) => {
|
|
|
241
237
|
}
|
|
242
238
|
return /* @__PURE__ */ jsx("time", { dateTime: machineReadableDate, ...otherProps, children: relativeDate });
|
|
243
239
|
};
|
|
240
|
+
RelativeDateTime.displayName = "RelativeDateTime";
|
|
244
241
|
var CommentStylesContext = createContext({});
|
|
245
242
|
var useStyles = () => useContext(CommentStylesContext);
|
|
246
243
|
var Comment = (props) => {
|
|
@@ -321,6 +318,7 @@ var CommentFooter = (props) => {
|
|
|
321
318
|
var CommentAction = (props) => {
|
|
322
319
|
return /* @__PURE__ */ jsx(Button, { variant: "outline", size: "xs", ...props });
|
|
323
320
|
};
|
|
321
|
+
CommentAction.displayName = "CommentAction";
|
|
324
322
|
var CommentReplyBox = ({
|
|
325
323
|
ref,
|
|
326
324
|
...props
|
|
@@ -390,7 +388,7 @@ var CommentReplyBox = ({
|
|
|
390
388
|
justifyContent: "flex-end",
|
|
391
389
|
children: /* @__PURE__ */ jsxs(ButtonGroup, { marginInlineStart: "auto", size: "sm", children: [
|
|
392
390
|
/* @__PURE__ */ jsx(
|
|
393
|
-
Button,
|
|
391
|
+
Button$1,
|
|
394
392
|
{
|
|
395
393
|
variant: "outline",
|
|
396
394
|
loading: isSubmitting,
|
|
@@ -398,7 +396,7 @@ var CommentReplyBox = ({
|
|
|
398
396
|
children: cancelLabel
|
|
399
397
|
}
|
|
400
398
|
),
|
|
401
|
-
/* @__PURE__ */ jsx(Button, { type: "submit", variant: "solid", loading: isSubmitting, children: replyLabel })
|
|
399
|
+
/* @__PURE__ */ jsx(Button$1, { type: "submit", variant: "solid", loading: isSubmitting, children: replyLabel })
|
|
402
400
|
] })
|
|
403
401
|
}
|
|
404
402
|
)
|
|
@@ -518,6 +516,7 @@ var PersonaAvatar = ({
|
|
|
518
516
|
const { name, size, ...rest } = props;
|
|
519
517
|
return /* @__PURE__ */ jsx(Avatar, { ref, name, size, ...rest });
|
|
520
518
|
};
|
|
519
|
+
PersonaAvatar.displayName = "PersonaAvatar";
|
|
521
520
|
var PersonaDetails = ({
|
|
522
521
|
ref,
|
|
523
522
|
...props
|
|
@@ -536,6 +535,7 @@ var PersonaDetails = ({
|
|
|
536
535
|
}
|
|
537
536
|
);
|
|
538
537
|
};
|
|
538
|
+
PersonaDetails.displayName = "PersonaDetails";
|
|
539
539
|
var PersonaLabel = ({
|
|
540
540
|
ref,
|
|
541
541
|
...props
|
|
@@ -543,6 +543,7 @@ var PersonaLabel = ({
|
|
|
543
543
|
const styles = usePersonaStyles();
|
|
544
544
|
return /* @__PURE__ */ jsx(chakra.span, { ref, style: styles.label, ...props });
|
|
545
545
|
};
|
|
546
|
+
PersonaLabel.displayName = "PersonaLabel";
|
|
546
547
|
var BaseSingleValue = ({
|
|
547
548
|
data,
|
|
548
549
|
...props
|
|
@@ -745,6 +746,55 @@ var createTableMenuComponents = (options) => ({
|
|
|
745
746
|
),
|
|
746
747
|
Option: (props) => /* @__PURE__ */ jsx(TableOption, { ...props, columns: options.columns })
|
|
747
748
|
});
|
|
749
|
+
var SplitButton = (props) => {
|
|
750
|
+
const { label, menuItems, onClick, ...rest } = props;
|
|
751
|
+
const hasMenuItems = menuItems && menuItems.length > 0;
|
|
752
|
+
return /* @__PURE__ */ jsxs(HStack, { gap: 0.5, children: [
|
|
753
|
+
onClick && /* @__PURE__ */ jsxs(
|
|
754
|
+
Button,
|
|
755
|
+
{
|
|
756
|
+
...rest,
|
|
757
|
+
colorPalette: "blue",
|
|
758
|
+
onClick,
|
|
759
|
+
size: "lg",
|
|
760
|
+
borderEndRadius: hasMenuItems ? "none" : void 0,
|
|
761
|
+
children: [
|
|
762
|
+
/* @__PURE__ */ jsx(Plus, { size: 16 }),
|
|
763
|
+
label
|
|
764
|
+
]
|
|
765
|
+
}
|
|
766
|
+
),
|
|
767
|
+
hasMenuItems && /* @__PURE__ */ jsxs(MenuRoot, { children: [
|
|
768
|
+
/* @__PURE__ */ jsx(MenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
769
|
+
Button,
|
|
770
|
+
{
|
|
771
|
+
...rest,
|
|
772
|
+
size: "lg",
|
|
773
|
+
colorPalette: "blue",
|
|
774
|
+
borderStartRadius: onClick ? "none" : void 0,
|
|
775
|
+
children: [
|
|
776
|
+
/* @__PURE__ */ jsx(ChevronDown, { size: 16 }),
|
|
777
|
+
onClick ? null : label
|
|
778
|
+
]
|
|
779
|
+
}
|
|
780
|
+
) }),
|
|
781
|
+
/* @__PURE__ */ jsx(MenuContent, { children: menuItems.map((menuItem) => /* @__PURE__ */ jsxs(
|
|
782
|
+
MenuItem,
|
|
783
|
+
{
|
|
784
|
+
value: menuItem.label,
|
|
785
|
+
onClick: menuItem.onClick,
|
|
786
|
+
color: menuItem.color,
|
|
787
|
+
children: [
|
|
788
|
+
menuItem.icon,
|
|
789
|
+
menuItem.label
|
|
790
|
+
]
|
|
791
|
+
},
|
|
792
|
+
menuItem.label
|
|
793
|
+
)) })
|
|
794
|
+
] })
|
|
795
|
+
] });
|
|
796
|
+
};
|
|
797
|
+
SplitButton.displayName = "SplitButton";
|
|
748
798
|
var Stat = (props) => {
|
|
749
799
|
const { label, value, icon, loading, ...boxProps } = props;
|
|
750
800
|
return /* @__PURE__ */ jsx(
|
|
@@ -767,28 +817,6 @@ var Stat = (props) => {
|
|
|
767
817
|
);
|
|
768
818
|
};
|
|
769
819
|
Stat.displayName = "Stat";
|
|
770
|
-
var StatusBadge = (props) => {
|
|
771
|
-
const { label, color } = props;
|
|
772
|
-
const textColor = useMemo(() => {
|
|
773
|
-
try {
|
|
774
|
-
return readableColor(color);
|
|
775
|
-
} catch {
|
|
776
|
-
return "black";
|
|
777
|
-
}
|
|
778
|
-
}, [color]);
|
|
779
|
-
return /* @__PURE__ */ jsx(
|
|
780
|
-
Badge,
|
|
781
|
-
{
|
|
782
|
-
bg: color,
|
|
783
|
-
color: textColor,
|
|
784
|
-
rounded: "base",
|
|
785
|
-
px: 2,
|
|
786
|
-
marginInlineStart: 1,
|
|
787
|
-
children: label
|
|
788
|
-
}
|
|
789
|
-
);
|
|
790
|
-
};
|
|
791
|
-
StatusBadge.displayName = "StatusBadge";
|
|
792
820
|
var TextOverflow = memo((props) => {
|
|
793
821
|
const { children, ...rest } = props;
|
|
794
822
|
const textElementRef = useRef(null);
|
|
@@ -840,6 +868,6 @@ var TypeBadge = ({
|
|
|
840
868
|
};
|
|
841
869
|
TypeBadge.displayName = "TypeBadge";
|
|
842
870
|
|
|
843
|
-
export { Action, BaseSelect, CheckboxCard, CheckboxCardGroup, ClipboardButton, ClipboardInput, ClipboardLink, Collapse, Comment, CommentAction, CommentReplyBox, DataList, DataListItem, DataListItemLabel, DataListItemValue, date_input_default as DateInput, Edit, EmptyState, Filter, Handle, Persona, PersonaAvatar, PersonaContainer, PersonaDetails, PersonaLabel, RelativeDateTime, Remove,
|
|
871
|
+
export { Action, BaseSelect, CheckboxCard, CheckboxCardGroup, ClipboardButton, ClipboardInput, ClipboardLink, Collapse, Comment, CommentAction, CommentReplyBox, DataList, DataListItem, DataListItemLabel, DataListItemValue, date_input_default as DateInput, Edit, EmptyState, Filter, Handle, Persona, PersonaAvatar, PersonaContainer, PersonaDetails, PersonaLabel, RelativeDateTime, Remove, SplitButton, Stat, TableMenuList, TableOption, TextOverflow, TypeBadge, createTableMenuComponents, formatDate, formatDateAndTime, formatMachineReadableDateTime, formatTime, formatWeekdayDate };
|
|
844
872
|
//# sourceMappingURL=index.js.map
|
|
845
873
|
//# sourceMappingURL=index.js.map
|