@knkcs/anker 1.9.4 → 1.10.1
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/CLAUDE-ANKER.md +31 -0
- package/dist/atoms/index.js +4 -4
- package/dist/{chunk-2QFOWHTU.js → chunk-2ZWZ2WAS.js} +20 -6
- package/dist/chunk-2ZWZ2WAS.js.map +1 -0
- package/dist/{chunk-NQN6LXYU.js → chunk-ELQTHWXC.js} +3 -3
- package/dist/{chunk-NQN6LXYU.js.map → chunk-ELQTHWXC.js.map} +1 -1
- package/dist/chunk-VOGT33LU.js +18 -0
- package/dist/chunk-VOGT33LU.js.map +1 -0
- package/dist/components/index.d.ts +54 -1
- package/dist/components/index.js +79 -9
- package/dist/components/index.js.map +1 -1
- package/dist/primitives/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-2QFOWHTU.js.map +0 -1
- package/dist/chunk-ZFBDVERP.js +0 -32
- package/dist/chunk-ZFBDVERP.js.map +0 -1
package/CLAUDE-ANKER.md
CHANGED
|
@@ -90,6 +90,37 @@ Full spec with composition diagrams, slot tables, and authoring rules: `docs/pag
|
|
|
90
90
|
|
|
91
91
|
---
|
|
92
92
|
|
|
93
|
+
## DataTable cells
|
|
94
|
+
|
|
95
|
+
anker ships 16 reusable cell components for `<DataTable>` columns under `@knkcs/anker/components/data-table/cells`. **Use cells before composing primitives.** Inline `<Badge>` / `<Box>` / `<Text>` / `<Tooltip>` cell content fragments the visual language and silently misses later improvements (a11y, dark mode, density).
|
|
96
|
+
|
|
97
|
+
**Rule:** cells are the contract — if no cell fits, file an issue and propose a new cell. Don't hand-roll.
|
|
98
|
+
|
|
99
|
+
| Cell | Use for |
|
|
100
|
+
|---|---|
|
|
101
|
+
| `ActionCell` | row action icons |
|
|
102
|
+
| `BooleanCell` | yes/no |
|
|
103
|
+
| `CodeCell` | monospace code |
|
|
104
|
+
| `ColorSwatchCell` | color swatch |
|
|
105
|
+
| `CountCell` | "N items" |
|
|
106
|
+
| `DateCell` | timestamps |
|
|
107
|
+
| `DeviceCell` | User-Agent → browser/OS + tooltip |
|
|
108
|
+
| `IdentityCell` | avatar + name (+ subText) |
|
|
109
|
+
| `LinkCell` | internal link |
|
|
110
|
+
| `MenuCell` | row overflow menu |
|
|
111
|
+
| `NumberCell` | numbers |
|
|
112
|
+
| `SlugCell` | mono IDs |
|
|
113
|
+
| `StatusBadgeCell` | status pill (+ optional `tooltip`) |
|
|
114
|
+
| `SwitchCell` | inline toggle |
|
|
115
|
+
| `TruncatedTextCell` | text (+ optional `subText`, `maxLength`) |
|
|
116
|
+
| `UrlCell` | external URL |
|
|
117
|
+
|
|
118
|
+
Import path: `@knkcs/anker/components/data-table/cells`.
|
|
119
|
+
|
|
120
|
+
Full slot/prop tables: `docs/react-table-reference.md`. Mapping guide for common column intents: `docs/page-patterns.md` §11.13.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
93
124
|
## Pointers
|
|
94
125
|
|
|
95
126
|
- Full spec: anker GitHub Pages docs site (`/design-system`, `/page-patterns`)
|
package/dist/atoms/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Prose
|
|
2
|
-
import { formatRelativeToCurrentWeekDateTime, formatRelativeDateTime } from '../chunk-
|
|
3
|
-
export { StatusBadge, formatRelativeDateTime, formatRelativeToCurrentWeekDateTime } from '../chunk-
|
|
4
|
-
import { Tooltip, Table, MenuRoot, MenuTrigger, MenuContent, MenuItem, Badge } from '../chunk-
|
|
1
|
+
import { Prose } from '../chunk-VOGT33LU.js';
|
|
2
|
+
import { formatRelativeToCurrentWeekDateTime, formatRelativeDateTime } from '../chunk-ELQTHWXC.js';
|
|
3
|
+
export { StatusBadge, formatRelativeDateTime, formatRelativeToCurrentWeekDateTime } from '../chunk-ELQTHWXC.js';
|
|
4
|
+
import { Tooltip, Avatar, Table, MenuRoot, MenuTrigger, MenuContent, MenuItem, Badge } from '../chunk-2ZWZ2WAS.js';
|
|
5
5
|
export { SearchInput } from '../chunk-E7KRPPCQ.js';
|
|
6
6
|
import { Textarea } from '../chunk-NFZMG6ZL.js';
|
|
7
7
|
import { text_input_default } from '../chunk-OU6H3KU4.js';
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
import { Menu, Portal, AbsoluteCenter, Tooltip as Tooltip$1 } from '@chakra-ui/react';
|
|
1
|
+
import { AvatarGroup as AvatarGroup$1, Menu, Avatar as Avatar$1, Portal, AbsoluteCenter, Tooltip as Tooltip$1 } from '@chakra-ui/react';
|
|
2
2
|
export { Badge, Table } from '@chakra-ui/react';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
4
|
import { Check, ChevronRight } from 'lucide-react';
|
|
4
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
|
-
// src/primitives/
|
|
6
|
+
// src/primitives/avatar.tsx
|
|
7
|
+
var Avatar = function Avatar2({
|
|
8
|
+
ref,
|
|
9
|
+
...props
|
|
10
|
+
}) {
|
|
11
|
+
const { name, src, srcSet, loading, icon, fallback, children, ...rest } = props;
|
|
12
|
+
return /* @__PURE__ */ jsxs(Avatar$1.Root, { ref, ...rest, children: [
|
|
13
|
+
/* @__PURE__ */ jsx(Avatar$1.Fallback, { name, children: icon || fallback }),
|
|
14
|
+
/* @__PURE__ */ jsx(Avatar$1.Image, { src, srcSet, loading }),
|
|
15
|
+
children
|
|
16
|
+
] });
|
|
17
|
+
};
|
|
18
|
+
Avatar.displayName = "Avatar";
|
|
19
|
+
var AvatarGroup = AvatarGroup$1;
|
|
20
|
+
AvatarGroup.displayName = "AvatarGroup";
|
|
7
21
|
var MenuContent = function MenuContent2({
|
|
8
22
|
ref,
|
|
9
23
|
...props
|
|
@@ -104,6 +118,6 @@ var Tooltip = function Tooltip2({
|
|
|
104
118
|
};
|
|
105
119
|
Tooltip.displayName = "Tooltip";
|
|
106
120
|
|
|
107
|
-
export { MenuArrow, MenuCheckboxItem, MenuContent, MenuContextTrigger, MenuItem, MenuItemCommand, MenuItemGroup, MenuItemText, MenuRadioItem, MenuRadioItemGroup, MenuRoot, MenuSeparator, MenuTrigger, MenuTriggerItem, Tooltip };
|
|
108
|
-
//# sourceMappingURL=chunk-
|
|
109
|
-
//# sourceMappingURL=chunk-
|
|
121
|
+
export { Avatar, AvatarGroup, MenuArrow, MenuCheckboxItem, MenuContent, MenuContextTrigger, MenuItem, MenuItemCommand, MenuItemGroup, MenuItemText, MenuRadioItem, MenuRadioItemGroup, MenuRoot, MenuSeparator, MenuTrigger, MenuTriggerItem, Tooltip };
|
|
122
|
+
//# sourceMappingURL=chunk-2ZWZ2WAS.js.map
|
|
123
|
+
//# sourceMappingURL=chunk-2ZWZ2WAS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/primitives/avatar.tsx","../src/primitives/menu.tsx","../src/primitives/tooltip.tsx"],"names":["Avatar","ChakraAvatar","ChakraAvatarGroup","MenuContent","jsx","ChakraMenu","MenuArrow","MenuCheckboxItem","jsxs","MenuRadioItem","MenuItemGroup","MenuTriggerItem","Tooltip","ChakraTooltip","Portal"],"mappings":";;;;;;AAuBO,IAAM,MAAA,GAAS,SAASA,OAAAA,CAAO;AAAA,EACrC,GAAA;AAAA,EACA,GAAG;AACJ,CAAA,EAAsD;AACrD,EAAA,MAAM,EAAE,IAAA,EAAM,GAAA,EAAK,MAAA,EAAQ,OAAA,EAAS,MAAM,QAAA,EAAU,QAAA,EAAU,GAAG,IAAA,EAAK,GACrE,KAAA;AACD,EAAA,4BACEC,QAAA,CAAa,IAAA,EAAb,EAAkB,GAAA,EAAW,GAAG,IAAA,EAChC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAACA,QAAA,CAAa,QAAA,EAAb,EAAsB,IAAA,EACrB,kBAAQ,QAAA,EACV,CAAA;AAAA,wBACCA,QAAA,CAAa,KAAA,EAAb,EAAmB,GAAA,EAAU,QAAgB,OAAA,EAAkB,CAAA;AAAA,IAC/D;A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,IACA,QAAA;AAAA,IACA,SAAA,GAAY,IAAA;AAAA,IACZ,OAAA;AAAA,IACA,YAAA;AAAA,IACA,SAAA;AAAA,IACA,GAAG;AAAA,GACJ,GAAI,KAAA;AAEJ,EAAA,IAAI,UAAU,OAAO,QAAA;AAErB,EAAA,uBACCJ,IAAAA,CAACK,SAAA,CAAc,IAAA,EAAd,EAAoB,GAAG,IAAA,EACvB,QAAA,EAAA;AAAA,oBAAAT,IAACS,SAAA,CAAc,OAAA,EAAd,EAAsB,OAAA,EAAO,MAAE,QAAA,EAAS,CAAA;AAAA,oBACzCT,IAACU,MAAAA,EAAA,EAAO,UAAU,CAAC,SAAA,EAAW,WAAW,SAAA,EACxC,QAAA,kBAAAV,IAACS,SAAA,CAAc,UAAA,EAAd,EACA,QAAA,kBAAAL,IAAAA,CAACK,UAAc,OAAA,EAAd,EAAsB,GAAA,EAAW,GAAG,YAAA,EACnC,QAAA,EAAA;AAAA,MAAA,SAAA,oBACAT,GAAAA,CAACS,SAAA,CAAc,KAAA,EAAd,EACA,0BAAAT,GAAAA,CAACS,SAAA,CAAc,QAAA,EAAd,EAAuB,CAAA,EACzB,CAAA;AAAA,MAEA;AAAA,KAAA,EACF,GACD,CAAA,EACD;AAAA,GAAA,EACD,CAAA;AAEF;AACA,OAAA,CAAQ,WAAA,GAAc,SAAA","file":"chunk-2ZWZ2WAS.js","sourcesContent":["import {\n\tAvatar as ChakraAvatar,\n\tAvatarGroup as ChakraAvatarGroup,\n} from \"@chakra-ui/react\";\nimport type * as React from \"react\";\n\ntype ImageProps = React.ImgHTMLAttributes<HTMLImageElement>;\n\nexport interface AvatarProps extends ChakraAvatar.RootProps {\n\t/** Display name used to generate initials for the fallback. */\n\tname?: string;\n\t/** Image source URL. */\n\tsrc?: string;\n\t/** Image srcSet attribute for responsive images. */\n\tsrcSet?: string;\n\t/** Image loading strategy. */\n\tloading?: ImageProps[\"loading\"];\n\t/** Custom icon element shown as fallback. */\n\ticon?: React.ReactElement;\n\t/** Custom fallback content when no image or icon is provided. */\n\tfallback?: React.ReactNode;\n}\n\nexport const Avatar = function Avatar({\n\tref,\n\t...props\n}: AvatarProps & { ref?: React.Ref<HTMLDivElement> }) {\n\tconst { name, src, srcSet, loading, icon, fallback, children, ...rest } =\n\t\tprops;\n\treturn (\n\t\t<ChakraAvatar.Root ref={ref} {...rest}>\n\t\t\t<ChakraAvatar.Fallback name={name}>\n\t\t\t\t{icon || fallback}\n\t\t\t</ChakraAvatar.Fallback>\n\t\t\t<ChakraAvatar.Image src={src} srcSet={srcSet} loading={loading} />\n\t\t\t{children}\n\t\t</ChakraAvatar.Root>\n\t);\n};\nAvatar.displayName = \"Avatar\";\n\nexport const AvatarGroup = ChakraAvatarGroup;\nAvatarGroup.displayName = \"AvatarGroup\";\n","\"use client\";\n\nimport { AbsoluteCenter, Menu as ChakraMenu, Portal } from \"@chakra-ui/react\";\nimport { Check, ChevronRight } from \"lucide-react\";\nimport type * as React from \"react\";\n\ninterface MenuContentProps extends ChakraMenu.ContentProps {\n\t/** Whether to render the menu content inside a portal. @default true */\n\tportalled?: boolean;\n\t/** Container ref for the portal. */\n\tportalRef?: React.RefObject<HTMLElement | null>;\n}\n\nexport const MenuContent = function MenuContent({\n\tref,\n\t...props\n}: MenuContentProps & { ref?: React.Ref<HTMLDivElement> }) {\n\tconst { portalled = true, portalRef, ...rest } = props;\n\treturn (\n\t\t<Portal disabled={!portalled} container={portalRef}>\n\t\t\t<ChakraMenu.Positioner>\n\t\t\t\t<ChakraMenu.Content ref={ref} {...rest} />\n\t\t\t</ChakraMenu.Positioner>\n\t\t</Portal>\n\t);\n};\nMenuContent.displayName = \"MenuContent\";\n\nexport const MenuArrow = function MenuArrow({\n\tref,\n\t...props\n}: ChakraMenu.ArrowProps & { ref?: React.Ref<HTMLDivElement> }) {\n\treturn (\n\t\t<ChakraMenu.Arrow ref={ref} {...props}>\n\t\t\t<ChakraMenu.ArrowTip />\n\t\t</ChakraMenu.Arrow>\n\t);\n};\nMenuArrow.displayName = \"MenuArrow\";\n\nexport const MenuCheckboxItem = function MenuCheckboxItem({\n\tref,\n\t...props\n}: ChakraMenu.CheckboxItemProps & { ref?: React.Ref<HTMLDivElement> }) {\n\treturn (\n\t\t<ChakraMenu.CheckboxItem ps=\"8\" ref={ref} {...props}>\n\t\t\t<AbsoluteCenter axis=\"horizontal\" insetStart=\"4\" asChild>\n\t\t\t\t<ChakraMenu.ItemIndicator>\n\t\t\t\t\t<Check />\n\t\t\t\t</ChakraMenu.ItemIndicator>\n\t\t\t</AbsoluteCenter>\n\t\t\t{props.children}\n\t\t</ChakraMenu.CheckboxItem>\n\t);\n};\nMenuCheckboxItem.displayName = \"MenuCheckboxItem\";\n\nexport const MenuRadioItem = function MenuRadioItem({\n\tref,\n\t...props\n}: ChakraMenu.RadioItemProps & { ref?: React.Ref<HTMLDivElement> }) {\n\tconst { children, ...rest } = props;\n\treturn (\n\t\t<ChakraMenu.RadioItem ps=\"8\" ref={ref} {...rest}>\n\t\t\t<AbsoluteCenter axis=\"horizontal\" insetStart=\"4\" asChild>\n\t\t\t\t<ChakraMenu.ItemIndicator>\n\t\t\t\t\t<Check />\n\t\t\t\t</ChakraMenu.ItemIndicator>\n\t\t\t</AbsoluteCenter>\n\t\t\t<ChakraMenu.ItemText>{children}</ChakraMenu.ItemText>\n\t\t</ChakraMenu.RadioItem>\n\t);\n};\nMenuRadioItem.displayName = \"MenuRadioItem\";\n\nexport const MenuItemGroup = function MenuItemGroup({\n\tref,\n\t...props\n}: ChakraMenu.ItemGroupProps & { ref?: React.Ref<HTMLDivElement> }) {\n\tconst { title, children, ...rest } = props;\n\treturn (\n\t\t<ChakraMenu.ItemGroup ref={ref} {...rest}>\n\t\t\t{title && (\n\t\t\t\t<ChakraMenu.ItemGroupLabel userSelect=\"none\">\n\t\t\t\t\t{title}\n\t\t\t\t</ChakraMenu.ItemGroupLabel>\n\t\t\t)}\n\t\t\t{children}\n\t\t</ChakraMenu.ItemGroup>\n\t);\n};\nMenuItemGroup.displayName = \"MenuItemGroup\";\n\nexport interface MenuTriggerItemProps extends ChakraMenu.ItemProps {\n\t/** Icon rendered before the trigger item label. */\n\tstartIcon?: React.ReactNode;\n}\n\nexport const MenuTriggerItem = function MenuTriggerItem({\n\tref,\n\t...props\n}: MenuTriggerItemProps & { ref?: React.Ref<HTMLDivElement> }) {\n\tconst { startIcon, children, ...rest } = props;\n\treturn (\n\t\t<ChakraMenu.TriggerItem ref={ref} {...rest}>\n\t\t\t{startIcon}\n\t\t\t{children}\n\t\t\t<ChevronRight />\n\t\t</ChakraMenu.TriggerItem>\n\t);\n};\nMenuTriggerItem.displayName = \"MenuTriggerItem\";\n\nexport const MenuRadioItemGroup = ChakraMenu.RadioItemGroup;\nMenuRadioItemGroup.displayName = \"MenuRadioItemGroup\";\nexport const MenuContextTrigger = ChakraMenu.ContextTrigger;\nMenuContextTrigger.displayName = \"MenuContextTrigger\";\nexport const MenuRoot = ChakraMenu.Root;\nMenuRoot.displayName = \"MenuRoot\";\nexport const MenuSeparator = ChakraMenu.Separator;\nMenuSeparator.displayName = \"MenuSeparator\";\n\nexport const MenuItem = ChakraMenu.Item;\nMenuItem.displayName = \"MenuItem\";\nexport const MenuItemText = ChakraMenu.ItemText;\nMenuItemText.displayName = \"MenuItemText\";\nexport const MenuItemCommand = ChakraMenu.ItemCommand;\nMenuItemCommand.displayName = \"MenuItemCommand\";\nexport const MenuTrigger = ChakraMenu.Trigger;\nMenuTrigger.displayName = \"MenuTrigger\";\n","import { Tooltip as ChakraTooltip, Portal } from \"@chakra-ui/react\";\nimport type * as React from \"react\";\n\nexport interface TooltipProps extends ChakraTooltip.RootProps {\n\tshowArrow?: boolean;\n\tportalled?: boolean;\n\tportalRef?: React.RefObject<HTMLElement | null>;\n\tcontent: React.ReactNode;\n\tcontentProps?: ChakraTooltip.ContentProps;\n\tdisabled?: boolean;\n}\n\nexport const Tooltip = function Tooltip({\n\tref,\n\t...props\n}: TooltipProps & { ref?: React.Ref<HTMLDivElement> }) {\n\tconst {\n\t\tshowArrow,\n\t\tchildren,\n\t\tdisabled,\n\t\tportalled = true,\n\t\tcontent,\n\t\tcontentProps,\n\t\tportalRef,\n\t\t...rest\n\t} = props;\n\n\tif (disabled) return children;\n\n\treturn (\n\t\t<ChakraTooltip.Root {...rest}>\n\t\t\t<ChakraTooltip.Trigger asChild>{children}</ChakraTooltip.Trigger>\n\t\t\t<Portal disabled={!portalled} container={portalRef}>\n\t\t\t\t<ChakraTooltip.Positioner>\n\t\t\t\t\t<ChakraTooltip.Content ref={ref} {...contentProps}>\n\t\t\t\t\t\t{showArrow && (\n\t\t\t\t\t\t\t<ChakraTooltip.Arrow>\n\t\t\t\t\t\t\t\t<ChakraTooltip.ArrowTip />\n\t\t\t\t\t\t\t</ChakraTooltip.Arrow>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{content}\n\t\t\t\t\t</ChakraTooltip.Content>\n\t\t\t\t</ChakraTooltip.Positioner>\n\t\t\t</Portal>\n\t\t</ChakraTooltip.Root>\n\t);\n};\nTooltip.displayName = \"Tooltip\";\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Badge } from './chunk-
|
|
1
|
+
import { Badge } from './chunk-2ZWZ2WAS.js';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
import calendarPlugin from 'dayjs/plugin/calendar.js';
|
|
4
4
|
import relativeTime from 'dayjs/plugin/relativeTime.js';
|
|
@@ -46,5 +46,5 @@ var StatusBadge = (props) => {
|
|
|
46
46
|
StatusBadge.displayName = "StatusBadge";
|
|
47
47
|
|
|
48
48
|
export { StatusBadge, formatRelativeDateTime, formatRelativeToCurrentWeekDateTime };
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
50
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-ELQTHWXC.js.map
|
|
50
|
+
//# sourceMappingURL=chunk-ELQTHWXC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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AAA;AAAA,MAElB,QAAA,EAAA;AAAA;AAAA,GACF;AAEF;AAEA,WAAA,CAAY,WAAA,GAAc,aAAA","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/atoms/datetime/utils/relative-date-time-utils.ts","../src/atoms/status-badge/status-badge.tsx"],"names":[],"mappings":";;;;;;;;;AAKA,KAAA,CAAM,OAAO,SAAS,CAAA;AACtB,KAAA,CAAM,OAAO,YAAY,CAAA;AACzB,KAAA,CAAM,OAAO,cAAc,CAAA;AAmBpB,SAAS,sBAAA,CACf,IAAA,EACA,QAAA,mBAAqB,IAAI,MAAK,EAC7B;AACD,EAAA,OAAO,KAAA,CAAM,IAAI,CAAA,CAAE,IAAA,CAAK,QAAQ,CAAA;AACjC;AAmBO,SAAS,mCAAA,CACf,IAAA,EACA,QAAA,mBAAqB,IAAI,MAAK,EAC7B;AACD,EAAA,MAAM,UAAU,KAAA,CAAM,IAAI,CAAA,CAAE,MAAA,CAAO,UAAU,KAAK,CAAA;AAElD,EAAA,IAAI,CAAC,OAAA,EAAS;AAGb,IAAA,OAAO,KAAA,CAAM,IAAI,CAAA,CAAE,QAAA,CAAS,QAAA,EAAU;AAAA,MACrC,QAAA,EAAU;AAAA,KACV,CAAA;AAAA,EACF;AAGA,EAAA,OAAO,sBAAA,CAAuB,MAAM,QAAQ,CAAA;AAC7C;ACtDO,IAAM,WAAA,GAA0C,CAAC,KAAA,KAAU;AACjE,EAAA,MAAM,EAAE,KAAA,EAAO,KAAA,EAAM,GAAI,KAAA;AAEzB,EAAA,MAAM,SAAA,GAAY,QAAQ,MAAM;AAC/B,IAAA,IAAI;AACH,MAAA,OAAO,cAAc,KAAK,CAAA;AAAA,IAC3B,CAAA,CAAA,MAAQ;AACP,MAAA,OAAO,OAAA;AAAA,IACR;AAAA,EACD,CAAA,EAAG,CAAC,KAAK,CAAC,CAAA;AAEV,EAAA,uBACC,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACA,EAAA,EAAI,KAAA;AAAA,MACJ,KAAA,EAAO,SAAA;AAAA,MACP,OAAA,EAAQ,MAAA;AAAA,MACR,EAAA,EAAI,CAAA;AAAA,MACJ,iBAAA,EAAmB,CAAA;AAAA,MAElB,QAAA,EAAA;AAAA;AAAA,GACF;AAEF;AAEA,WAAA,CAAY,WAAA,GAAc,aAAA","file":"chunk-ELQTHWXC.js","sourcesContent":["import dayjs from \"dayjs\";\nimport calendarPlugin from \"dayjs/plugin/calendar.js\";\nimport relativeTime from \"dayjs/plugin/relativeTime.js\";\nimport utcPlugin from \"dayjs/plugin/utc.js\";\n\ndayjs.extend(utcPlugin);\ndayjs.extend(relativeTime);\ndayjs.extend(calendarPlugin);\n\nimport type { DateType } from \"../types\";\n\n/**\n * A function that will return a string with how far a given date is in the past or future,\n * using a baseDate as reference. If the baseDate is not passed, the function will use today as reference.\n *\n * @param date - the date to be formatted\n * @param baseDate - the date that should be used as a reference (default is \"today\")\n * @returns a relative date\n *\n * @example\n * // Considering today as 18.08.2021\n * formatRelativeDateTime('2021-08-17T15:45:00') // returns \"a day ago\"\n *\n * @example\n * formatRelativeDateTime('2021-08-17T15:45:00', '2021-08-16') // returns \"in a day\"\n */\nexport function formatRelativeDateTime(\n\tdate: DateType,\n\tbaseDate: DateType = new Date(),\n) {\n\treturn dayjs(date).from(baseDate);\n}\n\n/**\n * A function that formats a date relative to Today or to the `baseDate` if passed.\n * If the date is not today, it will return a string with \"Yesterday ...\", \"Tomorrow ...\", etc\n * If the date is not in the current week, it return a string with \"DD MMM YYYY\" format\n * If the date is today, it will return a string with \"... ago\" or \"in ...\"\n *\n * @param date - the date to be formatted\n * @param baseDate - the date that should be used as a reference (default is \"today\")\n * @returns a relative date\n *\n * @example\n * // Considering today as 18.08.2021\n * formatRelativeToCurrentWeekDateTime('2021-08-17T15:45:00') // returns \"Yesterday at 3:45 PM\"\n *\n * @example\n * formatRelativeToCurrentWeekDateTime('2021-08-17T15:45:00', '2021-08-16') // returns \"Tomorrow at 3:45 PM\"\n */\nexport function formatRelativeToCurrentWeekDateTime(\n\tdate: DateType,\n\tbaseDate: DateType = new Date(),\n) {\n\tconst isToday = dayjs(date).isSame(baseDate, \"day\");\n\n\tif (!isToday) {\n\t\t// if the date is not today, we display it with \"Yesterday\", \"Tomorrow\", etc.\n\t\t// and if the date is not in the current week then it will display \"17 Aug 2021\"\n\t\treturn dayjs(date).calendar(baseDate, {\n\t\t\tsameElse: \"DD MMM YYYY\",\n\t\t});\n\t}\n\n\t// returns \"... ago\"\n\treturn formatRelativeDateTime(date, baseDate);\n}\n","import { readableColor } from \"color2k\";\nimport type React from \"react\";\nimport { useMemo } from \"react\";\nimport { Badge } from \"../../primitives/badge\";\n\nexport interface StatusBadgeProps {\n\t/** The display label for the badge */\n\tlabel: string;\n\t/** The background color for the badge (hex format, e.g. \"#ff0000\") */\n\tcolor: string;\n}\n\nexport const StatusBadge: React.FC<StatusBadgeProps> = (props) => {\n\tconst { label, color } = props;\n\n\tconst textColor = useMemo(() => {\n\t\ttry {\n\t\t\treturn readableColor(color);\n\t\t} catch {\n\t\t\treturn \"black\";\n\t\t}\n\t}, [color]);\n\n\treturn (\n\t\t<Badge\n\t\t\tbg={color}\n\t\t\tcolor={textColor}\n\t\t\trounded=\"base\"\n\t\t\tpx={2}\n\t\t\tmarginInlineStart={1}\n\t\t>\n\t\t\t{label}\n\t\t</Badge>\n\t);\n};\n\nStatusBadge.displayName = \"StatusBadge\";\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useRecipe, chakra } from '@chakra-ui/react';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
// src/primitives/prose.tsx
|
|
5
|
+
var Prose = ({
|
|
6
|
+
ref,
|
|
7
|
+
size,
|
|
8
|
+
...props
|
|
9
|
+
}) => {
|
|
10
|
+
const recipe = useRecipe({ key: "prose" });
|
|
11
|
+
const styles = recipe({ size });
|
|
12
|
+
return /* @__PURE__ */ jsx(chakra.div, { ref, css: styles, ...props });
|
|
13
|
+
};
|
|
14
|
+
Prose.displayName = "Prose";
|
|
15
|
+
|
|
16
|
+
export { Prose };
|
|
17
|
+
//# sourceMappingURL=chunk-VOGT33LU.js.map
|
|
18
|
+
//# sourceMappingURL=chunk-VOGT33LU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/primitives/prose.tsx"],"names":[],"mappings":";;;;AAOO,IAAM,QAAQ,CAAC;AAAA,EACrB,GAAA;AAAA,EACA,IAAA;AAAA,EACA,GAAG;AACJ,CAAA,KAAwD;AACvD,EAAA,MAAM,MAAA,GAAS,SAAA,CAAU,EAAE,GAAA,EAAK,SAAS,CAAA;AACzC,EAAA,MAAM,MAAA,GAAS,MAAA,CAAO,EAAE,IAAA,EAAM,CAAA;AAC9B,EAAA,uBAAO,GAAA,CAAC,OAAO,GAAA,EAAP,EAAW,KAAU,GAAA,EAAK,MAAA,EAAS,GAAG,KAAA,EAAO,CAAA;AACtD;AACA,KAAA,CAAM,WAAA,GAAc,OAAA","file":"chunk-VOGT33LU.js","sourcesContent":["import { chakra, type HTMLChakraProps, useRecipe } from \"@chakra-ui/react\";\nimport type React from \"react\";\n\nexport interface ProseProps extends HTMLChakraProps<\"div\"> {\n\tsize?: \"md\" | \"lg\";\n}\n\nexport const Prose = ({\n\tref,\n\tsize,\n\t...props\n}: ProseProps & { ref?: React.Ref<HTMLDivElement> }) => {\n\tconst recipe = useRecipe({ key: \"prose\" });\n\tconst styles = recipe({ size });\n\treturn <chakra.div ref={ref} css={styles} {...props} />;\n};\nProse.displayName = \"Prose\";\n"]}
|
|
@@ -241,6 +241,31 @@ interface DateCellProps {
|
|
|
241
241
|
}
|
|
242
242
|
declare const DateCell: React__default.FC<DateCellProps>;
|
|
243
243
|
|
|
244
|
+
interface DeviceCellProps {
|
|
245
|
+
/** Raw User-Agent string. Null/empty renders the empty cell value. */
|
|
246
|
+
userAgent: string | null | undefined;
|
|
247
|
+
/** Optional badge displayed to the right of the primary line (e.g. "Current"). */
|
|
248
|
+
badge?: {
|
|
249
|
+
label: string;
|
|
250
|
+
colorPalette?: string;
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
declare const DeviceCell: React__default.FC<DeviceCellProps>;
|
|
254
|
+
|
|
255
|
+
interface IdentityCellProps {
|
|
256
|
+
/** Primary display name. Null/undefined renders the empty cell value. */
|
|
257
|
+
name: string | null | undefined;
|
|
258
|
+
/** Optional secondary line below the name (e.g., email, ID). */
|
|
259
|
+
subText?: React__default.ReactNode;
|
|
260
|
+
/** Avatar image source URL. */
|
|
261
|
+
avatarSrc?: string;
|
|
262
|
+
/** Initials shown as the avatar fallback. Auto-derived from `name` when omitted. */
|
|
263
|
+
avatarFallback?: string;
|
|
264
|
+
/** Avatar size; defaults to "sm" to match table density. */
|
|
265
|
+
size?: "sm" | "md";
|
|
266
|
+
}
|
|
267
|
+
declare const IdentityCell: React__default.FC<IdentityCellProps>;
|
|
268
|
+
|
|
244
269
|
interface LinkCellProps {
|
|
245
270
|
/** Route path for navigation. Renders em-dash when null/undefined. */
|
|
246
271
|
to: string | null | undefined;
|
|
@@ -297,6 +322,12 @@ interface StatusBadgeCellProps {
|
|
|
297
322
|
detail?: string | null;
|
|
298
323
|
/** Color for the detail text. @default "fg.error" */
|
|
299
324
|
detailColor?: string;
|
|
325
|
+
/**
|
|
326
|
+
* Optional tooltip content shown on hover/focus over the badge. Useful
|
|
327
|
+
* for status descriptions, full JSON payloads, or contextual hints that
|
|
328
|
+
* don't fit on the badge label.
|
|
329
|
+
*/
|
|
330
|
+
tooltip?: React__default.ReactNode;
|
|
300
331
|
}
|
|
301
332
|
declare const StatusBadgeCell: React__default.FC<StatusBadgeCellProps>;
|
|
302
333
|
|
|
@@ -313,6 +344,12 @@ declare const SwitchCell: React__default.FC<SwitchCellProps>;
|
|
|
313
344
|
interface TruncatedTextCellProps {
|
|
314
345
|
value: string | null | undefined;
|
|
315
346
|
maxLength?: number;
|
|
347
|
+
/**
|
|
348
|
+
* Optional secondary line rendered below the primary value in smaller,
|
|
349
|
+
* muted text (e.g. "created 2 days ago", target ID, contextual hint).
|
|
350
|
+
* Sub-text is `lineClamp={1}` and is not affected by `maxLength`.
|
|
351
|
+
*/
|
|
352
|
+
subText?: React__default.ReactNode;
|
|
316
353
|
}
|
|
317
354
|
declare const TruncatedTextCell: React__default.FC<TruncatedTextCellProps>;
|
|
318
355
|
|
|
@@ -322,6 +359,22 @@ interface UrlCellProps {
|
|
|
322
359
|
}
|
|
323
360
|
declare const UrlCell: React__default.FC<UrlCellProps>;
|
|
324
361
|
|
|
362
|
+
/**
|
|
363
|
+
* Parse a User-Agent string into a coarse browser + OS label.
|
|
364
|
+
*
|
|
365
|
+
* Used by `DeviceCell` to render "Chrome on macOS" style labels in
|
|
366
|
+
* sessions / device lists. The matchers are intentionally simple —
|
|
367
|
+
* they cover the common power-user browsers (Chrome, Safari, Firefox,
|
|
368
|
+
* Edge, Opera) on the common platforms (macOS, Windows, iOS, Android,
|
|
369
|
+
* Linux). Unknown browsers return `"Unknown"`; unknown OSes return `""`.
|
|
370
|
+
*/
|
|
371
|
+
declare function parseUserAgent(ua: string | undefined | null): {
|
|
372
|
+
browser: string;
|
|
373
|
+
os: string;
|
|
374
|
+
};
|
|
375
|
+
/** Format a parsed UA into the "Chrome on macOS" style label. */
|
|
376
|
+
declare function formatUserAgent(ua: string | undefined | null): string;
|
|
377
|
+
|
|
325
378
|
interface DataTableProps<T extends Record<string, unknown>> {
|
|
326
379
|
/** Column definitions for TanStack Table */
|
|
327
380
|
columns: ColumnDef<T, unknown>[];
|
|
@@ -896,4 +949,4 @@ interface WidgetProps {
|
|
|
896
949
|
}
|
|
897
950
|
declare const Widget: React__default.FC<WidgetProps>;
|
|
898
951
|
|
|
899
|
-
export { ActionCell, type ActionCellAction, type ActionCellProps, BooleanCell, type BooleanCellProps, BulkActionBar, type BulkActionBarProps, type BulkActionProps, type BulkPopoverActionProps, Card, CardList, CardListData, type CardListDataProps, CardListItem, type CardListItemProps, type CardListMenuItem, type CardListProps, type CardProps, ChipPicker, type ChipPickerProps, CodeCell, type CodeCellProps, ColorSwatchCell, type ColorSwatchCellProps, ContextRail, type ContextRailHeaderProps, type ContextRailProps, type ContextRailSectionProps, CountCell, type CountCellProps, DataTable, type DataTableProps, DateCell, type DateCellProps, type DrawerProps, DrawerRoot, FactBox, type FactBoxAction, type FactBoxProps, InlineCreatableList, type InlineCreatableListProps, LabeledSwitch, type LabeledSwitchProps, LinkCell, type LinkCellProps, MenuCell, type MenuCellAction, type MenuCellProps, Modal, type ModalProps, NumberCell, type NumberCellProps, Pagination, type PaginationProps, SelectableCard, type SelectableCardBodyProps, type SelectableCardFooterProps, type SelectableCardProps, type SelectableCardThumbnailProps, Sidebar, type SidebarItemProps, type SidebarLogoProps, type SidebarSectionProps$1 as SidebarNavSectionProps, type SidebarProps, SidebarSection, type SidebarSectionProps, type SidebarUserMenuItemProps, type SidebarUserMenuProps, SlugCell, type SlugCellProps, StatusBadgeCell, type StatusBadgeCellProps, Stepper, StepperCompleted, StepperContainer, StepperContent, type StepperContentProps, StepperIcon, type StepperIconProps, type StepperProps, StepperProvider, StepperSeparator, type StepperSeparatorProps, StepperStep, type StepperStepProps, StepperStepTitle, StepperSteps, type StepperStepsProps, SwitchCell, type SwitchCellProps, CardList as Table, CardListData as TableData, type CardListDataProps as TableDataProps, CardListItem as TableItem, type CardListItemProps as TableItemProps, type CardListMenuItem as TableMenuItem, type CardListProps as TableProps, TimelineConnector, TimelineContent, TimelineDescription, TimelineIndicator, TimelineItem, type TimelineItemProps, TimelineRoot, type TimelineRootProps, TimelineSeparator, TimelineTitle, Toolbar, type ToolbarFilterChipProps, type ToolbarSearchProps, TreeViewBranch, TreeViewBranchContent, TreeViewBranchControl, TreeViewBranchIndicator, type TreeViewBranchProps, TreeViewBranchText, TreeViewBranchTrigger, TreeViewItem, TreeViewItemIndicator, type TreeViewItemProps, TreeViewItemText, TreeViewLabel, TreeViewNode, TreeViewRoot, type TreeViewRootProps, TreeViewTree, TruncatedTextCell, type TruncatedTextCellProps, UploadDropZone, type UploadDropZoneProps, UrlCell, type UrlCellProps, type UseStepProps, type UseStepperProps, type UseStepperReturn, Widget, type WidgetProps, emptyCellValue, pluralize, truncateText, useSidebarContext, useStep, useStepper, useStepperContext, useStepperNextButton, useStepperPrevButton };
|
|
952
|
+
export { ActionCell, type ActionCellAction, type ActionCellProps, BooleanCell, type BooleanCellProps, BulkActionBar, type BulkActionBarProps, type BulkActionProps, type BulkPopoverActionProps, Card, CardList, CardListData, type CardListDataProps, CardListItem, type CardListItemProps, type CardListMenuItem, type CardListProps, type CardProps, ChipPicker, type ChipPickerProps, CodeCell, type CodeCellProps, ColorSwatchCell, type ColorSwatchCellProps, ContextRail, type ContextRailHeaderProps, type ContextRailProps, type ContextRailSectionProps, CountCell, type CountCellProps, DataTable, type DataTableProps, DateCell, type DateCellProps, DeviceCell, type DeviceCellProps, type DrawerProps, DrawerRoot, FactBox, type FactBoxAction, type FactBoxProps, IdentityCell, type IdentityCellProps, InlineCreatableList, type InlineCreatableListProps, LabeledSwitch, type LabeledSwitchProps, LinkCell, type LinkCellProps, MenuCell, type MenuCellAction, type MenuCellProps, Modal, type ModalProps, NumberCell, type NumberCellProps, Pagination, type PaginationProps, SelectableCard, type SelectableCardBodyProps, type SelectableCardFooterProps, type SelectableCardProps, type SelectableCardThumbnailProps, Sidebar, type SidebarItemProps, type SidebarLogoProps, type SidebarSectionProps$1 as SidebarNavSectionProps, type SidebarProps, SidebarSection, type SidebarSectionProps, type SidebarUserMenuItemProps, type SidebarUserMenuProps, SlugCell, type SlugCellProps, StatusBadgeCell, type StatusBadgeCellProps, Stepper, StepperCompleted, StepperContainer, StepperContent, type StepperContentProps, StepperIcon, type StepperIconProps, type StepperProps, StepperProvider, StepperSeparator, type StepperSeparatorProps, StepperStep, type StepperStepProps, StepperStepTitle, StepperSteps, type StepperStepsProps, SwitchCell, type SwitchCellProps, CardList as Table, CardListData as TableData, type CardListDataProps as TableDataProps, CardListItem as TableItem, type CardListItemProps as TableItemProps, type CardListMenuItem as TableMenuItem, type CardListProps as TableProps, TimelineConnector, TimelineContent, TimelineDescription, TimelineIndicator, TimelineItem, type TimelineItemProps, TimelineRoot, type TimelineRootProps, TimelineSeparator, TimelineTitle, Toolbar, type ToolbarFilterChipProps, type ToolbarSearchProps, TreeViewBranch, TreeViewBranchContent, TreeViewBranchControl, TreeViewBranchIndicator, type TreeViewBranchProps, TreeViewBranchText, TreeViewBranchTrigger, TreeViewItem, TreeViewItemIndicator, type TreeViewItemProps, TreeViewItemText, TreeViewLabel, TreeViewNode, TreeViewRoot, type TreeViewRootProps, TreeViewTree, TruncatedTextCell, type TruncatedTextCellProps, UploadDropZone, type UploadDropZoneProps, UrlCell, type UrlCellProps, type UseStepProps, type UseStepperProps, type UseStepperReturn, Widget, type WidgetProps, emptyCellValue, formatUserAgent, parseUserAgent, pluralize, truncateText, useSidebarContext, useStep, useStepper, useStepperContext, useStepperNextButton, useStepperPrevButton };
|
package/dist/components/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Collapsible, Skeleton, Separator, Checkbox as Checkbox$1 } from '../chunk-TXGJ7BNX.js';
|
|
2
|
-
import { formatRelativeDateTime, StatusBadge } from '../chunk-
|
|
3
|
-
import { MenuItem, MenuRoot, MenuTrigger, MenuContent, Tooltip, Table } from '../chunk-
|
|
2
|
+
import { formatRelativeDateTime, StatusBadge } from '../chunk-ELQTHWXC.js';
|
|
3
|
+
import { MenuItem, MenuRoot, MenuTrigger, MenuContent, Tooltip, Badge, Avatar, Table } from '../chunk-2ZWZ2WAS.js';
|
|
4
4
|
import { Popover, PopoverTrigger, PopoverContent, PopoverBody, Switch } from '../chunk-WQIEF5N3.js';
|
|
5
5
|
import { text_input_default } from '../chunk-OU6H3KU4.js';
|
|
6
6
|
import { Button, IconButton } from '../chunk-JS7ZEZV3.js';
|
|
7
7
|
export { AuthCard, PageHeader } from '../chunk-D5ICTOCW.js';
|
|
8
|
-
import { Box, Flex, Heading, Text, HStack, Grid, GridItem, Code,
|
|
8
|
+
import { Box, Flex, Heading, Text, HStack, Grid, GridItem, Code, VStack, Link, Spacer, Stack } from '../chunk-G4QMIXLC.js';
|
|
9
9
|
import { PanelRightOpen, PanelRightClose, ChevronRight, Search, PanelLeftOpen, PanelLeftClose, X, Ellipsis, Plus, ChevronLeft, ArrowUp, ArrowDown, ArrowUpDown, ChevronDown, Check, Upload } from 'lucide-react';
|
|
10
10
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
11
11
|
import { createContext as createContext$1, Timeline, TreeView, Card as Card$1, Menu, Portal, Checkbox, Drawer, ButtonGroup, Dialog, useSlotRecipe, chakra } from '@chakra-ui/react';
|
|
@@ -699,6 +699,66 @@ var DateCell = ({
|
|
|
699
699
|
return /* @__PURE__ */ jsx("span", { children: formatted });
|
|
700
700
|
};
|
|
701
701
|
DateCell.displayName = "DateCell";
|
|
702
|
+
|
|
703
|
+
// src/components/data-table/cells/user-agent.ts
|
|
704
|
+
function parseUserAgent(ua) {
|
|
705
|
+
if (!ua) return { browser: "Unknown", os: "" };
|
|
706
|
+
let browser = "Unknown";
|
|
707
|
+
if (/Edg\//.test(ua)) browser = "Edge";
|
|
708
|
+
else if (/Firefox\//.test(ua)) browser = "Firefox";
|
|
709
|
+
else if (/OPR\/|Opera/.test(ua)) browser = "Opera";
|
|
710
|
+
else if (/Chrome\//.test(ua)) browser = "Chrome";
|
|
711
|
+
else if (/Safari\//.test(ua)) browser = "Safari";
|
|
712
|
+
let os = "";
|
|
713
|
+
if (/Windows NT/.test(ua)) os = "Windows";
|
|
714
|
+
else if (/iPhone|iPad/.test(ua)) os = "iOS";
|
|
715
|
+
else if (/Mac OS X|Macintosh/.test(ua)) os = "macOS";
|
|
716
|
+
else if (/Android/.test(ua)) os = "Android";
|
|
717
|
+
else if (/Linux/.test(ua)) os = "Linux";
|
|
718
|
+
return { browser, os };
|
|
719
|
+
}
|
|
720
|
+
function formatUserAgent(ua) {
|
|
721
|
+
const { browser, os } = parseUserAgent(ua);
|
|
722
|
+
return os ? `${browser} on ${os}` : browser;
|
|
723
|
+
}
|
|
724
|
+
var DeviceCell = ({ userAgent, badge }) => {
|
|
725
|
+
if (userAgent == null || userAgent === "") {
|
|
726
|
+
return /* @__PURE__ */ jsx("span", { children: emptyCellValue });
|
|
727
|
+
}
|
|
728
|
+
const label = formatUserAgent(userAgent);
|
|
729
|
+
return /* @__PURE__ */ jsx(Tooltip, { content: userAgent, showArrow: true, children: /* @__PURE__ */ jsxs(VStack, { align: "start", gap: 0, children: [
|
|
730
|
+
/* @__PURE__ */ jsxs(HStack, { gap: 2, align: "center", children: [
|
|
731
|
+
/* @__PURE__ */ jsx(Text, { fontSize: "sm", fontWeight: "medium", lineClamp: 1, children: label }),
|
|
732
|
+
badge && /* @__PURE__ */ jsx(Badge, { colorPalette: badge.colorPalette, size: "xs", children: badge.label })
|
|
733
|
+
] }),
|
|
734
|
+
/* @__PURE__ */ jsx(Text, { fontSize: "xs", color: "fg.muted", lineClamp: 1, children: userAgent })
|
|
735
|
+
] }) });
|
|
736
|
+
};
|
|
737
|
+
DeviceCell.displayName = "DeviceCell";
|
|
738
|
+
function deriveInitials(name) {
|
|
739
|
+
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
740
|
+
if (parts.length === 0) return "";
|
|
741
|
+
if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();
|
|
742
|
+
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
|
743
|
+
}
|
|
744
|
+
var IdentityCell = ({
|
|
745
|
+
name,
|
|
746
|
+
subText,
|
|
747
|
+
avatarSrc,
|
|
748
|
+
avatarFallback,
|
|
749
|
+
size = "sm"
|
|
750
|
+
}) => {
|
|
751
|
+
if (name == null) return /* @__PURE__ */ jsx("span", { children: emptyCellValue });
|
|
752
|
+
const initials = avatarFallback ?? deriveInitials(name);
|
|
753
|
+
return /* @__PURE__ */ jsxs(HStack, { gap: 2, align: "center", children: [
|
|
754
|
+
/* @__PURE__ */ jsx(Avatar, { size, name, src: avatarSrc, fallback: initials }),
|
|
755
|
+
/* @__PURE__ */ jsxs(VStack, { align: "start", gap: 0, children: [
|
|
756
|
+
/* @__PURE__ */ jsx(Text, { fontSize: "sm", fontWeight: "semibold", lineClamp: 1, children: name }),
|
|
757
|
+
subText != null && /* @__PURE__ */ jsx(Text, { fontSize: "xs", color: "fg.muted", lineClamp: 1, children: subText })
|
|
758
|
+
] })
|
|
759
|
+
] });
|
|
760
|
+
};
|
|
761
|
+
IdentityCell.displayName = "IdentityCell";
|
|
702
762
|
var LinkCell = ({ to, label }) => {
|
|
703
763
|
if (to == null) return /* @__PURE__ */ jsx("span", { children: emptyCellValue });
|
|
704
764
|
return /* @__PURE__ */ jsx(Link, { color: "accent", asChild: true, children: /* @__PURE__ */ jsx(
|
|
@@ -791,18 +851,22 @@ var StatusBadgeCell = ({
|
|
|
791
851
|
colorMap,
|
|
792
852
|
fallbackColor = "gray",
|
|
793
853
|
detail,
|
|
794
|
-
detailColor = "fg.error"
|
|
854
|
+
detailColor = "fg.error",
|
|
855
|
+
tooltip
|
|
795
856
|
}) => {
|
|
796
857
|
if (value == null) return /* @__PURE__ */ jsx("span", { children: emptyCellValue });
|
|
797
858
|
const color = colorMap?.[value] ?? fallbackColor;
|
|
798
|
-
|
|
859
|
+
let badge = /* @__PURE__ */ jsx(StatusBadge, { label: value, color });
|
|
860
|
+
if (tooltip != null) {
|
|
861
|
+
badge = /* @__PURE__ */ jsx(Tooltip, { content: tooltip, showArrow: true, children: /* @__PURE__ */ jsx("span", { children: badge }) });
|
|
862
|
+
}
|
|
799
863
|
if (detail) {
|
|
800
864
|
return /* @__PURE__ */ jsxs(VStack, { align: "start", gap: 0.5, children: [
|
|
801
865
|
badge,
|
|
802
866
|
/* @__PURE__ */ jsx(Text, { fontSize: "xs", color: detailColor, children: detail })
|
|
803
867
|
] });
|
|
804
868
|
}
|
|
805
|
-
return badge;
|
|
869
|
+
return /* @__PURE__ */ jsx(Fragment, { children: badge });
|
|
806
870
|
};
|
|
807
871
|
StatusBadgeCell.displayName = "StatusBadgeCell";
|
|
808
872
|
var SwitchCell = ({
|
|
@@ -827,12 +891,18 @@ var SwitchCell = ({
|
|
|
827
891
|
SwitchCell.displayName = "SwitchCell";
|
|
828
892
|
var TruncatedTextCell = ({
|
|
829
893
|
value,
|
|
830
|
-
maxLength
|
|
894
|
+
maxLength,
|
|
895
|
+
subText
|
|
831
896
|
}) => {
|
|
832
897
|
if (value == null) return /* @__PURE__ */ jsx("span", { children: emptyCellValue });
|
|
833
898
|
const isTruncated = maxLength != null && value.length > maxLength;
|
|
834
899
|
const display = isTruncated ? truncateText(value, maxLength) : value;
|
|
835
|
-
|
|
900
|
+
const primary = /* @__PURE__ */ jsx("span", { title: isTruncated ? value : void 0, children: display });
|
|
901
|
+
if (subText == null) return primary;
|
|
902
|
+
return /* @__PURE__ */ jsxs(VStack, { align: "start", gap: 0, children: [
|
|
903
|
+
primary,
|
|
904
|
+
/* @__PURE__ */ jsx(Text, { fontSize: "xs", color: "fg.muted", lineClamp: 1, children: subText })
|
|
905
|
+
] });
|
|
836
906
|
};
|
|
837
907
|
TruncatedTextCell.displayName = "TruncatedTextCell";
|
|
838
908
|
var UrlCell = ({ value, label }) => {
|
|
@@ -2566,6 +2636,6 @@ var Widget = ({
|
|
|
2566
2636
|
};
|
|
2567
2637
|
Widget.displayName = "Widget";
|
|
2568
2638
|
|
|
2569
|
-
export { ActionCell, BooleanCell, BulkActionBar, Card, CardList, CardListData, CardListItem, ChipPicker, CodeCell, ColorSwatchCell, ContextRail, CountCell, DataTable, DateCell, DrawerRoot, FactBox, InlineCreatableList, LabeledSwitch, LinkCell, MenuCell, Modal, NumberCell, Pagination, SelectableCard, Sidebar, SidebarSection2 as SidebarSection, SlugCell, StatusBadgeCell, Stepper, StepperCompleted, StepperContainer, StepperContent, StepperIcon, StepperProvider, StepperSeparator, StepperStep, StepperStepTitle, StepperSteps, SwitchCell, CardList as Table, CardListData as TableData, CardListItem as TableItem, TimelineConnector, TimelineContent, TimelineDescription, TimelineIndicator, TimelineItem, TimelineRoot, TimelineSeparator, TimelineTitle, Toolbar, TreeViewBranch, TreeViewBranchContent, TreeViewBranchControl, TreeViewBranchIndicator, TreeViewBranchText, TreeViewBranchTrigger, TreeViewItem, TreeViewItemIndicator, TreeViewItemText, TreeViewLabel, TreeViewNode, TreeViewRoot, TreeViewTree, TruncatedTextCell, UploadDropZone, UrlCell, Widget, emptyCellValue, pluralize, truncateText, useSidebarContext, useStep, useStepper, useStepperContext, useStepperNextButton, useStepperPrevButton };
|
|
2639
|
+
export { ActionCell, BooleanCell, BulkActionBar, Card, CardList, CardListData, CardListItem, ChipPicker, CodeCell, ColorSwatchCell, ContextRail, CountCell, DataTable, DateCell, DeviceCell, DrawerRoot, FactBox, IdentityCell, InlineCreatableList, LabeledSwitch, LinkCell, MenuCell, Modal, NumberCell, Pagination, SelectableCard, Sidebar, SidebarSection2 as SidebarSection, SlugCell, StatusBadgeCell, Stepper, StepperCompleted, StepperContainer, StepperContent, StepperIcon, StepperProvider, StepperSeparator, StepperStep, StepperStepTitle, StepperSteps, SwitchCell, CardList as Table, CardListData as TableData, CardListItem as TableItem, TimelineConnector, TimelineContent, TimelineDescription, TimelineIndicator, TimelineItem, TimelineRoot, TimelineSeparator, TimelineTitle, Toolbar, TreeViewBranch, TreeViewBranchContent, TreeViewBranchControl, TreeViewBranchIndicator, TreeViewBranchText, TreeViewBranchTrigger, TreeViewItem, TreeViewItemIndicator, TreeViewItemText, TreeViewLabel, TreeViewNode, TreeViewRoot, TreeViewTree, TruncatedTextCell, UploadDropZone, UrlCell, Widget, emptyCellValue, formatUserAgent, parseUserAgent, pluralize, truncateText, useSidebarContext, useStep, useStepper, useStepperContext, useStepperNextButton, useStepperPrevButton };
|
|
2570
2640
|
//# sourceMappingURL=index.js.map
|
|
2571
2641
|
//# sourceMappingURL=index.js.map
|