@flipdish/ui-library 0.10.0 → 0.11.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/dist/components/atoms/Button/index.cjs +4 -1
- package/dist/components/atoms/Button/index.cjs.map +1 -1
- package/dist/components/atoms/Button/index.d.ts +2 -0
- package/dist/components/atoms/Button/index.d.ts.map +1 -1
- package/dist/components/atoms/Button/index.js +4 -1
- package/dist/components/atoms/Button/index.js.map +1 -1
- package/dist/components/atoms/Checkbox/index.cjs +4 -2
- package/dist/components/atoms/Checkbox/index.cjs.map +1 -1
- package/dist/components/atoms/Checkbox/index.d.ts +3 -1
- package/dist/components/atoms/Checkbox/index.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/index.js +4 -2
- package/dist/components/atoms/Checkbox/index.js.map +1 -1
- package/dist/components/atoms/Input/index.cjs +7 -4
- package/dist/components/atoms/Input/index.cjs.map +1 -1
- package/dist/components/atoms/Input/index.d.ts +6 -2
- package/dist/components/atoms/Input/index.d.ts.map +1 -1
- package/dist/components/atoms/Input/index.js +7 -4
- package/dist/components/atoms/Input/index.js.map +1 -1
- package/dist/components/atoms/RadioButton/index.cjs +8 -4
- package/dist/components/atoms/RadioButton/index.cjs.map +1 -1
- package/dist/components/atoms/RadioButton/index.d.ts +8 -3
- package/dist/components/atoms/RadioButton/index.d.ts.map +1 -1
- package/dist/components/atoms/RadioButton/index.js +8 -4
- package/dist/components/atoms/RadioButton/index.js.map +1 -1
- package/dist/components/atoms/Toggle/index.cjs +4 -2
- package/dist/components/atoms/Toggle/index.cjs.map +1 -1
- package/dist/components/atoms/Toggle/index.d.ts +3 -1
- package/dist/components/atoms/Toggle/index.d.ts.map +1 -1
- package/dist/components/atoms/Toggle/index.js +4 -2
- package/dist/components/atoms/Toggle/index.js.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-account-item.cjs +3 -1
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-account-item.cjs.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-account-item.d.ts.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-account-item.js +3 -1
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-account-item.js.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-item.cjs +9 -5
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-item.cjs.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-item.d.ts +5 -1
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-item.d.ts.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-item.js +9 -5
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-item.js.map +1 -1
- package/dist/components/molecules/Breadcrumbs/index.cjs +4 -2
- package/dist/components/molecules/Breadcrumbs/index.cjs.map +1 -1
- package/dist/components/molecules/Breadcrumbs/index.d.ts +8 -2
- package/dist/components/molecules/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/components/molecules/Breadcrumbs/index.js +4 -2
- package/dist/components/molecules/Breadcrumbs/index.js.map +1 -1
- package/dist/components/molecules/Pagination/components/pagination-base.cjs +11 -4
- package/dist/components/molecules/Pagination/components/pagination-base.cjs.map +1 -1
- package/dist/components/molecules/Pagination/components/pagination-base.d.ts +8 -1
- package/dist/components/molecules/Pagination/components/pagination-base.d.ts.map +1 -1
- package/dist/components/molecules/Pagination/components/pagination-base.js +11 -4
- package/dist/components/molecules/Pagination/components/pagination-base.js.map +1 -1
- package/dist/components/molecules/ProgressSteps/components/progress-step-base.cjs +16 -16
- package/dist/components/molecules/ProgressSteps/components/progress-step-base.cjs.map +1 -1
- package/dist/components/molecules/ProgressSteps/components/progress-step-base.d.ts +8 -8
- package/dist/components/molecules/ProgressSteps/components/progress-step-base.d.ts.map +1 -1
- package/dist/components/molecules/ProgressSteps/components/progress-step-base.js +16 -16
- package/dist/components/molecules/ProgressSteps/components/progress-step-base.js.map +1 -1
- package/dist/components/molecules/ProgressSteps/index.cjs +19 -12
- package/dist/components/molecules/ProgressSteps/index.cjs.map +1 -1
- package/dist/components/molecules/ProgressSteps/index.d.ts +3 -3
- package/dist/components/molecules/ProgressSteps/index.d.ts.map +1 -1
- package/dist/components/molecules/ProgressSteps/index.js +19 -12
- package/dist/components/molecules/ProgressSteps/index.js.map +1 -1
- package/dist/components/molecules/ProgressSteps/progressSteps.types.d.ts +10 -0
- package/dist/components/molecules/ProgressSteps/progressSteps.types.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-avatar.cjs +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-avatar.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-avatar.d.ts +3 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-avatar.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-avatar.js +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-avatar.js.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-checkbox.cjs +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-checkbox.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-checkbox.d.ts +3 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-checkbox.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-checkbox.js +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-checkbox.js.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-card.cjs +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-card.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-card.d.ts +3 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-card.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-card.js +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-card.js.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-simple.cjs +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-simple.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-simple.d.ts +3 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-simple.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-simple.js +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-simple.js.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-payment-icon.cjs +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-payment-icon.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-payment-icon.d.ts +3 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-payment-icon.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-payment-icon.js +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-payment-icon.js.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-radio-button.cjs +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-radio-button.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-radio-button.d.ts +3 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-radio-button.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-radio-button.js +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-radio-button.js.map +1 -1
- package/dist/components/molecules/Select/components/multi-select.cjs +4 -2
- package/dist/components/molecules/Select/components/multi-select.cjs.map +1 -1
- package/dist/components/molecules/Select/components/multi-select.d.ts +1 -1
- package/dist/components/molecules/Select/components/multi-select.d.ts.map +1 -1
- package/dist/components/molecules/Select/components/multi-select.js +4 -2
- package/dist/components/molecules/Select/components/multi-select.js.map +1 -1
- package/dist/components/molecules/Select/components/select-item.cjs +6 -3
- package/dist/components/molecules/Select/components/select-item.cjs.map +1 -1
- package/dist/components/molecules/Select/components/select-item.d.ts +3 -1
- package/dist/components/molecules/Select/components/select-item.d.ts.map +1 -1
- package/dist/components/molecules/Select/components/select-item.js +6 -3
- package/dist/components/molecules/Select/components/select-item.js.map +1 -1
- package/dist/components/molecules/Select/components/select-shared.cjs.map +1 -1
- package/dist/components/molecules/Select/components/select-shared.d.ts +6 -0
- package/dist/components/molecules/Select/components/select-shared.d.ts.map +1 -1
- package/dist/components/molecules/Select/components/select-shared.js.map +1 -1
- package/dist/components/molecules/Select/index.cjs +6 -4
- package/dist/components/molecules/Select/index.cjs.map +1 -1
- package/dist/components/molecules/Select/index.d.ts +1 -1
- package/dist/components/molecules/Select/index.d.ts.map +1 -1
- package/dist/components/molecules/Select/index.js +6 -4
- package/dist/components/molecules/Select/index.js.map +1 -1
- package/dist/components/molecules/Tabs/index.cjs +24 -8
- package/dist/components/molecules/Tabs/index.cjs.map +1 -1
- package/dist/components/molecules/Tabs/index.d.ts +17 -7
- package/dist/components/molecules/Tabs/index.d.ts.map +1 -1
- package/dist/components/molecules/Tabs/index.js +24 -8
- package/dist/components/molecules/Tabs/index.js.map +1 -1
- package/dist/components/organisms/ActivityFeed/index.cjs +8 -2
- package/dist/components/organisms/ActivityFeed/index.cjs.map +1 -1
- package/dist/components/organisms/ActivityFeed/index.d.ts +3 -1
- package/dist/components/organisms/ActivityFeed/index.d.ts.map +1 -1
- package/dist/components/organisms/ActivityFeed/index.js +8 -2
- package/dist/components/organisms/ActivityFeed/index.js.map +1 -1
- package/dist/components/organisms/CommandMenu/components/command-menu-item.cjs +5 -1
- package/dist/components/organisms/CommandMenu/components/command-menu-item.cjs.map +1 -1
- package/dist/components/organisms/CommandMenu/components/command-menu-item.d.ts +2 -0
- package/dist/components/organisms/CommandMenu/components/command-menu-item.d.ts.map +1 -1
- package/dist/components/organisms/CommandMenu/components/command-menu-item.js +5 -1
- package/dist/components/organisms/CommandMenu/components/command-menu-item.js.map +1 -1
- package/dist/components/organisms/CommandMenu/index.cjs +6 -4
- package/dist/components/organisms/CommandMenu/index.cjs.map +1 -1
- package/dist/components/organisms/CommandMenu/index.d.ts +8 -2
- package/dist/components/organisms/CommandMenu/index.d.ts.map +1 -1
- package/dist/components/organisms/CommandMenu/index.js +6 -4
- package/dist/components/organisms/CommandMenu/index.js.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/mobile-header.cjs +3 -2
- package/dist/components/organisms/HeaderNavigation/components/mobile-header.cjs.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/mobile-header.d.ts +6 -1
- package/dist/components/organisms/HeaderNavigation/components/mobile-header.d.ts.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/mobile-header.js +3 -2
- package/dist/components/organisms/HeaderNavigation/components/mobile-header.js.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-account-card.cjs +9 -6
- package/dist/components/organisms/HeaderNavigation/components/nav-account-card.cjs.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-account-card.d.ts +10 -2
- package/dist/components/organisms/HeaderNavigation/components/nav-account-card.d.ts.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-account-card.js +9 -6
- package/dist/components/organisms/HeaderNavigation/components/nav-account-card.js.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-button.cjs +2 -2
- package/dist/components/organisms/HeaderNavigation/components/nav-button.cjs.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-button.d.ts +3 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-button.d.ts.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-button.js +2 -2
- package/dist/components/organisms/HeaderNavigation/components/nav-button.js.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-item.cjs +4 -4
- package/dist/components/organisms/HeaderNavigation/components/nav-item.cjs.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-item.d.ts +3 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-item.d.ts.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-item.js +4 -4
- package/dist/components/organisms/HeaderNavigation/components/nav-item.js.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-list.cjs +9 -3
- package/dist/components/organisms/HeaderNavigation/components/nav-list.cjs.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-list.d.ts +3 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-list.d.ts.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-list.js +9 -3
- package/dist/components/organisms/HeaderNavigation/components/nav-list.js.map +1 -1
- package/dist/components/organisms/HeaderNavigation/headerNavigation.types.d.ts +17 -8
- package/dist/components/organisms/HeaderNavigation/headerNavigation.types.d.ts.map +1 -1
- package/dist/components/organisms/HeaderNavigation/index.cjs +9 -2
- package/dist/components/organisms/HeaderNavigation/index.cjs.map +1 -1
- package/dist/components/organisms/HeaderNavigation/index.d.ts +10 -1
- package/dist/components/organisms/HeaderNavigation/index.d.ts.map +1 -1
- package/dist/components/organisms/HeaderNavigation/index.js +10 -3
- package/dist/components/organisms/HeaderNavigation/index.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/mobile-header.cjs +2 -2
- package/dist/components/organisms/SidebarNavigation/components/mobile-header.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/mobile-header.d.ts +8 -2
- package/dist/components/organisms/SidebarNavigation/components/mobile-header.d.ts.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/mobile-header.js +2 -2
- package/dist/components/organisms/SidebarNavigation/components/mobile-header.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-account-card.cjs +15 -5
- package/dist/components/organisms/SidebarNavigation/components/nav-account-card.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-account-card.d.ts +12 -2
- package/dist/components/organisms/SidebarNavigation/components/nav-account-card.d.ts.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-account-card.js +15 -5
- package/dist/components/organisms/SidebarNavigation/components/nav-account-card.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-button.cjs +2 -2
- package/dist/components/organisms/SidebarNavigation/components/nav-button.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-button.d.ts +3 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-button.d.ts.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-button.js +2 -2
- package/dist/components/organisms/SidebarNavigation/components/nav-button.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-item.cjs +4 -4
- package/dist/components/organisms/SidebarNavigation/components/nav-item.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-item.d.ts +3 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-item.d.ts.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-item.js +4 -4
- package/dist/components/organisms/SidebarNavigation/components/nav-item.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-list.cjs +9 -3
- package/dist/components/organisms/SidebarNavigation/components/nav-list.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-list.d.ts +3 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-list.d.ts.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-list.js +9 -3
- package/dist/components/organisms/SidebarNavigation/components/nav-list.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/sidebar-menu-button.cjs +1 -1
- package/dist/components/organisms/SidebarNavigation/components/sidebar-menu-button.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/sidebar-menu-button.d.ts +3 -1
- package/dist/components/organisms/SidebarNavigation/components/sidebar-menu-button.d.ts.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/sidebar-menu-button.js +1 -1
- package/dist/components/organisms/SidebarNavigation/components/sidebar-menu-button.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/index.cjs +10 -6
- package/dist/components/organisms/SidebarNavigation/index.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/index.d.ts +7 -1
- package/dist/components/organisms/SidebarNavigation/index.d.ts.map +1 -1
- package/dist/components/organisms/SidebarNavigation/index.js +11 -7
- package/dist/components/organisms/SidebarNavigation/index.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/sidebarNavigation.types.d.ts +21 -8
- package/dist/components/organisms/SidebarNavigation/sidebarNavigation.types.d.ts.map +1 -1
- package/dist/components/organisms/Table/index.cjs +13 -8
- package/dist/components/organisms/Table/index.cjs.map +1 -1
- package/dist/components/organisms/Table/index.d.ts +17 -3
- package/dist/components/organisms/Table/index.d.ts.map +1 -1
- package/dist/components/organisms/Table/index.js +13 -8
- package/dist/components/organisms/Table/index.js.map +1 -1
- package/dist/utilities/testIdUtils/index.cjs +70 -0
- package/dist/utilities/testIdUtils/index.cjs.map +1 -0
- package/dist/utilities/testIdUtils/index.d.ts +57 -0
- package/dist/utilities/testIdUtils/index.d.ts.map +1 -0
- package/dist/utilities/testIdUtils/index.js +58 -0
- package/dist/utilities/testIdUtils/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/molecules/Tabs/index.tsx"],"sourcesContent":[null],"names":["_jsx","AriaTabList","AriaTabPanel","AriaTab","_jsxs","AriaTabs"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/molecules/Tabs/index.tsx"],"sourcesContent":[null],"names":["_jsx","AriaTabList","AriaTabPanel","AriaTab","_jsxs","_Fragment","AriaTabs"],"mappings":";;;;;;;;AAyBA;AACA,MAAM,YAAY,GAAG,CAAC,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAsB,MAAM;AACvF,IAAA,cAAc,EAAE,EAAE,CAChB,mDAAmD,EACnD,cAAc,IAAI,6BAA6B,EAC/C,CAAC,UAAU,IAAI,SAAS,KAAK,qFAAqF,CACnH;AACD,IAAA,aAAa,EAAE,EAAE,CACf,mDAAmD,EACnD,SAAS,IAAI,qEAAqE,EAClF,cAAc,IAAI,6BAA6B,EAC/C,UAAU,IAAI,qEAAqE,CACpF;AAC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require('@flipdish/ui-library/components/atoms/Button');
|
|
8
8
|
var Dot = require('@flipdish/ui-library/components/atoms/Dot');
|
|
9
9
|
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
10
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
10
11
|
|
|
11
|
-
const FeedItem = ({ user, date, action, attachment, comment, labels, message, unseen, connector, size = 'md' }) => {
|
|
12
|
-
|
|
12
|
+
const FeedItem = ({ id, user, date, action, attachment, comment, labels, message, unseen, connector, size = 'md', 'data-testid': dataTestId, }) => {
|
|
13
|
+
const itemTestId = testIdUtils.useResolvedTestId({
|
|
14
|
+
testId: dataTestId,
|
|
15
|
+
segment: `feed-item-${testIdUtils.slugifyTestId(String(id))}`,
|
|
16
|
+
rootName: `feed-item-${testIdUtils.slugifyTestId(String(id))}`,
|
|
17
|
+
});
|
|
18
|
+
return (jsxRuntime.jsxs("article", { "data-testid": itemTestId, className: "relative flex gap-3", children: [unseen && jsxRuntime.jsx(Dot.Dot, { size: "md", className: "absolute top-0 right-0 text-fg-success-secondary" }), jsxRuntime.jsxs("div", { className: "flex shrink-0 flex-col", children: [jsxRuntime.jsx(Avatar.Avatar, { src: user.avatarUrl, alt: user.name, size: size === 'sm' ? 'sm' : 'md', status: user.status }), connector && (jsxRuntime.jsx("div", { className: "relative my-1 flex h-full w-full justify-center self-center overflow-hidden", children: jsxRuntime.jsx("svg", { className: "absolute", width: "2.4", children: jsxRuntime.jsx("line", { x1: "1.2", y1: "1.2", x2: "1.2", y2: "100%", className: "stroke-border-primary", stroke: "black", strokeWidth: "2.4", strokeDasharray: "0,6", strokeLinecap: "round" }) }) }))] }), jsxRuntime.jsxs("div", { className: cx.cx('flex flex-1 flex-col gap-3', connector && 'pb-8'), children: [jsxRuntime.jsxs("header", { children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("a", { href: user.href, className: "rounded text-sm font-medium text-secondary outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2", children: user.name }), date && (jsxRuntime.jsx("time", { className: "text-xs text-tertiary", dateTime: date, children: date }))] }), action && (jsxRuntime.jsxs("p", { className: "text-sm text-tertiary", children: [action.content, ' ', action.target && (jsxRuntime.jsx(Button.Button, { href: action.href, className: "inline text-sm font-medium whitespace-normal", color: "link-color", size: "sm", children: action.target }))] })), user.username && jsxRuntime.jsx("p", { className: "text-sm text-tertiary", children: user.username })] }), attachment && (jsxRuntime.jsxs("figure", { className: "flex gap-3", children: [jsxRuntime.jsx(uiIcons.FileIcon, { type: attachment.type, theme: "light", className: "size-10 dark:hidden" }), jsxRuntime.jsx(uiIcons.FileIcon, { type: attachment.type, theme: "dark", className: "size-10 not-dark:hidden" }), jsxRuntime.jsxs("figcaption", { children: [jsxRuntime.jsx("p", { className: "text-sm font-medium text-secondary", children: attachment.name }), jsxRuntime.jsx("p", { className: "text-sm text-tertiary", children: attachment.size })] })] })), labels && labels.length > 0 && (jsxRuntime.jsx("aside", { className: "flex gap-1", "aria-label": "Labels", children: labels.map((label) => (jsxRuntime.jsx(Badge.Badge, { color: label.color, size: "sm", children: label.name }, label.name))) })), comment && jsxRuntime.jsx("q", { className: "text-sm text-tertiary", children: comment }), message && (jsxRuntime.jsx("section", { className: cx.cx('gap-2 rounded-lg rounded-tl-none p-3 ring-1 ring-secondary ring-inset', connector && 'py-2.5'), children: jsxRuntime.jsx("p", { className: "text-sm text-secondary", children: message }) }))] })] }));
|
|
13
19
|
};
|
|
14
20
|
|
|
15
21
|
exports.FeedItem = FeedItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/organisms/ActivityFeed/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx","Dot","Avatar","cx","Button","FileIcon","Badge"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/organisms/ActivityFeed/index.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","slugifyTestId","_jsxs","_jsx","Dot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 export type FeedItemType = {
|
|
|
30
30
|
export interface FeedItemProps extends FeedItemType {
|
|
31
31
|
connector?: boolean;
|
|
32
32
|
size?: 'sm' | 'md';
|
|
33
|
+
/** Overrides the derived `data-testid` (defaults to `fd-feed-item-<id>`). */
|
|
34
|
+
'data-testid'?: string;
|
|
33
35
|
}
|
|
34
|
-
export declare const FeedItem: ({ user, date, action, attachment, comment, labels, message, unseen, connector, size }: FeedItemProps) => import("react").JSX.Element;
|
|
36
|
+
export declare const FeedItem: ({ id, user, date, action, attachment, comment, labels, message, unseen, connector, size, "data-testid": dataTestId, }: FeedItemProps) => import("react").JSX.Element;
|
|
35
37
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/ActivityFeed/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/ActivityFeed/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAO/E,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;KAC/B,CAAC;IACF,UAAU,CAAC,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;KACrC,CAAC;IACF,MAAM,CAAC,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QAEb,KAAK,EAAE,WAAW,CAAC;KACpB,EAAE,CAAC;IACJ,MAAM,CAAC,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC;AAEF,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,QAAQ,GAAI,uHAatB,aAAa,gCAyFf,CAAC"}
|
|
@@ -5,9 +5,15 @@ import { Badge } from '@flipdish/ui-library/components/atoms/Badge';
|
|
|
5
5
|
import { Button } from '@flipdish/ui-library/components/atoms/Button';
|
|
6
6
|
import { Dot } from '@flipdish/ui-library/components/atoms/Dot';
|
|
7
7
|
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
8
|
+
import { useResolvedTestId, slugifyTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
8
9
|
|
|
9
|
-
const FeedItem = ({ user, date, action, attachment, comment, labels, message, unseen, connector, size = 'md' }) => {
|
|
10
|
-
|
|
10
|
+
const FeedItem = ({ id, user, date, action, attachment, comment, labels, message, unseen, connector, size = 'md', 'data-testid': dataTestId, }) => {
|
|
11
|
+
const itemTestId = useResolvedTestId({
|
|
12
|
+
testId: dataTestId,
|
|
13
|
+
segment: `feed-item-${slugifyTestId(String(id))}`,
|
|
14
|
+
rootName: `feed-item-${slugifyTestId(String(id))}`,
|
|
15
|
+
});
|
|
16
|
+
return (jsxs("article", { "data-testid": itemTestId, className: "relative flex gap-3", children: [unseen && jsx(Dot, { size: "md", className: "absolute top-0 right-0 text-fg-success-secondary" }), jsxs("div", { className: "flex shrink-0 flex-col", children: [jsx(Avatar, { src: user.avatarUrl, alt: user.name, size: size === 'sm' ? 'sm' : 'md', status: user.status }), connector && (jsx("div", { className: "relative my-1 flex h-full w-full justify-center self-center overflow-hidden", children: jsx("svg", { className: "absolute", width: "2.4", children: jsx("line", { x1: "1.2", y1: "1.2", x2: "1.2", y2: "100%", className: "stroke-border-primary", stroke: "black", strokeWidth: "2.4", strokeDasharray: "0,6", strokeLinecap: "round" }) }) }))] }), jsxs("div", { className: cx('flex flex-1 flex-col gap-3', connector && 'pb-8'), children: [jsxs("header", { children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("a", { href: user.href, className: "rounded text-sm font-medium text-secondary outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2", children: user.name }), date && (jsx("time", { className: "text-xs text-tertiary", dateTime: date, children: date }))] }), action && (jsxs("p", { className: "text-sm text-tertiary", children: [action.content, ' ', action.target && (jsx(Button, { href: action.href, className: "inline text-sm font-medium whitespace-normal", color: "link-color", size: "sm", children: action.target }))] })), user.username && jsx("p", { className: "text-sm text-tertiary", children: user.username })] }), attachment && (jsxs("figure", { className: "flex gap-3", children: [jsx(FileIcon, { type: attachment.type, theme: "light", className: "size-10 dark:hidden" }), jsx(FileIcon, { type: attachment.type, theme: "dark", className: "size-10 not-dark:hidden" }), jsxs("figcaption", { children: [jsx("p", { className: "text-sm font-medium text-secondary", children: attachment.name }), jsx("p", { className: "text-sm text-tertiary", children: attachment.size })] })] })), labels && labels.length > 0 && (jsx("aside", { className: "flex gap-1", "aria-label": "Labels", children: labels.map((label) => (jsx(Badge, { color: label.color, size: "sm", children: label.name }, label.name))) })), comment && jsx("q", { className: "text-sm text-tertiary", children: comment }), message && (jsx("section", { className: cx('gap-2 rounded-lg rounded-tl-none p-3 ring-1 ring-secondary ring-inset', connector && 'py-2.5'), children: jsx("p", { className: "text-sm text-secondary", children: message }) }))] })] }));
|
|
11
17
|
};
|
|
12
18
|
|
|
13
19
|
export { FeedItem };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/organisms/ActivityFeed/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/organisms/ActivityFeed/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;AAgDO,MAAM,QAAQ,GAAG,CAAC,EACvB,EAAE,EACF,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,UAAU,EACV,OAAO,EACP,MAAM,EACN,OAAO,EACP,MAAM,EACN,SAAS,EACT,IAAI,GAAG,IAAI,EACX,aAAa,EAAE,UAAU,GACX,KAAI;IAClB,MAAM,UAAU,GAAG,iBAAiB,CAAC;AACnC,QAAA,MAAM,EAAE,UAAU;QAClB,OAAO,EAAE,aAAa,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAA,CAAE;QACjD,QAAQ,EAAE,aAAa,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAA,CAAE;AACnD,KAAA,CAAC;IAEF,QACEA,iCAAsB,UAAU,EAAE,SAAS,EAAC,qBAAqB,aAC9D,MAAM,IAAIC,IAAC,GAAG,EAAA,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,kDAAkD,EAAA,CAAG,EACzFD,cAAK,SAAS,EAAC,wBAAwB,EAAA,QAAA,EAAA,CACrCC,GAAA,CAAC,MAAM,EAAA,EAAC,GAAG,EAAE,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAA,CAAI,EACtG,SAAS,KACRA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,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,EAAA,EAAS,SAAS,EAAE,EAAE,CAAC,uEAAuE,EAAE,SAAS,IAAI,QAAQ,CAAC,EAAA,QAAA,EACpHA,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,wBAAwB,YAAE,OAAO,EAAA,CAAK,GAC3C,CACX,CAAA,EAAA,CACG,CAAA,EAAA,CACE;AAEd;;;;"}
|
|
@@ -4,6 +4,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
var Avatar = require('@flipdish/ui-library/components/atoms/Avatar');
|
|
5
5
|
var FeaturedIcon = require('@flipdish/ui-library/components/atoms/FeaturedIcon');
|
|
6
6
|
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
7
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
7
8
|
var reactAriaComponents = require('react-aria-components');
|
|
8
9
|
var commandShortcut = require('./command-shortcut.cjs');
|
|
9
10
|
|
|
@@ -13,7 +14,10 @@ function omit(obj, keys) {
|
|
|
13
14
|
return Object.fromEntries(Object.entries(obj).filter(([key]) => !keysToOmit.has(key)));
|
|
14
15
|
}
|
|
15
16
|
const CommandDropdownMenuItem = ({ label, children, description, stacked, shortcutKeys, className, ...props }) => {
|
|
16
|
-
|
|
17
|
+
const prefix = testIdUtils.useTestIdPrefix();
|
|
18
|
+
const explicitTestId = props['data-testid'];
|
|
19
|
+
const itemTestId = explicitTestId ?? (prefix && props.id !== undefined ? testIdUtils.joinTestId(prefix, `item-${testIdUtils.slugifyTestId(String(props.id))}`) : undefined);
|
|
20
|
+
return (jsxRuntime.jsx(reactAriaComponents.ListBoxItem, { ...omit(props, ['type', 'icon', 'alt', 'src']), "data-testid": itemTestId, textValue: label, className: (state) => cx.cx('group block cursor-pointer px-2 py-0.5 outline-hidden', typeof className === 'function' ? className(state) : className), children: (state) => (jsxRuntime.jsxs("div", { className: cx.cx('relative flex min-h-10 items-center justify-between rounded-lg px-2.5 py-2 pl-2.5 outline-focus-ring transition duration-100 ease-linear hover:bg-primary_hover', state.isSelected && 'bg-primary_hover', state.isFocusVisible && 'outline-2 outline-offset-2', stacked && 'items-start p-2.5 pl-3.5'), children: [props.type === 'icon' && !stacked && jsxRuntime.jsx(props.icon, { className: "mr-2 size-5 text-fg-quaternary" }), props.type === 'icon' && stacked && jsxRuntime.jsx(FeaturedIcon.FeaturedIcon, { color: "gray", size: "md", theme: "modern", icon: props.icon, className: "mr-2" }), props.type === 'avatar' && jsxRuntime.jsx(Avatar.Avatar, { alt: props.alt, src: props.src, size: stacked ? 'md' : 'xs', className: "mr-2" }), props.type === 'dot' && (
|
|
17
21
|
// biome-ignore lint/a11y/noSvgWithoutTitle: svg has no title
|
|
18
22
|
jsxRuntime.jsx("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", className: cx.cx('mr-2 shrink-0 text-fg-success-secondary', stacked && 'mt-2 self-start'), children: jsxRuntime.jsx("circle", { cx: "5", cy: "5", r: "4", fill: "currentColor" }) })), jsxRuntime.jsxs("div", { className: cx.cx('flex flex-1 gap-x-1.5', stacked && 'flex-col'), children: [jsxRuntime.jsx(reactAriaComponents.Text, { slot: "label", className: "text-sm font-medium text-primary", children: typeof children === 'function' ? children(state) : children || label }), description && (jsxRuntime.jsx(reactAriaComponents.Text, { slot: "description", className: "text-sm text-tertiary", children: description }))] }), shortcutKeys && jsxRuntime.jsx(commandShortcut.CommandShortcut, { keys: shortcutKeys })] })) }));
|
|
19
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-menu-item.cjs","sources":["../../../../../src/components/organisms/CommandMenu/components/command-menu-item.tsx"],"sourcesContent":[null],"names":["_jsx","ListBoxItem","cx","_jsxs","FeaturedIcon","Avatar","AriaText","CommandShortcut"],"mappings":"
|
|
1
|
+
{"version":3,"file":"command-menu-item.cjs","sources":["../../../../../src/components/organisms/CommandMenu/components/command-menu-item.tsx"],"sourcesContent":[null],"names":["useTestIdPrefix","joinTestId","slugifyTestId","_jsx","ListBoxItem","c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AAA,CAACM,wBAAQ,EAAA,EAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,kCAAkC,EAAA,QAAA,EAChE,OAAO,QAAQ,KAAK,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,QAAQ,IAAI,KAAK,EAAA,CAC5D,EACV,WAAW,KACVN,cAAA,CAACM,wBAAQ,EAAA,EAAC,IAAI,EAAC,aAAa,EAAC,SAAS,EAAC,uBAAuB,EAAA,QAAA,EAC3D,WAAW,EAAA,CACH,CACZ,CAAA,EAAA,CACG,EAEL,YAAY,IAAIN,cAAA,CAACO,+BAAe,EAAA,EAAC,IAAI,EAAE,YAAY,EAAA,CAAI,CAAA,EAAA,CACpD,CACP,EAAA,CACW;AAElB;;;;"}
|
|
@@ -6,6 +6,8 @@ interface CommandMenuItemBaseType {
|
|
|
6
6
|
description?: string;
|
|
7
7
|
stacked?: boolean;
|
|
8
8
|
shortcutKeys?: string[];
|
|
9
|
+
/** Overrides the derived `data-testid` for this item (default `<root>--item-<id>`). */
|
|
10
|
+
'data-testid'?: string;
|
|
9
11
|
}
|
|
10
12
|
interface CommandDropdownMenuItemDefaultType extends CommandMenuItemBaseType {
|
|
11
13
|
type?: 'default';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-menu-item.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/CommandMenu/components/command-menu-item.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command-menu-item.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/CommandMenu/components/command-menu-item.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAiC,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG7F,UAAU,uBAAuB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,uFAAuF;IACvF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,kCAAmC,SAAQ,uBAAuB;IAC1E,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,UAAU,+BAAgC,SAAQ,uBAAuB;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,EAAE,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClC;AAED,UAAU,iCAAkC,SAAQ,uBAAuB;IACzE,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,UAAU,8BAA+B,SAAQ,uBAAuB;IACtE,IAAI,EAAE,KAAK,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,2BAA2B,GACnC,kCAAkC,GAClC,+BAA+B,GAC/B,iCAAiC,GACjC,8BAA8B,CAAC;AAQnC,MAAM,MAAM,4BAA4B,GAAG,2BAA2B,GAAG,gBAAgB,CAAC;AAE1F,eAAO,MAAM,uBAAuB,GAAI,8EAQrC,4BAA4B,gCAyD9B,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
2
2
|
import { Avatar } from '@flipdish/ui-library/components/atoms/Avatar';
|
|
3
3
|
import { FeaturedIcon } from '@flipdish/ui-library/components/atoms/FeaturedIcon';
|
|
4
4
|
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
5
|
+
import { useTestIdPrefix, joinTestId, slugifyTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
5
6
|
import { ListBoxItem, Text } from 'react-aria-components';
|
|
6
7
|
import { CommandShortcut } from './command-shortcut.js';
|
|
7
8
|
|
|
@@ -11,7 +12,10 @@ function omit(obj, keys) {
|
|
|
11
12
|
return Object.fromEntries(Object.entries(obj).filter(([key]) => !keysToOmit.has(key)));
|
|
12
13
|
}
|
|
13
14
|
const CommandDropdownMenuItem = ({ label, children, description, stacked, shortcutKeys, className, ...props }) => {
|
|
14
|
-
|
|
15
|
+
const prefix = useTestIdPrefix();
|
|
16
|
+
const explicitTestId = props['data-testid'];
|
|
17
|
+
const itemTestId = explicitTestId ?? (prefix && props.id !== undefined ? joinTestId(prefix, `item-${slugifyTestId(String(props.id))}`) : undefined);
|
|
18
|
+
return (jsx(ListBoxItem, { ...omit(props, ['type', 'icon', 'alt', 'src']), "data-testid": itemTestId, textValue: label, className: (state) => cx('group block cursor-pointer px-2 py-0.5 outline-hidden', typeof className === 'function' ? className(state) : className), children: (state) => (jsxs("div", { className: cx('relative flex min-h-10 items-center justify-between rounded-lg px-2.5 py-2 pl-2.5 outline-focus-ring transition duration-100 ease-linear hover:bg-primary_hover', state.isSelected && 'bg-primary_hover', state.isFocusVisible && 'outline-2 outline-offset-2', stacked && 'items-start p-2.5 pl-3.5'), children: [props.type === 'icon' && !stacked && jsx(props.icon, { className: "mr-2 size-5 text-fg-quaternary" }), props.type === 'icon' && stacked && jsx(FeaturedIcon, { color: "gray", size: "md", theme: "modern", icon: props.icon, className: "mr-2" }), props.type === 'avatar' && jsx(Avatar, { alt: props.alt, src: props.src, size: stacked ? 'md' : 'xs', className: "mr-2" }), props.type === 'dot' && (
|
|
15
19
|
// biome-ignore lint/a11y/noSvgWithoutTitle: svg has no title
|
|
16
20
|
jsx("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", className: cx('mr-2 shrink-0 text-fg-success-secondary', stacked && 'mt-2 self-start'), children: jsx("circle", { cx: "5", cy: "5", r: "4", fill: "currentColor" }) })), jsxs("div", { className: cx('flex flex-1 gap-x-1.5', stacked && 'flex-col'), children: [jsx(Text, { slot: "label", className: "text-sm font-medium text-primary", children: typeof children === 'function' ? children(state) : children || label }), description && (jsx(Text, { slot: "description", className: "text-sm text-tertiary", children: description }))] }), shortcutKeys && jsx(CommandShortcut, { keys: shortcutKeys })] })) }));
|
|
17
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-menu-item.js","sources":["../../../../../src/components/organisms/CommandMenu/components/command-menu-item.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","AriaText"],"mappings":"
|
|
1
|
+
{"version":3,"file":"command-menu-item.js","sources":["../../../../../src/components/organisms/CommandMenu/components/command-menu-item.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","AriaText"],"mappings":";;;;;;;;AA8CA;AACA,SAAS,IAAI,CAAC,GAAW,EAAE,IAAc,EAAA;AACvC,IAAA,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC;AAChC,IAAA,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AACxF;MAIa,uBAAuB,GAAG,CAAC,EACtC,KAAK,EACL,QAAQ,EACR,WAAW,EACX,OAAO,EACP,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACqB,KAAI;AACjC,IAAA,MAAM,MAAM,GAAG,eAAe,EAAE;AAChC,IAAA,MAAM,cAAc,GAAI,KAAoC,CAAC,aAAa,CAAC;AAC3E,IAAA,MAAM,UAAU,GAAG,cAAc,KAAK,MAAM,IAAI,KAAK,CAAC,EAAE,KAAK,SAAS,GAAG,UAAU,CAAC,MAAM,EAAE,CAAA,KAAA,EAAQ,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAA,CAAE,CAAC,GAAG,SAAS,CAAC;AAEnJ,IAAA,QACEA,GAAA,CAAC,WAAW,OACN,IAAI,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC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EtFA,GAAA,CAAA,QAAA,EAAA,EAAQ,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,IAAI,EAAC,cAAc,EAAA,CAAG,EAAA,CAC9C,CACP,EAEDC,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,OAAO,IAAI,UAAU,CAAC,EAAA,QAAA,EAAA,CAChED,GAAA,CAACE,IAAQ,EAAA,EAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,kCAAkC,EAAA,QAAA,EAChE,OAAO,QAAQ,KAAK,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,QAAQ,IAAI,KAAK,EAAA,CAC5D,EACV,WAAW,KACVF,GAAA,CAACE,IAAQ,EAAA,EAAC,IAAI,EAAC,aAAa,EAAC,SAAS,EAAC,uBAAuB,EAAA,QAAA,EAC3D,WAAW,EAAA,CACH,CACZ,CAAA,EAAA,CACG,EAEL,YAAY,IAAIF,GAAA,CAAC,eAAe,EAAA,EAAC,IAAI,EAAE,YAAY,EAAA,CAAI,CAAA,EAAA,CACpD,CACP,EAAA,CACW;AAElB;;;;"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
5
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
5
6
|
var React = require('react');
|
|
6
7
|
var reactAriaComponents = require('react-aria-components');
|
|
7
8
|
var reactHotkeysHook = require('react-hotkeys-hook');
|
|
@@ -18,9 +19,10 @@ const CommandMenuContext = React.createContext({
|
|
|
18
19
|
selectedKeys: new Set(),
|
|
19
20
|
setSelectedKeys: () => { },
|
|
20
21
|
});
|
|
21
|
-
const CommandMenuRoot = ({ items, children, dialogClassName, overlayClassName, filter, inputValue, defaultItems, onInputChange, onSelectionChange, sensitivity = 'base', placeholder = 'Search', defaultSelectedKeys, shortcut = '⌘/', ...otherProps }) => {
|
|
22
|
+
const CommandMenuRoot = ({ items, children, dialogClassName, overlayClassName, filter, inputValue, defaultItems, onInputChange, onSelectionChange, sensitivity = 'base', placeholder = 'Search', defaultSelectedKeys, shortcut = '⌘/', 'data-testid': dataTestId, ...otherProps }) => {
|
|
22
23
|
const inputRef = React.useRef(null);
|
|
23
24
|
const { contains } = reactAriaComponents.useFilter({ sensitivity });
|
|
25
|
+
const rootTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'command-menu', rootName: 'command-menu' });
|
|
24
26
|
const [selectedKeys, setSelectedKeys] = React.useState(defaultSelectedKeys ?? new Set());
|
|
25
27
|
// Flatten the items and register hotkeys for items with shortcut keys.
|
|
26
28
|
const resolvedItems = items ?? defaultItems ?? [];
|
|
@@ -56,10 +58,10 @@ const CommandMenuRoot = ({ items, children, dialogClassName, overlayClassName, f
|
|
|
56
58
|
});
|
|
57
59
|
return hasFooter;
|
|
58
60
|
}, [children]);
|
|
59
|
-
return (jsxRuntime.jsx(CommandMenuContext.Provider, { value: { hasFooter, flatItems, selectedKeys, setSelectedKeys, onSelectionChange, items, ...otherProps }, children: jsxRuntime.jsx(CommandDialog, { isOpen: otherProps.isOpen, onOpenChange: otherProps.onOpenChange, className: overlayClassName, dialogClassName: dialogClassName, children: jsxRuntime.jsxs(reactAriaComponents.Autocomplete, { inputValue, onInputChange, filter: filter === false ? undefined : filter || contains, children: [jsxRuntime.jsx(reactAriaComponents.TextField, { "aria-label": "Search", children: jsxRuntime.jsx(commandInput.CommandInput, { autoFocus: true, shortcutKeys: shortcut ? [shortcut] : undefined, placeholder: placeholder, ref: commandMenu_utils.mergeRefs([inputRef, useHotkeysRef]), className: "relative outline-hidden! after:absolute after:bottom-0 after:left-0 after:h-px after:w-full after:bg-border-secondary" }) }), children] }) }) }));
|
|
61
|
+
return (jsxRuntime.jsx(testIdUtils.TestIdProvider, { value: rootTestId, children: jsxRuntime.jsx(CommandMenuContext.Provider, { value: { hasFooter, flatItems, selectedKeys, setSelectedKeys, onSelectionChange, items, ...otherProps }, children: jsxRuntime.jsx(CommandDialog, { isOpen: otherProps.isOpen, onOpenChange: otherProps.onOpenChange, className: overlayClassName, dialogClassName: dialogClassName, "data-testid": rootTestId, children: jsxRuntime.jsxs(reactAriaComponents.Autocomplete, { inputValue, onInputChange, filter: filter === false ? undefined : filter || contains, children: [jsxRuntime.jsx(reactAriaComponents.TextField, { "aria-label": "Search", children: jsxRuntime.jsx(commandInput.CommandInput, { autoFocus: true, shortcutKeys: shortcut ? [shortcut] : undefined, placeholder: placeholder, ref: commandMenu_utils.mergeRefs([inputRef, useHotkeysRef]), className: "relative outline-hidden! after:absolute after:bottom-0 after:left-0 after:h-px after:w-full after:bg-border-secondary" }) }), children] }) }) }) }));
|
|
60
62
|
};
|
|
61
|
-
const CommandDialog = ({ className, dialogClassName, children, ...comboboxProps }) => {
|
|
62
|
-
return (jsxRuntime.jsx(reactAriaComponents.ModalOverlay, { ...comboboxProps, isDismissable: true, className: (state) => cx.cx('fixed inset-0 z-50 flex min-h-full items-start justify-center overflow-y-auto bg-overlay/70 p-4 text-center backdrop-blur md:pt-16 xl:pt-[clamp(64px,10vh,243px)]', state.isEntering && 'duration-300 ease-out animate-in fade-in', state.isExiting && 'duration-200 ease-in animate-out fade-out', typeof className === 'function' ? className(state) : className), children: (state) => (jsxRuntime.jsx(reactAriaComponents.Modal, { className: (state) => cx.cx('flex max-h-full w-160 flex-col overflow-hidden rounded-xl bg-primary text-left align-middle shadow-xl', state.isEntering && 'duration-300 ease-out animate-in zoom-in-95', state.isExiting && 'duration-200 ease-in animate-out zoom-out-95', typeof dialogClassName === 'function' ? dialogClassName(state) : dialogClassName), children: jsxRuntime.jsx(reactAriaComponents.Dialog, { "aria-label": "Command menu", className: "relative flex min-h-0 flex-1 flex-col outline-hidden", children: typeof children === 'function' ? children(state) : children }) })) }));
|
|
63
|
+
const CommandDialog = ({ className, dialogClassName, children, 'data-testid': dataTestId, ...comboboxProps }) => {
|
|
64
|
+
return (jsxRuntime.jsx(reactAriaComponents.ModalOverlay, { ...comboboxProps, isDismissable: true, className: (state) => cx.cx('fixed inset-0 z-50 flex min-h-full items-start justify-center overflow-y-auto bg-overlay/70 p-4 text-center backdrop-blur md:pt-16 xl:pt-[clamp(64px,10vh,243px)]', state.isEntering && 'duration-300 ease-out animate-in fade-in', state.isExiting && 'duration-200 ease-in animate-out fade-out', typeof className === 'function' ? className(state) : className), children: (state) => (jsxRuntime.jsx(reactAriaComponents.Modal, { className: (state) => cx.cx('flex max-h-full w-160 flex-col overflow-hidden rounded-xl bg-primary text-left align-middle shadow-xl', state.isEntering && 'duration-300 ease-out animate-in zoom-in-95', state.isExiting && 'duration-200 ease-in animate-out zoom-out-95', typeof dialogClassName === 'function' ? dialogClassName(state) : dialogClassName), children: jsxRuntime.jsx(reactAriaComponents.Dialog, { "aria-label": "Command menu", "data-testid": dataTestId, className: "relative flex min-h-0 flex-1 flex-col outline-hidden", children: typeof children === 'function' ? children(state) : children }) })) }));
|
|
63
65
|
};
|
|
64
66
|
const CommandMenuList = ({ className, selectionMode = 'single', ...props }) => {
|
|
65
67
|
const { hasFooter, emptyState, ...listBoxProps } = React.useContext(CommandMenuContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/organisms/CommandMenu/index.tsx"],"sourcesContent":[null],"names":["createContext","useRef","useFilter","useState","useHotkeys","parseHotkey","isDeepEqual","useMemo","Children","CommandMenuFooter","_jsx","_jsxs","AriaAutocomplete","AriaTextField","CommandInput","mergeRefs","AriaModalOverlay","cx","AriaModal","AriaDialog","useContext","AriaListBox","AriaListBoxSection","CommandMenuHeader","AriaCollection","Fragment","CommandDropdownMenuItem","AriaDialogTrigger"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/organisms/CommandMenu/index.tsx"],"sourcesContent":[null],"names":["createContext","useRef","useFilter","useResolvedTestId","useState","useHotkeys","parseHotkey","isDeepEqual","useMemo","Children","CommandMenuFooter","_jsx","TestIdProvider","_jsxs","AriaAutocomplete","AriaTextField","CommandInput","mergeRefs","AriaModalOverlay","cx","AriaModal","AriaDialog","useContext","AriaListBox","AriaListBoxSection","CommandMenuHeader","AriaCollection","Fragment","CommandDropdownMenuItem","AriaDialogTrigger"],"mappings":";;;;;;;;;;;;;;;AAkDA,MAAM,kBAAkB,GAAGA,mBAAa,CAAyB;AAC/D,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,SAAS,EAAE,EAAE;IACb,YAAY,EAAE,IAAI,GAAG,EAAE;AACvB,IAAA,eAAe,EAAE,MAAK,EAAE,CAAC;AAC1B,CAAA,CAAC;AAsBF,MAAM,eAAe,GAAG,CAAC,EACvB,KAAK,EACL,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,MAAM,EACN,UAAU,EACV,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,WAAW,GAAG,MAAM,EACpB,WAAW,GAAG,QAAQ,EACtB,mBAAmB,EACnB,QAAQ,GAAG,IAAI,EACf,aAAa,EAAE,UAAU,EACzB,GAAG,UAAU,EACQ,KAAI;AACzB,IAAA,MAAM,QAAQ,GAAGC,YAAM,CAAmB,IAAI,CAAC;IAC/C,MAAM,EAAE,QAAQ,EAAE,GAAGC,6BAAS,CAAC,EAAE,WAAW,EAAE,CAAC;AAC/C,IAAA,MAAM,UAAU,GAAGC,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;AAE/G,IAAA,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAGC,cAAQ,CAAgB,mBAAmB,IAAI,IAAI,GAAG,EAAE,CAAC;;AAGjG,IAAA,MAAM,aAAa,GAAG,KAAK,IAAI,YAAY,IAAI,EAAE;AACjD,IAAA,MAAM,SAAS,GAAG,aAAa,CAAC,OAAO,C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,CAAC,UAAU,GAAGH,8BAAc;;;;;;;;;"}
|
|
@@ -18,12 +18,18 @@ export interface CommandMenuRootProps extends Omit<ListBoxProps<CommandMenuGroup
|
|
|
18
18
|
sensitivity?: 'base' | 'accent' | 'case' | 'variant' | undefined;
|
|
19
19
|
shortcut?: string | null;
|
|
20
20
|
filter?: false | AutocompleteProps['filter'];
|
|
21
|
+
/**
|
|
22
|
+
* Overrides the root `data-testid`. Defaults to `fd-command-menu`. Items derive
|
|
23
|
+
* their testids from this prefix (e.g. `<root>--item-search`).
|
|
24
|
+
*/
|
|
25
|
+
'data-testid'?: string;
|
|
21
26
|
}
|
|
22
|
-
declare const CommandMenuRoot: ({ items, children, dialogClassName, overlayClassName, filter, inputValue, defaultItems, onInputChange, onSelectionChange, sensitivity, placeholder, defaultSelectedKeys, shortcut, ...otherProps }: CommandMenuRootProps) => import("react").JSX.Element;
|
|
27
|
+
declare const CommandMenuRoot: ({ items, children, dialogClassName, overlayClassName, filter, inputValue, defaultItems, onInputChange, onSelectionChange, sensitivity, placeholder, defaultSelectedKeys, shortcut, "data-testid": dataTestId, ...otherProps }: CommandMenuRootProps) => import("react").JSX.Element;
|
|
23
28
|
interface CommandMenuProps extends ModalOverlayProps {
|
|
24
29
|
dialogClassName?: ModalOverlayProps['className'];
|
|
30
|
+
'data-testid'?: string;
|
|
25
31
|
}
|
|
26
|
-
export declare const CommandDialog: ({ className, dialogClassName, children, ...comboboxProps }: CommandMenuProps) => import("react").JSX.Element;
|
|
32
|
+
export declare const CommandDialog: ({ className, dialogClassName, children, "data-testid": dataTestId, ...comboboxProps }: CommandMenuProps) => import("react").JSX.Element;
|
|
27
33
|
interface CommandMenuListProps extends Omit<ListBoxProps<CommandMenuGroupType>, 'items'> {
|
|
28
34
|
}
|
|
29
35
|
export declare const CommandMenuList: ({ className, selectionMode, ...props }: CommandMenuListProps) => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/CommandMenu/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/CommandMenu/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,GAAG,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC9I,OAAO,EAEL,UAAU,IAAI,cAAc,EAE5B,aAAa,IAAI,iBAAiB,EAOnC,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE,OAAO,EAAE,uBAAuB,EAAE,KAAK,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAG5G,MAAM,MAAM,oBAAoB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,4BAA4B,EAAE,CAAA;CAAE,CAAC;AA8BzG,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,YAAY,CAAC,oBAAoB,CAAC,EAAE,UAAU,GAAG,cAAc,GAAG,WAAW,CAAC,EACzF,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,EACjC,kBAAkB;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,eAAe,CAAC,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;IACjD,gBAAgB,CAAC,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAClD,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAC/B,YAAY,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,G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AAe,GAAG;IAC9D,IAAI,EAAE,OAAO,uBAAuB,CAAC;IACrC,IAAI,EAAE,OAAO,eAAe,CAAC;IAC7B,KAAK,EAAE,OAAO,gBAAgB,CAAC;IAC/B,MAAM,EAAE,OAAO,iBAAiB,CAAC;IACjC,OAAO,EAAE,OAAO,kBAAkB,CAAC;IACnC,OAAO,EAAE,OAAO,kBAAkB,CAAC;IACnC,OAAO,EAAE,OAAO,iBAAiB,CAAC;IAClC,UAAU,EAAE,OAAO,cAAc,CAAC;CACnC,CAAC;AAWF,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
3
|
+
import { useResolvedTestId, TestIdProvider } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
3
4
|
import { createContext, useRef, useState, useMemo, Children, useContext, Fragment } from 'react';
|
|
4
5
|
import { ModalOverlay, Modal, Dialog, useFilter, Autocomplete, TextField, ListBox, ListBoxSection, Collection, DialogTrigger } from 'react-aria-components';
|
|
5
6
|
import { useHotkeys } from 'react-hotkeys-hook';
|
|
@@ -16,9 +17,10 @@ const CommandMenuContext = createContext({
|
|
|
16
17
|
selectedKeys: new Set(),
|
|
17
18
|
setSelectedKeys: () => { },
|
|
18
19
|
});
|
|
19
|
-
const CommandMenuRoot = ({ items, children, dialogClassName, overlayClassName, filter, inputValue, defaultItems, onInputChange, onSelectionChange, sensitivity = 'base', placeholder = 'Search', defaultSelectedKeys, shortcut = '⌘/', ...otherProps }) => {
|
|
20
|
+
const CommandMenuRoot = ({ items, children, dialogClassName, overlayClassName, filter, inputValue, defaultItems, onInputChange, onSelectionChange, sensitivity = 'base', placeholder = 'Search', defaultSelectedKeys, shortcut = '⌘/', 'data-testid': dataTestId, ...otherProps }) => {
|
|
20
21
|
const inputRef = useRef(null);
|
|
21
22
|
const { contains } = useFilter({ sensitivity });
|
|
23
|
+
const rootTestId = useResolvedTestId({ testId: dataTestId, segment: 'command-menu', rootName: 'command-menu' });
|
|
22
24
|
const [selectedKeys, setSelectedKeys] = useState(defaultSelectedKeys ?? new Set());
|
|
23
25
|
// Flatten the items and register hotkeys for items with shortcut keys.
|
|
24
26
|
const resolvedItems = items ?? defaultItems ?? [];
|
|
@@ -54,10 +56,10 @@ const CommandMenuRoot = ({ items, children, dialogClassName, overlayClassName, f
|
|
|
54
56
|
});
|
|
55
57
|
return hasFooter;
|
|
56
58
|
}, [children]);
|
|
57
|
-
return (jsx(CommandMenuContext.Provider, { value: { hasFooter, flatItems, selectedKeys, setSelectedKeys, onSelectionChange, items, ...otherProps }, children: jsx(CommandDialog, { isOpen: otherProps.isOpen, onOpenChange: otherProps.onOpenChange, className: overlayClassName, dialogClassName: dialogClassName, children: jsxs(Autocomplete, { inputValue, onInputChange, filter: filter === false ? undefined : filter || contains, children: [jsx(TextField, { "aria-label": "Search", children: jsx(CommandInput, { autoFocus: true, shortcutKeys: shortcut ? [shortcut] : undefined, placeholder: placeholder, ref: mergeRefs([inputRef, useHotkeysRef]), className: "relative outline-hidden! after:absolute after:bottom-0 after:left-0 after:h-px after:w-full after:bg-border-secondary" }) }), children] }) }) }));
|
|
59
|
+
return (jsx(TestIdProvider, { value: rootTestId, children: jsx(CommandMenuContext.Provider, { value: { hasFooter, flatItems, selectedKeys, setSelectedKeys, onSelectionChange, items, ...otherProps }, children: jsx(CommandDialog, { isOpen: otherProps.isOpen, onOpenChange: otherProps.onOpenChange, className: overlayClassName, dialogClassName: dialogClassName, "data-testid": rootTestId, children: jsxs(Autocomplete, { inputValue, onInputChange, filter: filter === false ? undefined : filter || contains, children: [jsx(TextField, { "aria-label": "Search", children: jsx(CommandInput, { autoFocus: true, shortcutKeys: shortcut ? [shortcut] : undefined, placeholder: placeholder, ref: mergeRefs([inputRef, useHotkeysRef]), className: "relative outline-hidden! after:absolute after:bottom-0 after:left-0 after:h-px after:w-full after:bg-border-secondary" }) }), children] }) }) }) }));
|
|
58
60
|
};
|
|
59
|
-
const CommandDialog = ({ className, dialogClassName, children, ...comboboxProps }) => {
|
|
60
|
-
return (jsx(ModalOverlay, { ...comboboxProps, isDismissable: true, className: (state) => cx('fixed inset-0 z-50 flex min-h-full items-start justify-center overflow-y-auto bg-overlay/70 p-4 text-center backdrop-blur md:pt-16 xl:pt-[clamp(64px,10vh,243px)]', state.isEntering && 'duration-300 ease-out animate-in fade-in', state.isExiting && 'duration-200 ease-in animate-out fade-out', typeof className === 'function' ? className(state) : className), children: (state) => (jsx(Modal, { className: (state) => cx('flex max-h-full w-160 flex-col overflow-hidden rounded-xl bg-primary text-left align-middle shadow-xl', state.isEntering && 'duration-300 ease-out animate-in zoom-in-95', state.isExiting && 'duration-200 ease-in animate-out zoom-out-95', typeof dialogClassName === 'function' ? dialogClassName(state) : dialogClassName), children: jsx(Dialog, { "aria-label": "Command menu", className: "relative flex min-h-0 flex-1 flex-col outline-hidden", children: typeof children === 'function' ? children(state) : children }) })) }));
|
|
61
|
+
const CommandDialog = ({ className, dialogClassName, children, 'data-testid': dataTestId, ...comboboxProps }) => {
|
|
62
|
+
return (jsx(ModalOverlay, { ...comboboxProps, isDismissable: true, className: (state) => cx('fixed inset-0 z-50 flex min-h-full items-start justify-center overflow-y-auto bg-overlay/70 p-4 text-center backdrop-blur md:pt-16 xl:pt-[clamp(64px,10vh,243px)]', state.isEntering && 'duration-300 ease-out animate-in fade-in', state.isExiting && 'duration-200 ease-in animate-out fade-out', typeof className === 'function' ? className(state) : className), children: (state) => (jsx(Modal, { className: (state) => cx('flex max-h-full w-160 flex-col overflow-hidden rounded-xl bg-primary text-left align-middle shadow-xl', state.isEntering && 'duration-300 ease-out animate-in zoom-in-95', state.isExiting && 'duration-200 ease-in animate-out zoom-out-95', typeof dialogClassName === 'function' ? dialogClassName(state) : dialogClassName), children: jsx(Dialog, { "aria-label": "Command menu", "data-testid": dataTestId, className: "relative flex min-h-0 flex-1 flex-col outline-hidden", children: typeof children === 'function' ? children(state) : children }) })) }));
|
|
61
63
|
};
|
|
62
64
|
const CommandMenuList = ({ className, selectionMode = 'single', ...props }) => {
|
|
63
65
|
const { hasFooter, emptyState, ...listBoxProps } = useContext(CommandMenuContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/organisms/CommandMenu/index.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","AriaAutocomplete","AriaTextField","AriaModalOverlay","AriaModal","AriaDialog","AriaListBox","AriaListBoxSection","AriaCollection","AriaDialogTrigger"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/organisms/CommandMenu/index.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","AriaAutocomplete","AriaTextField","AriaModalOverlay","AriaModal","AriaDialog","AriaListBox","AriaListBoxSection","AriaCollection","AriaDialogTrigger"],"mappings":";;;;;;;;;;;;;AAkDA,MAAM,kBAAkB,GAAG,aAAa,CAAyB;AAC/D,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,SAAS,EAAE,EAAE;IACb,YAAY,EAAE,IAAI,GAAG,EAAE;AACvB,IAAA,eAAe,EAAE,MAAK,EAAE,CAAC;AAC1B,CAAA,CAAC;AAsBF,MAAM,eAAe,GAAG,CAAC,EACvB,KAAK,EACL,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,MAAM,EACN,UAAU,EACV,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,WAAW,GAAG,MAAM,EACpB,WAAW,GAAG,QAAQ,EACtB,mBAAmB,EACnB,QAAQ,GAAG,IAAI,EACf,aAAa,EAAE,UAAU,EACzB,GAAG,UAAU,EACQ,KAAI;AACzB,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAmB,IAAI,CAAC;IAC/C,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC,EAAE,WAAW,EAAE,CAAC;AAC/C,IAAA,MAAM,UAAU,GAAG,iBAAiB,CAA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,GAAG,uBAAuB;AAC1C,WAAW,CAAC,IAAI,GAAG,eAAe;AAClC,WAAW,CAAC,KAAK,GAAG,gBAAgB;AACpC,WAAW,CAAC,MAAM,GAAG,iBAAiB;AACtC,WAAW,CAAC,OAAO,GAAG,kBAAkB;AACxC,WAAW,CAAC,OAAO,GAAG,kBAAkB;AACxC,WAAW,CAAC,OAAO,GAAGU,aAAiB;AACvC,WAAW,CAAC,UAAU,GAAGD,UAAc;;;;"}
|
|
@@ -4,10 +4,11 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
var uiIcons = require('@flipdish/ui-icons');
|
|
5
5
|
var FlipdishLogo = require('@flipdish/ui-library/components/atoms/FlipdishLogo');
|
|
6
6
|
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
7
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
7
8
|
var reactAriaComponents = require('react-aria-components');
|
|
8
9
|
|
|
9
|
-
const MobileNavigationHeader = ({ children }) => {
|
|
10
|
-
return (jsxRuntime.jsxs(reactAriaComponents.DialogTrigger, { children: [jsxRuntime.jsxs("header", { className: "flex h-14 items-center justify-between border-b border-secondary bg-primary p-3 pl-4 lg:hidden", children: [jsxRuntime.jsx(FlipdishLogo.FlipdishLogo, { size: "sm" }), jsxRuntime.jsxs(reactAriaComponents.Button, { "aria-label": "Expand navigation menu", className: "group flex items-center justify-center rounded-lg bg-primary p-2 text-fg-secondary outline-focus-ring hover:bg-primary_hover hover:text-fg-secondary_hover focus-visible:outline-2 focus-visible:outline-offset-2", children: [jsxRuntime.jsx(uiIcons.Menu02, { className: "size-6 transition duration-200 ease-in-out group-aria-expanded:opacity-0" }), jsxRuntime.jsx(uiIcons.X, { className: "absolute size-6 opacity-0 transition duration-200 ease-in-out group-aria-expanded:opacity-100" })] })] }), jsxRuntime.jsx(reactAriaComponents.ModalOverlay, { isDismissable: true, className: ({ isEntering, isExiting }) => cx.cx('fixed inset-0 z-50 cursor-pointer bg-overlay/70 pr-16 backdrop-blur-md lg:hidden', isEntering && 'duration-300 ease-in-out animate-in fade-in', isExiting && 'duration-200 ease-in-out animate-out fade-out'), children: ({ state }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(reactAriaComponents.Button, { "aria-label": "Close navigation menu", onPress: () => state.close(), className: "fixed top-2.5 right-3 flex cursor-pointer items-center justify-center rounded-lg p-2 text-fg-white/70 outline-focus-ring hover:bg-white/10 hover:text-fg-white focus-visible:outline-2 focus-visible:outline-offset-2", children: jsxRuntime.jsx(uiIcons.X, { className: "size-6" }) }), jsxRuntime.jsx(reactAriaComponents.Modal, { className: "w-full max-w-74 cursor-auto will-change-transform", children: jsxRuntime.jsx(reactAriaComponents.Dialog, { className: "h-dvh outline-hidden focus:outline-hidden", children: children }) })] })) })] }));
|
|
10
|
+
const MobileNavigationHeader = ({ children, testIdPrefix }) => {
|
|
11
|
+
return (jsxRuntime.jsxs(reactAriaComponents.DialogTrigger, { children: [jsxRuntime.jsxs("header", { className: "flex h-14 items-center justify-between border-b border-secondary bg-primary p-3 pl-4 lg:hidden", children: [jsxRuntime.jsx(FlipdishLogo.FlipdishLogo, { size: "sm" }), jsxRuntime.jsxs(reactAriaComponents.Button, { "aria-label": "Expand navigation menu", "data-testid": testIdPrefix ? testIdUtils.joinTestId(testIdPrefix, 'mobile-toggle') : undefined, className: "group flex items-center justify-center rounded-lg bg-primary p-2 text-fg-secondary outline-focus-ring hover:bg-primary_hover hover:text-fg-secondary_hover focus-visible:outline-2 focus-visible:outline-offset-2", children: [jsxRuntime.jsx(uiIcons.Menu02, { className: "size-6 transition duration-200 ease-in-out group-aria-expanded:opacity-0" }), jsxRuntime.jsx(uiIcons.X, { className: "absolute size-6 opacity-0 transition duration-200 ease-in-out group-aria-expanded:opacity-100" })] })] }), jsxRuntime.jsx(reactAriaComponents.ModalOverlay, { isDismissable: true, className: ({ isEntering, isExiting }) => cx.cx('fixed inset-0 z-50 cursor-pointer bg-overlay/70 pr-16 backdrop-blur-md lg:hidden', isEntering && 'duration-300 ease-in-out animate-in fade-in', isExiting && 'duration-200 ease-in-out animate-out fade-out'), children: ({ state }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(reactAriaComponents.Button, { "aria-label": "Close navigation menu", "data-testid": testIdPrefix ? testIdUtils.joinTestId(testIdPrefix, 'mobile-close') : undefined, onPress: () => state.close(), className: "fixed top-2.5 right-3 flex cursor-pointer items-center justify-center rounded-lg p-2 text-fg-white/70 outline-focus-ring hover:bg-white/10 hover:text-fg-white focus-visible:outline-2 focus-visible:outline-offset-2", children: jsxRuntime.jsx(uiIcons.X, { className: "size-6" }) }), jsxRuntime.jsx(reactAriaComponents.Modal, { className: "w-full max-w-74 cursor-auto will-change-transform", children: jsxRuntime.jsx(reactAriaComponents.Dialog, { className: "h-dvh outline-hidden focus:outline-hidden", children: children }) })] })) })] }));
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
exports.MobileNavigationHeader = MobileNavigationHeader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobile-header.cjs","sources":["../../../../../src/components/organisms/HeaderNavigation/components/mobile-header.tsx"],"sourcesContent":[null],"names":["_jsxs","AriaDialogTrigger","_jsx","FlipdishLogo","AriaButton","Menu02","CloseIcon","AriaModalOverlay","cx","_Fragment","AriaModal","AriaDialog"],"mappings":"
|
|
1
|
+
{"version":3,"file":"mobile-header.cjs","sources":["../../../../../src/components/organisms/HeaderNavigation/components/mobile-header.tsx"],"sourcesContent":[null],"names":["_jsxs","AriaDialogTrigger","_jsx","FlipdishLogo","AriaButton","joinTestId","Menu02","CloseIcon","AriaModalOverlay","cx","_Fragment","AriaModal","AriaDialog"],"mappings":";;;;;;;;;AAoBO,MAAM,sBAAsB,GAAG,CAAC,EAAE,QAAQ,EAAE,YAAY,EAA+B,KAAI;AAChG,IAAA,QACEA,eAAA,CAACC,iCAAiB,EAAA,EAAA,QAAA,EAAA,CAChBD,eAA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AA,CACX,CACJ,EAAA,CACgB,CAAA,EAAA,CACD;AAExB;;;;"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
-
|
|
2
|
+
interface MobileNavigationHeaderProps extends PropsWithChildren {
|
|
3
|
+
/** Resolved testid of the header used to derive the toggle/close `data-testid`s. */
|
|
4
|
+
testIdPrefix?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const MobileNavigationHeader: ({ children, testIdPrefix }: MobileNavigationHeaderProps) => import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
3
8
|
//# sourceMappingURL=mobile-header.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobile-header.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/HeaderNavigation/components/mobile-header.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mobile-header.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/HeaderNavigation/components/mobile-header.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAS/C,UAAU,2BAA4B,SAAQ,iBAAiB;IAC7D,oFAAoF;IACpF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,sBAAsB,GAAI,4BAA4B,2BAA2B,gCA6C7F,CAAC"}
|
|
@@ -2,10 +2,11 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import { Menu02, X } from '@flipdish/ui-icons';
|
|
3
3
|
import { FlipdishLogo } from '@flipdish/ui-library/components/atoms/FlipdishLogo';
|
|
4
4
|
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
5
|
+
import { joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
5
6
|
import { DialogTrigger, Button, ModalOverlay, Modal, Dialog } from 'react-aria-components';
|
|
6
7
|
|
|
7
|
-
const MobileNavigationHeader = ({ children }) => {
|
|
8
|
-
return (jsxs(DialogTrigger, { children: [jsxs("header", { className: "flex h-14 items-center justify-between border-b border-secondary bg-primary p-3 pl-4 lg:hidden", children: [jsx(FlipdishLogo, { size: "sm" }), jsxs(Button, { "aria-label": "Expand navigation menu", className: "group flex items-center justify-center rounded-lg bg-primary p-2 text-fg-secondary outline-focus-ring hover:bg-primary_hover hover:text-fg-secondary_hover focus-visible:outline-2 focus-visible:outline-offset-2", children: [jsx(Menu02, { className: "size-6 transition duration-200 ease-in-out group-aria-expanded:opacity-0" }), jsx(X, { className: "absolute size-6 opacity-0 transition duration-200 ease-in-out group-aria-expanded:opacity-100" })] })] }), jsx(ModalOverlay, { isDismissable: true, className: ({ isEntering, isExiting }) => cx('fixed inset-0 z-50 cursor-pointer bg-overlay/70 pr-16 backdrop-blur-md lg:hidden', isEntering && 'duration-300 ease-in-out animate-in fade-in', isExiting && 'duration-200 ease-in-out animate-out fade-out'), children: ({ state }) => (jsxs(Fragment, { children: [jsx(Button, { "aria-label": "Close navigation menu", onPress: () => state.close(), className: "fixed top-2.5 right-3 flex cursor-pointer items-center justify-center rounded-lg p-2 text-fg-white/70 outline-focus-ring hover:bg-white/10 hover:text-fg-white focus-visible:outline-2 focus-visible:outline-offset-2", children: jsx(X, { className: "size-6" }) }), jsx(Modal, { className: "w-full max-w-74 cursor-auto will-change-transform", children: jsx(Dialog, { className: "h-dvh outline-hidden focus:outline-hidden", children: children }) })] })) })] }));
|
|
8
|
+
const MobileNavigationHeader = ({ children, testIdPrefix }) => {
|
|
9
|
+
return (jsxs(DialogTrigger, { children: [jsxs("header", { className: "flex h-14 items-center justify-between border-b border-secondary bg-primary p-3 pl-4 lg:hidden", children: [jsx(FlipdishLogo, { size: "sm" }), jsxs(Button, { "aria-label": "Expand navigation menu", "data-testid": testIdPrefix ? joinTestId(testIdPrefix, 'mobile-toggle') : undefined, className: "group flex items-center justify-center rounded-lg bg-primary p-2 text-fg-secondary outline-focus-ring hover:bg-primary_hover hover:text-fg-secondary_hover focus-visible:outline-2 focus-visible:outline-offset-2", children: [jsx(Menu02, { className: "size-6 transition duration-200 ease-in-out group-aria-expanded:opacity-0" }), jsx(X, { className: "absolute size-6 opacity-0 transition duration-200 ease-in-out group-aria-expanded:opacity-100" })] })] }), jsx(ModalOverlay, { isDismissable: true, className: ({ isEntering, isExiting }) => cx('fixed inset-0 z-50 cursor-pointer bg-overlay/70 pr-16 backdrop-blur-md lg:hidden', isEntering && 'duration-300 ease-in-out animate-in fade-in', isExiting && 'duration-200 ease-in-out animate-out fade-out'), children: ({ state }) => (jsxs(Fragment, { children: [jsx(Button, { "aria-label": "Close navigation menu", "data-testid": testIdPrefix ? joinTestId(testIdPrefix, 'mobile-close') : undefined, onPress: () => state.close(), className: "fixed top-2.5 right-3 flex cursor-pointer items-center justify-center rounded-lg p-2 text-fg-white/70 outline-focus-ring hover:bg-white/10 hover:text-fg-white focus-visible:outline-2 focus-visible:outline-offset-2", children: jsx(X, { className: "size-6" }) }), jsx(Modal, { className: "w-full max-w-74 cursor-auto will-change-transform", children: jsx(Dialog, { className: "h-dvh outline-hidden focus:outline-hidden", children: children }) })] })) })] }));
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
export { MobileNavigationHeader };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobile-header.js","sources":["../../../../../src/components/organisms/HeaderNavigation/components/mobile-header.tsx"],"sourcesContent":[null],"names":["_jsxs","AriaDialogTrigger","_jsx","AriaButton","CloseIcon","AriaModalOverlay","_Fragment","AriaModal","AriaDialog"],"mappings":"
|
|
1
|
+
{"version":3,"file":"mobile-header.js","sources":["../../../../../src/components/organisms/HeaderNavigation/components/mobile-header.tsx"],"sourcesContent":[null],"names":["_jsxs","AriaDialogTrigger","_jsx","AriaButton","CloseIcon","AriaModalOverlay","_Fragment","AriaModal","AriaDialog"],"mappings":";;;;;;;AAoBO,MAAM,sBAAsB,GAAG,CAAC,EAAE,QAAQ,EAAE,YAAY,EAA+B,KAAI;AAChG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