@knkcs/anker 0.0.3 → 0.0.5

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.
Files changed (55) hide show
  1. package/dist/atoms/index.d.ts +16 -3
  2. package/dist/atoms/index.js +112 -18
  3. package/dist/atoms/index.js.map +1 -1
  4. package/dist/{chunk-NJFF6S77.js → chunk-2QFOWHTU.js} +4 -3
  5. package/dist/chunk-2QFOWHTU.js.map +1 -0
  6. package/dist/chunk-5YDCDC4B.js +12 -0
  7. package/dist/chunk-5YDCDC4B.js.map +1 -0
  8. package/dist/{chunk-YSFUGIQM.js → chunk-7WPKYUHP.js} +232 -116
  9. package/dist/chunk-7WPKYUHP.js.map +1 -0
  10. package/dist/{chunk-PZCL4M6I.js → chunk-E7KRPPCQ.js} +5 -18
  11. package/dist/chunk-E7KRPPCQ.js.map +1 -0
  12. package/dist/chunk-G4QMIXLC.js +3 -0
  13. package/dist/chunk-G4QMIXLC.js.map +1 -0
  14. package/dist/{chunk-C4JI3JNA.js → chunk-M5WNB4K6.js} +13 -34
  15. package/dist/chunk-M5WNB4K6.js.map +1 -0
  16. package/dist/chunk-NFZMG6ZL.js +3 -0
  17. package/dist/chunk-NFZMG6ZL.js.map +1 -0
  18. package/dist/{chunk-GJTQLZ4O.js → chunk-NQN6LXYU.js} +5 -28
  19. package/dist/chunk-NQN6LXYU.js.map +1 -0
  20. package/dist/chunk-OU6H3KU4.js +21 -0
  21. package/dist/chunk-OU6H3KU4.js.map +1 -0
  22. package/dist/chunk-SJ6YXNZW.js +30 -0
  23. package/dist/chunk-SJ6YXNZW.js.map +1 -0
  24. package/dist/chunk-TXGJ7BNX.js +51 -0
  25. package/dist/chunk-TXGJ7BNX.js.map +1 -0
  26. package/dist/chunk-WEP2AIQ5.js +37 -0
  27. package/dist/chunk-WEP2AIQ5.js.map +1 -0
  28. package/dist/chunk-WQIEF5N3.js +52 -0
  29. package/dist/chunk-WQIEF5N3.js.map +1 -0
  30. package/dist/{chunk-QU3FF5WI.js → chunk-ZFBDVERP.js} +4 -8
  31. package/dist/chunk-ZFBDVERP.js.map +1 -0
  32. package/dist/components/index.d.ts +207 -3
  33. package/dist/components/index.js +764 -15
  34. package/dist/components/index.js.map +1 -1
  35. package/dist/feedback/index.d.ts +20 -1
  36. package/dist/feedback/index.js +121 -3
  37. package/dist/feedback/index.js.map +1 -1
  38. package/dist/forms/index.d.ts +23 -15
  39. package/dist/forms/index.js +74 -48
  40. package/dist/forms/index.js.map +1 -1
  41. package/dist/primitives/index.js +13 -52
  42. package/dist/primitives/index.js.map +1 -1
  43. package/dist/theme/index.d.ts +162 -1
  44. package/dist/theme/index.js +1 -1
  45. package/package.json +4 -2
  46. package/dist/chunk-7UJ4QEUW.js +0 -37
  47. package/dist/chunk-7UJ4QEUW.js.map +0 -1
  48. package/dist/chunk-C4JI3JNA.js.map +0 -1
  49. package/dist/chunk-GJTQLZ4O.js.map +0 -1
  50. package/dist/chunk-NJFF6S77.js.map +0 -1
  51. package/dist/chunk-PZCL4M6I.js.map +0 -1
  52. package/dist/chunk-QU3FF5WI.js.map +0 -1
  53. package/dist/chunk-RJPEVNMJ.js +0 -23
  54. package/dist/chunk-RJPEVNMJ.js.map +0 -1
  55. package/dist/chunk-YSFUGIQM.js.map +0 -1
@@ -1,13 +1,16 @@
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 { 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';
4
+ import { ButtonProps as ButtonProps$1, IconButtonProps, BoxProps, useCheckboxGroup, StackProps, UseCheckboxGroupProps, Clipboard, InputProps, DataList as DataList$1, HTMLChakraProps, TextProps, BadgeProps } from '@chakra-ui/react';
5
+ export { IconButtonProps } from '@chakra-ui/react';
6
6
  import { b as AvatarProps } from '../avatar-DhqkKdqc.js';
7
7
  export { S as SearchInput, a as SearchInputProps } from '../search-input-C_Cl2OEx.js';
8
8
  import { Props, GroupBase, MultiValue, SingleValue, ActionMeta, SelectInstance, MenuListProps, OptionProps } from 'chakra-react-select';
9
9
  export { ActionMeta, Select as ChakraReactSelect, ChakraStylesConfig, CreatableSelect, GroupBase, MenuListProps, MultiValue, OptionProps, SelectInstance, SingleValue, SingleValueProps, StylesConfig, chakraComponents } from 'chakra-react-select';
10
10
 
11
+ type ButtonProps = Omit<ButtonProps$1, "variant"> & {
12
+ variant?: "solid" | "subtle" | "surface" | "outline" | "ghost" | "plain" | "primary" | "secondary" | "link" | "link-gray" | undefined;
13
+ };
11
14
  declare const Button: {
12
15
  ({ ref, ...props }: ButtonProps & {
13
16
  ref?: React.Ref<HTMLButtonElement>;
@@ -141,6 +144,16 @@ declare const ClipboardLink: {
141
144
  displayName: string;
142
145
  };
143
146
 
147
+ interface ColorSwatchPickerProps {
148
+ value?: string;
149
+ onChange: (color: string) => void;
150
+ presets?: string[];
151
+ showHexInput?: boolean;
152
+ showPreview?: boolean;
153
+ size?: "sm" | "md" | "lg";
154
+ }
155
+ declare const ColorSwatchPicker: React__default.FC<ColorSwatchPickerProps>;
156
+
144
157
  type DateType = Date | string | number;
145
158
  type DateFormat = "fullWithSeconds" | "full" | "time" | "day" | "weekday";
146
159
 
@@ -569,4 +582,4 @@ interface TypeBadgeProps extends Omit<BadgeProps, "children"> {
569
582
  }
570
583
  declare const TypeBadge: React__default.FC<TypeBadgeProps>;
571
584
 
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 };
585
+ export { Action, type ActionProps, type BaseOption, BaseSelect, type BaseSelectProps, Button, type ButtonProps, CheckboxCard, CheckboxCardGroup, type CheckboxCardGroupProps, type CheckboxCardProps, ClipboardButton, type ClipboardButtonProps, ClipboardInput, type ClipboardInputProps, ClipboardLink, type ClipboardLinkProps, Collapse, type CollapseProps, ColorSwatchPicker, type ColorSwatchPickerProps, 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 };
@@ -1,10 +1,17 @@
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';
5
- export { SearchInput, text_input_default as TextInput } from '../chunk-PZCL4M6I.js';
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';
1
+ import { Prose, Avatar } from '../chunk-ZFBDVERP.js';
2
+ import { formatRelativeToCurrentWeekDateTime, formatRelativeDateTime } from '../chunk-NQN6LXYU.js';
3
+ export { StatusBadge, formatRelativeDateTime, formatRelativeToCurrentWeekDateTime } from '../chunk-NQN6LXYU.js';
4
+ import { Tooltip, Table, MenuRoot, MenuTrigger, MenuContent, MenuItem, Badge } from '../chunk-2QFOWHTU.js';
5
+ export { SearchInput } from '../chunk-E7KRPPCQ.js';
6
+ import { Textarea } from '../chunk-NFZMG6ZL.js';
7
+ import { text_input_default } from '../chunk-OU6H3KU4.js';
8
+ export { text_input_default as TextInput } from '../chunk-OU6H3KU4.js';
9
+ import { Spinner } from '../chunk-5YDCDC4B.js';
10
+ import { IconButton, Button } from '../chunk-SJ6YXNZW.js';
11
+ export { Button, IconButton } from '../chunk-SJ6YXNZW.js';
12
+ import { Text, Box, Stack as Stack$1, Flex, HStack, Heading } from '../chunk-G4QMIXLC.js';
7
13
  import { jsx, jsxs } from 'react/jsx-runtime';
14
+ import { DataList as DataList$1, Icon, Circle, useCheckboxGroup, Stack, Box as Box$1, Clipboard, IconButton as IconButton$1, Input, chakra, ButtonGroup, Button as Button$1, Square } from '@chakra-ui/react';
8
15
  import { ChevronRight, ChevronDown, Pencil, Filter as Filter$1, GripVertical, X, Clipboard as Clipboard$1, Check, Link, Plus } from 'lucide-react';
9
16
  import React, { createContext, memo, useRef, useState, useCallback, useEffect, useMemo, useContext } from 'react';
10
17
  import dayjs2 from 'dayjs';
@@ -128,7 +135,7 @@ var CheckboxCard = (props) => {
128
135
  const { checkboxProps, children, ...rest } = props;
129
136
  const id = React.useId();
130
137
  return /* @__PURE__ */ jsx(
131
- Box,
138
+ Box$1,
132
139
  {
133
140
  cursor: "pointer",
134
141
  css: {
@@ -140,7 +147,7 @@ var CheckboxCard = (props) => {
140
147
  asChild: true,
141
148
  children: /* @__PURE__ */ jsxs("label", { children: [
142
149
  /* @__PURE__ */ jsx("input", { type: "checkbox", "aria-labelledby": id, ...checkboxProps }),
143
- /* @__PURE__ */ jsx(Box, { ...rest, children: /* @__PURE__ */ jsx(Stack, { direction: "row", children: /* @__PURE__ */ jsx(Box, { flex: "1", id, children }) }) })
150
+ /* @__PURE__ */ jsx(Box$1, { ...rest, children: /* @__PURE__ */ jsx(Stack, { direction: "row", children: /* @__PURE__ */ jsx(Box$1, { flex: "1", id, children }) }) })
144
151
  ] })
145
152
  }
146
153
  );
@@ -173,6 +180,84 @@ var ClipboardLink = function ClipboardLink2({
173
180
  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 }) }) }) }) });
174
181
  };
175
182
  ClipboardLink.displayName = "ClipboardLink";
183
+ var DEFAULT_PRESETS = [
184
+ "#3b82f6",
185
+ "#10b981",
186
+ "#f59e0b",
187
+ "#ef4444",
188
+ "#8b5cf6",
189
+ "#ec4899",
190
+ "#14b8a6",
191
+ "#6b7280"
192
+ ];
193
+ var SWATCH_SIZES = { sm: 4, md: 5, lg: 7 };
194
+ var ColorSwatchPicker = ({
195
+ value,
196
+ onChange,
197
+ presets = DEFAULT_PRESETS,
198
+ showHexInput = false,
199
+ showPreview = false,
200
+ size = "md"
201
+ }) => {
202
+ const [hexInput, setHexInput] = useState(value ?? "");
203
+ useEffect(() => {
204
+ setHexInput(value ?? "");
205
+ }, [value]);
206
+ const swatchSize = SWATCH_SIZES[size];
207
+ const handleHexSubmit = () => {
208
+ const trimmed = hexInput.trim();
209
+ if (/^#[0-9a-fA-F]{6}$/.test(trimmed)) {
210
+ onChange(trimmed);
211
+ }
212
+ };
213
+ return /* @__PURE__ */ jsxs(Stack$1, { gap: 3, children: [
214
+ /* @__PURE__ */ jsx(Flex, { wrap: "wrap", gap: 2, children: presets.map((color) => /* @__PURE__ */ jsx(
215
+ Box,
216
+ {
217
+ w: swatchSize,
218
+ h: swatchSize,
219
+ rounded: "sm",
220
+ bg: color,
221
+ cursor: "pointer",
222
+ borderWidth: "2px",
223
+ borderColor: value === color ? "border.emphasized" : "transparent",
224
+ onClick: () => onChange(color),
225
+ _hover: { transform: "scale(1.1)" },
226
+ transition: "transform 0.1s"
227
+ },
228
+ color
229
+ )) }),
230
+ (showHexInput || showPreview) && /* @__PURE__ */ jsxs(HStack, { gap: 2, children: [
231
+ showPreview && /* @__PURE__ */ jsx(
232
+ Box,
233
+ {
234
+ w: 9,
235
+ h: 9,
236
+ rounded: "md",
237
+ bg: value || "transparent",
238
+ borderWidth: "1px",
239
+ borderColor: "border",
240
+ flexShrink: 0
241
+ }
242
+ ),
243
+ showHexInput && /* @__PURE__ */ jsx(
244
+ text_input_default,
245
+ {
246
+ value: hexInput,
247
+ onChange: (e) => setHexInput(e.target.value),
248
+ onBlur: handleHexSubmit,
249
+ onKeyDown: (e) => {
250
+ if (e.key === "Enter") handleHexSubmit();
251
+ },
252
+ placeholder: "#000000",
253
+ size: "sm",
254
+ maxW: "120px"
255
+ }
256
+ )
257
+ ] })
258
+ ] });
259
+ };
260
+ ColorSwatchPicker.displayName = "ColorSwatchPicker";
176
261
  dayjs2.extend(utcPlugin);
177
262
  function formatDateAndTime(date, format = "full") {
178
263
  let template;
@@ -263,8 +348,8 @@ var Comment = (props) => {
263
348
  };
264
349
  return /* @__PURE__ */ jsx(chakra.div, { css: styles.container, "data-id": id, ...rest, children: /* @__PURE__ */ jsxs(CommentStylesContext.Provider, { value: styles, children: [
265
350
  avatar && /* @__PURE__ */ jsx(AvatarSlot, { children: avatar }),
266
- (content || isDeleted) && /* @__PURE__ */ jsx(ContentContainer, { children: /* @__PURE__ */ jsxs(Stack, { gap: 3, children: [
267
- /* @__PURE__ */ jsxs(Stack, { gap: 2, children: [
351
+ (content || isDeleted) && /* @__PURE__ */ jsx(ContentContainer, { children: /* @__PURE__ */ jsxs(Stack$1, { gap: 3, children: [
352
+ /* @__PURE__ */ jsxs(Stack$1, { gap: 2, children: [
268
353
  /* @__PURE__ */ jsx(CommentHeader, { ...headerProps }),
269
354
  /* @__PURE__ */ jsx(
270
355
  Prose,
@@ -286,7 +371,7 @@ var Comment = (props) => {
286
371
  ] }),
287
372
  /* @__PURE__ */ jsx(CommentFooter, { ...footerProps })
288
373
  ] }) }),
289
- children && /* @__PURE__ */ jsx(Stack, { gap: 4, css: styles.children, children })
374
+ children && /* @__PURE__ */ jsx(Stack$1, { gap: 4, css: styles.children, children })
290
375
  ] }) });
291
376
  };
292
377
  Comment.displayName = "Comment";
@@ -396,7 +481,16 @@ var CommentReplyBox = ({
396
481
  children: cancelLabel
397
482
  }
398
483
  ),
399
- /* @__PURE__ */ jsx(Button$1, { type: "submit", variant: "solid", loading: isSubmitting, children: replyLabel })
484
+ /* @__PURE__ */ jsx(
485
+ Button$1,
486
+ {
487
+ type: "submit",
488
+ variant: "solid",
489
+ colorPalette: "primary",
490
+ loading: isSubmitting,
491
+ children: replyLabel
492
+ }
493
+ )
400
494
  ] })
401
495
  }
402
496
  )
@@ -456,7 +550,7 @@ var date_input_default = DateInput;
456
550
  var EmptyState = (props) => {
457
551
  const { header, description, icon, actions } = props;
458
552
  return /* @__PURE__ */ jsxs(
459
- Stack,
553
+ Stack$1,
460
554
  {
461
555
  justifyContent: "center",
462
556
  alignItems: "center",
@@ -468,7 +562,7 @@ var EmptyState = (props) => {
468
562
  icon,
469
563
  /* @__PURE__ */ jsx(Heading, { size: "lg", children: header }),
470
564
  description && /* @__PURE__ */ jsx(Text, { color: "muted", fontSize: "sm", children: description }),
471
- actions && /* @__PURE__ */ jsx(Stack, { pt: 4, gap: 2, children: actions })
565
+ actions && /* @__PURE__ */ jsx(Stack$1, { pt: 4, gap: 2, children: actions })
472
566
  ]
473
567
  }
474
568
  );
@@ -806,12 +900,12 @@ var Stat = (props) => {
806
900
  borderRadius: "lg",
807
901
  boxShadow: "sm",
808
902
  ...boxProps,
809
- children: /* @__PURE__ */ jsxs(Stack, { gap: { base: "5", md: "6" }, children: [
810
- /* @__PURE__ */ jsx(Stack, { direction: "row", justify: "space-between", children: /* @__PURE__ */ jsxs(HStack, { gap: "4", children: [
903
+ children: /* @__PURE__ */ jsxs(Stack$1, { gap: { base: "5", md: "6" }, children: [
904
+ /* @__PURE__ */ jsx(Stack$1, { direction: "row", justify: "space-between", children: /* @__PURE__ */ jsxs(HStack, { gap: "4", children: [
811
905
  icon && /* @__PURE__ */ jsx(Square, { size: "8", bg: "bg-accent-subtle", borderRadius: "md", children: icon }),
812
906
  /* @__PURE__ */ jsx(Text, { fontWeight: "medium", children: label })
813
907
  ] }) }),
814
- /* @__PURE__ */ jsx(Stack, { gap: "4", children: loading ? /* @__PURE__ */ jsx(Spinner, {}) : /* @__PURE__ */ jsx(Heading, { size: { base: "sm", md: "md" }, children: value ?? 0 }) })
908
+ /* @__PURE__ */ jsx(Stack$1, { gap: "4", children: loading ? /* @__PURE__ */ jsx(Spinner, {}) : /* @__PURE__ */ jsx(Heading, { size: { base: "sm", md: "md" }, children: value ?? 0 }) })
815
909
  ] })
816
910
  }
817
911
  );
@@ -868,6 +962,6 @@ var TypeBadge = ({
868
962
  };
869
963
  TypeBadge.displayName = "TypeBadge";
870
964
 
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 };
965
+ export { Action, BaseSelect, CheckboxCard, CheckboxCardGroup, ClipboardButton, ClipboardInput, ClipboardLink, Collapse, ColorSwatchPicker, 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 };
872
966
  //# sourceMappingURL=index.js.map
873
967
  //# sourceMappingURL=index.js.map