@payfit/unity-components 0.0.0-alpha.7 → 0.0.0-alpha.8
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/cjs/components/alert/Alert.js +1 -1
- package/dist/cjs/components/avatar/parts/AvatarPair.js +1 -1
- package/dist/cjs/components/badge/Badge.d.ts +3 -0
- package/dist/cjs/components/badge/Badge.js +1 -1
- package/dist/cjs/components/breadcrumbs/parts/Breadcrumb.js +1 -1
- package/dist/cjs/components/checkbox/parts/CheckboxIndicator.js +1 -1
- package/dist/cjs/components/collapsible/Collapsible.d.ts +33 -0
- package/dist/cjs/components/collapsible/parts/CollapsibleContent.d.ts +36 -0
- package/dist/cjs/components/collapsible/parts/CollapsibleTitle.d.ts +39 -0
- package/dist/cjs/components/date-picker/DatePicker.js +1 -1
- package/dist/cjs/components/date-picker/parts/DateInput.js +1 -1
- package/dist/cjs/components/fieldset/Fieldset.d.ts +150 -0
- package/dist/cjs/components/fieldset/Fieldset.js +1 -0
- package/dist/cjs/components/fieldset/parts/FieldGroup.d.ts +27 -0
- package/dist/cjs/components/fieldset/parts/FieldGroup.js +1 -0
- package/dist/cjs/components/form-field/parts/FormControl.d.ts +23 -0
- package/dist/cjs/components/icon-button/CircularIconButton.js +1 -1
- package/dist/cjs/components/icon-button/IconButton.variants.js +1 -1
- package/dist/cjs/components/input/Input.js +1 -1
- package/dist/cjs/components/menu/parts/MenuContent.js +1 -1
- package/dist/cjs/components/multi-select/MultiSelect.d.ts +62 -0
- package/dist/cjs/components/multi-select/MultiSelect.js +1 -0
- package/dist/cjs/components/multi-select/Multiselect.context.d.ts +7 -0
- package/dist/cjs/components/multi-select/Multiselect.context.js +1 -0
- package/dist/cjs/components/multi-select/Multiselect.types.d.ts +109 -0
- package/dist/cjs/components/multi-select/hooks/use-combobox-filter.d.ts +12 -0
- package/dist/cjs/components/multi-select/hooks/use-combobox-filter.js +1 -0
- package/dist/cjs/components/multi-select/hooks/use-multiselection-state.d.ts +14 -0
- package/dist/cjs/components/multi-select/hooks/use-multiselection-state.js +1 -0
- package/dist/cjs/components/multi-select/parts/MultiSelectButton.d.ts +16 -0
- package/dist/cjs/components/multi-select/parts/MultiSelectButton.js +1 -0
- package/dist/cjs/components/multi-select/parts/MultiSelectOptGroup.d.ts +69 -0
- package/dist/cjs/components/multi-select/parts/MultiSelectOptGroup.js +1 -0
- package/dist/cjs/components/multi-select/parts/MultiSelectOption.d.ts +20 -0
- package/dist/cjs/components/multi-select/parts/MultiSelectOption.js +1 -0
- package/dist/cjs/components/multi-select/parts/MultiSelectPopover.d.ts +7 -0
- package/dist/cjs/components/multi-select/parts/MultiSelectPopover.js +1 -0
- package/dist/cjs/components/multi-select-field/MultiSelectField.d.ts +59 -0
- package/dist/cjs/components/multi-select-field/MultiSelectField.js +1 -0
- package/dist/cjs/components/segmented-button-group/SegmentedButtonGroup.d.ts +43 -0
- package/dist/cjs/components/segmented-button-group/SegmentedButtonGroups.context.d.ts +8 -0
- package/dist/cjs/components/segmented-button-group/parts/ToggleButton.d.ts +47 -0
- package/dist/cjs/components/select/Select.js +1 -1
- package/dist/cjs/components/select/parts/SearchInput.js +1 -1
- package/dist/cjs/components/selectable-button-group/SelectableButtonGroup.context.d.ts +2 -0
- package/dist/cjs/components/selectable-button-group/SelectableButtonGroup.context.js +1 -0
- package/dist/cjs/components/selectable-button-group/SelectableButtonGroup.d.ts +59 -0
- package/dist/cjs/components/selectable-button-group/SelectableButtonGroup.js +1 -0
- package/dist/cjs/components/selectable-button-group/parts/SelectableButton.d.ts +127 -0
- package/dist/cjs/components/selectable-button-group/parts/SelectableButton.js +1 -0
- package/dist/cjs/components/tabs/parts/TabList.js +1 -1
- package/dist/cjs/components/text-area/TextArea.js +1 -1
- package/dist/cjs/components/toast/UnityToast.d.ts +2 -2
- package/dist/cjs/components/toast/UnityToast.js +1 -1
- package/dist/cjs/components/tooltip/Tooltip.js +1 -1
- package/dist/cjs/index.d.ts +10 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/types/utils.d.ts +1 -0
- package/dist/esm/components/alert/Alert.mjs +1 -1
- package/dist/esm/components/app-menu/parts/AppMenuFooter.mjs +3 -3
- package/dist/esm/components/avatar/parts/AvatarPair.mjs +10 -10
- package/dist/esm/components/badge/Badge.d.mts +3 -0
- package/dist/esm/components/badge/Badge.mjs +12 -10
- package/dist/esm/components/breadcrumbs/parts/Breadcrumb.mjs +10 -10
- package/dist/esm/components/checkbox/parts/CheckboxIndicator.mjs +1 -1
- package/dist/esm/components/collapsible/Collapsible.d.mts +33 -0
- package/dist/esm/components/collapsible/parts/CollapsibleContent.d.mts +36 -0
- package/dist/esm/components/collapsible/parts/CollapsibleTitle.d.mts +39 -0
- package/dist/esm/components/date-picker/DatePicker.mjs +1 -1
- package/dist/esm/components/date-picker/parts/DateInput.mjs +7 -7
- package/dist/esm/components/fieldset/Fieldset.d.mts +150 -0
- package/dist/esm/components/fieldset/Fieldset.mjs +65 -0
- package/dist/esm/components/fieldset/parts/FieldGroup.d.mts +27 -0
- package/dist/esm/components/fieldset/parts/FieldGroup.mjs +18 -0
- package/dist/esm/components/form/Form.mjs +5 -5
- package/dist/esm/components/form-field/parts/FormControl.d.mts +23 -0
- package/dist/esm/components/icon-button/CircularIconButton.mjs +10 -11
- package/dist/esm/components/icon-button/IconButton.variants.mjs +9 -9
- package/dist/esm/components/input/Input.mjs +30 -30
- package/dist/esm/components/menu/parts/MenuContent.mjs +1 -1
- package/dist/esm/components/multi-select/MultiSelect.d.mts +62 -0
- package/dist/esm/components/multi-select/MultiSelect.mjs +230 -0
- package/dist/esm/components/multi-select/Multiselect.context.d.mts +7 -0
- package/dist/esm/components/multi-select/Multiselect.context.mjs +8 -0
- package/dist/esm/components/multi-select/Multiselect.types.d.mts +109 -0
- package/dist/esm/components/multi-select/hooks/use-combobox-filter.d.mts +12 -0
- package/dist/esm/components/multi-select/hooks/use-combobox-filter.mjs +22 -0
- package/dist/esm/components/multi-select/hooks/use-multiselection-state.d.mts +14 -0
- package/dist/esm/components/multi-select/hooks/use-multiselection-state.mjs +47 -0
- package/dist/esm/components/multi-select/parts/MultiSelectButton.d.mts +16 -0
- package/dist/esm/components/multi-select/parts/MultiSelectButton.mjs +160 -0
- package/dist/esm/components/multi-select/parts/MultiSelectOptGroup.d.mts +69 -0
- package/dist/esm/components/multi-select/parts/MultiSelectOptGroup.mjs +34 -0
- package/dist/esm/components/multi-select/parts/MultiSelectOption.d.mts +20 -0
- package/dist/esm/components/multi-select/parts/MultiSelectOption.mjs +85 -0
- package/dist/esm/components/multi-select/parts/MultiSelectPopover.d.mts +7 -0
- package/dist/esm/components/multi-select/parts/MultiSelectPopover.mjs +65 -0
- package/dist/esm/components/multi-select-field/MultiSelectField.d.mts +59 -0
- package/dist/esm/components/multi-select-field/MultiSelectField.mjs +81 -0
- package/dist/esm/components/segmented-button-group/SegmentedButtonGroup.d.mts +43 -0
- package/dist/esm/components/segmented-button-group/SegmentedButtonGroups.context.d.mts +8 -0
- package/dist/esm/components/segmented-button-group/parts/ToggleButton.d.mts +47 -0
- package/dist/esm/components/select/Select.mjs +19 -19
- package/dist/esm/components/select/parts/SearchInput.mjs +7 -7
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.context.d.mts +2 -0
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.context.mjs +5 -0
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.d.mts +59 -0
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.mjs +25 -0
- package/dist/esm/components/selectable-button-group/parts/SelectableButton.d.mts +127 -0
- package/dist/esm/components/selectable-button-group/parts/SelectableButton.mjs +98 -0
- package/dist/esm/components/tabs/parts/TabList.mjs +47 -25
- package/dist/esm/components/text-area/TextArea.mjs +28 -30
- package/dist/esm/components/toast/UnityToast.d.mts +2 -2
- package/dist/esm/components/toast/UnityToast.mjs +5 -5
- package/dist/esm/components/tooltip/Tooltip.mjs +11 -17
- package/dist/esm/index.d.mts +10 -0
- package/dist/esm/index.mjs +176 -155
- package/dist/esm/providers/router/RouterProvider.mjs +3 -3
- package/dist/esm/types/utils.d.mts +1 -0
- package/i18n/en-GB.json +1 -0
- package/i18n/es-ES.json +1 -0
- package/i18n/fr-FR.json +1 -0
- package/package.json +20 -18
- package/dist/cjs/components/index.d.ts +0 -4
- package/dist/esm/components/index.d.mts +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),g=require("react"),f=require("tailwind-variants"),w=require("../icon-button/CircularIconButton.js"),p=require("../icon/Icon.js"),x=f.tv({slots:{base:"uy-p-200 uy-flex uy-gap-200 uy-border uy-rounded-100",content:"uy-flex uy-flex-col uy-flex-1 uy-gap-200 uy-pt-50 uy-pb-100",icon:"uy-mt-50"},variants:{variant:{info:{base:"uy-bg-surface-info-lowest uy-border-border-info-lowest"},warning:{base:"uy-bg-surface-warning-lowest uy-border-border-warning-lowest"},success:{base:"uy-bg-surface-success-lowest uy-border-border-success-lowest"},danger:{base:"uy-bg-surface-danger-lowest uy-border-border-danger-lowest"}}},defaultVariants:{variant:"info"}}),m={info:{src:"InfoFilled",color:"content.info"},warning:{src:"WarningFilled",color:"content.warning"},success:{src:"CheckCircleFilled",color:"content.success"},danger:{src:"WarningCircleFilled",color:"content.danger"}},s=g.forwardRef(({children:o,variant:e,isDismissable:n,onDismiss:t,dismissButtonLabel:a,...c},i)=>{const{base:l,content:u,icon:d}=x({variant:e}),y=m[e],b={role:e==="danger"?"alert":"status","aria-live":e==="danger"?"assertive":"polite","aria-atomic":!0,"aria-relevant":"additions removals"};return r.jsxs("div",{ref:i,className:l(),...b,...c,children:[r.jsx("div",{className:d(),children:r.jsx(p.Icon,{size:24,...y,alt:`${e} alert`})}),r.jsx("section",{className:u(),children:o}),n&&r.jsx(w.CircularIconButton,{title:a,icon:"CloseOutlined",onPress:t})]})});s.displayName="Alert";exports.Alert=s;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),g=require("react"),f=require("tailwind-variants"),w=require("../icon-button/CircularIconButton.js"),p=require("../icon/Icon.js"),x=f.tv({slots:{base:"uy-p-200 uy-flex uy-gap-200 uy-border uy-border-solid uy-rounded-100",content:"uy-flex uy-flex-col uy-flex-1 uy-gap-200 uy-pt-50 uy-pb-100",icon:"uy-mt-50"},variants:{variant:{info:{base:"uy-bg-surface-info-lowest uy-border-border-info-lowest"},warning:{base:"uy-bg-surface-warning-lowest uy-border-border-warning-lowest"},success:{base:"uy-bg-surface-success-lowest uy-border-border-success-lowest"},danger:{base:"uy-bg-surface-danger-lowest uy-border-border-danger-lowest"}}},defaultVariants:{variant:"info"}}),m={info:{src:"InfoFilled",color:"content.info"},warning:{src:"WarningFilled",color:"content.warning"},success:{src:"CheckCircleFilled",color:"content.success"},danger:{src:"WarningCircleFilled",color:"content.danger"}},s=g.forwardRef(({children:o,variant:e,isDismissable:n,onDismiss:t,dismissButtonLabel:a,...c},i)=>{const{base:l,content:u,icon:d}=x({variant:e}),y=m[e],b={role:e==="danger"?"alert":"status","aria-live":e==="danger"?"assertive":"polite","aria-atomic":!0,"aria-relevant":"additions removals"};return r.jsxs("div",{ref:i,className:l(),...b,...c,children:[r.jsx("div",{className:d(),children:r.jsx(p.Icon,{size:24,...y,alt:`${e} alert`})}),r.jsx("section",{className:u(),children:o}),n&&r.jsx(w.CircularIconButton,{title:a,icon:"CloseOutlined",onPress:t})]})});s.displayName="Alert";exports.Alert=s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),y=require("react"),m=require("@radix-ui/react-avatar"),p=require("tailwind-variants"),o=require("../Avatar.context.js"),b=require("../Avatar.variants.js");function c(e){if(e&&typeof e=="object"&&"default"in e)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const P=c(y),g=c(m),x=p.tv({extend:b.avatarBase,base:"uy-absolute uy-overflow-hidden uy-leading-[0] uy-border uy-border-content-inverted -uy-bottom-[var(--pair-offset)] -uy-right-[var(--pair-offset)] uy-transition-transform uy-origin-center",variants:{size:{xs:"uy-size-200",sm:"uy-size-300"},isHidden:{true:"uy-scale-0",false:"uy-scale-100"}},defaultVariants:{size:"sm",variant:"circle",isHidden:!1}}),u=P.forwardRef(({variant:e,isHidden:t,children:r,...a},l)=>{const{size:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),y=require("react"),m=require("@radix-ui/react-avatar"),p=require("tailwind-variants"),o=require("../Avatar.context.js"),b=require("../Avatar.variants.js");function c(e){if(e&&typeof e=="object"&&"default"in e)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const P=c(y),g=c(m),x=p.tv({extend:b.avatarBase,base:"uy-absolute uy-overflow-hidden uy-leading-[0] uy-border uy-border-solid uy-border-content-inverted -uy-bottom-[var(--pair-offset)] -uy-right-[var(--pair-offset)] uy-transition-transform uy-origin-center",variants:{size:{xs:"uy-size-200",sm:"uy-size-300"},isHidden:{true:"uy-scale-0",false:"uy-scale-100"}},defaultVariants:{size:"sm",variant:"circle",isHidden:!1}}),u=P.forwardRef(({variant:e,isHidden:t,children:r,...a},l)=>{const{size:d}=o.useAvatarContext(),i=d==="xl",s=i?"sm":"xs",f=i?0:4,v=x({variant:e,size:s,isHidden:t});return n.jsx(o.AvatarProvider,{variant:e,size:s,hasPair:!0,children:n.jsx(g.Root,{ref:l,role:"img",className:v,"aria-hidden":t,style:{"--pair-offset":`${f}px`},...a,children:r})})});u.displayName="AvatarPair";exports.AvatarPair=u;
|
|
@@ -8,6 +8,7 @@ declare const badge: import('tailwind-variants').TVReturnType<{
|
|
|
8
8
|
neutral: string;
|
|
9
9
|
promo: string;
|
|
10
10
|
attention: string;
|
|
11
|
+
numeric: string;
|
|
11
12
|
contextual: string;
|
|
12
13
|
};
|
|
13
14
|
}, undefined, "uy-inline-block uy-rounded-75 uy-px-75 uy-py-25 uy-font-sans uy-typography-body uy-whitespace-nowrap uy-text-center", {
|
|
@@ -20,6 +21,7 @@ declare const badge: import('tailwind-variants').TVReturnType<{
|
|
|
20
21
|
neutral: string;
|
|
21
22
|
promo: string;
|
|
22
23
|
attention: string;
|
|
24
|
+
numeric: string;
|
|
23
25
|
contextual: string;
|
|
24
26
|
};
|
|
25
27
|
}, undefined, import('tailwind-variants').TVReturnType<{
|
|
@@ -30,6 +32,7 @@ declare const badge: import('tailwind-variants').TVReturnType<{
|
|
|
30
32
|
neutral: string;
|
|
31
33
|
promo: string;
|
|
32
34
|
attention: string;
|
|
35
|
+
numeric: string;
|
|
33
36
|
contextual: string;
|
|
34
37
|
};
|
|
35
38
|
}, undefined, "uy-inline-block uy-rounded-75 uy-px-75 uy-py-25 uy-font-sans uy-typography-body uy-whitespace-nowrap uy-text-center", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),i=require("react"),g=require("@radix-ui/react-slot"),d=require("tailwind-merge"),b=require("tailwind-variants"),w=b.tv({base:"uy-inline-block uy-rounded-75 uy-px-75 uy-py-25 uy-font-sans uy-typography-body uy-whitespace-nowrap uy-text-center",variants:{variant:{success:"uy-bg-surface-success-low uy-text-content-neutral",warning:"uy-bg-surface-warning-low uy-text-content-neutral",danger:"uy-bg-surface-danger-low uy-text-content-neutral",neutral:"uy-bg-surface-neutral-lowest uy-text-content-neutral",promo:"uy-bg-surface-promo-low uy-text-content-neutral",attention:"uy-bg-surface-danger uy-text-content-inverted",contextual:"uy-bg-surface-neutral uy-border uy-border-border-neutral uy-text-content-neutral"}},defaultVariants:{variant:"neutral"}},{twMerge:!1}),f={success:"status",warning:"alert",danger:"alert",neutral:"status",promo:"status",attention:"alert",contextual:"status"},t=i.forwardRef(({className:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),i=require("react"),g=require("@radix-ui/react-slot"),d=require("tailwind-merge"),b=require("tailwind-variants"),w=b.tv({base:"uy-inline-block uy-rounded-75 uy-px-75 uy-py-25 uy-font-sans uy-typography-body uy-whitespace-nowrap uy-text-center",variants:{variant:{success:"uy-bg-surface-success-low uy-text-content-neutral",warning:"uy-bg-surface-warning-low uy-text-content-neutral",danger:"uy-bg-surface-danger-low uy-text-content-neutral",neutral:"uy-bg-surface-neutral-lowest uy-text-content-neutral",promo:"uy-bg-surface-promo-low uy-text-content-neutral",attention:"uy-bg-surface-danger uy-text-content-inverted",numeric:"uy-bg-surface-primary-low uy-text-blue-L10",contextual:"uy-bg-surface-neutral uy-border uy-border-solid uy-border-border-neutral uy-text-content-neutral"}},defaultVariants:{variant:"neutral"}},{twMerge:!1}),f={success:"status",warning:"alert",danger:"alert",neutral:"status",promo:"status",attention:"alert",contextual:"status",numeric:"status"},t=i.forwardRef(({className:r,variant:e="neutral",role:a,asChild:n=!1,children:u,...s},o)=>{const l=a??f[e]??"status",c=n?g.Slot:"span";return y.jsx(c,{ref:o,className:d.twMerge(w({variant:e}),r),role:l,...s,children:u})});t.displayName="Badge";exports.Badge=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),j=require("react"),i=require("react-aria-components"),o=require("../../icon/Icon.js"),u=require("../../link/Link.js"),h=require("../../tooltip/Tooltip.js"),q=require("../Breadcrumbs.context.js"),B=require("../Breadcrumbs.variant.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),j=require("react"),i=require("react-aria-components"),o=require("../../icon/Icon.js"),u=require("../../link/Link.js"),h=require("../../tooltip/Tooltip.js"),q=require("../Breadcrumbs.context.js"),B=require("../Breadcrumbs.variant.js"),g=25,d=({children:e,href:t})=>e.length>g?r.jsx(h,{title:e,children:r.jsx(u.Link,{href:t,color:"secondary",maxCharactersTruncation:25,children:e})}):r.jsx(u.Link,{href:t,color:"secondary",maxCharactersTruncation:25,children:e}),C=j.forwardRef((e,t)=>{const{wrap:l,isMobile:m,isStaticApi:x}=q.useBreadcrumbsContext(),{breadcrumb:s}=B.breadcrumbsVariant({wrap:l});if(!e)return null;const{href:a,label:n,...c}=e;return m&&!x?r.jsxs(i.Breadcrumb,{ref:t,...c,className:s(),children:[r.jsx(o.Icon,{src:"CaretLeftOutlined","aria-hidden":"true"}),r.jsx(d,{href:a,children:n})]}):r.jsx(i.Breadcrumb,{ref:t,...c,className:s(),children:({isCurrent:b})=>b?r.jsx("span",{className:"uy-text-nowrap",children:n}):r.jsxs(r.Fragment,{children:[r.jsx(d,{href:a,children:n}),r.jsx(o.Icon,{src:"CaretRightOutlined","aria-hidden":"true"})]})})});exports.Breadcrumb=C;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("tailwind-variants"),c=n.tv({slots:{base:["uy-flex uy-items-center uy-justify-center uy-rounded-50 uy-w-200 uy-h-200 uy-text-content-inverted uy-border uy-transition-all uy-duration-100"],checkmark:["uy-w-[16px] uy-fill-none uy-stroke-[2px] uy-stroke-content-inverted uy-transition-all uy-duration-500"]},variants:{isSelected:{true:{base:"uy-border-border-form-active uy-bg-surface-form-active"}},isDisabled:{true:""},isReadOnly:{true:""},isInvalid:{true:""}},defaultVariants:{isSelected:!1,isDisabled:!1,isInvalid:!1,isReadOnly:!1},compoundVariants:[{isSelected:!1,isDisabled:!1,isInvalid:!1,isReadOnly:!1,className:{base:"uy-border-border-form-enabled uy-bg-surface-form-enabled"}},{isSelected:!1,isDisabled:!0,className:{base:"!uy-bg-surface-form-disabled uy-border-border-form-disabled",checkmark:"uy-text-transparent"}},{isSelected:!0,isDisabled:!0,className:{base:"!uy-bg-surface-form-disabled uy-border-border-form-disabled",checkmark:"uy-text-border-form-disabled"}},{isSelected:!1,isInvalid:!0,className:{base:"uy-border-border-form-error uy-bg-surface-form-enabled",checkmark:"uy-text-transparent"}},{isSelected:!0,isInvalid:!0,className:{base:"!uy-border-border-danger !uy-bg-surface-danger",checkmark:"uy-text-content-inverted"}},{isSelected:!1,isReadOnly:!0,className:{base:"uy-border-border-form-disabled uy-bg-surface-form-disabled",checkmark:"uy-text-transparent"}},{isSelected:!0,isReadOnly:!0,className:{base:"!uy-bg-surface-form-disabled uy-border-border-form-disabled",checkmark:"uy-text-border-form-read-only"}}]});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("tailwind-variants"),c=n.tv({slots:{base:["uy-flex uy-items-center uy-justify-center uy-rounded-50 uy-w-200 uy-h-200 uy-text-content-inverted uy-border uy-border-solid uy-transition-all uy-duration-100"],checkmark:["uy-w-[16px] uy-fill-none uy-stroke-[2px] uy-stroke-content-inverted uy-transition-all uy-duration-500"]},variants:{isSelected:{true:{base:"uy-border-border-form-active uy-bg-surface-form-active"}},isDisabled:{true:""},isReadOnly:{true:""},isInvalid:{true:""}},defaultVariants:{isSelected:!1,isDisabled:!1,isInvalid:!1,isReadOnly:!1},compoundVariants:[{isSelected:!1,isDisabled:!1,isInvalid:!1,isReadOnly:!1,className:{base:"uy-border-border-form-enabled uy-bg-surface-form-enabled"}},{isSelected:!1,isDisabled:!0,className:{base:"!uy-bg-surface-form-disabled uy-border-border-form-disabled",checkmark:"uy-text-transparent"}},{isSelected:!0,isDisabled:!0,className:{base:"!uy-bg-surface-form-disabled uy-border-border-form-disabled",checkmark:"uy-text-border-form-disabled"}},{isSelected:!1,isInvalid:!0,className:{base:"uy-border-border-form-error uy-bg-surface-form-enabled",checkmark:"uy-text-transparent"}},{isSelected:!0,isInvalid:!0,className:{base:"!uy-border-border-danger !uy-bg-surface-danger",checkmark:"uy-text-content-inverted"}},{isSelected:!1,isReadOnly:!0,className:{base:"uy-border-border-form-disabled uy-bg-surface-form-disabled",checkmark:"uy-text-transparent"}},{isSelected:!0,isReadOnly:!0,className:{base:"!uy-bg-surface-form-disabled uy-border-border-form-disabled",checkmark:"uy-text-border-form-read-only"}}]});function s({isSelected:r,isDisabled:a,isIndeterminate:t,isInvalid:d,isReadOnly:i,className:o}){const{base:l,checkmark:u}=c({isSelected:r,isDisabled:a,isInvalid:d,isReadOnly:i});return e.jsx("div",{className:l({className:o}),children:e.jsx("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 16 16","aria-hidden":"true",className:u(),style:{strokeDashoffset:r?44:66},children:t?e.jsx("rect",{x:"3",y:"7",width:"10",height:"2",rx:"0.5",stroke:"none",fill:"currentColor"}):e.jsx("polyline",{points:"3.5,8 6.5,11 12.5,5",stroke:"currentColor",strokeDasharray:"22",strokeLinecap:"butt",strokeLinejoin:"bevel"})})})}s.displayName="CheckboxIndicator";exports.CheckboxIndicator=s;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DisclosureProps } from 'react-aria-components';
|
|
3
|
+
export interface CollapsibleProps extends Omit<DisclosureProps, 'isDisabled' | 'defaultExpanded' | 'className'> {
|
|
4
|
+
/**
|
|
5
|
+
* The content of the collapsible component.
|
|
6
|
+
* Typically includes a CollapsibleTitle and CollapsibleContent.
|
|
7
|
+
*/
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Controls whether the collapsible is expanded by default.
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
isExpanded?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @description
|
|
17
|
+
* The Collapsible component provides an expandable/collapsible container that can show or hide content.
|
|
18
|
+
* It's typically used to organize information in a space-efficient way, allowing users to focus on relevant content.
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <Collapsible>
|
|
22
|
+
* <CollapsibleTitle>Section Title</CollapsibleTitle>
|
|
23
|
+
* <CollapsibleContent>
|
|
24
|
+
* Content that can be shown or hidden
|
|
25
|
+
* </CollapsibleContent>
|
|
26
|
+
* </Collapsible>
|
|
27
|
+
* ```
|
|
28
|
+
* @component
|
|
29
|
+
* @see {@link CollapsibleTitle} - The clickable title component that toggles the expanded state
|
|
30
|
+
* @see {@link CollapsibleContent} - The content component that is shown/hidden based on the expanded state
|
|
31
|
+
*/
|
|
32
|
+
declare const Collapsible: import('react').ForwardRefExoticComponent<CollapsibleProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
33
|
+
export { Collapsible };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @description
|
|
4
|
+
* The CollapsibleContent component renders the content that is shown or hidden
|
|
5
|
+
* when the parent Collapsible component is expanded or collapsed.
|
|
6
|
+
*/
|
|
7
|
+
export interface CollapsibleContentProps {
|
|
8
|
+
/**
|
|
9
|
+
* The content to be shown or hidden.
|
|
10
|
+
*/
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The content component for a Collapsible.
|
|
15
|
+
*
|
|
16
|
+
* This component renders a DisclosurePanel that shows or hides its content
|
|
17
|
+
* based on the expanded state of the parent Collapsible component.
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <Collapsible>
|
|
21
|
+
* <CollapsibleTitle>Section Title</CollapsibleTitle>
|
|
22
|
+
* <CollapsibleContent>
|
|
23
|
+
* This content will be shown or hidden based on the expanded state.
|
|
24
|
+
* </CollapsibleContent>
|
|
25
|
+
* </Collapsible>
|
|
26
|
+
* ```
|
|
27
|
+
* @component
|
|
28
|
+
* @see {@link Collapsible} - The parent component
|
|
29
|
+
* @see {@link CollapsibleTitle} - The title component that toggles the expanded state
|
|
30
|
+
* @param {CollapsibleContentProps} props - The component props
|
|
31
|
+
* @param {ReactNode} props.children - The content to be shown or hidden
|
|
32
|
+
* @param {React.Ref<HTMLDivElement>} ref - A ref to the underlying HTML div element
|
|
33
|
+
* @returns {JSX.Element} The rendered CollapsibleContent component
|
|
34
|
+
*/
|
|
35
|
+
declare const CollapsibleContent: import('react').ForwardRefExoticComponent<CollapsibleContentProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
36
|
+
export { CollapsibleContent };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @description
|
|
4
|
+
* The CollapsibleTitle component renders the clickable header of a Collapsible component.
|
|
5
|
+
* It displays a title with an icon that rotates based on the expanded state.
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <Collapsible>
|
|
9
|
+
* <CollapsibleTitle>Section Title</CollapsibleTitle>
|
|
10
|
+
* <CollapsibleContent>Content</CollapsibleContent>
|
|
11
|
+
* </Collapsible>
|
|
12
|
+
* ```
|
|
13
|
+
* @component
|
|
14
|
+
* @see {@link Collapsible} - The parent component
|
|
15
|
+
* @see {@link CollapsibleContent} - The content component that is shown/hidden
|
|
16
|
+
*/
|
|
17
|
+
interface CollapsibleTitleProps {
|
|
18
|
+
/**
|
|
19
|
+
* The content of the collapsible title.
|
|
20
|
+
*/
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Optional content to display after the title.
|
|
24
|
+
*/
|
|
25
|
+
suffix?: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The title component for a Collapsible.
|
|
29
|
+
*
|
|
30
|
+
* This component renders a heading with a button that toggles the expanded state of the parent Collapsible.
|
|
31
|
+
* It displays an icon that rotates based on the expanded state to indicate the current state.
|
|
32
|
+
* @param {CollapsibleTitleProps} props - The component props
|
|
33
|
+
* @param {ReactNode} props.children - The content of the title
|
|
34
|
+
* @param {ReactNode} [props.suffix] - Optional content to display after the title
|
|
35
|
+
* @param {React.Ref<HTMLDivElement>} ref - A ref to the underlying HTML div element
|
|
36
|
+
* @returns {JSX.Element} The rendered CollapsibleTitle component
|
|
37
|
+
*/
|
|
38
|
+
declare const CollapsibleTitle: import('react').ForwardRefExoticComponent<CollapsibleTitleProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
39
|
+
export { CollapsibleTitle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),I=require("react"),s=require("react-aria-components"),N=require("react-intl"),m=require("tailwind-variants"),P=require("../icon/Icon.js"),W=require("./parts/DateCalendar.js"),R=require("./parts/DateInput.js"),U=m.tv({slots:{base:["uy-group uy-flex uy-h-500 uy-border uy-rounded-100","active:uy-border-border-form-active data-[focus-visible]:uy-border-border-form-active"],inputWrapper:["uy-flex uy-grow uy-rounded-75 uy-outline-none","focus-within:uy-outline-2 focus-within:uy-outline-utility-focus-ring focus-within:uy-outline-offset-2","group-[:has(button:focus)]:data-[focus-within]:uy-outline-none group-[:has(button:focus)]:data-[focus-within]:uy-outline-offset-0 group-[:has(button:focus)]:data-[focus-within]:uy-outline-transparent"],suffix:["uy-flex-grow-0 uy-content-center uy-pt-100 uy-pb-100 uy-pl-150 uy-pr-150 uy-border-l uy-rounded-r-100","hover:uy-bg-surface-neutral-hover active:uy-bg-surface-neutral-pressed active:uy-border-border-form-active data-[pressed]:uy-bg-surface-neutral-pressed data-[pressed]:uy-border-border-form-active","focus-visible:uy-outline-2 focus-visible:uy-outline-utility-focus-ring focus-visible:uy-outline-offset-[3px]"]},variants:{isInvalid:{true:{base:"uy-border-border-form-error uy-bg-surface-form-error",suffix:"uy-bg-surface-form-error uy-border-border-form-error"}},isReadOnly:{true:{base:"uy-border-border-form-disabled uy-bg-surface-form-disabled",inputWrapper:"uy-border-border-form-disabled uy-bg-surface-form-disabled",suffix:"uy-bg-surface-form-disabled uy-border-border-form-disabled uy-text-content-form-disabled"}},isDisabled:{true:{base:"uy-border-border-form-disabled uy-bg-surface-form-disabled",inputWrapper:"uy-bg-surface-form-disabled uy-text-content-form-disabled",suffix:"uy-bg-surface-form-disabled uy-border-border-form-disabled uy-text-content-form-disabled"}}},compoundVariants:[{isInvalid:!1,isDisabled:!1,isReadOnly:!1,className:{base:"uy-border-border-form-enabled uy-bg-surface-form-enabled",suffix:"uy-border-border-form-enabled uy-bg-surface-neutral-low uy-text-content-form-enabled"}}]}),M=m.tv({base:"uy-overflow-auto uy-shadow-floating uy-border uy-border-solid uy-border-border-neutral uy-bg-surface-neutral uy-rounded-75",variants:{isEntering:{true:"uy-animate-in uy-fade-in data-[placement-bottom]:uy-slide-in-from-top-1 data-[placement-top]:uy-slide-in-from-bottom-1 uy-duration-200 uy-ease-out"},isExiting:{true:"uy-animate-out uy-fade-out data-[placement-bottom]:uy-slide-out-to-top-1 data-[placement-top]:uy-slide-out-to-bottom-1 uy-duration-150 uy-ease-in"}}}),p=I.forwardRef(({value:f,defaultValue:b,isInvalid:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),I=require("react"),s=require("react-aria-components"),N=require("react-intl"),m=require("tailwind-variants"),P=require("../icon/Icon.js"),W=require("./parts/DateCalendar.js"),R=require("./parts/DateInput.js"),U=m.tv({slots:{base:["uy-group uy-flex uy-h-500 uy-border uy-border-solid uy-rounded-100","active:uy-border-border-form-active data-[focus-visible]:uy-border-border-form-active"],inputWrapper:["uy-flex uy-grow uy-rounded-75 uy-outline-none","focus-within:uy-outline-2 focus-within:uy-outline-utility-focus-ring focus-within:uy-outline-offset-2","group-[:has(button:focus)]:data-[focus-within]:uy-outline-none group-[:has(button:focus)]:data-[focus-within]:uy-outline-offset-0 group-[:has(button:focus)]:data-[focus-within]:uy-outline-transparent"],suffix:["uy-flex-grow-0 uy-content-center uy-pt-100 uy-pb-100 uy-pl-150 uy-pr-150 uy-border-l uy-rounded-r-100","hover:uy-bg-surface-neutral-hover active:uy-bg-surface-neutral-pressed active:uy-border-border-form-active data-[pressed]:uy-bg-surface-neutral-pressed data-[pressed]:uy-border-border-form-active","focus-visible:uy-outline-2 focus-visible:uy-outline-utility-focus-ring focus-visible:uy-outline-offset-[3px]"]},variants:{isInvalid:{true:{base:"uy-border-border-form-error uy-bg-surface-form-error",suffix:"uy-bg-surface-form-error uy-border-border-form-error"}},isReadOnly:{true:{base:"uy-border-border-form-disabled uy-bg-surface-form-disabled",inputWrapper:"uy-border-border-form-disabled uy-bg-surface-form-disabled",suffix:"uy-bg-surface-form-disabled uy-border-border-form-disabled uy-text-content-form-disabled"}},isDisabled:{true:{base:"uy-border-border-form-disabled uy-bg-surface-form-disabled",inputWrapper:"uy-bg-surface-form-disabled uy-text-content-form-disabled",suffix:"uy-bg-surface-form-disabled uy-border-border-form-disabled uy-text-content-form-disabled"}}},compoundVariants:[{isInvalid:!1,isDisabled:!1,isReadOnly:!1,className:{base:"uy-border-border-form-enabled uy-bg-surface-form-enabled",suffix:"uy-border-border-form-enabled uy-bg-surface-neutral-low uy-text-content-form-enabled"}}]}),M=m.tv({base:"uy-overflow-auto uy-shadow-floating uy-border uy-border-solid uy-border-border-neutral uy-bg-surface-neutral uy-rounded-75",variants:{isEntering:{true:"uy-animate-in uy-fade-in data-[placement-bottom]:uy-slide-in-from-top-1 data-[placement-top]:uy-slide-in-from-bottom-1 uy-duration-200 uy-ease-out"},isExiting:{true:"uy-animate-out uy-fade-out data-[placement-bottom]:uy-slide-out-to-top-1 data-[placement-top]:uy-slide-out-to-bottom-1 uy-duration-150 uy-ease-in"}}}),p=I.forwardRef(({value:f,defaultValue:b,isInvalid:y,isLoading:v,isDisabled:t,isReadOnly:u,onClearButtonPress:d,onBlur:o,onFocus:i,onChange:n,onOpenChange:l,id:x,...e},O)=>{const g=N.useIntl(),{base:h,inputWrapper:D,suffix:w}=U({isInvalid:!!y,isReadOnly:!!u,isDisabled:!!t}),c=r=>{n==null||n(r??void 0)},j=r=>{l==null||l(r),r?i==null||i():o==null||o()},k=r=>e.isDateUnavailable?e.isDateUnavailable(r):!1,V=()=>{d==null||d()};return a.jsxs(s.DatePicker,{...e,className:h(),value:f,defaultValue:b,minValue:e.minValue,maxValue:e.maxValue,isReadOnly:!!u,isDisabled:!!t,onChange:c,onFocus:i,onBlur:o,onOpenChange:j,isDateUnavailable:k,children:[a.jsxs(s.Group,{className:D(),id:x,children:[a.jsx(R.DateInput,{isLoading:v,isDisabled:t,isReadOnly:u,isInvalid:y,onClearButtonPress:V}),a.jsx(s.Button,{className:w(),isDisabled:u||t,children:a.jsx(P.Icon,{src:"CalendarBlankOutlined",color:"inherit",alt:g.formatMessage({id:"unity:component:form-field:date-picker:calendar-button",defaultMessage:"Open Calendar"})})})]}),a.jsx(s.Popover,{className:({isEntering:r,isExiting:q})=>M({isEntering:r,isExiting:q}),children:a.jsx(W.DateCalendar,{value:f,defaultValue:b,minValue:e.minValue,maxValue:e.maxValue,onChange:c,firstDayOfWeek:e.firstDayOfWeek})})]})});p.displayName="DatePicker";exports.DatePicker=p;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("react"),s=require("react-aria-components"),I=require("react-intl"),c=require("tailwind-variants"),v=require("../../icon-button/CircularIconButton.js"),j=require("../../icon/Icon.js"),h=require("../../spinner/Spinner.js"),q=c.tv({base:"uy-group uy-box-content uy-rounded-25 uy-px-25 uy-text-end uy-tabular-nums uy-outline-none uy-typography-body focus:uy-bg-surface-form-active focus:uy-rounded-25 focus:uy-text-content-inverted data-[disabled]:uy-text-content-form-disabled",variants:{isPlaceholder:{true:"uy-text-content-neutral-lowest",false:"uy-text-content-form-enabled"},isLiteral:{true:"uy-text-content-form-enabled",false:""}}}),d=c.tv({slots:{base:"uy-flex uy-gap-50 uy-flex-grow uy-pt-100 uy-pb-100 uy-pl-150 uy-pr-150 uy-rounded-100",input:"uy-flex uy-gap-25 uy-w-fit uy-grow",state:"uy-flex uy-gap-50 uy-items-center"},variants:{isInvalid:{true:{base:"uy-bg-surface-form-error",state:"uy-text-content-form-error"}},isReadOnly:{true:{base:"uy-border-border-form-disabled uy-bg-surface-form-disabled"}},isDisabled:{true:{base:"uy-bg-surface-form-disabled uy-text-content-form-disabled"}}},compoundVariants:[{isInvalid:!1,isDisabled:!1,isReadOnly:!1,className:{base:"uy-border-border-form-enabled uy-bg-surface-form-enabled",state:"uy-text-content-neutral-disabled"}}]});function y({isLoading:u,isInvalid:o,isReadOnly:l,isDisabled:i,onClearButtonPress:a}){const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("react"),s=require("react-aria-components"),I=require("react-intl"),c=require("tailwind-variants"),v=require("../../icon-button/CircularIconButton.js"),j=require("../../icon/Icon.js"),h=require("../../spinner/Spinner.js"),q=c.tv({base:"uy-group uy-box-content uy-rounded-25 uy-px-25 uy-text-end uy-tabular-nums uy-outline-none uy-typography-body focus:uy-bg-surface-form-active focus:uy-rounded-25 focus:uy-text-content-inverted data-[disabled]:uy-text-content-form-disabled",variants:{isPlaceholder:{true:"uy-text-content-neutral-lowest",false:"uy-text-content-form-enabled"},isLiteral:{true:"uy-text-content-form-enabled",false:""}}}),d=c.tv({slots:{base:"uy-flex uy-gap-50 uy-flex-grow uy-pt-100 uy-pb-100 uy-pl-150 uy-pr-150 uy-rounded-100",input:"uy-flex uy-gap-25 uy-w-fit uy-grow",state:"uy-flex uy-gap-50 uy-items-center"},variants:{isInvalid:{true:{base:"uy-bg-surface-form-error",state:"uy-text-content-form-error"}},isReadOnly:{true:{base:"uy-border-border-form-disabled uy-bg-surface-form-disabled"}},isDisabled:{true:{base:"uy-bg-surface-form-disabled uy-text-content-form-disabled"}}},compoundVariants:[{isInvalid:!1,isDisabled:!1,isReadOnly:!1,className:{base:"uy-border-border-form-enabled uy-bg-surface-form-enabled",state:"uy-text-content-neutral-disabled"}}]});function y({isLoading:u,isInvalid:o,isReadOnly:l,isDisabled:i,onClearButtonPress:a}){const n=I.useIntl(),t=g.useContext(s.DatePickerStateContext),{dateValue:f}=t,{base:m,input:b,state:p}=d({isInvalid:!!o,isReadOnly:!!l,isDisabled:!!i}),x=f&&!u&&!l&&!i;return e.jsxs("div",{className:m(),children:[e.jsx(s.DateInput,{className:b(),children:r=>e.jsx(s.DateSegment,{segment:r,className:q({isPlaceholder:r.isPlaceholder,isLiteral:r.type==="literal"})})}),e.jsxs("div",{className:p(),children:[u&&e.jsx(h.Spinner,{color:"inherit",size:"small",label:n.formatMessage({id:"unity:component:common:loading:label",defaultMessage:"Loading..."})}),o&&e.jsx(j.Icon,{src:"WarningCircleOutlined",color:"content.form.invalid",alt:n.formatMessage({id:"unity:component:form-field:form-input:error:alt",defaultMessage:"Error"})}),x&&e.jsx(v.CircularIconButton,{slot:null,title:n.formatMessage({id:"unity:component:form-field:form-input:clear:title",defaultMessage:"Clear"}),icon:"CloseOutlined",onPress:()=>{t==null||t.setValue(null),a==null||a()}})]})]})}y.displayName="DateInput";exports.DateInput=y;exports.dateInput=d;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { VariantProps } from 'tailwind-variants';
|
|
3
|
+
export declare const fieldset: import('tailwind-variants').TVReturnType<{
|
|
4
|
+
isLegendHidden: {
|
|
5
|
+
true: {
|
|
6
|
+
legend: string;
|
|
7
|
+
description: string;
|
|
8
|
+
fieldsContainer: string;
|
|
9
|
+
};
|
|
10
|
+
false: {
|
|
11
|
+
legend: string;
|
|
12
|
+
description: string;
|
|
13
|
+
fieldsContainer: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}, {
|
|
17
|
+
base: string;
|
|
18
|
+
legend: string;
|
|
19
|
+
description: string;
|
|
20
|
+
fieldsContainer: string;
|
|
21
|
+
}, undefined, import('tailwind-variants/dist/config').TVConfig<{
|
|
22
|
+
isLegendHidden: {
|
|
23
|
+
true: {
|
|
24
|
+
legend: string;
|
|
25
|
+
description: string;
|
|
26
|
+
fieldsContainer: string;
|
|
27
|
+
};
|
|
28
|
+
false: {
|
|
29
|
+
legend: string;
|
|
30
|
+
description: string;
|
|
31
|
+
fieldsContainer: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
}, {
|
|
35
|
+
isLegendHidden: {
|
|
36
|
+
true: {
|
|
37
|
+
legend: string;
|
|
38
|
+
description: string;
|
|
39
|
+
fieldsContainer: string;
|
|
40
|
+
};
|
|
41
|
+
false: {
|
|
42
|
+
legend: string;
|
|
43
|
+
description: string;
|
|
44
|
+
fieldsContainer: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
}>, {
|
|
48
|
+
isLegendHidden: {
|
|
49
|
+
true: {
|
|
50
|
+
legend: string;
|
|
51
|
+
description: string;
|
|
52
|
+
fieldsContainer: string;
|
|
53
|
+
};
|
|
54
|
+
false: {
|
|
55
|
+
legend: string;
|
|
56
|
+
description: string;
|
|
57
|
+
fieldsContainer: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
}, {
|
|
61
|
+
base: string;
|
|
62
|
+
legend: string;
|
|
63
|
+
description: string;
|
|
64
|
+
fieldsContainer: string;
|
|
65
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
66
|
+
isLegendHidden: {
|
|
67
|
+
true: {
|
|
68
|
+
legend: string;
|
|
69
|
+
description: string;
|
|
70
|
+
fieldsContainer: string;
|
|
71
|
+
};
|
|
72
|
+
false: {
|
|
73
|
+
legend: string;
|
|
74
|
+
description: string;
|
|
75
|
+
fieldsContainer: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
}, {
|
|
79
|
+
base: string;
|
|
80
|
+
legend: string;
|
|
81
|
+
description: string;
|
|
82
|
+
fieldsContainer: string;
|
|
83
|
+
}, undefined, import('tailwind-variants/dist/config').TVConfig<{
|
|
84
|
+
isLegendHidden: {
|
|
85
|
+
true: {
|
|
86
|
+
legend: string;
|
|
87
|
+
description: string;
|
|
88
|
+
fieldsContainer: string;
|
|
89
|
+
};
|
|
90
|
+
false: {
|
|
91
|
+
legend: string;
|
|
92
|
+
description: string;
|
|
93
|
+
fieldsContainer: string;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
}, {
|
|
97
|
+
isLegendHidden: {
|
|
98
|
+
true: {
|
|
99
|
+
legend: string;
|
|
100
|
+
description: string;
|
|
101
|
+
fieldsContainer: string;
|
|
102
|
+
};
|
|
103
|
+
false: {
|
|
104
|
+
legend: string;
|
|
105
|
+
description: string;
|
|
106
|
+
fieldsContainer: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
}>, unknown, unknown, undefined>>;
|
|
110
|
+
export interface FieldsetProps extends PropsWithChildren<VariantProps<typeof fieldset>> {
|
|
111
|
+
/**
|
|
112
|
+
* The legend of the fieldset.
|
|
113
|
+
*/
|
|
114
|
+
legend: string;
|
|
115
|
+
/**
|
|
116
|
+
* An optional description of the fieldset.
|
|
117
|
+
*/
|
|
118
|
+
description?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Whether to hide the legend of the fieldset.
|
|
121
|
+
*/
|
|
122
|
+
isLegendHidden?: boolean;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The `Fieldset` component groups related form fields together with an accessible structure.
|
|
126
|
+
* It provides visual organization and semantic HTML for form sections, making forms more understandable and navigable.
|
|
127
|
+
* @param {FieldsetProps} props - The props for the `Fieldset` component
|
|
128
|
+
* @see {@link FieldsetProps} for all available props
|
|
129
|
+
* @example
|
|
130
|
+
* ```tsx
|
|
131
|
+
* import { Fieldset } from '@payfit/unity-components'
|
|
132
|
+
*
|
|
133
|
+
* function Example() {
|
|
134
|
+
* return (
|
|
135
|
+
* <Fieldset
|
|
136
|
+
* legend="Personal Information"
|
|
137
|
+
* description="Please provide your contact details"
|
|
138
|
+
* isLegendHidden={false}
|
|
139
|
+
* >
|
|
140
|
+
* <TextField name="firstName" label="First name" />
|
|
141
|
+
* <TextField name="lastName" label="Last name" />
|
|
142
|
+
* </Fieldset>
|
|
143
|
+
* )
|
|
144
|
+
* }
|
|
145
|
+
* ```
|
|
146
|
+
* @remarks
|
|
147
|
+
* [API](https://unity-components.payfit.io/?path=/docs/forms-fieldset--docs) • [Design docs](https://www.payfit.design/24f360409/p/1151cf-form-layout)
|
|
148
|
+
*/
|
|
149
|
+
declare const Fieldset: import('react').ForwardRefExoticComponent<FieldsetProps & import('react').RefAttributes<HTMLFieldSetElement>>;
|
|
150
|
+
export { Fieldset };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),b=require("react-aria"),x=require("tailwind-variants"),i=x.tv({slots:{base:"uy-p-0 uy-m-0 [&+&]:uy-mt-500 [&:last-of-type]:uy-mb-500",legend:"uy-typography-h3 uy-text-content-neutral",description:"uy-block uy-typography-body uy-mt-100 uy-text-content-neutral",fieldsContainer:"uy-flex uy-flex-col uy-gap-250"},variants:{isLegendHidden:{true:{legend:"uy-sr-only",description:"uy-sr-only",fieldsContainer:"uy-mt-0"},false:{legend:"uy-block",description:"uy-block",fieldsContainer:"uy-mt-300"}}},defaultVariants:{isLegendHidden:!1}}),n=m.forwardRef(({children:d,...l},r)=>{const s=b.useId(),{legend:a,description:t,isLegendHidden:o,...c}=l,{base:y,legend:u,description:f,fieldsContainer:p}=i({isLegendHidden:o}),g=t?`${s}-fieldset-description`:void 0;return e.jsxs("fieldset",{...c,ref:r,className:y(),"aria-describedby":g,children:[e.jsx("legend",{className:u(),children:a}),t&&e.jsx("span",{id:`${s}-fieldset-description`,"data-fieldset-slot":"description",className:f(),children:t}),e.jsx("div",{className:p(),children:d})]})});n.displayName="Fieldset";exports.Fieldset=n;exports.fieldset=i;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `FieldGroup` component arranges form fields in a responsive grid layout within a Fieldset.
|
|
3
|
+
* It optimizes space by displaying fields side-by-side on larger screens while stacking them on mobile devices.
|
|
4
|
+
* @param {PropsWithChildren<object>} props - The props for the `FieldGroup` component
|
|
5
|
+
* @example
|
|
6
|
+
* ```tsx
|
|
7
|
+
* import { Fieldset, FieldGroup } from '@payfit/unity-components'
|
|
8
|
+
*
|
|
9
|
+
* function Example() {
|
|
10
|
+
* return (
|
|
11
|
+
* <Fieldset legend="Personal Information">
|
|
12
|
+
* <FieldGroup>
|
|
13
|
+
* <TextField name="firstName" label="First name" />
|
|
14
|
+
* <TextField name="lastName" label="Last name" />
|
|
15
|
+
* </FieldGroup>
|
|
16
|
+
* <TextField name="email" label="Email" />
|
|
17
|
+
* </Fieldset>
|
|
18
|
+
* )
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
* @remarks
|
|
22
|
+
* [API](https://unity-components.payfit.io/?path=/docs/forms-fieldset-fieldgroup--docs) • [Design docs](https://www.payfit.design/24f360409/p/1151cf-form-layout)
|
|
23
|
+
*/
|
|
24
|
+
declare const FieldGroup: import('react').ForwardRefExoticComponent<object & {
|
|
25
|
+
children?: import('react').ReactNode | undefined;
|
|
26
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
27
|
+
export { FieldGroup };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),d=require("react"),e=d.forwardRef(({children:r,...u},o)=>i.jsx("div",{...u,ref:o,role:"group",className:"uy-grid uy-grid-cols-1 uy-gap-y-250 md:uy-grid-cols-2 md:uy-gap-x-200",children:r}));e.displayName="FieldGroup";exports.FieldGroup=e;
|
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
import { Slot } from '@radix-ui/react-slot';
|
|
2
2
|
export type FormControlProps = React.ComponentProps<typeof Slot>;
|
|
3
|
+
/**
|
|
4
|
+
* FormControl is a wrapper component that connects input components to form state within a FormField.
|
|
5
|
+
* It handles accessibility concerns like proper ARIA attributes and focus states.
|
|
6
|
+
*
|
|
7
|
+
* This component is required when building custom form fields - it must wrap the actual input element
|
|
8
|
+
* to connect it properly to the form state.
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { FormControl, FormField, Input } from '@payfit/unity-components'
|
|
12
|
+
*
|
|
13
|
+
* function MyFormField() {
|
|
14
|
+
* return (
|
|
15
|
+
* <FormField name="email">
|
|
16
|
+
* <FormControl>
|
|
17
|
+
* <Input />
|
|
18
|
+
* </FormControl>
|
|
19
|
+
* </FormField>
|
|
20
|
+
* )
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
* @remarks
|
|
24
|
+
* [API & Docs](https://unity-components.payfit.io/?path=/docs/forms-formfield-formcontrol--docs)
|
|
25
|
+
*/
|
|
3
26
|
declare function FormControl({ ...props }: FormControlProps): import("react/jsx-runtime").JSX.Element;
|
|
4
27
|
declare namespace FormControl {
|
|
5
28
|
var displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),y=require("react-aria-components"),b=require("tailwind-variants"),f=require("../../hooks/use-id.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),y=require("react-aria-components"),b=require("tailwind-variants"),f=require("../../hooks/use-id.js"),x=require("../icon/Icon.js"),p=require("../spinner/Spinner.js"),v=require("../tooltip/Tooltip.js"),i=b.tv({base:"uy-w-300 uy-h-300 uy-rounded-circle uy-flex uy-items-center uy-justify-center uy-text-content-neutral uy-transition-colors hover:uy-bg-surface-neutral-hover active:uy-bg-surface-neutral-active data-[pressed]:uy-bg-surface-neutral-pressed focus-visible:uy-outline-2 focus-visible:uy-outline-offset-2 focus-visible:uy-outline-utility-focus-ring disabled:uy-cursor-not-allowed disabled:uy-text-content-neutral-disabled aria-busy:uy-cursor-not-allowed aria-busy:uy-text-content-neutral-disabled"});function s(o){const u=f(),{onPress:l,icon:a,isLoading:t,title:r,isDisabled:c,...d}=o,n=`icon-button-label-${u}`;return e.jsx(v,{title:r,children:e.jsx(y.Pressable,{...d,onPress:l,isDisabled:c||t,"aria-labelledby":n,"aria-busy":t,children:e.jsxs("div",{className:i(),role:"button",children:[t?e.jsx(p.Spinner,{size:"small",label:"Loading",color:"inherit"}):e.jsx(x.Icon,{src:a,color:"inherit",role:"presentation"}),e.jsx("span",{id:n,className:"uy-sr-only",children:r})]})})})}s.displayName="CircularIconButton";exports.CircularIconButton=s;exports.circularIconButton=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("tailwind-variants"),t=e.tv({slots:{button:"uy-group uy-w-500 uy-h-500 uy-flex uy-justify-center uy-items-center uy-rounded-75 focus-visible:uy-outline-2 focus-visible:uy-outline-offset-2 focus-visible:uy-outline-utility-focus-ring",icon:"uy-w-250 uy-h-250"},variants:{isDisabled:{true:{button:"uy-cursor-not-allowed"},false:{button:""}},isLoading:{true:{button:"uy-cursor-progress uy-text-content-neutral-disabled",icon:""},false:{button:""}},color:{inverted:{button:"focus-visible:uy-outline-utility-inverted-focus-ring"}}},defaultVariants:{isDisabled:!1,isLoading:!1}}),r=e.tv({extend:t,variants:{variant:{primary:""},color:{primary:"",danger:"",warning:"",inverted:""}},compoundVariants:[{variant:"primary",color:"primary",isDisabled:!1,isLoading:!1,class:{button:"uy-bg-surface-primary hover:uy-bg-surface-primary-hover active:uy-bg-surface-primary-active focus-visible:uy-bg-surface-primary-focus data-[pressed]:uy-bg-surface-primary-pressed",icon:"uy-text-content-inverted group-hover:uy-text-content-inverted-hover active:uy-text-content-inverted-active focus-visible:uy-text-content-inverted-focus data-[pressed]:uy-text-content-inverted-pressed"}},{variant:"primary",color:"danger",isDisabled:!1,isLoading:!1,class:{button:"uy-bg-content-danger hover:uy-bg-content-danger-hover active:uy-bg-content-danger-pressed focus:uy-bg-content-danger-focus data-[pressed]:uy-bg-content-danger-pressed",icon:"uy-text-content-inverted group-hover:uy-text-content-inverted-hover active:uy-text-content-inverted-pressed focus:uy-text-content-inverted-focus data-[pressed]:uy-text-content-inverted-pressed"}},{variant:"primary",color:"warning",isDisabled:!1,isLoading:!1,class:{button:"uy-bg-content-warning hover:uy-bg-content-warning-hover active:uy-bg-content-warning-pressed focus-visible:uy-bg-content-warning-focus data-[pressed]:uy-bg-content-warning-pressed]:",icon:"uy-text-content-inverted group-hover:uy-text-content-inverted-hover active:uy-text-content-inverted-pressed focus-visible:uy-text-content-inverted-focus data-[pressed]:uy-text-content-inverted-pressed"}},{variant:"primary",color:"inverted",isDisabled:!1,isLoading:!1,class:{button:"uy-bg-surface-inverted hover:uy-accent-surface-inverted-hover active:uy-accent-surface-inverted-pressed focus-visible:uy-accent-surface-inverted-focus data-[pressed]:uy-accent-surface-inverted-pressed",icon:"uy-text-content-neutral group-hover:uy-text-content-neutral-hover active:uy-text-content-neutral-pressed focus-visible:uy-text-content-neutral-focus data-[pressed]:uy-text-content-neutral-pressed"}},{variant:"primary",color:"primary",isDisabled:!0,isLoading:!1,class:{button:"uy-bg-surface-neutral-disabled",icon:"uy-text-content-neutral-disabled"}},{variant:"primary",color:["primary","danger","warning","inverted"],isLoading:!0,isDisabled:!1,class:{button:"uy-bg-surface-neutral-disabled",icon:"uy-text-content-neutral-disabled"}}]}),n=e.tv({extend:t,variants:{variant:{secondary:{button:"focus-visible:uy-outline-offset-4"}},color:{primary:"",inverted:""}},compoundVariants:[{color:"primary",isDisabled:!1,isLoading:!1,class:{button:"uy-border uy-border-border-primary hover:uy-border-border-primary-hover active:uy-border-border-primary-active data-[pressed]:uy-border-border-primary-pressed",icon:"uy-text-content-primary group-hover:uy-text-content-primary-hover active:uy-text-content-primary-active data-[pressed]:uy-text-content-primary-pressed focus-visible:uy-text-content-primary-focus"}},{color:"primary",isLoading:!0,isDisabled:!1,class:{button:"uy-border uy-border-border-neutral-disabled focus-visible:uy-border-border-primary-focus",icon:"uy-text-content-neutral-disabled"}},{color:"primary",isLoading:!1,isDisabled:!0,class:{button:"uy-border uy-border-border-neutral-disabled focus-visible:uy-border-border-primary-focus",icon:"uy-text-content-neutral-disabled"}},{color:"inverted",isDisabled:!1,isLoading:!1,class:{button:"uy-border uy-border-border-inverted hover:uy-border-border-inverted-hover data-[pressed]:uy-border-border-inverted-pressed active:uy-border-border-inverted-active focus-visible:uy-border-border-inverted-focus",icon:"uy-text-content-inverted group-hover:uy-text-content-inverted-hover data-[pressed]:uy-text-content-inverted-pressed active:uy-text-content-inverted-active focus-visible:uy-text-content-inverted-focus"}},{color:"inverted",isLoading:!1,isDisabled:!0,class:{button:"uy-border uy-border-border-inverted-disabled focus-visible:uy-border-border-primary-focus",icon:"uy-text-content-inverted-disabled"}}]}),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("tailwind-variants"),t=e.tv({slots:{button:"uy-group uy-w-500 uy-h-500 uy-flex uy-justify-center uy-items-center uy-rounded-75 focus-visible:uy-outline-2 focus-visible:uy-outline-offset-2 focus-visible:uy-outline-utility-focus-ring",icon:"uy-w-250 uy-h-250"},variants:{isDisabled:{true:{button:"uy-cursor-not-allowed"},false:{button:""}},isLoading:{true:{button:"uy-cursor-progress uy-text-content-neutral-disabled",icon:""},false:{button:""}},color:{inverted:{button:"focus-visible:uy-outline-utility-inverted-focus-ring"}}},defaultVariants:{isDisabled:!1,isLoading:!1}}),r=e.tv({extend:t,variants:{variant:{primary:""},color:{primary:"",danger:"",warning:"",inverted:""}},compoundVariants:[{variant:"primary",color:"primary",isDisabled:!1,isLoading:!1,class:{button:"uy-bg-surface-primary hover:uy-bg-surface-primary-hover active:uy-bg-surface-primary-active focus-visible:uy-bg-surface-primary-focus data-[pressed]:uy-bg-surface-primary-pressed",icon:"uy-text-content-inverted group-hover:uy-text-content-inverted-hover active:uy-text-content-inverted-active focus-visible:uy-text-content-inverted-focus data-[pressed]:uy-text-content-inverted-pressed"}},{variant:"primary",color:"danger",isDisabled:!1,isLoading:!1,class:{button:"uy-bg-content-danger hover:uy-bg-content-danger-hover active:uy-bg-content-danger-pressed focus:uy-bg-content-danger-focus data-[pressed]:uy-bg-content-danger-pressed",icon:"uy-text-content-inverted group-hover:uy-text-content-inverted-hover active:uy-text-content-inverted-pressed focus:uy-text-content-inverted-focus data-[pressed]:uy-text-content-inverted-pressed"}},{variant:"primary",color:"warning",isDisabled:!1,isLoading:!1,class:{button:"uy-bg-content-warning hover:uy-bg-content-warning-hover active:uy-bg-content-warning-pressed focus-visible:uy-bg-content-warning-focus data-[pressed]:uy-bg-content-warning-pressed]:",icon:"uy-text-content-inverted group-hover:uy-text-content-inverted-hover active:uy-text-content-inverted-pressed focus-visible:uy-text-content-inverted-focus data-[pressed]:uy-text-content-inverted-pressed"}},{variant:"primary",color:"inverted",isDisabled:!1,isLoading:!1,class:{button:"uy-bg-surface-inverted hover:uy-accent-surface-inverted-hover active:uy-accent-surface-inverted-pressed focus-visible:uy-accent-surface-inverted-focus data-[pressed]:uy-accent-surface-inverted-pressed",icon:"uy-text-content-neutral group-hover:uy-text-content-neutral-hover active:uy-text-content-neutral-pressed focus-visible:uy-text-content-neutral-focus data-[pressed]:uy-text-content-neutral-pressed"}},{variant:"primary",color:"primary",isDisabled:!0,isLoading:!1,class:{button:"uy-bg-surface-neutral-disabled",icon:"uy-text-content-neutral-disabled"}},{variant:"primary",color:["primary","danger","warning","inverted"],isLoading:!0,isDisabled:!1,class:{button:"uy-bg-surface-neutral-disabled",icon:"uy-text-content-neutral-disabled"}}]}),n=e.tv({extend:t,variants:{variant:{secondary:{button:"focus-visible:uy-outline-offset-4"}},color:{primary:"",inverted:""}},compoundVariants:[{color:"primary",isDisabled:!1,isLoading:!1,class:{button:"uy-border uy-border-solid uy-border-border-primary hover:uy-border-border-primary-hover active:uy-border-border-primary-active data-[pressed]:uy-border-border-primary-pressed",icon:"uy-text-content-primary group-hover:uy-text-content-primary-hover active:uy-text-content-primary-active data-[pressed]:uy-text-content-primary-pressed focus-visible:uy-text-content-primary-focus"}},{color:"primary",isLoading:!0,isDisabled:!1,class:{button:"uy-border uy-border-solid uy-border-border-neutral-disabled focus-visible:uy-border-border-primary-focus",icon:"uy-text-content-neutral-disabled"}},{color:"primary",isLoading:!1,isDisabled:!0,class:{button:"uy-border uy-border-solid uy-border-border-neutral-disabled focus-visible:uy-border-border-primary-focus",icon:"uy-text-content-neutral-disabled"}},{color:"inverted",isDisabled:!1,isLoading:!1,class:{button:"uy-border uy-border-solid uy-border-border-inverted hover:uy-border-border-inverted-hover data-[pressed]:uy-border-border-inverted-pressed active:uy-border-border-inverted-active focus-visible:uy-border-border-inverted-focus",icon:"uy-text-content-inverted group-hover:uy-text-content-inverted-hover data-[pressed]:uy-text-content-inverted-pressed active:uy-text-content-inverted-active focus-visible:uy-text-content-inverted-focus"}},{color:"inverted",isLoading:!1,isDisabled:!0,class:{button:"uy-border uy-border-solid uy-border-border-inverted-disabled focus-visible:uy-border-border-primary-focus",icon:"uy-text-content-inverted-disabled"}}]}),o=e.tv({extend:t,variants:{variant:{ghost:""},color:{neutral:"",primary:"",danger:"",warning:""}},compoundVariants:[{color:"neutral",isDisabled:!1,isLoading:!1,class:{button:"hover:uy-bg-surface-neutral-hover data-[pressed]:uy-bg-surface-neutral-pressed active:uy-bg-surface-neutral-active",icon:"uy-text-content-neutral group-hover:uy-text-content-neutral-hover data-[pressed]:uy-text-content-neutral-pressed focus-visible:uy-text-content-neutral-focus active:uy-text-content-neutral-active"}},{color:"primary",isDisabled:!1,isLoading:!1,class:{button:"hover:uy-bg-surface-primary-lowest-hover data-[pressed]:uy-bg-surface-primary-lowest-pressed active:uy-bg-surface-primary-lowest-active",icon:"uy-text-content-primary group-hover:uy-text-content-primary data-[pressed]:uy-text-content-primary focus-visible:uy-text-content-primary active:uy-text-content-primary"}},{color:"danger",isDisabled:!1,isLoading:!1,class:{button:"hover:uy-bg-surface-danger-lowest-hover data-[pressed]:uy-bg-surface-danger-lowest-pressed active:uy-bg-surface-danger-lowest-active",icon:"uy-text-content-danger group-hover:uy-text-content-danger-hover data-[pressed]:uy-text-content-danger-pressed focus-visible:uy-text-content-danger-focus active:uy-text-content-danger-active"}},{color:"warning",isDisabled:!1,isLoading:!1,class:{button:"hover:uy-bg-surface-warning-lowest-hover data-[pressed]:uy-bg-surface-warning-lowest-pressed active:uy-bg-surface-warning-lowest-active",icon:"uy-text-content-warning group-hover:uy-text-content-warning-hover data-[pressed]:uy-text-content-warning-pressed focus-visible:uy-text-content-warning-focus active:uy-text-content-warning-active"}},{color:["primary","neutral","danger","warning"],isDisabled:!0,isLoading:!1,class:{button:"",icon:"uy-text-content-neutral-disabled"}},{color:["primary","neutral","danger","warning"],isDisabled:!1,isLoading:!0,class:{button:"",icon:"uy-text-content-neutral-disabled"}}]});exports.iconButtonGhost=o;exports.iconButtonPrimary=r;exports.iconButtonSecondary=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("react"),h=require("react-aria-components"),j=require("react-intl"),I=require("tailwind-variants"),N=require("../icon-button/CircularIconButton.js"),q=require("../icon/Icon.js"),M=require("../spinner/Spinner.js"),S=I.tv({slots:{base:"uy-flex uy-h-500 uy-border uy-border-solid uy-rounded-100 focus-within:uy-outline-none focus-within:uy-ring-2 focus-within:uy-ring-utility-focus-ring focus-within:uy-ring-offset-2 active:uy-border-border-form-active",prefix:"uy-flex-grow-0 uy-content-center uy-pt-100 uy-pb-100 uy-pl-150 uy-pr-150 uy-border-r uy-rounded-l-100 active:uy-border-border-form-active",inputWrapper:"uy-flex uy-gap-50 uy-flex-grow uy-flex-nowrap uy-pt-100 uy-pb-100 uy-pl-150 uy-pr-150 uy-rounded-100 uy-max-w-full uy-justify-between",input:"uy-w-full uy-max-w-full uy-flex-1 uy-outline-none uy-typography-body placeholder:uy-text-content-neutral-lowest uy-min-w-0 uy-max-w-full",state:"uy-flex uy-gap-50 uy-items-center uy-shrink-0",suffix:"uy-flex-grow-0 uy-content-center uy-pt-100 uy-pb-100 uy-pl-150 uy-pr-150 uy-border-l uy-rounded-r-100 active:uy-border-border-form-active"},variants:{isInvalid:{true:{base:"uy-border-border-form-error uy-bg-surface-form-error",prefix:"uy-bg-surface-form-error uy-border-border-form-error",inputWrapper:"uy-bg-surface-form-error",input:"uy-bg-surface-form-error",state:"uy-text-content-form-error",suffix:"uy-bg-surface-form-error uy-border-border-form-error"}},isReadOnly:{true:{base:"uy-border-border-form-disabled uy-bg-surface-form-disabled",prefix:"uy-bg-surface-form-disabled uy-border-border-form-disabled uy-text-content-form-readonly",inputWrapper:"uy-border-border-form-disabled uy-bg-surface-form-disabled",input:"uy-bg-surface-form-disabled uy-text-content-form-readonly",suffix:"uy-bg-surface-form-disabled uy-border-border-form-disabled uy-text-content-form-readonly"}},isDisabled:{true:{base:"uy-border-border-form-disabled uy-bg-surface-form-disabled",prefix:"uy-bg-surface-form-disabled uy-border-border-form-disabled uy-text-content-form-disabled",inputWrapper:"uy-bg-surface-form-disabled uy-text-content-form-disabled",input:"uy-bg-surface-form-disabled uy-text-content-form-disabled",suffix:"uy-bg-surface-form-disabled uy-border-border-form-disabled uy-text-content-form-disabled"}}},compoundVariants:[{isInvalid:!1,isDisabled:!1,isReadOnly:!1,className:{base:"uy-border-border-form-enabled uy-bg-surface-form-enabled",prefix:"uy-bg-surface-neutral-low uy-border-border-form-enabled uy-text-content-form-enabled",inputWrapper:"uy-border-border-form-enabled uy-bg-surface-form-enabled",input:"uy-text-content-form-enabled uy-bg-surface-form-enabled",state:"uy-text-content-neutral-disabled",suffix:"uy-border-border-form-enabled uy-bg-surface-neutral-low uy-text-content-form-enabled"}}]}),l=v.forwardRef(({type:f="text",prefix:a,suffix:s,isInvalid:d,isLoading:r,isDisabled:u,isReadOnly:o,onClearButtonPress:t,...i},y)=>{const n=j.useIntl(),{base:b,prefix:c,inputWrapper:m,input:p,state:x,suffix:g}=S({isInvalid:!!d,isReadOnly:!!o,isDisabled:!!u}),w=i.value&&!r&&!o&&!u;return e.jsxs("div",{className:b(),children:[a?e.jsx("span",{className:c(),children:a}):null,e.jsxs("div",{className:m(),children:[e.jsx(h.Input,{...i,ref:y,type:f,className:p(),"aria-busy":r,readOnly:o,disabled:u}),e.jsxs("div",{className:x(),children:[r&&e.jsx(M.Spinner,{color:"inherit",size:"small",label:n.formatMessage({id:"unity:component:common:loading:label",defaultMessage:"Loading..."})}),d&&e.jsx(q.Icon,{src:"WarningCircleOutlined",color:"content.form.invalid",alt:n.formatMessage({id:"unity:component:form-field:form-input:error:alt",defaultMessage:"Error"})}),w&&e.jsx(N.CircularIconButton,{title:n.formatMessage({id:"unity:component:form-field:form-input:clear:title",defaultMessage:"Clear"}),className:"uy-text-content-neutral-enabled",icon:"CloseOutlined",onPress:()=>{t==null||t()}})]})]}),s?e.jsx("span",{className:g(),children:s}):null]})});l.displayName="Input";exports.Input=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),t=require("react-aria-components");function n({children:r,placement:o,width:e}){const s=e?`uy-w-[${e}px]`:"";return u.jsx(t.Popover,{placement:o,className:"uy-flex uy-flex-col uy-justify-end uy-items-start uy-p-100 uy-rounded-100 uy-border uy-border-border-neutral uy-bg-surface-neutral uy-shadow-floating",children:u.jsx(t.Menu,{autoFocus:"first",className:`uy-min-w-[320px] ${s}`,children:r})})}n.displayName="MenuContent";exports.MenuContent=n;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),t=require("react-aria-components");function n({children:r,placement:o,width:e}){const s=e?`uy-w-[${e}px]`:"";return u.jsx(t.Popover,{placement:o,className:"uy-flex uy-flex-col uy-justify-end uy-items-start uy-p-100 uy-rounded-100 uy-border uy-border-solid uy-border-border-neutral uy-bg-surface-neutral uy-shadow-floating",children:u.jsx(t.Menu,{autoFocus:"first",className:`uy-min-w-[320px] ${s}`,children:r})})}n.displayName="MenuContent";exports.MenuContent=n;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { MultiSelectComponent, MultiSelectProps } from './Multiselect.types.js';
|
|
2
|
+
declare const MultiSelectComponent: <TItem extends Record<string | number, unknown>, TItemKey extends keyof TItem, TKeyType extends TItem[TItemKey] & (string | number)>(props: MultiSelectProps<TItem, TItemKey, TKeyType>, ref: React.ForwardedRef<HTMLButtonElement>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
/**
|
|
4
|
+
* The MultiSelect component allows users to select multiple items from a dropdown list.
|
|
5
|
+
* The component provides two different APIs:
|
|
6
|
+
* 1. Static API - For simple cases where options are defined as direct children and use primitive values as keys (strings or numbers)
|
|
7
|
+
* 2. Dynamic API - For data-driven cases where options are generated from a dynamic collection with typed objects
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* import { MultiSelect, MultiSelectOption, MultiSelectOptGroup } from '@payfit/unity-components'
|
|
11
|
+
*
|
|
12
|
+
* // Static API - Options defined as direct children
|
|
13
|
+
* <MultiSelect
|
|
14
|
+
* placeholder="Select fruits..."
|
|
15
|
+
* onChange={(selected) => console.log(selected)}
|
|
16
|
+
* >
|
|
17
|
+
* <MultiSelectOptGroup label="Citrus" withSeparator>
|
|
18
|
+
* <MultiSelectOption value="orange">Orange</MultiSelectOption>
|
|
19
|
+
* <MultiSelectOption value="lemon">Lemon</MultiSelectOption>
|
|
20
|
+
* </MultiSelectOptGroup>
|
|
21
|
+
* <MultiSelectOption value="apple">Apple</MultiSelectOption>
|
|
22
|
+
* </MultiSelect>
|
|
23
|
+
*
|
|
24
|
+
* // Dynamic API - Options generated from a collection with typed objects
|
|
25
|
+
* interface Fruit {
|
|
26
|
+
* id: string;
|
|
27
|
+
* name: string;
|
|
28
|
+
* category: string;
|
|
29
|
+
* }
|
|
30
|
+
*
|
|
31
|
+
* const fruits: Set<Fruit> = new Set([
|
|
32
|
+
* { id: 'apple-1', name: 'Apple', category: 'Core' },
|
|
33
|
+
* { id: 'orange-1', name: 'Orange', category: 'Citrus' }
|
|
34
|
+
* ]);
|
|
35
|
+
*
|
|
36
|
+
* <MultiSelect
|
|
37
|
+
* items={fruits}
|
|
38
|
+
* placeholder="Select fruits..."
|
|
39
|
+
* value={new Set(['apple-1'])}
|
|
40
|
+
* getItemValue={item => item.id}
|
|
41
|
+
* renderValue={(items) =>
|
|
42
|
+
* Array.from(items)
|
|
43
|
+
* .map(item => item.name)
|
|
44
|
+
* .join(', ')
|
|
45
|
+
* }
|
|
46
|
+
* >
|
|
47
|
+
* {(item) => (
|
|
48
|
+
* <MultiSelectOption value={item.id}>
|
|
49
|
+
* {item.name}
|
|
50
|
+
* </MultiSelectOption>
|
|
51
|
+
* )}
|
|
52
|
+
* </MultiSelect>
|
|
53
|
+
* ```
|
|
54
|
+
* @component
|
|
55
|
+
* @template TItem - The type of items in the collection. When using the dynamic API, it must be a Record or an object. For the static API, it defaults to a string or number.
|
|
56
|
+
* @template TItemKey - The key name within TItem used as the selection value (must be a key of TItem). Applies only to the dynamic API.
|
|
57
|
+
* @template TKeyType - The type of the property at TItem[TItemKey] (must be string or number). Applies only to the dynamic API.
|
|
58
|
+
* @remarks
|
|
59
|
+
* [API & Docs](https://unity-components.payfit.io/?path=/docs/inputs-multiselect--docs) • [Design Guidelines](https://www.payfit.design/24f360409/p/928776-multiselect)
|
|
60
|
+
*/
|
|
61
|
+
export declare const MultiSelect: MultiSelectComponent;
|
|
62
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),c=require("react"),P=require("@ariakit/react"),fe=require("./hooks/use-combobox-filter.js"),Se=require("./hooks/use-multiselection-state.js"),Q=require("./Multiselect.context.js"),z=require("./parts/MultiSelectButton.js"),J=require("./parts/MultiSelectPopover.js");function U(t){return t instanceof Map}function me(t){return!Object.prototype.hasOwnProperty.call(t,"items")}function u(t){return String(t)}function y(t){return isNaN(Number(t))?t:Number(t)}function X(t){return Array.from(t,u)}function W(t){return new Set(X(t))}const Y=(t,V)=>{const s=me(t),j=e=>{if(Object.hasOwnProperty.call(e,"value"))return e.value;if(Object.prototype.hasOwnProperty.call(e,"id"))return e.id;if(typeof e=="string")return e;const n=Object.keys(e)[0];return e[n]},Z=s?e=>Array.from(e).map(String).join(", "):e=>Array.from(e).map(n=>j(n)).join(", "),S=t,K=t,a=c.useMemo(()=>s?void 0:S.items,[s,S.items]),r=s?void 0:S.getItemValue??j,$=t.renderValue??Z,{children:p}=s?K:S,ee=s?void 0:S.searchOptions,{children:A}=K,{children:be,value:b,defaultValue:f,onChange:v,onBlur:g,isDisabled:O,isInvalid:w,isLoading:R,isReadOnly:q,isSearchable:h,placeholder:D,onClearButtonPress:k,maxVisibleItems:I=7,...F}=t,m=c.useCallback(()=>s||!a?[]:U(a)?Array.from(a.values()).flat():Array.from(a),[a,s]),te=c.useCallback(()=>{if("value"in t)return b?W(b):new Set},[t,b]),re=c.useCallback(()=>f?W(f):new Set,[f]),ne=c.useCallback(e=>{if(!v)return;const n=new Set(Array.from(e).map(l=>y(l)));v(n)},[v]),{selectedKeys:d,selectKey:B,unselectKey:N}=Se.useMultiSelectionState({selectedKeys:te(),defaultSelectedKeys:re(),onSelectionChange:ne}),se=c.useCallback(e=>{B(u(e))},[B]),oe=c.useCallback(e=>{N(u(e))},[N]),{setSearchQuery:le,matchingItems:M}=fe.useComboboxFilter({items:m(),extractSearchableText:e=>s?[""]:[u((r==null?void 0:r(e))||"")],enabled:h,searchOptions:ee}),ce=()=>{if(s)return Array.from(d);const e=m();return Array.from(d).map(n=>{const l=e.find(o=>u((r==null?void 0:r(o))||"")===n);return l&&r?r(l):y(n)})},ue=()=>{if(s)return new Set(Array.from(d).map(l=>y(l)));const e=m(),n=new Set;return Array.from(d).forEach(l=>{const o=e.find(x=>u((r==null?void 0:r(x))||"")===l);o&&n.add(o)}),n},ae=()=>{if(f)return X(f)},C=c.useMemo(ce,[d,s,r,m]),T=c.useMemo(ue,[d,s,r,m]),L=c.useMemo(ae,[f]),G=e=>{const n=new Set(e),l=new Set(C.map(o=>u(o)));for(const o of n)l.has(o)||se(y(o));for(const o of l)n.has(o)||oe(y(o))},_=c.useCallback(()=>s?A:a?U(a)?Array.from(a.entries()).map(([e,n])=>{const l=n.filter(o=>M.some(x=>{const ie=(r==null?void 0:r(o))||"",de=(r==null?void 0:r(x))||"";return u(de)===u(ie)}));return p(e,l)}):M.map(e=>p(e)):null,[p,a,M,A,r,s]),E=c.useMemo(()=>_(),[_]),H=$;return h?i.jsx(P.ComboboxProvider,{resetValueOnHide:!0,setValue:le,children:i.jsx(P.SelectProvider,{value:C.map(e=>u(e)),defaultValue:L,setValue:G,focusLoop:!0,children:i.jsxs(Q.MultiSelectContext.Provider,{value:{isSearchable:h,maxVisibleItems:I,selectedKeys:d},children:[i.jsx(z.MultiSelectButton,{ref:V,placeholder:D,isDisabled:O,isReadOnly:q,isLoading:R,isInvalid:w,renderValue:H,selectedItems:T,onClearButtonPress:k,...F}),i.jsx(J.MultiSelectPopover,{onBlur:g,children:E})]})})}):i.jsx(P.SelectProvider,{value:C.map(e=>u(e)),defaultValue:L,setValue:G,focusLoop:!0,children:i.jsxs(Q.MultiSelectContext.Provider,{value:{isSearchable:h,maxVisibleItems:I,selectedKeys:d},children:[i.jsx(z.MultiSelectButton,{ref:V,placeholder:D,isDisabled:O,isReadOnly:q,isLoading:R,isInvalid:w,renderValue:H,selectedItems:T,onClearButtonPress:k,...F}),i.jsx(J.MultiSelectPopover,{onBlur:g,children:E})]})})};Y.displayName="MultiSelect";const ye=c.forwardRef(Y);exports.MultiSelect=ye;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=e.createContext({isSearchable:!1,selectedKeys:new Set});exports.MultiSelectContext=t;
|