@simplybusiness/mobius 5.1.2 → 5.3.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/CHANGELOG.md +25 -0
- package/dist/cjs/components/Accordion/Accordion.js +6 -5
- package/dist/cjs/components/Accordion/Accordion.js.map +1 -1
- package/dist/cjs/components/Button/Button.js.map +1 -1
- package/dist/cjs/components/Drawer/Drawer.js.map +1 -1
- package/dist/cjs/components/Grid/Item.js.map +1 -1
- package/dist/cjs/components/Icon/Icon.js.map +1 -1
- package/dist/cjs/components/List/List.js.map +1 -1
- package/dist/cjs/components/PasswordField/ShowHideButton.js.map +1 -1
- package/dist/cjs/components/Progress/Progress.js.map +1 -1
- package/dist/cjs/components/Radio/RadioGroup.js.map +1 -1
- package/dist/cjs/components/Segment/SegmentGroup.js.map +1 -1
- package/dist/cjs/components/Stack/Stack.js.map +1 -1
- package/dist/cjs/components/Text/Text.js.map +1 -1
- package/dist/cjs/components/Trust/Trust.js.map +1 -1
- package/dist/cjs/hooks/useButton/useButton.js +3 -1
- package/dist/cjs/hooks/useButton/useButton.js.map +1 -1
- package/dist/cjs/hooks/useLabel/useLabel.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/cjs/utils/getSpacingValue.js.map +1 -1
- package/dist/esm/components/Accordion/Accordion.js +6 -5
- package/dist/esm/components/Accordion/Accordion.js.map +1 -1
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/Drawer/Drawer.js.map +1 -1
- package/dist/esm/components/Grid/Item.js.map +1 -1
- package/dist/esm/components/Icon/Icon.js.map +1 -1
- package/dist/esm/components/List/List.js.map +1 -1
- package/dist/esm/components/PasswordField/ShowHideButton.js.map +1 -1
- package/dist/esm/components/Progress/Progress.js.map +1 -1
- package/dist/esm/components/Radio/RadioGroup.js.map +1 -1
- package/dist/esm/components/Segment/SegmentGroup.js.map +1 -1
- package/dist/esm/components/Stack/Stack.js.map +1 -1
- package/dist/esm/components/Text/Text.js.map +1 -1
- package/dist/esm/components/Trust/Trust.js.map +1 -1
- package/dist/esm/hooks/useButton/useButton.js +3 -1
- package/dist/esm/hooks/useButton/useButton.js.map +1 -1
- package/dist/esm/hooks/useLabel/useLabel.js.map +1 -1
- package/dist/esm/utils/getSpacingValue.js.map +1 -1
- package/dist/types/components/Accordion/Accordion.d.ts +4 -0
- package/dist/types/components/Button/Button.d.ts +4 -0
- package/dist/types/hooks/useButton/useButton.d.ts +7 -1
- package/package.json +24 -25
- package/src/components/Accordion/Accordion.css +9 -0
- package/src/components/Accordion/Accordion.stories.tsx +1 -0
- package/src/components/Accordion/Accordion.test.tsx +36 -1
- package/src/components/Accordion/Accordion.tsx +19 -4
- package/src/components/Button/Button.tsx +4 -0
- package/src/components/Segment/Segment.css +1 -1
- package/src/components/Text/Text.css +5 -0
- package/src/hooks/useButton/useButton.tsx +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 749961a: Adds `name` and `value` properties to `<Button />` to be used when submitting a form
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 982456d: Remove unnecessary type packages
|
|
12
|
+
|
|
13
|
+
## 5.2.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- 2973f98: Support Accordion heading element type
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- 3f02903: Upgrade dependencies
|
|
22
|
+
- 61d44d8: Add `text-wrap` of `balance` to headings and `pretty` to body text
|
|
23
|
+
- af09896: Update CSS imports to not import from outside their own package directory
|
|
24
|
+
- ffb1bbe: Change Segment subtle bg colour to pale grey
|
|
25
|
+
- Updated dependencies [3f02903]
|
|
26
|
+
- @simplybusiness/icons@4.14.1
|
|
27
|
+
|
|
3
28
|
## 5.1.2
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -13,15 +13,15 @@ const _jsxruntime = require("react/jsx-runtime");
|
|
|
13
13
|
const _icons = require("@simplybusiness/icons");
|
|
14
14
|
const _dedupe = /*#__PURE__*/ _interop_require_default(require("classnames/dedupe"));
|
|
15
15
|
const _react = require("react");
|
|
16
|
+
const _usePrefersReducedMotion = require("../../hooks/usePrefersReducedMotion");
|
|
16
17
|
const _Flex = require("../Flex");
|
|
17
18
|
const _Icon = require("../Icon");
|
|
18
|
-
const _usePrefersReducedMotion = require("../../hooks/usePrefersReducedMotion");
|
|
19
19
|
function _interop_require_default(obj) {
|
|
20
20
|
return obj && obj.__esModule ? obj : {
|
|
21
21
|
default: obj
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
const AccordionLink = ({ text, toggle, onClick, headerChildren, ariaExpanded })=>{
|
|
24
|
+
const AccordionLink = ({ text, elementType: LinkElement = "span", toggle, onClick, headerChildren, ariaExpanded })=>{
|
|
25
25
|
const linkClasses = (0, _dedupe.default)("mobius-accordion__link", {
|
|
26
26
|
"--is-open": ariaExpanded
|
|
27
27
|
});
|
|
@@ -53,7 +53,7 @@ const AccordionLink = ({ text, toggle, onClick, headerChildren, ariaExpanded })=
|
|
|
53
53
|
tabIndex: 0,
|
|
54
54
|
"aria-expanded": !!ariaExpanded,
|
|
55
55
|
children: [
|
|
56
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
56
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(LinkElement, {
|
|
57
57
|
className: "mobius-accordion__link-text",
|
|
58
58
|
children: text
|
|
59
59
|
}),
|
|
@@ -75,7 +75,7 @@ const AccordionLink = ({ text, toggle, onClick, headerChildren, ariaExpanded })=
|
|
|
75
75
|
tabIndex: 0,
|
|
76
76
|
"aria-expanded": !!ariaExpanded,
|
|
77
77
|
children: [
|
|
78
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
78
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(LinkElement, {
|
|
79
79
|
className: "mobius-accordion__link-text",
|
|
80
80
|
children: text
|
|
81
81
|
}),
|
|
@@ -87,7 +87,7 @@ const AccordionLink = ({ text, toggle, onClick, headerChildren, ariaExpanded })=
|
|
|
87
87
|
});
|
|
88
88
|
};
|
|
89
89
|
const Accordion = /*#__PURE__*/ (0, _react.forwardRef)((props, ref)=>{
|
|
90
|
-
const { showText = "See more", hideText = "See less", headerPosition = "top", startOpen = false, onOpen, onClose, onChange = ()=>{}, headerChildren, ...rest } = props;
|
|
90
|
+
const { showText = "See more", hideText = "See less", headerPosition = "top", startOpen = false, linkElementType, onOpen, onClose, onChange = ()=>{}, headerChildren, ...rest } = props;
|
|
91
91
|
const [accordionState, setAccordionState] = (0, _react.useState)({
|
|
92
92
|
open: true,
|
|
93
93
|
withAnimation: false
|
|
@@ -135,6 +135,7 @@ const Accordion = /*#__PURE__*/ (0, _react.forwardRef)((props, ref)=>{
|
|
|
135
135
|
children: [
|
|
136
136
|
headerPosition === "top" && /*#__PURE__*/ (0, _jsxruntime.jsx)(AccordionLink, {
|
|
137
137
|
text: linkText,
|
|
138
|
+
elementType: linkElementType,
|
|
138
139
|
toggle: handleChange,
|
|
139
140
|
ariaExpanded: accordionState.open,
|
|
140
141
|
headerChildren: headerChildren
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["\"use client\";\n\nimport { chevronDown } from \"@simplybusiness/icons\";\nimport classNames from \"classnames/dedupe\";\nimport {\n KeyboardEvent,\n ReactNode,\n Ref,\n RefAttributes,\n forwardRef,\n useEffect,\n useState,\n} from \"react\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { DOMProps } from \"../../types/dom\";\nimport { Flex } from \"../Flex\";\nimport { Icon } from \"../Icon\";\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["\"use client\";\n\nimport { chevronDown } from \"@simplybusiness/icons\";\nimport classNames from \"classnames/dedupe\";\nimport {\n KeyboardEvent,\n ReactNode,\n Ref,\n RefAttributes,\n forwardRef,\n useEffect,\n useState,\n} from \"react\";\nimport { usePrefersReducedMotion } from \"../../hooks/usePrefersReducedMotion\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { DOMProps } from \"../../types/dom\";\nimport { Flex } from \"../Flex\";\nimport { Icon } from \"../Icon\";\n\nexport type AccordionLinkElementType =\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"span\";\nexport type AccordionElementType = HTMLDivElement;\nexport type AccordionRef = Ref<AccordionElementType>;\nexport interface AccordionLinkProps extends DOMProps {\n /** Link text to show accordion content */\n text?: string;\n elementType?: AccordionLinkElementType;\n onClick?: () => void;\n toggle: () => void;\n headerChildren?: ReactNode;\n ariaExpanded: boolean | undefined;\n}\n\nconst AccordionLink = ({\n text,\n elementType: LinkElement = \"span\",\n toggle,\n onClick,\n headerChildren,\n ariaExpanded,\n}: AccordionLinkProps) => {\n const linkClasses = classNames(\"mobius-accordion__link\", {\n \"--is-open\": ariaExpanded,\n });\n const iconClasses = classNames(\"mobius-accordion__link-icon\", {\n \"--is-open\": ariaExpanded,\n });\n const handleOnClick = (): void => {\n if (onClick) {\n onClick();\n }\n toggle();\n };\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === \" \" || e.key === \"Enter\") {\n toggle();\n }\n };\n\n if (headerChildren) {\n return (\n <Flex\n justifyContent=\"space-between\"\n alignItems=\"center\"\n className=\"mobius-accordion__header\"\n >\n <div\n className={linkClasses}\n onClick={handleOnClick}\n onKeyDown={handleKeyDown}\n role=\"button\"\n tabIndex={0}\n aria-expanded={!!ariaExpanded}\n >\n <LinkElement className=\"mobius-accordion__link-text\">\n {text}\n </LinkElement>\n <Icon icon={chevronDown} className={iconClasses} />\n </div>\n {headerChildren}\n </Flex>\n );\n }\n\n return (\n <div\n className={linkClasses}\n onClick={handleOnClick}\n onKeyDown={handleKeyDown}\n role=\"button\"\n tabIndex={0}\n aria-expanded={!!ariaExpanded}\n >\n <LinkElement className=\"mobius-accordion__link-text\">{text}</LinkElement>\n <Icon icon={chevronDown} className={iconClasses} />\n </div>\n );\n};\n\nexport interface AccordionProps\n extends DOMProps,\n RefAttributes<AccordionElementType> {\n /** Custom class name for setting specific CSS */\n className?: string;\n /** Link text to show accordion content */\n showText?: string;\n /** Link text to hide accordion content */\n hideText?: string;\n /** Whether header is above or below content */\n headerPosition?: \"top\" | \"bottom\";\n /** Whether to expand the accordion initially */\n startOpen?: boolean | undefined;\n /** Semantic heading for title link (default is span) */\n linkElementType?: AccordionLinkElementType;\n /** Callback that fires each time the accordion is opened */\n onOpen?: () => void;\n /** Callback that fires each time the accordion is closed */\n onClose?: () => void;\n /** Callback that fires each time the accordion state changes */\n onChange?: (state: boolean) => void;\n children?: ReactNode;\n headerChildren?: ReactNode;\n}\n\nexport const Accordion: ForwardedRefComponent<\n AccordionProps,\n AccordionElementType\n> = forwardRef((props: AccordionProps, ref: AccordionRef) => {\n const {\n showText = \"See more\",\n hideText = \"See less\",\n headerPosition = \"top\",\n startOpen = false,\n linkElementType,\n onOpen,\n onClose,\n onChange = () => {},\n headerChildren,\n ...rest\n } = props;\n const [accordionState, setAccordionState] = useState({\n open: true,\n withAnimation: false,\n });\n const prefersReducedMotion = usePrefersReducedMotion();\n\n const containerClasses = classNames(\n \"mobius\",\n \"mobius-accordion\",\n props.className,\n {\n \"--should-animate\": accordionState.withAnimation && !prefersReducedMotion,\n \"--is-open\": accordionState.open,\n },\n );\n const contentContainerClasses = classNames(\n \"mobius-accordion__content-container\",\n {\n \"--is-open\": accordionState.open,\n },\n );\n const contentClasses = classNames(\"mobius-accordion__content\", {\n \"--is-open\": accordionState.open,\n });\n const linkText = accordionState.open ? hideText : showText;\n\n const handleChange = () => {\n // Fire events\n if (!accordionState.open && onOpen) {\n onOpen();\n }\n if (accordionState.open && onClose) {\n onClose();\n }\n if (onChange) {\n onChange(!accordionState.open);\n }\n setAccordionState({\n open: !accordionState.open,\n withAnimation: true,\n });\n };\n\n useEffect(() => {\n setAccordionState({\n open: startOpen,\n withAnimation: false,\n });\n }, [startOpen]);\n\n return (\n <div ref={ref} {...rest} className={containerClasses}>\n {headerPosition === \"top\" && (\n <AccordionLink\n text={linkText}\n elementType={linkElementType}\n toggle={handleChange}\n ariaExpanded={accordionState.open}\n headerChildren={headerChildren}\n />\n )}\n <div\n className={contentContainerClasses}\n aria-hidden={!accordionState.open}\n >\n <div className={contentClasses}>{props.children}</div>\n </div>\n {headerPosition === \"bottom\" && (\n <AccordionLink\n text={linkText}\n toggle={handleChange}\n ariaExpanded={accordionState.open}\n headerChildren={headerChildren}\n />\n )}\n </div>\n );\n});\n"],"names":["Accordion","AccordionLink","text","elementType","LinkElement","toggle","onClick","headerChildren","ariaExpanded","linkClasses","classNames","iconClasses","handleOnClick","handleKeyDown","e","key","Flex","justifyContent","alignItems","className","div","onKeyDown","role","tabIndex","aria-expanded","Icon","icon","chevronDown","forwardRef","props","ref","showText","hideText","headerPosition","startOpen","linkElementType","onOpen","onClose","onChange","rest","accordionState","setAccordionState","useState","open","withAnimation","prefersReducedMotion","usePrefersReducedMotion","containerClasses","contentContainerClasses","contentClasses","linkText","handleChange","useEffect","aria-hidden","children"],"mappings":"AAAA;;;;;+BAmIaA;;;eAAAA;;;;uBAjIe;+DACL;uBAShB;yCACiC;sBAGnB;sBACA;;;;;;AAsBrB,MAAMC,gBAAgB,CAAC,EACrBC,IAAI,EACJC,aAAaC,cAAc,MAAM,EACjCC,MAAM,EACNC,OAAO,EACPC,cAAc,EACdC,YAAY,EACO;IACnB,MAAMC,cAAcC,IAAAA,eAAU,EAAC,0BAA0B;QACvD,aAAaF;IACf;IACA,MAAMG,cAAcD,IAAAA,eAAU,EAAC,+BAA+B;QAC5D,aAAaF;IACf;IACA,MAAMI,gBAAgB;QACpB,IAAIN,SAAS;YACXA;QACF;QACAD;IACF;IAEA,MAAMQ,gBAAgB,CAACC;QACrB,IAAIA,EAAEC,GAAG,KAAK,OAAOD,EAAEC,GAAG,KAAK,SAAS;YACtCV;QACF;IACF;IAEA,IAAIE,gBAAgB;QAClB,qBACE,sBAACS,UAAI;YACHC,gBAAe;YACfC,YAAW;YACXC,WAAU;;8BAEV,sBAACC;oBACCD,WAAWV;oBACXH,SAASM;oBACTS,WAAWR;oBACXS,MAAK;oBACLC,UAAU;oBACVC,iBAAe,CAAC,CAAChB;;sCAEjB,qBAACJ;4BAAYe,WAAU;sCACpBjB;;sCAEH,qBAACuB,UAAI;4BAACC,MAAMC,kBAAW;4BAAER,WAAWR;;;;gBAErCJ;;;IAGP;IAEA,qBACE,sBAACa;QACCD,WAAWV;QACXH,SAASM;QACTS,WAAWR;QACXS,MAAK;QACLC,UAAU;QACVC,iBAAe,CAAC,CAAChB;;0BAEjB,qBAACJ;gBAAYe,WAAU;0BAA+BjB;;0BACtD,qBAACuB,UAAI;gBAACC,MAAMC,kBAAW;gBAAER,WAAWR;;;;AAG1C;AA2BO,MAAMX,0BAGT4B,IAAAA,iBAAU,EAAC,CAACC,OAAuBC;IACrC,MAAM,EACJC,WAAW,UAAU,EACrBC,WAAW,UAAU,EACrBC,iBAAiB,KAAK,EACtBC,YAAY,KAAK,EACjBC,eAAe,EACfC,MAAM,EACNC,OAAO,EACPC,WAAW,KAAO,CAAC,EACnB/B,cAAc,EACd,GAAGgC,MACJ,GAAGV;IACJ,MAAM,CAACW,gBAAgBC,kBAAkB,GAAGC,IAAAA,eAAQ,EAAC;QACnDC,MAAM;QACNC,eAAe;IACjB;IACA,MAAMC,uBAAuBC,IAAAA,gDAAuB;IAEpD,MAAMC,mBAAmBrC,IAAAA,eAAU,EACjC,UACA,oBACAmB,MAAMV,SAAS,EACf;QACE,oBAAoBqB,eAAeI,aAAa,IAAI,CAACC;QACrD,aAAaL,eAAeG,IAAI;IAClC;IAEF,MAAMK,0BAA0BtC,IAAAA,eAAU,EACxC,uCACA;QACE,aAAa8B,eAAeG,IAAI;IAClC;IAEF,MAAMM,iBAAiBvC,IAAAA,eAAU,EAAC,6BAA6B;QAC7D,aAAa8B,eAAeG,IAAI;IAClC;IACA,MAAMO,WAAWV,eAAeG,IAAI,GAAGX,WAAWD;IAElD,MAAMoB,eAAe;QACnB,cAAc;QACd,IAAI,CAACX,eAAeG,IAAI,IAAIP,QAAQ;YAClCA;QACF;QACA,IAAII,eAAeG,IAAI,IAAIN,SAAS;YAClCA;QACF;QACA,IAAIC,UAAU;YACZA,SAAS,CAACE,eAAeG,IAAI;QAC/B;QACAF,kBAAkB;YAChBE,MAAM,CAACH,eAAeG,IAAI;YAC1BC,eAAe;QACjB;IACF;IAEAQ,IAAAA,gBAAS,EAAC;QACRX,kBAAkB;YAChBE,MAAMT;YACNU,eAAe;QACjB;IACF,GAAG;QAACV;KAAU;IAEd,qBACE,sBAACd;QAAIU,KAAKA;QAAM,GAAGS,IAAI;QAAEpB,WAAW4B;;YACjCd,mBAAmB,uBAClB,qBAAChC;gBACCC,MAAMgD;gBACN/C,aAAagC;gBACb9B,QAAQ8C;gBACR3C,cAAcgC,eAAeG,IAAI;gBACjCpC,gBAAgBA;;0BAGpB,qBAACa;gBACCD,WAAW6B;gBACXK,eAAa,CAACb,eAAeG,IAAI;0BAEjC,cAAA,qBAACvB;oBAAID,WAAW8B;8BAAiBpB,MAAMyB,QAAQ;;;YAEhDrB,mBAAmB,0BAClB,qBAAChC;gBACCC,MAAMgD;gBACN7C,QAAQ8C;gBACR3C,cAAcgC,eAAeG,IAAI;gBACjCpC,gBAAgBA;;;;AAK1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["\"use client\";\n\nimport { Ref, forwardRef, RefAttributes, ReactNode, MouseEvent } from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { Loading } from \"./Loading\";\nimport { UseButtonProps, useButton } from \"../../hooks/useButton\";\nimport { useDeprecationWarning } from \"../../hooks\";\nimport { Success } from \"./Success\";\n\nexport type ButtonElementType = HTMLButtonElement;\n\nexport type Variant =\n | \"primary\"\n | \"secondary\"\n | \"ghost\"\n | \"inverse\"\n | \"inverse-ghost\"\n | \"basic\"\n | \"link\";\n\nexport type Size = \"sm\" | \"md\" | \"lg\";\n\nexport interface ButtonProps\n extends UseButtonProps,\n DOMProps,\n RefAttributes<ButtonElementType> {\n /** Custom class name for setting specific CSS */\n className?: string;\n /** Shortlist of styles */\n variant?: Variant;\n size?: Size;\n /** Display loading spinner */\n isLoading?: boolean;\n /** Display success style */\n isSuccess?: boolean;\n onClick?: (event: MouseEvent<HTMLButtonElement>) => void;\n children?: ReactNode;\n}\n\nexport type ButtonRef = Ref<ButtonElementType>;\n\nconst Button: ForwardedRefComponent<ButtonProps, ButtonElementType> =\n forwardRef((props: ButtonProps, ref: ButtonRef) => {\n const {\n children,\n elementType: Component = \"button\",\n isDisabled,\n isLoading,\n isSuccess,\n variant = \"primary\",\n size = \"md\",\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onPress,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onClick,\n ...otherProps\n } = props;\n const { buttonProps } = useButton(props);\n\n useDeprecationWarning({\n \"variant 'inverse'\": variant === \"inverse\",\n \"variant 'inverse-ghost'\": variant === \"inverse-ghost\",\n });\n\n // Map deprecated variants to alternative ones\n const getVariant = (type: Variant) => {\n if (type === \"inverse\") {\n return \"basic\";\n }\n\n if (type === \"inverse-ghost\") {\n return \"secondary\";\n }\n\n return variant;\n };\n\n const buttonVariant = getVariant(variant);\n\n // Reshape class name and apply to outer element\n const classes = classNames(\n \"mobius\",\n \"mobius-button\",\n `--variant-${buttonVariant}`,\n `--size-${size}`,\n {\n \"--is-disabled\": isDisabled,\n \"--is-loading\": isLoading,\n \"--is-success\": isSuccess && !isLoading,\n },\n otherProps.className,\n );\n otherProps.className = classes;\n\n return (\n <Component ref={ref} {...buttonProps} {...otherProps}>\n {isLoading ? <Loading>{children}</Loading> : children}\n {isSuccess && !isLoading && <Success />}\n </Component>\n );\n });\n\nButton.displayName = \"Button\";\nexport { Button };\n"],"names":["Button","forwardRef","props","ref","children","elementType","Component","isDisabled","isLoading","isSuccess","variant","size","onPress","onClick","otherProps","buttonProps","useButton","useDeprecationWarning","getVariant","type","buttonVariant","classes","classNames","className","Loading","Success","displayName"],"mappings":"AAAA;;;;;+
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["\"use client\";\n\nimport { Ref, forwardRef, RefAttributes, ReactNode, MouseEvent } from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { Loading } from \"./Loading\";\nimport { UseButtonProps, useButton } from \"../../hooks/useButton\";\nimport { useDeprecationWarning } from \"../../hooks\";\nimport { Success } from \"./Success\";\n\nexport type ButtonElementType = HTMLButtonElement;\n\nexport type Variant =\n | \"primary\"\n | \"secondary\"\n | \"ghost\"\n | \"inverse\"\n | \"inverse-ghost\"\n | \"basic\"\n | \"link\";\n\nexport type Size = \"sm\" | \"md\" | \"lg\";\n\nexport interface ButtonProps\n extends UseButtonProps,\n DOMProps,\n RefAttributes<ButtonElementType> {\n /** The name of the button when submitted in a form */\n name?: string | undefined;\n /** The value of the button when submitted in a form */\n value?: string | undefined;\n /** Custom class name for setting specific CSS */\n className?: string;\n /** Shortlist of styles */\n variant?: Variant;\n size?: Size;\n /** Display loading spinner */\n isLoading?: boolean;\n /** Display success style */\n isSuccess?: boolean;\n onClick?: (event: MouseEvent<HTMLButtonElement>) => void;\n children?: ReactNode;\n}\n\nexport type ButtonRef = Ref<ButtonElementType>;\n\nconst Button: ForwardedRefComponent<ButtonProps, ButtonElementType> =\n forwardRef((props: ButtonProps, ref: ButtonRef) => {\n const {\n children,\n elementType: Component = \"button\",\n isDisabled,\n isLoading,\n isSuccess,\n variant = \"primary\",\n size = \"md\",\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onPress,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onClick,\n ...otherProps\n } = props;\n const { buttonProps } = useButton(props);\n\n useDeprecationWarning({\n \"variant 'inverse'\": variant === \"inverse\",\n \"variant 'inverse-ghost'\": variant === \"inverse-ghost\",\n });\n\n // Map deprecated variants to alternative ones\n const getVariant = (type: Variant) => {\n if (type === \"inverse\") {\n return \"basic\";\n }\n\n if (type === \"inverse-ghost\") {\n return \"secondary\";\n }\n\n return variant;\n };\n\n const buttonVariant = getVariant(variant);\n\n // Reshape class name and apply to outer element\n const classes = classNames(\n \"mobius\",\n \"mobius-button\",\n `--variant-${buttonVariant}`,\n `--size-${size}`,\n {\n \"--is-disabled\": isDisabled,\n \"--is-loading\": isLoading,\n \"--is-success\": isSuccess && !isLoading,\n },\n otherProps.className,\n );\n otherProps.className = classes;\n\n return (\n <Component ref={ref} {...buttonProps} {...otherProps}>\n {isLoading ? <Loading>{children}</Loading> : children}\n {isSuccess && !isLoading && <Success />}\n </Component>\n );\n });\n\nButton.displayName = \"Button\";\nexport { Button };\n"],"names":["Button","forwardRef","props","ref","children","elementType","Component","isDisabled","isLoading","isSuccess","variant","size","onPress","onClick","otherProps","buttonProps","useButton","useDeprecationWarning","getVariant","type","buttonVariant","classes","classNames","className","Loading","Success","displayName"],"mappings":"AAAA;;;;;+BA6GSA;;;eAAAA;;;;uBA3G6D;+DAC/C;yBAGC;2BACkB;uBACJ;yBACd;;;;;;AAsCxB,MAAMA,uBACJC,IAAAA,iBAAU,EAAC,CAACC,OAAoBC;IAC9B,MAAM,EACJC,QAAQ,EACRC,aAAaC,YAAY,QAAQ,EACjCC,UAAU,EACVC,SAAS,EACTC,SAAS,EACTC,UAAU,SAAS,EACnBC,OAAO,IAAI,EACX,6DAA6D;IAC7DC,OAAO,EACP,6DAA6D;IAC7DC,OAAO,EACP,GAAGC,YACJ,GAAGZ;IACJ,MAAM,EAAEa,WAAW,EAAE,GAAGC,IAAAA,oBAAS,EAACd;IAElCe,IAAAA,4BAAqB,EAAC;QACpB,qBAAqBP,YAAY;QACjC,2BAA2BA,YAAY;IACzC;IAEA,8CAA8C;IAC9C,MAAMQ,aAAa,CAACC;QAClB,IAAIA,SAAS,WAAW;YACtB,OAAO;QACT;QAEA,IAAIA,SAAS,iBAAiB;YAC5B,OAAO;QACT;QAEA,OAAOT;IACT;IAEA,MAAMU,gBAAgBF,WAAWR;IAEjC,gDAAgD;IAChD,MAAMW,UAAUC,IAAAA,eAAU,EACxB,UACA,iBACA,CAAC,UAAU,EAAEF,eAAe,EAC5B,CAAC,OAAO,EAAET,MAAM,EAChB;QACE,iBAAiBJ;QACjB,gBAAgBC;QAChB,gBAAgBC,aAAa,CAACD;IAChC,GACAM,WAAWS,SAAS;IAEtBT,WAAWS,SAAS,GAAGF;IAEvB,qBACE,sBAACf;QAAUH,KAAKA;QAAM,GAAGY,WAAW;QAAG,GAAGD,UAAU;;YACjDN,0BAAY,qBAACgB,gBAAO;0BAAEpB;iBAAsBA;YAC5CK,aAAa,CAACD,2BAAa,qBAACiB,gBAAO;;;AAG1C;AAEFzB,OAAO0B,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport classNames from \"classnames/dedupe\";\nimport {\n Ref,\n forwardRef,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { useDialog } from \"../../hooks\";\nimport { mergeRefs, supportsDialog } from \"../../utils\";\nimport { VisuallyHidden } from \"../VisuallyHidden\";\nimport { DrawerContext } from \"./DrawerContext\";\nimport { DrawerProps } from \"./types\";\n\nexport type DialogElementType = HTMLDialogElement;\nexport type DialogRef = Ref<DialogElementType>;\n\nconst TRANSITION_CSS_VARIABLE = \"--drawer-transition-duration\";\n\nconst Drawer = forwardRef((props: DrawerProps, ref: DialogRef) => {\n const {\n isOpen,\n className,\n closeLabel,\n direction,\n announce = \"Drawer opened on screen\",\n onOpen,\n onClose,\n children,\n } = props;\n const dialogRef = useRef<HTMLDialogElement | null>(null);\n const [shouldTransition, setShouldTransition] = useState(false);\n const { close } = useDialog({\n ref: dialogRef,\n isOpen,\n onOpen,\n onClose,\n transition: {\n isEnabled: true,\n CSSVariable: TRANSITION_CSS_VARIABLE,\n },\n });\n const hiddenId = `screen-reader-announce-${useId()}`;\n\n const dialogClasses = classNames(\n \"mobius\",\n \"mobius-drawer\",\n `--${direction}`,\n className,\n {\n \"--should-transition\": shouldTransition,\n },\n );\n\n useEffect(() => {\n setShouldTransition(supportsDialog());\n }, []);\n\n const contextValue = useMemo(\n () => ({\n onClose: close,\n closeLabel,\n }),\n [close, closeLabel],\n );\n\n return (\n <dialog\n id={useId()}\n ref={mergeRefs([dialogRef, ref])}\n onCancel={close}\n className={dialogClasses}\n aria-describedby={hiddenId}\n >\n <VisuallyHidden>\n <div id={hiddenId}>{announce}</div>\n </VisuallyHidden>\n <DrawerContext.Provider value={contextValue}>\n {children}\n </DrawerContext.Provider>\n </dialog>\n );\n});\n\nDrawer.displayName = \"Drawer\";\nexport { Drawer };\n"],"names":["Drawer","TRANSITION_CSS_VARIABLE","forwardRef","props","ref","isOpen","className","closeLabel","direction","announce","onOpen","onClose","children","dialogRef","useRef","shouldTransition","setShouldTransition","useState","close","useDialog","transition","isEnabled","CSSVariable","hiddenId","useId","dialogClasses","classNames","useEffect","supportsDialog","contextValue","useMemo","dialog","id","mergeRefs","onCancel","aria-describedby","VisuallyHidden","div","DrawerContext","Provider","value","displayName"],"mappings":"AAAA;;;;;+BAyFSA;;;eAAAA;;;;+DAvFc;uBAShB;uBACmB;uBACgB;gCACX;+BACD;;;;;;AAM9B,MAAMC,0BAA0B;AAEhC,MAAMD,uBAASE,IAAAA,iBAAU,EAAC,CAACC,OAAoBC;IAC7C,MAAM,EACJC,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,SAAS,EACTC,WAAW,yBAAyB,EACpCC,MAAM,EACNC,OAAO,EACPC,QAAQ,EACT,GAAGT;IACJ,MAAMU,YAAYC,IAAAA,aAAM,EAA2B;IACnD,MAAM,CAACC,kBAAkBC,oBAAoB,GAAGC,IAAAA,eAAQ,EAAC;IACzD,MAAM,EAAEC,KAAK,EAAE,GAAGC,IAAAA,gBAAS,EAAC;QAC1Bf,KAAKS;QACLR;QACAK;QACAC;QACAS,YAAY;YACVC,WAAW;YACXC,aAAarB;QACf;IACF;IACA,MAAMsB,WAAW,CAAC,uBAAuB,EAAEC,IAAAA,YAAK,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport classNames from \"classnames/dedupe\";\nimport {\n Ref,\n forwardRef,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { useDialog } from \"../../hooks\";\nimport { mergeRefs, supportsDialog } from \"../../utils\";\nimport { VisuallyHidden } from \"../VisuallyHidden\";\nimport { DrawerContext } from \"./DrawerContext\";\nimport { DrawerProps } from \"./types\";\n\nexport type DialogElementType = HTMLDialogElement;\nexport type DialogRef = Ref<DialogElementType>;\n\nconst TRANSITION_CSS_VARIABLE = \"--drawer-transition-duration\";\n\nconst Drawer = forwardRef((props: DrawerProps, ref: DialogRef) => {\n const {\n isOpen,\n className,\n closeLabel,\n direction,\n announce = \"Drawer opened on screen\",\n onOpen,\n onClose,\n children,\n } = props;\n const dialogRef = useRef<HTMLDialogElement | null>(null);\n const [shouldTransition, setShouldTransition] = useState(false);\n const { close } = useDialog({\n ref: dialogRef,\n isOpen,\n onOpen,\n onClose,\n transition: {\n isEnabled: true,\n CSSVariable: TRANSITION_CSS_VARIABLE,\n },\n });\n const hiddenId = `screen-reader-announce-${useId()}`;\n\n const dialogClasses = classNames(\n \"mobius\",\n \"mobius-drawer\",\n `--${direction}`,\n className,\n {\n \"--should-transition\": shouldTransition,\n },\n );\n\n useEffect(() => {\n setShouldTransition(supportsDialog());\n }, []);\n\n const contextValue = useMemo(\n () => ({\n onClose: close,\n closeLabel,\n }),\n [close, closeLabel],\n );\n\n return (\n <dialog\n id={useId()}\n ref={mergeRefs([dialogRef, ref])}\n onCancel={close}\n className={dialogClasses}\n aria-describedby={hiddenId}\n >\n <VisuallyHidden>\n <div id={hiddenId}>{announce}</div>\n </VisuallyHidden>\n <DrawerContext.Provider value={contextValue}>\n {children}\n </DrawerContext.Provider>\n </dialog>\n );\n});\n\nDrawer.displayName = \"Drawer\";\nexport { Drawer };\n"],"names":["Drawer","TRANSITION_CSS_VARIABLE","forwardRef","props","ref","isOpen","className","closeLabel","direction","announce","onOpen","onClose","children","dialogRef","useRef","shouldTransition","setShouldTransition","useState","close","useDialog","transition","isEnabled","CSSVariable","hiddenId","useId","dialogClasses","classNames","useEffect","supportsDialog","contextValue","useMemo","dialog","id","mergeRefs","onCancel","aria-describedby","VisuallyHidden","div","DrawerContext","Provider","value","displayName"],"mappings":"AAAA;;;;;+BAyFSA;;;eAAAA;;;;+DAvFc;uBAShB;uBACmB;uBACgB;gCACX;+BACD;;;;;;AAM9B,MAAMC,0BAA0B;AAEhC,MAAMD,uBAASE,IAAAA,iBAAU,EAAC,CAACC,OAAoBC;IAC7C,MAAM,EACJC,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,SAAS,EACTC,WAAW,yBAAyB,EACpCC,MAAM,EACNC,OAAO,EACPC,QAAQ,EACT,GAAGT;IACJ,MAAMU,YAAYC,IAAAA,aAAM,EAA2B;IACnD,MAAM,CAACC,kBAAkBC,oBAAoB,GAAGC,IAAAA,eAAQ,EAAC;IACzD,MAAM,EAAEC,KAAK,EAAE,GAAGC,IAAAA,gBAAS,EAAC;QAC1Bf,KAAKS;QACLR;QACAK;QACAC;QACAS,YAAY;YACVC,WAAW;YACXC,aAAarB;QACf;IACF;IACA,MAAMsB,WAAW,CAAC,uBAAuB,EAAEC,IAAAA,YAAK,KAAI;IAEpD,MAAMC,gBAAgBC,IAAAA,eAAU,EAC9B,UACA,iBACA,CAAC,EAAE,EAAElB,WAAW,EAChBF,WACA;QACE,uBAAuBS;IACzB;IAGFY,IAAAA,gBAAS,EAAC;QACRX,oBAAoBY,IAAAA,qBAAc;IACpC,GAAG,EAAE;IAEL,MAAMC,eAAeC,IAAAA,cAAO,EAC1B,IAAO,CAAA;YACLnB,SAASO;YACTX;QACF,CAAA,GACA;QAACW;QAAOX;KAAW;IAGrB,qBACE,sBAACwB;QACCC,IAAIR,IAAAA,YAAK;QACTpB,KAAK6B,IAAAA,gBAAS,EAAC;YAACpB;YAAWT;SAAI;QAC/B8B,UAAUhB;QACVZ,WAAWmB;QACXU,oBAAkBZ;;0BAElB,qBAACa,8BAAc;0BACb,cAAA,qBAACC;oBAAIL,IAAIT;8BAAWd;;;0BAEtB,qBAAC6B,4BAAa,CAACC,QAAQ;gBAACC,OAAOX;0BAC5BjB;;;;AAIT;AAEAZ,OAAOyC,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Grid/Item.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Ref,\n forwardRef,\n RefAttributes,\n useEffect,\n useState,\n CSSProperties,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\nimport { useBreakpoint } from \"../../hooks\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { SizeType } from \"../../types\";\n\nexport type GridItemElementType = HTMLDivElement;\n\nexport interface GridItemProps\n extends RefAttributes<GridItemElementType>,\n DOMProps {\n /** How many columns the item spans */\n span?: number | number[];\n /** React children */\n children?: React.ReactNode;\n /** How many columns the item spans on the smallest breakpoint */\n xs?: number;\n sm?: number;\n md?: number;\n lg?: number;\n xl?: number;\n /** How many columns the item spans on the largest breakpoint */\n xxl?: number;\n /** Aligns the grid item along the block (column) axis */\n alignSelf?: \"center\" | \"start\" | \"end\" | \"stretch\";\n /** Aligns the grid item along the inline (row) axis */\n justifySelf?: \"center\" | \"start\" | \"end\" | \"stretch\";\n /** Custom class name for setting specific CSS */\n className?: string;\n}\n\nexport const getBreakpointMap = (config: Partial<Record<SizeType, number>>) =>\n Object.entries(config).reduce((prev, [key, value]) => {\n const previous = Object.values(prev);\n const lastDefined = previous[previous.length - 1];\n return { ...prev, [key]: value || lastDefined };\n }, {});\n\nexport type GridItemRef = Ref<GridItemElementType>;\n\nexport const DEFAULT_SPAN = 12;\n\nconst GridItem: ForwardedRefComponent<GridItemProps, GridItemElementType> =\n forwardRef((props: GridItemProps, _ref: GridItemRef) => {\n const {\n breakpoint: { size: breakpointSize },\n } = useBreakpoint();\n const {\n span,\n xs = Array.isArray(span) ? DEFAULT_SPAN : span,\n sm,\n md,\n lg,\n xl,\n xxl,\n alignSelf,\n justifySelf,\n className,\n ...rest\n } = props;\n const breakpointMap = getBreakpointMap({\n xs,\n sm,\n md,\n lg,\n xl,\n xxl,\n });\n const [responsiveSpan, setResponsiveSpan] = useState();\n const classes = classNames(\"mobius-grid__item\", className);\n\n useEffect(() => {\n // @ts-expect-error\n setResponsiveSpan(breakpointMap[breakpointSize]);\n }, [breakpointSize, breakpointMap]);\n\n const styles: CSSProperties = {\n gridColumn: responsiveSpan ? `span ${responsiveSpan}` : undefined,\n alignSelf,\n justifySelf,\n };\n\n return <div style={{ ...styles }} className={classes} {...rest} />;\n });\n\nGridItem.displayName = \"GridItem\";\nexport { GridItem };\n"],"names":["DEFAULT_SPAN","GridItem","getBreakpointMap","config","Object","entries","reduce","prev","key","value","previous","values","lastDefined","length","forwardRef","props","_ref","breakpoint","size","breakpointSize","useBreakpoint","span","xs","Array","isArray","sm","md","lg","xl","xxl","alignSelf","justifySelf","className","rest","breakpointMap","responsiveSpan","setResponsiveSpan","useState","classes","classNames","useEffect","styles","gridColumn","undefined","div","style","displayName"],"mappings":"AAAA;;;;;;;;;;;;IAkDaA,YAAY;eAAZA;;IA8CJC,QAAQ;eAARA;;IAvDIC,gBAAgB;eAAhBA;;;;uBAhCN;+DACgB;uBAEO;;;;;;AA6BvB,MAAMA,mBAAmB,CAACC,SAC/BC,OAAOC,OAAO,CAACF,QAAQG,MAAM,CAAC,CAACC,MAAM,CAACC,KAAKC,MAAM;QAC/C,MAAMC,WAAWN,OAAOO,MAAM,CAACJ;QAC/B,MAAMK,cAAcF,QAAQ,CAACA,SAASG,MAAM,GAAG,EAAE;QACjD,OAAO;YAAE,GAAGN,IAAI;YAAE,CAACC,IAAI,EAAEC,SAASG;QAAY;IAChD,GAAG,CAAC;AAIC,MAAMZ,eAAe;AAE5B,MAAMC,yBACJa,IAAAA,iBAAU,EAAC,CAACC,OAAsBC;IAChC,MAAM,EACJC,YAAY,EAAEC,MAAMC,cAAc,EAAE,EACrC,GAAGC,IAAAA,oBAAa;IACjB,MAAM,EACJC,IAAI,EACJC,KAAKC,MAAMC,OAAO,CAACH,QAAQrB,eAAeqB,IAAI,EAC9CI,EAAE,EACFC,EAAE,EACFC,EAAE,EACFC,EAAE,EACFC,GAAG,EACHC,SAAS,EACTC,WAAW,EACXC,SAAS,EACT,GAAGC,MACJ,GAAGlB;IACJ,MAAMmB,gBAAgBhC,iBAAiB;QACrCoB;QACAG;QACAC;QACAC;QACAC;QACAC;IACF;IACA,MAAM,CAACM,gBAAgBC,kBAAkB,GAAGC,IAAAA,eAAQ;IACpD,MAAMC,UAAUC,IAAAA,eAAU,EAAC,qBAAqBP;IAEhDQ,IAAAA,gBAAS,EAAC;QACR,mBAAmB;QACnBJ,kBAAkBF,aAAa,CAACf,eAAe;IACjD,GAAG;QAACA;QAAgBe;KAAc;IAElC,MAAMO,SAAwB;QAC5BC,YAAYP,iBAAiB,CAAC,KAAK,EAAEA,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Grid/Item.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Ref,\n forwardRef,\n RefAttributes,\n useEffect,\n useState,\n CSSProperties,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\nimport { useBreakpoint } from \"../../hooks\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { SizeType } from \"../../types\";\n\nexport type GridItemElementType = HTMLDivElement;\n\nexport interface GridItemProps\n extends RefAttributes<GridItemElementType>,\n DOMProps {\n /** How many columns the item spans */\n span?: number | number[];\n /** React children */\n children?: React.ReactNode;\n /** How many columns the item spans on the smallest breakpoint */\n xs?: number;\n sm?: number;\n md?: number;\n lg?: number;\n xl?: number;\n /** How many columns the item spans on the largest breakpoint */\n xxl?: number;\n /** Aligns the grid item along the block (column) axis */\n alignSelf?: \"center\" | \"start\" | \"end\" | \"stretch\";\n /** Aligns the grid item along the inline (row) axis */\n justifySelf?: \"center\" | \"start\" | \"end\" | \"stretch\";\n /** Custom class name for setting specific CSS */\n className?: string;\n}\n\nexport const getBreakpointMap = (config: Partial<Record<SizeType, number>>) =>\n Object.entries(config).reduce((prev, [key, value]) => {\n const previous = Object.values(prev);\n const lastDefined = previous[previous.length - 1];\n return { ...prev, [key]: value || lastDefined };\n }, {});\n\nexport type GridItemRef = Ref<GridItemElementType>;\n\nexport const DEFAULT_SPAN = 12;\n\nconst GridItem: ForwardedRefComponent<GridItemProps, GridItemElementType> =\n forwardRef((props: GridItemProps, _ref: GridItemRef) => {\n const {\n breakpoint: { size: breakpointSize },\n } = useBreakpoint();\n const {\n span,\n xs = Array.isArray(span) ? DEFAULT_SPAN : span,\n sm,\n md,\n lg,\n xl,\n xxl,\n alignSelf,\n justifySelf,\n className,\n ...rest\n } = props;\n const breakpointMap = getBreakpointMap({\n xs,\n sm,\n md,\n lg,\n xl,\n xxl,\n });\n const [responsiveSpan, setResponsiveSpan] = useState();\n const classes = classNames(\"mobius-grid__item\", className);\n\n useEffect(() => {\n // @ts-expect-error\n setResponsiveSpan(breakpointMap[breakpointSize]);\n }, [breakpointSize, breakpointMap]);\n\n const styles: CSSProperties = {\n gridColumn: responsiveSpan ? `span ${responsiveSpan}` : undefined,\n alignSelf,\n justifySelf,\n };\n\n return <div style={{ ...styles }} className={classes} {...rest} />;\n });\n\nGridItem.displayName = \"GridItem\";\nexport { GridItem };\n"],"names":["DEFAULT_SPAN","GridItem","getBreakpointMap","config","Object","entries","reduce","prev","key","value","previous","values","lastDefined","length","forwardRef","props","_ref","breakpoint","size","breakpointSize","useBreakpoint","span","xs","Array","isArray","sm","md","lg","xl","xxl","alignSelf","justifySelf","className","rest","breakpointMap","responsiveSpan","setResponsiveSpan","useState","classes","classNames","useEffect","styles","gridColumn","undefined","div","style","displayName"],"mappings":"AAAA;;;;;;;;;;;;IAkDaA,YAAY;eAAZA;;IA8CJC,QAAQ;eAARA;;IAvDIC,gBAAgB;eAAhBA;;;;uBAhCN;+DACgB;uBAEO;;;;;;AA6BvB,MAAMA,mBAAmB,CAACC,SAC/BC,OAAOC,OAAO,CAACF,QAAQG,MAAM,CAAC,CAACC,MAAM,CAACC,KAAKC,MAAM;QAC/C,MAAMC,WAAWN,OAAOO,MAAM,CAACJ;QAC/B,MAAMK,cAAcF,QAAQ,CAACA,SAASG,MAAM,GAAG,EAAE;QACjD,OAAO;YAAE,GAAGN,IAAI;YAAE,CAACC,IAAI,EAAEC,SAASG;QAAY;IAChD,GAAG,CAAC;AAIC,MAAMZ,eAAe;AAE5B,MAAMC,yBACJa,IAAAA,iBAAU,EAAC,CAACC,OAAsBC;IAChC,MAAM,EACJC,YAAY,EAAEC,MAAMC,cAAc,EAAE,EACrC,GAAGC,IAAAA,oBAAa;IACjB,MAAM,EACJC,IAAI,EACJC,KAAKC,MAAMC,OAAO,CAACH,QAAQrB,eAAeqB,IAAI,EAC9CI,EAAE,EACFC,EAAE,EACFC,EAAE,EACFC,EAAE,EACFC,GAAG,EACHC,SAAS,EACTC,WAAW,EACXC,SAAS,EACT,GAAGC,MACJ,GAAGlB;IACJ,MAAMmB,gBAAgBhC,iBAAiB;QACrCoB;QACAG;QACAC;QACAC;QACAC;QACAC;IACF;IACA,MAAM,CAACM,gBAAgBC,kBAAkB,GAAGC,IAAAA,eAAQ;IACpD,MAAMC,UAAUC,IAAAA,eAAU,EAAC,qBAAqBP;IAEhDQ,IAAAA,gBAAS,EAAC;QACR,mBAAmB;QACnBJ,kBAAkBF,aAAa,CAACf,eAAe;IACjD,GAAG;QAACA;QAAgBe;KAAc;IAElC,MAAMO,SAAwB;QAC5BC,YAAYP,iBAAiB,CAAC,KAAK,EAAEA,gBAAgB,GAAGQ;QACxDb;QACAC;IACF;IAEA,qBAAO,qBAACa;QAAIC,OAAO;YAAE,GAAGJ,MAAM;QAAC;QAAGT,WAAWM;QAAU,GAAGL,IAAI;;AAChE;AAEFhC,SAAS6C,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import classNames from \"classnames/dedupe\";\nimport { IconProps } from \"./types\";\n\nconst ICON_PREFIX = \"mobius-icon\";\n\nconst capitaliseFirstLetter = (str: string) =>\n str.charAt(0).toUpperCase() + str.slice(1);\n\nexport function Icon({\n icon,\n className,\n size = \"xs\",\n color,\n fixedWidth,\n spin,\n spinReverse,\n title,\n ...otherProps\n}: IconProps) {\n if (!icon) {\n throw new Error(\"Must specify icon object\");\n }\n\n const classes = classNames(\n \"mobius\",\n \"mobius-icon\",\n `svg-inline--${ICON_PREFIX}`,\n `--size-${size}`,\n className,\n {\n [`${ICON_PREFIX}-fw`]: fixedWidth,\n [`${ICON_PREFIX}-spin`]: spin || spinReverse,\n [`${ICON_PREFIX}-spin-reverse`]: spinReverse,\n },\n );\n\n const { iconName, width, height, svgPathData } = icon;\n const formattedIconName = iconName.split(\"-\").join(\" \");\n\n const defaultTitle = `${capitaliseFirstLetter(formattedIconName)} icon`;\n const titleText = title || defaultTitle;\n\n return (\n <svg\n aria-hidden=\"true\"\n focusable=\"false\"\n data-icon={iconName}\n className={classes}\n role=\"img\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox={`0 0 ${width} ${height}`}\n style={{ color }}\n {...otherProps}\n >\n <title>{titleText}</title>\n <path fill=\"currentColor\" d={svgPathData} />\n </svg>\n );\n}\n"],"names":["Icon","ICON_PREFIX","capitaliseFirstLetter","str","charAt","toUpperCase","slice","icon","className","size","color","fixedWidth","spin","spinReverse","title","otherProps","Error","classes","classNames","iconName","width","height","svgPathData","formattedIconName","split","join","defaultTitle","titleText","svg","aria-hidden","focusable","data-icon","role","xmlns","viewBox","style","path","fill","d"],"mappings":";;;;+BAQgBA;;;eAAAA;;;;+DARO;;;;;;AAGvB,MAAMC,cAAc;AAEpB,MAAMC,wBAAwB,CAACC,MAC7BA,IAAIC,MAAM,CAAC,GAAGC,WAAW,KAAKF,IAAIG,KAAK,CAAC;AAEnC,SAASN,KAAK,EACnBO,IAAI,EACJC,SAAS,EACTC,OAAO,IAAI,EACXC,KAAK,EACLC,UAAU,EACVC,IAAI,EACJC,WAAW,EACXC,KAAK,EACL,GAAGC,YACO;IACV,IAAI,CAACR,MAAM;QACT,MAAM,IAAIS,MAAM;IAClB;IAEA,MAAMC,UAAUC,IAAAA,eAAU,EACxB,UACA,eACA,CAAC,YAAY,EAAEjB,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import classNames from \"classnames/dedupe\";\nimport { IconProps } from \"./types\";\n\nconst ICON_PREFIX = \"mobius-icon\";\n\nconst capitaliseFirstLetter = (str: string) =>\n str.charAt(0).toUpperCase() + str.slice(1);\n\nexport function Icon({\n icon,\n className,\n size = \"xs\",\n color,\n fixedWidth,\n spin,\n spinReverse,\n title,\n ...otherProps\n}: IconProps) {\n if (!icon) {\n throw new Error(\"Must specify icon object\");\n }\n\n const classes = classNames(\n \"mobius\",\n \"mobius-icon\",\n `svg-inline--${ICON_PREFIX}`,\n `--size-${size}`,\n className,\n {\n [`${ICON_PREFIX}-fw`]: fixedWidth,\n [`${ICON_PREFIX}-spin`]: spin || spinReverse,\n [`${ICON_PREFIX}-spin-reverse`]: spinReverse,\n },\n );\n\n const { iconName, width, height, svgPathData } = icon;\n const formattedIconName = iconName.split(\"-\").join(\" \");\n\n const defaultTitle = `${capitaliseFirstLetter(formattedIconName)} icon`;\n const titleText = title || defaultTitle;\n\n return (\n <svg\n aria-hidden=\"true\"\n focusable=\"false\"\n data-icon={iconName}\n className={classes}\n role=\"img\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox={`0 0 ${width} ${height}`}\n style={{ color }}\n {...otherProps}\n >\n <title>{titleText}</title>\n <path fill=\"currentColor\" d={svgPathData} />\n </svg>\n );\n}\n"],"names":["Icon","ICON_PREFIX","capitaliseFirstLetter","str","charAt","toUpperCase","slice","icon","className","size","color","fixedWidth","spin","spinReverse","title","otherProps","Error","classes","classNames","iconName","width","height","svgPathData","formattedIconName","split","join","defaultTitle","titleText","svg","aria-hidden","focusable","data-icon","role","xmlns","viewBox","style","path","fill","d"],"mappings":";;;;+BAQgBA;;;eAAAA;;;;+DARO;;;;;;AAGvB,MAAMC,cAAc;AAEpB,MAAMC,wBAAwB,CAACC,MAC7BA,IAAIC,MAAM,CAAC,GAAGC,WAAW,KAAKF,IAAIG,KAAK,CAAC;AAEnC,SAASN,KAAK,EACnBO,IAAI,EACJC,SAAS,EACTC,OAAO,IAAI,EACXC,KAAK,EACLC,UAAU,EACVC,IAAI,EACJC,WAAW,EACXC,KAAK,EACL,GAAGC,YACO;IACV,IAAI,CAACR,MAAM;QACT,MAAM,IAAIS,MAAM;IAClB;IAEA,MAAMC,UAAUC,IAAAA,eAAU,EACxB,UACA,eACA,CAAC,YAAY,EAAEjB,aAAa,EAC5B,CAAC,OAAO,EAAEQ,MAAM,EAChBD,WACA;QACE,CAAC,GAAGP,YAAY,GAAG,CAAC,CAAC,EAAEU;QACvB,CAAC,GAAGV,YAAY,KAAK,CAAC,CAAC,EAAEW,QAAQC;QACjC,CAAC,GAAGZ,YAAY,aAAa,CAAC,CAAC,EAAEY;IACnC;IAGF,MAAM,EAAEM,QAAQ,EAAEC,KAAK,EAAEC,MAAM,EAAEC,WAAW,EAAE,GAAGf;IACjD,MAAMgB,oBAAoBJ,SAASK,KAAK,CAAC,KAAKC,IAAI,CAAC;IAEnD,MAAMC,eAAe,GAAGxB,sBAAsBqB,mBAAmB,KAAK,CAAC;IACvE,MAAMI,YAAYb,SAASY;IAE3B,qBACE,sBAACE;QACCC,eAAY;QACZC,WAAU;QACVC,aAAWZ;QACXX,WAAWS;QACXe,MAAK;QACLC,OAAM;QACNC,SAAS,CAAC,IAAI,EAAEd,MAAM,CAAC,EAAEC,QAAQ;QACjCc,OAAO;YAAEzB;QAAM;QACd,GAAGK,UAAU;;0BAEd,qBAACD;0BAAOa;;0BACR,qBAACS;gBAAKC,MAAK;gBAAeC,GAAGhB;;;;AAGnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/List/List.tsx"],"sourcesContent":["import {\n Ref,\n Children,\n cloneElement,\n forwardRef,\n ReactNode,\n RefAttributes,\n isValidElement,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\nimport { ForwardedRefComponent } from \"../../types/components\";\n\nexport type ListElementType = HTMLOListElement | HTMLUListElement;\nexport type ListStyleType =\n | \"disc\"\n | \"circle\"\n | \"square\"\n | \"decimal\"\n | \"georgian\"\n | \"trad-chinese-informal\"\n | \"kannada\";\n\nexport interface ListProps extends DOMProps, RefAttributes<ListElementType> {\n children?: ReactNode;\n isOrdered?: boolean;\n isReversed?: boolean;\n start?: number;\n liststyletype?: ListStyleType;\n icon?: ReactNode;\n className?: string;\n}\n\nexport type ListRef = Ref<ListElementType>;\n\nconst List: ForwardedRefComponent<ListProps, ListElementType> = forwardRef(\n (props: ListProps, ref: ListRef) => {\n const Component = props.isOrdered ? \"ol\" : \"ul\";\n const { children, icon, ...otherProps } = props;\n\n // Remove props that should not exist on ol or ul element\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { isOrdered, liststyletype, isReversed, ...restProps } = otherProps;\n\n const mappedProps = {\n ...restProps,\n reversed: isReversed,\n };\n\n const classes = classNames(\n \"mobius\",\n \"mobius-list\",\n {\n \"--has-icon\": icon,\n [`--is-${liststyletype}`]: liststyletype,\n },\n otherProps.className,\n );\n\n return (\n <Component ref={ref as any} {...mappedProps} className={classes}>\n {Children.map(children, child => {\n if (isValidElement(child)) {\n return cloneElement(child, {\n parentIcon: icon,\n } as any);\n }\n\n return child;\n })}\n </Component>\n );\n },\n);\n\nList.displayName = \"List\";\nexport { List };\n"],"names":["List","forwardRef","props","ref","Component","isOrdered","children","icon","otherProps","liststyletype","isReversed","restProps","mappedProps","reversed","classes","classNames","className","Children","map","child","isValidElement","cloneElement","parentIcon","displayName"],"mappings":";;;;+BA4ESA;;;eAAAA;;;;uBApEF;+DACgB;;;;;;AA0BvB,MAAMA,qBAA0DC,IAAAA,iBAAU,EACxE,CAACC,OAAkBC;IACjB,MAAMC,YAAYF,MAAMG,SAAS,GAAG,OAAO;IAC3C,MAAM,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGC,YAAY,GAAGN;IAE1C,yDAAyD;IACzD,6DAA6D;IAC7D,MAAM,EAAEG,SAAS,EAAEI,aAAa,EAAEC,UAAU,EAAE,GAAGC,WAAW,GAAGH;IAE/D,MAAMI,cAAc;QAClB,GAAGD,SAAS;QACZE,UAAUH;IACZ;IAEA,MAAMI,UAAUC,IAAAA,eAAU,EACxB,UACA,eACA;QACE,cAAcR;QACd,CAAC,CAAC,KAAK,EAAEE,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/List/List.tsx"],"sourcesContent":["import {\n Ref,\n Children,\n cloneElement,\n forwardRef,\n ReactNode,\n RefAttributes,\n isValidElement,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\nimport { ForwardedRefComponent } from \"../../types/components\";\n\nexport type ListElementType = HTMLOListElement | HTMLUListElement;\nexport type ListStyleType =\n | \"disc\"\n | \"circle\"\n | \"square\"\n | \"decimal\"\n | \"georgian\"\n | \"trad-chinese-informal\"\n | \"kannada\";\n\nexport interface ListProps extends DOMProps, RefAttributes<ListElementType> {\n children?: ReactNode;\n isOrdered?: boolean;\n isReversed?: boolean;\n start?: number;\n liststyletype?: ListStyleType;\n icon?: ReactNode;\n className?: string;\n}\n\nexport type ListRef = Ref<ListElementType>;\n\nconst List: ForwardedRefComponent<ListProps, ListElementType> = forwardRef(\n (props: ListProps, ref: ListRef) => {\n const Component = props.isOrdered ? \"ol\" : \"ul\";\n const { children, icon, ...otherProps } = props;\n\n // Remove props that should not exist on ol or ul element\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { isOrdered, liststyletype, isReversed, ...restProps } = otherProps;\n\n const mappedProps = {\n ...restProps,\n reversed: isReversed,\n };\n\n const classes = classNames(\n \"mobius\",\n \"mobius-list\",\n {\n \"--has-icon\": icon,\n [`--is-${liststyletype}`]: liststyletype,\n },\n otherProps.className,\n );\n\n return (\n <Component ref={ref as any} {...mappedProps} className={classes}>\n {Children.map(children, child => {\n if (isValidElement(child)) {\n return cloneElement(child, {\n parentIcon: icon,\n } as any);\n }\n\n return child;\n })}\n </Component>\n );\n },\n);\n\nList.displayName = \"List\";\nexport { List };\n"],"names":["List","forwardRef","props","ref","Component","isOrdered","children","icon","otherProps","liststyletype","isReversed","restProps","mappedProps","reversed","classes","classNames","className","Children","map","child","isValidElement","cloneElement","parentIcon","displayName"],"mappings":";;;;+BA4ESA;;;eAAAA;;;;uBApEF;+DACgB;;;;;;AA0BvB,MAAMA,qBAA0DC,IAAAA,iBAAU,EACxE,CAACC,OAAkBC;IACjB,MAAMC,YAAYF,MAAMG,SAAS,GAAG,OAAO;IAC3C,MAAM,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGC,YAAY,GAAGN;IAE1C,yDAAyD;IACzD,6DAA6D;IAC7D,MAAM,EAAEG,SAAS,EAAEI,aAAa,EAAEC,UAAU,EAAE,GAAGC,WAAW,GAAGH;IAE/D,MAAMI,cAAc;QAClB,GAAGD,SAAS;QACZE,UAAUH;IACZ;IAEA,MAAMI,UAAUC,IAAAA,eAAU,EACxB,UACA,eACA;QACE,cAAcR;QACd,CAAC,CAAC,KAAK,EAAEE,eAAe,CAAC,EAAEA;IAC7B,GACAD,WAAWQ,SAAS;IAGtB,qBACE,qBAACZ;QAAUD,KAAKA;QAAa,GAAGS,WAAW;QAAEI,WAAWF;kBACrDG,eAAQ,CAACC,GAAG,CAACZ,UAAUa,CAAAA;YACtB,kBAAIC,IAAAA,qBAAc,EAACD,QAAQ;gBACzB,qBAAOE,IAAAA,mBAAY,EAACF,OAAO;oBACzBG,YAAYf;gBACd;YACF;YAEA,OAAOY;QACT;;AAGN;AAGFnB,KAAKuB,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/PasswordField/ShowHideButton.tsx"],"sourcesContent":["export interface ShowHideButtonProps {\n show?: boolean;\n onClick: () => void;\n}\n\nexport const ShowHideButton = ({\n show = false,\n onClick,\n}: ShowHideButtonProps) => (\n <button\n className=\"mobius-password-field__show-button\"\n type=\"button\"\n onClick={e => {\n e.preventDefault();\n onClick();\n }}\n aria-label={`${show ? \"Hide\" : \"Show\"} password`}\n data-testid=\"show-hide-button\"\n >\n {show ? \"hide\" : \"show\"}\n </button>\n);\n"],"names":["ShowHideButton","show","onClick","button","className","type","e","preventDefault","aria-label","data-testid"],"mappings":";;;;+BAKaA;;;eAAAA;;;;AAAN,MAAMA,iBAAiB,CAAC,EAC7BC,OAAO,KAAK,EACZC,OAAO,EACa,iBACpB,qBAACC;QACCC,WAAU;QACVC,MAAK;QACLH,SAASI,CAAAA;YACPA,EAAEC,cAAc;YAChBL;QACF;QACAM,cAAY,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/PasswordField/ShowHideButton.tsx"],"sourcesContent":["export interface ShowHideButtonProps {\n show?: boolean;\n onClick: () => void;\n}\n\nexport const ShowHideButton = ({\n show = false,\n onClick,\n}: ShowHideButtonProps) => (\n <button\n className=\"mobius-password-field__show-button\"\n type=\"button\"\n onClick={e => {\n e.preventDefault();\n onClick();\n }}\n aria-label={`${show ? \"Hide\" : \"Show\"} password`}\n data-testid=\"show-hide-button\"\n >\n {show ? \"hide\" : \"show\"}\n </button>\n);\n"],"names":["ShowHideButton","show","onClick","button","className","type","e","preventDefault","aria-label","data-testid"],"mappings":";;;;+BAKaA;;;eAAAA;;;;AAAN,MAAMA,iBAAiB,CAAC,EAC7BC,OAAO,KAAK,EACZC,OAAO,EACa,iBACpB,qBAACC;QACCC,WAAU;QACVC,MAAK;QACLH,SAASI,CAAAA;YACPA,EAAEC,cAAc;YAChBL;QACF;QACAM,cAAY,GAAGP,OAAO,SAAS,OAAO,SAAS,CAAC;QAChDQ,eAAY;kBAEXR,OAAO,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Progress/Progress.tsx"],"sourcesContent":["\"use client\";\n\n/* eslint no-console: \"off\" */\nimport type { AriaProgressBarProps } from \"@react-types/progress\";\nimport classNames from \"classnames/dedupe\";\nimport { ReactNode, Ref, RefAttributes, forwardRef, useId } from \"react\";\nimport { DOMProps } from \"../../types/dom\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { Label } from \"../Label\";\nimport { VisuallyHidden } from \"../VisuallyHidden\";\n\nexport type ProgressElementType = HTMLDivElement;\n\nexport interface ProgressProps\n extends Omit<AriaProgressBarProps, \"label\">,\n DOMProps,\n RefAttributes<ProgressElementType> {\n label: ReactNode;\n children?: ReactNode;\n /** Custom class name for setting specific CSS */\n id?: string;\n className?: string;\n showLabel?: boolean;\n showValueLabel?: boolean;\n variant?: \"primary\" | \"secondary\" | \"success\" | \"danger\" | \"warning\" | \"info\";\n value?: number;\n minValue?: number;\n maxValue?: number;\n valueFormatter?: (\n value: number,\n minValue: number,\n maxValue: number,\n ) => string;\n}\n\nexport type ProgressRef = Ref<ProgressElementType>;\n\nfunction warnAboutInvalidValues(\n value: number,\n minValue: number,\n maxValue: number,\n) {\n if (minValue > maxValue) {\n console.warn(\"minValue is greater than maxValue\");\n }\n if (value < minValue) {\n console.warn(\"Progress value is less than minValue\");\n }\n if (value > maxValue) {\n console.warn(\"Progress value is greater than maxValue\");\n }\n}\n\nconst sanitizedValue = (\n value: number | undefined,\n defaultValue: number,\n): number => {\n const numberValue = parseFloat(value as any);\n return Number.isNaN(numberValue) ? defaultValue : numberValue;\n};\n\nconst getLabelComponent = (\n label: ReactNode,\n progressLabelId: string,\n showLabel: boolean,\n) => {\n if (showLabel) {\n return (\n <Label\n id={progressLabelId}\n className=\"mobius-progress__label\"\n elementType=\"span\"\n >\n {label}\n </Label>\n );\n }\n\n return (\n <VisuallyHidden>\n <Label\n id={progressLabelId}\n className=\"mobius-progress__label\"\n elementType=\"span\"\n >\n {label}\n </Label>\n </VisuallyHidden>\n );\n};\n\nconst DEFAULT_VALUE = 0;\nconst DEFAULT_MIN_VALUE = 0;\nconst DEFAULT_MAX_VALUE = 100;\n\nconst Progress: ForwardedRefComponent<ProgressProps, ProgressElementType> =\n forwardRef((props: ProgressProps, ref: ProgressRef) => {\n const progressId = useId();\n const progressLabelId = useId();\n const {\n id,\n label,\n showLabel = true,\n showValueLabel = !!label,\n valueFormatter,\n variant = \"primary\",\n className,\n } = props;\n\n let { value, minValue, maxValue } = props;\n\n value = sanitizedValue(value, DEFAULT_VALUE);\n minValue = sanitizedValue(minValue, DEFAULT_MIN_VALUE);\n maxValue = sanitizedValue(maxValue, DEFAULT_MAX_VALUE);\n\n // Will never happen but lets appease the typescript gods\n if (\n value === undefined ||\n minValue === undefined ||\n maxValue === undefined\n ) {\n return null;\n }\n\n warnAboutInvalidValues(value, minValue, maxValue);\n\n // Calculate the width of the progress bar as a percentage\n const clamp = (num: number, min: number, max: number): number =>\n Math.min(Math.max(num, min), max);\n const percentage = clamp(\n Math.round(((value - minValue) / (maxValue - minValue)) * 100),\n 0,\n 100,\n );\n const barWidth = `${percentage}%`;\n\n const classes = classNames(\"mobius\", \"mobius-progress\", className, {\n \"--is-primary\": variant === \"primary\",\n \"--is-secondary\": variant === \"secondary\",\n });\n\n // Set progress aria values\n const progressBarProps: Record<string, string> = {};\n progressBarProps[\"aria-valuemin\"] = minValue.toString();\n progressBarProps[\"aria-valuemax\"] = maxValue.toString();\n progressBarProps[\"aria-valuenow\"] = value.toString();\n progressBarProps[\"aria-valuetext\"] =\n valueFormatter instanceof Function\n ? valueFormatter(value, minValue, maxValue!)\n : barWidth;\n const labelComponent = getLabelComponent(label, progressLabelId, showLabel);\n\n return (\n <div\n id={id || progressId}\n {...progressBarProps}\n ref={ref}\n className={classes}\n role=\"progressbar\"\n aria-labelledby={progressLabelId}\n >\n {labelComponent}\n <div className=\"mobius-progress__track\">\n <div className=\"mobius-progress__bar\" style={{ width: barWidth }} />\n </div>\n {showValueLabel && (\n <Label data-testid=\"value-label\" elementType=\"span\">\n {progressBarProps[\"aria-valuetext\"]}\n </Label>\n )}\n </div>\n );\n });\n\nProgress.displayName = \"Progress\";\nexport { Progress };\n"],"names":["Progress","warnAboutInvalidValues","value","minValue","maxValue","console","warn","sanitizedValue","defaultValue","numberValue","parseFloat","Number","isNaN","getLabelComponent","label","progressLabelId","showLabel","Label","id","className","elementType","VisuallyHidden","DEFAULT_VALUE","DEFAULT_MIN_VALUE","DEFAULT_MAX_VALUE","forwardRef","props","ref","progressId","useId","showValueLabel","valueFormatter","variant","undefined","clamp","num","min","max","Math","percentage","round","barWidth","classes","classNames","progressBarProps","toString","Function","labelComponent","div","role","aria-labelledby","style","width","data-testid","displayName"],"mappings":"AAAA;;;;;+BA+KSA;;;eAAAA;;;;+DA3Kc;uBAC0C;uBAG3C;gCACS;;;;;;AA4B/B,SAASC,uBACPC,KAAa,EACbC,QAAgB,EAChBC,QAAgB;IAEhB,IAAID,WAAWC,UAAU;QACvBC,QAAQC,IAAI,CAAC;IACf;IACA,IAAIJ,QAAQC,UAAU;QACpBE,QAAQC,IAAI,CAAC;IACf;IACA,IAAIJ,QAAQE,UAAU;QACpBC,QAAQC,IAAI,CAAC;IACf;AACF;AAEA,MAAMC,iBAAiB,CACrBL,OACAM;IAEA,MAAMC,cAAcC,WAAWR;IAC/B,OAAOS,OAAOC,KAAK,CAACH,eAAeD,eAAeC;AACpD;AAEA,MAAMI,oBAAoB,CACxBC,OACAC,iBACAC;IAEA,IAAIA,WAAW;QACb,qBACE,qBAACC,YAAK;YACJC,IAAIH;YACJI,WAAU;YACVC,aAAY;sBAEXN;;IAGP;IAEA,qBACE,qBAACO,8BAAc;kBACb,cAAA,qBAACJ,YAAK;YACJC,IAAIH;YACJI,WAAU;YACVC,aAAY;sBAEXN;;;AAIT;AAEA,MAAMQ,gBAAgB;AACtB,MAAMC,oBAAoB;AAC1B,MAAMC,oBAAoB;AAE1B,MAAMxB,yBACJyB,IAAAA,iBAAU,EAAC,CAACC,OAAsBC;IAChC,MAAMC,aAAaC,IAAAA,YAAK;IACxB,MAAMd,kBAAkBc,IAAAA,YAAK;IAC7B,MAAM,EACJX,EAAE,EACFJ,KAAK,EACLE,YAAY,IAAI,EAChBc,iBAAiB,CAAC,CAAChB,KAAK,EACxBiB,cAAc,EACdC,UAAU,SAAS,EACnBb,SAAS,EACV,GAAGO;IAEJ,IAAI,EAAExB,KAAK,EAAEC,QAAQ,EAAEC,QAAQ,EAAE,GAAGsB;IAEpCxB,QAAQK,eAAeL,OAAOoB;IAC9BnB,WAAWI,eAAeJ,UAAUoB;IACpCnB,WAAWG,eAAeH,UAAUoB;IAEpC,yDAAyD;IACzD,IACEtB,UAAU+B,aACV9B,aAAa8B,aACb7B,aAAa6B,WACb;QACA,OAAO;IACT;IAEAhC,uBAAuBC,OAAOC,UAAUC;IAExC,0DAA0D;IAC1D,MAAM8B,QAAQ,CAACC,KAAaC,KAAaC,MACvCC,KAAKF,GAAG,CAACE,KAAKD,GAAG,CAACF,KAAKC,MAAMC;IAC/B,MAAME,aAAaL,MACjBI,KAAKE,KAAK,CAAC,AAAEtC,CAAAA,QAAQC,QAAO,IAAMC,CAAAA,WAAWD,QAAO,IAAM,MAC1D,GACA;IAEF,MAAMsC,WAAW,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Progress/Progress.tsx"],"sourcesContent":["\"use client\";\n\n/* eslint no-console: \"off\" */\nimport type { AriaProgressBarProps } from \"@react-types/progress\";\nimport classNames from \"classnames/dedupe\";\nimport { ReactNode, Ref, RefAttributes, forwardRef, useId } from \"react\";\nimport { DOMProps } from \"../../types/dom\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { Label } from \"../Label\";\nimport { VisuallyHidden } from \"../VisuallyHidden\";\n\nexport type ProgressElementType = HTMLDivElement;\n\nexport interface ProgressProps\n extends Omit<AriaProgressBarProps, \"label\">,\n DOMProps,\n RefAttributes<ProgressElementType> {\n label: ReactNode;\n children?: ReactNode;\n /** Custom class name for setting specific CSS */\n id?: string;\n className?: string;\n showLabel?: boolean;\n showValueLabel?: boolean;\n variant?: \"primary\" | \"secondary\" | \"success\" | \"danger\" | \"warning\" | \"info\";\n value?: number;\n minValue?: number;\n maxValue?: number;\n valueFormatter?: (\n value: number,\n minValue: number,\n maxValue: number,\n ) => string;\n}\n\nexport type ProgressRef = Ref<ProgressElementType>;\n\nfunction warnAboutInvalidValues(\n value: number,\n minValue: number,\n maxValue: number,\n) {\n if (minValue > maxValue) {\n console.warn(\"minValue is greater than maxValue\");\n }\n if (value < minValue) {\n console.warn(\"Progress value is less than minValue\");\n }\n if (value > maxValue) {\n console.warn(\"Progress value is greater than maxValue\");\n }\n}\n\nconst sanitizedValue = (\n value: number | undefined,\n defaultValue: number,\n): number => {\n const numberValue = parseFloat(value as any);\n return Number.isNaN(numberValue) ? defaultValue : numberValue;\n};\n\nconst getLabelComponent = (\n label: ReactNode,\n progressLabelId: string,\n showLabel: boolean,\n) => {\n if (showLabel) {\n return (\n <Label\n id={progressLabelId}\n className=\"mobius-progress__label\"\n elementType=\"span\"\n >\n {label}\n </Label>\n );\n }\n\n return (\n <VisuallyHidden>\n <Label\n id={progressLabelId}\n className=\"mobius-progress__label\"\n elementType=\"span\"\n >\n {label}\n </Label>\n </VisuallyHidden>\n );\n};\n\nconst DEFAULT_VALUE = 0;\nconst DEFAULT_MIN_VALUE = 0;\nconst DEFAULT_MAX_VALUE = 100;\n\nconst Progress: ForwardedRefComponent<ProgressProps, ProgressElementType> =\n forwardRef((props: ProgressProps, ref: ProgressRef) => {\n const progressId = useId();\n const progressLabelId = useId();\n const {\n id,\n label,\n showLabel = true,\n showValueLabel = !!label,\n valueFormatter,\n variant = \"primary\",\n className,\n } = props;\n\n let { value, minValue, maxValue } = props;\n\n value = sanitizedValue(value, DEFAULT_VALUE);\n minValue = sanitizedValue(minValue, DEFAULT_MIN_VALUE);\n maxValue = sanitizedValue(maxValue, DEFAULT_MAX_VALUE);\n\n // Will never happen but lets appease the typescript gods\n if (\n value === undefined ||\n minValue === undefined ||\n maxValue === undefined\n ) {\n return null;\n }\n\n warnAboutInvalidValues(value, minValue, maxValue);\n\n // Calculate the width of the progress bar as a percentage\n const clamp = (num: number, min: number, max: number): number =>\n Math.min(Math.max(num, min), max);\n const percentage = clamp(\n Math.round(((value - minValue) / (maxValue - minValue)) * 100),\n 0,\n 100,\n );\n const barWidth = `${percentage}%`;\n\n const classes = classNames(\"mobius\", \"mobius-progress\", className, {\n \"--is-primary\": variant === \"primary\",\n \"--is-secondary\": variant === \"secondary\",\n });\n\n // Set progress aria values\n const progressBarProps: Record<string, string> = {};\n progressBarProps[\"aria-valuemin\"] = minValue.toString();\n progressBarProps[\"aria-valuemax\"] = maxValue.toString();\n progressBarProps[\"aria-valuenow\"] = value.toString();\n progressBarProps[\"aria-valuetext\"] =\n valueFormatter instanceof Function\n ? valueFormatter(value, minValue, maxValue!)\n : barWidth;\n const labelComponent = getLabelComponent(label, progressLabelId, showLabel);\n\n return (\n <div\n id={id || progressId}\n {...progressBarProps}\n ref={ref}\n className={classes}\n role=\"progressbar\"\n aria-labelledby={progressLabelId}\n >\n {labelComponent}\n <div className=\"mobius-progress__track\">\n <div className=\"mobius-progress__bar\" style={{ width: barWidth }} />\n </div>\n {showValueLabel && (\n <Label data-testid=\"value-label\" elementType=\"span\">\n {progressBarProps[\"aria-valuetext\"]}\n </Label>\n )}\n </div>\n );\n });\n\nProgress.displayName = \"Progress\";\nexport { Progress };\n"],"names":["Progress","warnAboutInvalidValues","value","minValue","maxValue","console","warn","sanitizedValue","defaultValue","numberValue","parseFloat","Number","isNaN","getLabelComponent","label","progressLabelId","showLabel","Label","id","className","elementType","VisuallyHidden","DEFAULT_VALUE","DEFAULT_MIN_VALUE","DEFAULT_MAX_VALUE","forwardRef","props","ref","progressId","useId","showValueLabel","valueFormatter","variant","undefined","clamp","num","min","max","Math","percentage","round","barWidth","classes","classNames","progressBarProps","toString","Function","labelComponent","div","role","aria-labelledby","style","width","data-testid","displayName"],"mappings":"AAAA;;;;;+BA+KSA;;;eAAAA;;;;+DA3Kc;uBAC0C;uBAG3C;gCACS;;;;;;AA4B/B,SAASC,uBACPC,KAAa,EACbC,QAAgB,EAChBC,QAAgB;IAEhB,IAAID,WAAWC,UAAU;QACvBC,QAAQC,IAAI,CAAC;IACf;IACA,IAAIJ,QAAQC,UAAU;QACpBE,QAAQC,IAAI,CAAC;IACf;IACA,IAAIJ,QAAQE,UAAU;QACpBC,QAAQC,IAAI,CAAC;IACf;AACF;AAEA,MAAMC,iBAAiB,CACrBL,OACAM;IAEA,MAAMC,cAAcC,WAAWR;IAC/B,OAAOS,OAAOC,KAAK,CAACH,eAAeD,eAAeC;AACpD;AAEA,MAAMI,oBAAoB,CACxBC,OACAC,iBACAC;IAEA,IAAIA,WAAW;QACb,qBACE,qBAACC,YAAK;YACJC,IAAIH;YACJI,WAAU;YACVC,aAAY;sBAEXN;;IAGP;IAEA,qBACE,qBAACO,8BAAc;kBACb,cAAA,qBAACJ,YAAK;YACJC,IAAIH;YACJI,WAAU;YACVC,aAAY;sBAEXN;;;AAIT;AAEA,MAAMQ,gBAAgB;AACtB,MAAMC,oBAAoB;AAC1B,MAAMC,oBAAoB;AAE1B,MAAMxB,yBACJyB,IAAAA,iBAAU,EAAC,CAACC,OAAsBC;IAChC,MAAMC,aAAaC,IAAAA,YAAK;IACxB,MAAMd,kBAAkBc,IAAAA,YAAK;IAC7B,MAAM,EACJX,EAAE,EACFJ,KAAK,EACLE,YAAY,IAAI,EAChBc,iBAAiB,CAAC,CAAChB,KAAK,EACxBiB,cAAc,EACdC,UAAU,SAAS,EACnBb,SAAS,EACV,GAAGO;IAEJ,IAAI,EAAExB,KAAK,EAAEC,QAAQ,EAAEC,QAAQ,EAAE,GAAGsB;IAEpCxB,QAAQK,eAAeL,OAAOoB;IAC9BnB,WAAWI,eAAeJ,UAAUoB;IACpCnB,WAAWG,eAAeH,UAAUoB;IAEpC,yDAAyD;IACzD,IACEtB,UAAU+B,aACV9B,aAAa8B,aACb7B,aAAa6B,WACb;QACA,OAAO;IACT;IAEAhC,uBAAuBC,OAAOC,UAAUC;IAExC,0DAA0D;IAC1D,MAAM8B,QAAQ,CAACC,KAAaC,KAAaC,MACvCC,KAAKF,GAAG,CAACE,KAAKD,GAAG,CAACF,KAAKC,MAAMC;IAC/B,MAAME,aAAaL,MACjBI,KAAKE,KAAK,CAAC,AAAEtC,CAAAA,QAAQC,QAAO,IAAMC,CAAAA,WAAWD,QAAO,IAAM,MAC1D,GACA;IAEF,MAAMsC,WAAW,GAAGF,WAAW,CAAC,CAAC;IAEjC,MAAMG,UAAUC,IAAAA,eAAU,EAAC,UAAU,mBAAmBxB,WAAW;QACjE,gBAAgBa,YAAY;QAC5B,kBAAkBA,YAAY;IAChC;IAEA,2BAA2B;IAC3B,MAAMY,mBAA2C,CAAC;IAClDA,gBAAgB,CAAC,gBAAgB,GAAGzC,SAAS0C,QAAQ;IACrDD,gBAAgB,CAAC,gBAAgB,GAAGxC,SAASyC,QAAQ;IACrDD,gBAAgB,CAAC,gBAAgB,GAAG1C,MAAM2C,QAAQ;IAClDD,gBAAgB,CAAC,iBAAiB,GAChCb,0BAA0Be,WACtBf,eAAe7B,OAAOC,UAAUC,YAChCqC;IACN,MAAMM,iBAAiBlC,kBAAkBC,OAAOC,iBAAiBC;IAEjE,qBACE,sBAACgC;QACC9B,IAAIA,MAAMU;QACT,GAAGgB,gBAAgB;QACpBjB,KAAKA;QACLR,WAAWuB;QACXO,MAAK;QACLC,mBAAiBnC;;YAEhBgC;0BACD,qBAACC;gBAAI7B,WAAU;0BACb,cAAA,qBAAC6B;oBAAI7B,WAAU;oBAAuBgC,OAAO;wBAAEC,OAAOX;oBAAS;;;YAEhEX,gCACC,qBAACb,YAAK;gBAACoC,eAAY;gBAAcjC,aAAY;0BAC1CwB,gBAAgB,CAAC,iBAAiB;;;;AAK7C;AAEF5C,SAASsD,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Radio/RadioGroup.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Children,\n ReactElement,\n ReactNode,\n Ref,\n RefAttributes,\n cloneElement,\n forwardRef,\n isValidElement,\n useId,\n useState,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { HTMLElementEvent } from \"../../types/events\";\nimport { spaceDelimitedList } from \"../../utils/spaceDelimitedList\";\nimport { ErrorMessage } from \"../ErrorMessage\";\nimport { Label } from \"../Label\";\nimport { Validation } from \"../../types\";\nimport { useValidationClasses } from \"../../hooks\";\nimport { Stack } from \"../Stack\";\n\nexport type RadioGroupElementType = HTMLDivElement;\n\nexport interface RadioGroupProps\n extends DOMProps,\n Validation,\n RefAttributes<RadioGroupElementType> {\n children: ReactNode;\n className?: string;\n orientation?: \"horizontal\" | \"vertical\";\n errorMessage?: string;\n // Callback that fires when select changes\n onChange?: (event: HTMLElementEvent<HTMLInputElement>) => void;\n // Defines a string value that labels the current element.\n \"aria-label\"?: string;\n // Identifies the element (or elements) that labels the current element.\n \"aria-labelledby\"?: string;\n // Identifies the element that provides an error message for the object.\n \"aria-errormessage\"?: string;\n // Identifies the element (or elements) that describes the object.\n \"aria-describedby\"?: string;\n // Whether user input is required on the input before form submission.\n isRequired?: boolean;\n // Whether the input is disabled.\n isDisabled?: boolean;\n // Whether the input can be selected but not changed by the user.\n isReadOnly?: boolean;\n // The default value (uncontrolled).\n defaultValue?: string;\n // The content to display as the label.\n label?: ReactNode;\n /**\n * The value of the radio button, used when submitting an HTML form.\n * See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio#Value).\n */\n value?: string;\n name?: string;\n}\n\nexport type RadioGroupRef = Ref<RadioGroupElementType>;\n\nconst getDefaultVal = (children: ReactNode, defaultValue?: string) => {\n if (Array.isArray(children) && defaultValue) {\n const option = children?.find(item => item.props.value === defaultValue);\n\n if (!option) return \"\";\n\n return option.props.value;\n }\n\n return \"\";\n};\n\nconst RadioGroup: ForwardedRefComponent<\n RadioGroupProps,\n RadioGroupElementType\n> = forwardRef((props: RadioGroupProps, ref: RadioGroupRef) => {\n const {\n label,\n isDisabled = false,\n isRequired,\n validationState,\n isInvalid,\n orientation = \"vertical\",\n className,\n errorMessage,\n children,\n defaultValue,\n isReadOnly,\n name,\n onChange,\n ...rest\n } = props;\n const defaultSelected = getDefaultVal(children, defaultValue);\n const [selected, setSelected] = useState<string>(defaultSelected);\n const validationClasses = useValidationClasses({\n validationState,\n isInvalid,\n });\n const radioClasses = {\n \"--is-disabled\": isDisabled,\n \"--is-required\": typeof isRequired === \"boolean\" && isRequired,\n \"--is-optional\": typeof isRequired === \"boolean\" && !isRequired,\n [`--is-${orientation}`]: true,\n [className || \"\"]: true,\n };\n const radioGroupClasses = classNames(\n \"mobius\",\n \"mobius-radio-group\",\n radioClasses,\n validationClasses,\n );\n const radioWrapperClasses = classNames(\"mobius-radio__wrapper\", {\n [`--is-${orientation}`]: true,\n });\n const labelClasses = classNames(radioClasses, validationClasses);\n const errorMessageId = useId();\n const defaultNameAttrId = useId();\n const nameAttribute = name || defaultNameAttrId;\n const shouldErrorMessageShow = errorMessage ? errorMessageId : undefined;\n const describedBy = spaceDelimitedList([\n shouldErrorMessageShow,\n props[\"aria-describedby\"],\n ]);\n const labelId = useId();\n\n return (\n <div\n {...rest}\n aria-describedby={describedBy}\n aria-disabled={isDisabled}\n aria-errormessage={shouldErrorMessageShow}\n aria-invalid={isInvalid}\n aria-label={props[\"aria-label\"]}\n aria-labelledby={props[\"aria-labelledby\"] || labelId}\n aria-orientation={orientation}\n aria-readonly={isReadOnly}\n aria-required={isRequired}\n ref={ref}\n className={radioGroupClasses}\n role=\"radiogroup\"\n >\n <Stack gap=\"xs\">\n {label && (\n <Label htmlFor={name} id={labelId} className={labelClasses}>\n {label}\n </Label>\n )}\n <div className={radioWrapperClasses}>\n {Children.map(children, child => {\n if (isValidElement(child)) {\n return cloneElement(child as ReactElement, {\n orientation,\n groupDisabled: isDisabled,\n name: nameAttribute,\n selected,\n setSelected,\n isRequired,\n \"aria-describedby\": describedBy,\n onChange,\n });\n }\n\n return child;\n })}\n </div>\n <ErrorMessage id={errorMessageId} errorMessage={errorMessage} />\n </Stack>\n </div>\n );\n});\n\nRadioGroup.displayName = \"RadioGroup\";\nexport { RadioGroup };\n"],"names":["RadioGroup","getDefaultVal","children","defaultValue","Array","isArray","option","find","item","props","value","forwardRef","ref","label","isDisabled","isRequired","validationState","isInvalid","orientation","className","errorMessage","isReadOnly","name","onChange","rest","defaultSelected","selected","setSelected","useState","validationClasses","useValidationClasses","radioClasses","radioGroupClasses","classNames","radioWrapperClasses","labelClasses","errorMessageId","useId","defaultNameAttrId","nameAttribute","shouldErrorMessageShow","undefined","describedBy","spaceDelimitedList","labelId","div","aria-describedby","aria-disabled","aria-errormessage","aria-invalid","aria-label","aria-labelledby","aria-orientation","aria-readonly","aria-required","role","Stack","gap","Label","htmlFor","id","Children","map","child","isValidElement","cloneElement","groupDisabled","ErrorMessage","displayName"],"mappings":"AAAA;;;;;+BAiLSA;;;eAAAA;;;;uBApKF;+DACgB;oCAIY;8BACN;uBACP;uBAEe;uBACf;;;;;;AA0CtB,MAAMC,gBAAgB,CAACC,UAAqBC;IAC1C,IAAIC,MAAMC,OAAO,CAACH,aAAaC,cAAc;QAC3C,MAAMG,SAASJ,qBAAAA,+BAAAA,SAAUK,IAAI,CAACC,CAAAA,OAAQA,KAAKC,KAAK,CAACC,KAAK,KAAKP;QAE3D,IAAI,CAACG,QAAQ,OAAO;QAEpB,OAAOA,OAAOG,KAAK,CAACC,KAAK;IAC3B;IAEA,OAAO;AACT;AAEA,MAAMV,2BAGFW,IAAAA,iBAAU,EAAC,CAACF,OAAwBG;IACtC,MAAM,EACJC,KAAK,EACLC,aAAa,KAAK,EAClBC,UAAU,EACVC,eAAe,EACfC,SAAS,EACTC,cAAc,UAAU,EACxBC,SAAS,EACTC,YAAY,EACZlB,QAAQ,EACRC,YAAY,EACZkB,UAAU,EACVC,IAAI,EACJC,QAAQ,EACR,GAAGC,MACJ,GAAGf;IACJ,MAAMgB,kBAAkBxB,cAAcC,UAAUC;IAChD,MAAM,CAACuB,UAAUC,YAAY,GAAGC,IAAAA,eAAQ,EAASH;IACjD,MAAMI,oBAAoBC,IAAAA,2BAAoB,EAAC;QAC7Cd;QACAC;IACF;IACA,MAAMc,eAAe;QACnB,iBAAiBjB;QACjB,iBAAiB,OAAOC,eAAe,aAAaA;QACpD,iBAAiB,OAAOA,eAAe,aAAa,CAACA;QACrD,CAAC,CAAC,KAAK,EAAEG,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Radio/RadioGroup.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Children,\n ReactElement,\n ReactNode,\n Ref,\n RefAttributes,\n cloneElement,\n forwardRef,\n isValidElement,\n useId,\n useState,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { HTMLElementEvent } from \"../../types/events\";\nimport { spaceDelimitedList } from \"../../utils/spaceDelimitedList\";\nimport { ErrorMessage } from \"../ErrorMessage\";\nimport { Label } from \"../Label\";\nimport { Validation } from \"../../types\";\nimport { useValidationClasses } from \"../../hooks\";\nimport { Stack } from \"../Stack\";\n\nexport type RadioGroupElementType = HTMLDivElement;\n\nexport interface RadioGroupProps\n extends DOMProps,\n Validation,\n RefAttributes<RadioGroupElementType> {\n children: ReactNode;\n className?: string;\n orientation?: \"horizontal\" | \"vertical\";\n errorMessage?: string;\n // Callback that fires when select changes\n onChange?: (event: HTMLElementEvent<HTMLInputElement>) => void;\n // Defines a string value that labels the current element.\n \"aria-label\"?: string;\n // Identifies the element (or elements) that labels the current element.\n \"aria-labelledby\"?: string;\n // Identifies the element that provides an error message for the object.\n \"aria-errormessage\"?: string;\n // Identifies the element (or elements) that describes the object.\n \"aria-describedby\"?: string;\n // Whether user input is required on the input before form submission.\n isRequired?: boolean;\n // Whether the input is disabled.\n isDisabled?: boolean;\n // Whether the input can be selected but not changed by the user.\n isReadOnly?: boolean;\n // The default value (uncontrolled).\n defaultValue?: string;\n // The content to display as the label.\n label?: ReactNode;\n /**\n * The value of the radio button, used when submitting an HTML form.\n * See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio#Value).\n */\n value?: string;\n name?: string;\n}\n\nexport type RadioGroupRef = Ref<RadioGroupElementType>;\n\nconst getDefaultVal = (children: ReactNode, defaultValue?: string) => {\n if (Array.isArray(children) && defaultValue) {\n const option = children?.find(item => item.props.value === defaultValue);\n\n if (!option) return \"\";\n\n return option.props.value;\n }\n\n return \"\";\n};\n\nconst RadioGroup: ForwardedRefComponent<\n RadioGroupProps,\n RadioGroupElementType\n> = forwardRef((props: RadioGroupProps, ref: RadioGroupRef) => {\n const {\n label,\n isDisabled = false,\n isRequired,\n validationState,\n isInvalid,\n orientation = \"vertical\",\n className,\n errorMessage,\n children,\n defaultValue,\n isReadOnly,\n name,\n onChange,\n ...rest\n } = props;\n const defaultSelected = getDefaultVal(children, defaultValue);\n const [selected, setSelected] = useState<string>(defaultSelected);\n const validationClasses = useValidationClasses({\n validationState,\n isInvalid,\n });\n const radioClasses = {\n \"--is-disabled\": isDisabled,\n \"--is-required\": typeof isRequired === \"boolean\" && isRequired,\n \"--is-optional\": typeof isRequired === \"boolean\" && !isRequired,\n [`--is-${orientation}`]: true,\n [className || \"\"]: true,\n };\n const radioGroupClasses = classNames(\n \"mobius\",\n \"mobius-radio-group\",\n radioClasses,\n validationClasses,\n );\n const radioWrapperClasses = classNames(\"mobius-radio__wrapper\", {\n [`--is-${orientation}`]: true,\n });\n const labelClasses = classNames(radioClasses, validationClasses);\n const errorMessageId = useId();\n const defaultNameAttrId = useId();\n const nameAttribute = name || defaultNameAttrId;\n const shouldErrorMessageShow = errorMessage ? errorMessageId : undefined;\n const describedBy = spaceDelimitedList([\n shouldErrorMessageShow,\n props[\"aria-describedby\"],\n ]);\n const labelId = useId();\n\n return (\n <div\n {...rest}\n aria-describedby={describedBy}\n aria-disabled={isDisabled}\n aria-errormessage={shouldErrorMessageShow}\n aria-invalid={isInvalid}\n aria-label={props[\"aria-label\"]}\n aria-labelledby={props[\"aria-labelledby\"] || labelId}\n aria-orientation={orientation}\n aria-readonly={isReadOnly}\n aria-required={isRequired}\n ref={ref}\n className={radioGroupClasses}\n role=\"radiogroup\"\n >\n <Stack gap=\"xs\">\n {label && (\n <Label htmlFor={name} id={labelId} className={labelClasses}>\n {label}\n </Label>\n )}\n <div className={radioWrapperClasses}>\n {Children.map(children, child => {\n if (isValidElement(child)) {\n return cloneElement(child as ReactElement, {\n orientation,\n groupDisabled: isDisabled,\n name: nameAttribute,\n selected,\n setSelected,\n isRequired,\n \"aria-describedby\": describedBy,\n onChange,\n });\n }\n\n return child;\n })}\n </div>\n <ErrorMessage id={errorMessageId} errorMessage={errorMessage} />\n </Stack>\n </div>\n );\n});\n\nRadioGroup.displayName = \"RadioGroup\";\nexport { RadioGroup };\n"],"names":["RadioGroup","getDefaultVal","children","defaultValue","Array","isArray","option","find","item","props","value","forwardRef","ref","label","isDisabled","isRequired","validationState","isInvalid","orientation","className","errorMessage","isReadOnly","name","onChange","rest","defaultSelected","selected","setSelected","useState","validationClasses","useValidationClasses","radioClasses","radioGroupClasses","classNames","radioWrapperClasses","labelClasses","errorMessageId","useId","defaultNameAttrId","nameAttribute","shouldErrorMessageShow","undefined","describedBy","spaceDelimitedList","labelId","div","aria-describedby","aria-disabled","aria-errormessage","aria-invalid","aria-label","aria-labelledby","aria-orientation","aria-readonly","aria-required","role","Stack","gap","Label","htmlFor","id","Children","map","child","isValidElement","cloneElement","groupDisabled","ErrorMessage","displayName"],"mappings":"AAAA;;;;;+BAiLSA;;;eAAAA;;;;uBApKF;+DACgB;oCAIY;8BACN;uBACP;uBAEe;uBACf;;;;;;AA0CtB,MAAMC,gBAAgB,CAACC,UAAqBC;IAC1C,IAAIC,MAAMC,OAAO,CAACH,aAAaC,cAAc;QAC3C,MAAMG,SAASJ,qBAAAA,+BAAAA,SAAUK,IAAI,CAACC,CAAAA,OAAQA,KAAKC,KAAK,CAACC,KAAK,KAAKP;QAE3D,IAAI,CAACG,QAAQ,OAAO;QAEpB,OAAOA,OAAOG,KAAK,CAACC,KAAK;IAC3B;IAEA,OAAO;AACT;AAEA,MAAMV,2BAGFW,IAAAA,iBAAU,EAAC,CAACF,OAAwBG;IACtC,MAAM,EACJC,KAAK,EACLC,aAAa,KAAK,EAClBC,UAAU,EACVC,eAAe,EACfC,SAAS,EACTC,cAAc,UAAU,EACxBC,SAAS,EACTC,YAAY,EACZlB,QAAQ,EACRC,YAAY,EACZkB,UAAU,EACVC,IAAI,EACJC,QAAQ,EACR,GAAGC,MACJ,GAAGf;IACJ,MAAMgB,kBAAkBxB,cAAcC,UAAUC;IAChD,MAAM,CAACuB,UAAUC,YAAY,GAAGC,IAAAA,eAAQ,EAASH;IACjD,MAAMI,oBAAoBC,IAAAA,2BAAoB,EAAC;QAC7Cd;QACAC;IACF;IACA,MAAMc,eAAe;QACnB,iBAAiBjB;QACjB,iBAAiB,OAAOC,eAAe,aAAaA;QACpD,iBAAiB,OAAOA,eAAe,aAAa,CAACA;QACrD,CAAC,CAAC,KAAK,EAAEG,aAAa,CAAC,EAAE;QACzB,CAACC,aAAa,GAAG,EAAE;IACrB;IACA,MAAMa,oBAAoBC,IAAAA,eAAU,EAClC,UACA,sBACAF,cACAF;IAEF,MAAMK,sBAAsBD,IAAAA,eAAU,EAAC,yBAAyB;QAC9D,CAAC,CAAC,KAAK,EAAEf,aAAa,CAAC,EAAE;IAC3B;IACA,MAAMiB,eAAeF,IAAAA,eAAU,EAACF,cAAcF;IAC9C,MAAMO,iBAAiBC,IAAAA,YAAK;IAC5B,MAAMC,oBAAoBD,IAAAA,YAAK;IAC/B,MAAME,gBAAgBjB,QAAQgB;IAC9B,MAAME,yBAAyBpB,eAAegB,iBAAiBK;IAC/D,MAAMC,cAAcC,IAAAA,sCAAkB,EAAC;QACrCH;QACA/B,KAAK,CAAC,mBAAmB;KAC1B;IACD,MAAMmC,UAAUP,IAAAA,YAAK;IAErB,qBACE,qBAACQ;QACE,GAAGrB,IAAI;QACRsB,oBAAkBJ;QAClBK,iBAAejC;QACfkC,qBAAmBR;QACnBS,gBAAchC;QACdiC,cAAYzC,KAAK,CAAC,aAAa;QAC/B0C,mBAAiB1C,KAAK,CAAC,kBAAkB,IAAImC;QAC7CQ,oBAAkBlC;QAClBmC,iBAAehC;QACfiC,iBAAevC;QACfH,KAAKA;QACLO,WAAWa;QACXuB,MAAK;kBAEL,cAAA,sBAACC,YAAK;YAACC,KAAI;;gBACR5C,uBACC,qBAAC6C,YAAK;oBAACC,SAASrC;oBAAMsC,IAAIhB;oBAASzB,WAAWgB;8BAC3CtB;;8BAGL,qBAACgC;oBAAI1B,WAAWe;8BACb2B,eAAQ,CAACC,GAAG,CAAC5D,UAAU6D,CAAAA;wBACtB,kBAAIC,IAAAA,qBAAc,EAACD,QAAQ;4BACzB,qBAAOE,IAAAA,mBAAY,EAACF,OAAuB;gCACzC7C;gCACAgD,eAAepD;gCACfQ,MAAMiB;gCACNb;gCACAC;gCACAZ;gCACA,oBAAoB2B;gCACpBnB;4BACF;wBACF;wBAEA,OAAOwC;oBACT;;8BAEF,qBAACI,0BAAY;oBAACP,IAAIxB;oBAAgBhB,cAAcA;;;;;AAIxD;AAEApB,WAAWoE,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Segment/SegmentGroup.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\n\nexport interface SegmentGroupProps extends DOMProps {\n className?: string;\n horizontal?: boolean;\n gap?: \"size-xs\" | \"size-s\" | \"size-m\" | \"size-l\" | \"size-xl\" | \"size-xxl\";\n children?: ReactNode;\n}\n\nconst SegmentGroup = (props: SegmentGroupProps) => {\n const { children, horizontal, gap, className, ...rest } = props;\n\n const gapClass = gap ? `gap-${gap}` : \"\";\n const classes = classNames(\n \"mobius\",\n \"mobius-segment-group\",\n className,\n { \"--is-horizontal\": horizontal },\n gapClass,\n );\n\n return (\n <div className={classes} {...rest}>\n {children}\n </div>\n );\n};\n\nSegmentGroup.displayName = \"SegmentGroup\";\nexport { SegmentGroup };\n"],"names":["SegmentGroup","props","children","horizontal","gap","className","rest","gapClass","classes","classNames","div","displayName"],"mappings":";;;;+BA+BSA;;;eAAAA;;;;+DA9Bc;;;;;;AAUvB,MAAMA,eAAe,CAACC;IACpB,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,GAAG,EAAEC,SAAS,EAAE,GAAGC,MAAM,GAAGL;IAE1D,MAAMM,WAAWH,MAAM,CAAC,IAAI,EAAEA,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Segment/SegmentGroup.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\n\nexport interface SegmentGroupProps extends DOMProps {\n className?: string;\n horizontal?: boolean;\n gap?: \"size-xs\" | \"size-s\" | \"size-m\" | \"size-l\" | \"size-xl\" | \"size-xxl\";\n children?: ReactNode;\n}\n\nconst SegmentGroup = (props: SegmentGroupProps) => {\n const { children, horizontal, gap, className, ...rest } = props;\n\n const gapClass = gap ? `gap-${gap}` : \"\";\n const classes = classNames(\n \"mobius\",\n \"mobius-segment-group\",\n className,\n { \"--is-horizontal\": horizontal },\n gapClass,\n );\n\n return (\n <div className={classes} {...rest}>\n {children}\n </div>\n );\n};\n\nSegmentGroup.displayName = \"SegmentGroup\";\nexport { SegmentGroup };\n"],"names":["SegmentGroup","props","children","horizontal","gap","className","rest","gapClass","classes","classNames","div","displayName"],"mappings":";;;;+BA+BSA;;;eAAAA;;;;+DA9Bc;;;;;;AAUvB,MAAMA,eAAe,CAACC;IACpB,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,GAAG,EAAEC,SAAS,EAAE,GAAGC,MAAM,GAAGL;IAE1D,MAAMM,WAAWH,MAAM,CAAC,IAAI,EAAEA,KAAK,GAAG;IACtC,MAAMI,UAAUC,IAAAA,eAAU,EACxB,UACA,wBACAJ,WACA;QAAE,mBAAmBF;IAAW,GAChCI;IAGF,qBACE,qBAACG;QAAIL,WAAWG;QAAU,GAAGF,IAAI;kBAC9BJ;;AAGP;AAEAF,aAAaW,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Stack/Stack.tsx"],"sourcesContent":["import React, { Ref, forwardRef, RefAttributes, ReactNode } from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport type { DOMProps } from \"../../types/dom\";\nimport type { ForwardedRefComponent } from \"../../types/components\";\nimport { SpacingType } from \"../../types\";\n\nexport type StackElementType = HTMLDivElement;\n\nexport interface StackProps extends DOMProps, RefAttributes<StackElementType> {\n children?: ReactNode;\n /** How big a gap between items */\n gap?: SpacingType;\n /** Custom class name for setting specific CSS */\n className?: string;\n elementType?: string | React.ElementType;\n}\n\nexport type StackRef = Ref<StackElementType>;\n\nexport const Stack: ForwardedRefComponent<StackProps, StackElementType> =\n forwardRef((props: StackProps, ref: StackRef) => {\n const { elementType: Element = \"div\", gap, ...otherProps } = props;\n\n const classes = classNames(\n \"mobius\",\n \"mobius-stack\",\n {\n [`--gap-${gap}`]: gap,\n },\n otherProps.className,\n );\n\n return <Element ref={ref} {...otherProps} className={classes} />;\n });\n"],"names":["Stack","forwardRef","props","ref","elementType","Element","gap","otherProps","classes","classNames","className"],"mappings":";;;;+BAmBaA;;;eAAAA;;;;+DAnBoD;+DAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBhB,MAAMA,sBACXC,IAAAA,iBAAU,EAAC,CAACC,OAAmBC;IAC7B,MAAM,EAAEC,aAAaC,UAAU,KAAK,EAAEC,GAAG,EAAE,GAAGC,YAAY,GAAGL;IAE7D,MAAMM,UAAUC,IAAAA,eAAU,EACxB,UACA,gBACA;QACE,CAAC,CAAC,MAAM,EAAEH,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Stack/Stack.tsx"],"sourcesContent":["import React, { Ref, forwardRef, RefAttributes, ReactNode } from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport type { DOMProps } from \"../../types/dom\";\nimport type { ForwardedRefComponent } from \"../../types/components\";\nimport { SpacingType } from \"../../types\";\n\nexport type StackElementType = HTMLDivElement;\n\nexport interface StackProps extends DOMProps, RefAttributes<StackElementType> {\n children?: ReactNode;\n /** How big a gap between items */\n gap?: SpacingType;\n /** Custom class name for setting specific CSS */\n className?: string;\n elementType?: string | React.ElementType;\n}\n\nexport type StackRef = Ref<StackElementType>;\n\nexport const Stack: ForwardedRefComponent<StackProps, StackElementType> =\n forwardRef((props: StackProps, ref: StackRef) => {\n const { elementType: Element = \"div\", gap, ...otherProps } = props;\n\n const classes = classNames(\n \"mobius\",\n \"mobius-stack\",\n {\n [`--gap-${gap}`]: gap,\n },\n otherProps.className,\n );\n\n return <Element ref={ref} {...otherProps} className={classes} />;\n });\n"],"names":["Stack","forwardRef","props","ref","elementType","Element","gap","otherProps","classes","classNames","className"],"mappings":";;;;+BAmBaA;;;eAAAA;;;;+DAnBoD;+DAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBhB,MAAMA,sBACXC,IAAAA,iBAAU,EAAC,CAACC,OAAmBC;IAC7B,MAAM,EAAEC,aAAaC,UAAU,KAAK,EAAEC,GAAG,EAAE,GAAGC,YAAY,GAAGL;IAE7D,MAAMM,UAAUC,IAAAA,eAAU,EACxB,UACA,gBACA;QACE,CAAC,CAAC,MAAM,EAAEH,KAAK,CAAC,EAAEA;IACpB,GACAC,WAAWG,SAAS;IAGtB,qBAAO,qBAACL;QAAQF,KAAKA;QAAM,GAAGI,UAAU;QAAEG,WAAWF;;AACvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Text/Text.tsx"],"sourcesContent":["import { forwardRef, ReactNode, Ref, RefAttributes } from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\nimport { ForwardedRefComponent } from \"../../types/components\";\n\nexport type TextElementType = HTMLHeadingElement | HTMLParagraphElement;\nexport type TextVariantType =\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"body\"\n | \"small\"\n | \"legal\";\nexport type ElementType = \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"p\" | \"span\";\nexport interface TextProps extends DOMProps, RefAttributes<TextElementType> {\n /** HTML element for the text */\n elementType?: ElementType;\n /** Specify font size override */\n variant?: TextVariantType;\n /** Specify compact line height override */\n spacing?: \"loose\" | \"tight\";\n /** Custom class name for setting specific CSS */\n className?: string;\n children: ReactNode;\n style?: React.CSSProperties;\n}\n\nexport type TextRef = Ref<TextElementType>;\n\nconst getElementType = (\n variant: TextVariantType | undefined,\n elementType: ElementType | undefined,\n) => {\n if (variant) {\n return [\"h1\", \"h2\", \"h3\", \"h4\"].includes(variant) ? variant : \"p\";\n }\n return elementType || \"p\";\n};\n\nconst Text: ForwardedRefComponent<TextProps, TextElementType> = forwardRef(\n ({ elementType: Component = \"p\", ...props }: TextProps, ref: TextRef) => {\n // Remove non-DOM props from element\n const { variant, className, spacing, ...otherProps } = props;\n\n // If a variant is supplied, set the class name and element type\n const elementType = getElementType(variant, Component);\n const variantType = variant || elementType;\n const classes = classNames(\n \"mobius\",\n \"mobius-text\",\n { [`--is-${variantType}`]: variantType },\n { [`--has-line-height-${spacing}`]: spacing },\n className,\n );\n\n return <Component ref={ref} {...otherProps} className={classes} />;\n },\n);\n\nText.displayName = \"Text\";\nexport { Text };\n"],"names":["Text","getElementType","variant","elementType","includes","forwardRef","Component","props","ref","className","spacing","otherProps","variantType","classes","classNames","displayName"],"mappings":";;;;+BA6DSA;;;eAAAA;;;;uBA7DiD;+DACnC;;;;;;AA6BvB,MAAMC,iBAAiB,CACrBC,SACAC;IAEA,IAAID,SAAS;QACX,OAAO;YAAC;YAAM;YAAM;YAAM;SAAK,CAACE,QAAQ,CAACF,WAAWA,UAAU;IAChE;IACA,OAAOC,eAAe;AACxB;AAEA,MAAMH,qBAA0DK,IAAAA,iBAAU,EACxE,CAAC,EAAEF,aAAaG,YAAY,GAAG,EAAE,GAAGC,OAAkB,EAAEC;IACtD,oCAAoC;IACpC,MAAM,EAAEN,OAAO,EAAEO,SAAS,EAAEC,OAAO,EAAE,GAAGC,YAAY,GAAGJ;IAEvD,gEAAgE;IAChE,MAAMJ,cAAcF,eAAeC,SAASI;IAC5C,MAAMM,cAAcV,WAAWC;IAC/B,MAAMU,UAAUC,IAAAA,eAAU,EACxB,UACA,eACA;QAAE,CAAC,CAAC,KAAK,EAAEF,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Text/Text.tsx"],"sourcesContent":["import { forwardRef, ReactNode, Ref, RefAttributes } from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\nimport { ForwardedRefComponent } from \"../../types/components\";\n\nexport type TextElementType = HTMLHeadingElement | HTMLParagraphElement;\nexport type TextVariantType =\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"body\"\n | \"small\"\n | \"legal\";\nexport type ElementType = \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"p\" | \"span\";\nexport interface TextProps extends DOMProps, RefAttributes<TextElementType> {\n /** HTML element for the text */\n elementType?: ElementType;\n /** Specify font size override */\n variant?: TextVariantType;\n /** Specify compact line height override */\n spacing?: \"loose\" | \"tight\";\n /** Custom class name for setting specific CSS */\n className?: string;\n children: ReactNode;\n style?: React.CSSProperties;\n}\n\nexport type TextRef = Ref<TextElementType>;\n\nconst getElementType = (\n variant: TextVariantType | undefined,\n elementType: ElementType | undefined,\n) => {\n if (variant) {\n return [\"h1\", \"h2\", \"h3\", \"h4\"].includes(variant) ? variant : \"p\";\n }\n return elementType || \"p\";\n};\n\nconst Text: ForwardedRefComponent<TextProps, TextElementType> = forwardRef(\n ({ elementType: Component = \"p\", ...props }: TextProps, ref: TextRef) => {\n // Remove non-DOM props from element\n const { variant, className, spacing, ...otherProps } = props;\n\n // If a variant is supplied, set the class name and element type\n const elementType = getElementType(variant, Component);\n const variantType = variant || elementType;\n const classes = classNames(\n \"mobius\",\n \"mobius-text\",\n { [`--is-${variantType}`]: variantType },\n { [`--has-line-height-${spacing}`]: spacing },\n className,\n );\n\n return <Component ref={ref} {...otherProps} className={classes} />;\n },\n);\n\nText.displayName = \"Text\";\nexport { Text };\n"],"names":["Text","getElementType","variant","elementType","includes","forwardRef","Component","props","ref","className","spacing","otherProps","variantType","classes","classNames","displayName"],"mappings":";;;;+BA6DSA;;;eAAAA;;;;uBA7DiD;+DACnC;;;;;;AA6BvB,MAAMC,iBAAiB,CACrBC,SACAC;IAEA,IAAID,SAAS;QACX,OAAO;YAAC;YAAM;YAAM;YAAM;SAAK,CAACE,QAAQ,CAACF,WAAWA,UAAU;IAChE;IACA,OAAOC,eAAe;AACxB;AAEA,MAAMH,qBAA0DK,IAAAA,iBAAU,EACxE,CAAC,EAAEF,aAAaG,YAAY,GAAG,EAAE,GAAGC,OAAkB,EAAEC;IACtD,oCAAoC;IACpC,MAAM,EAAEN,OAAO,EAAEO,SAAS,EAAEC,OAAO,EAAE,GAAGC,YAAY,GAAGJ;IAEvD,gEAAgE;IAChE,MAAMJ,cAAcF,eAAeC,SAASI;IAC5C,MAAMM,cAAcV,WAAWC;IAC/B,MAAMU,UAAUC,IAAAA,eAAU,EACxB,UACA,eACA;QAAE,CAAC,CAAC,KAAK,EAAEF,aAAa,CAAC,EAAEA;IAAY,GACvC;QAAE,CAAC,CAAC,kBAAkB,EAAEF,SAAS,CAAC,EAAEA;IAAQ,GAC5CD;IAGF,qBAAO,qBAACH;QAAUE,KAAKA;QAAM,GAAGG,UAAU;QAAEF,WAAWI;;AACzD;AAGFb,KAAKe,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Trust/Trust.tsx"],"sourcesContent":["import classNames from \"classnames/dedupe\";\nimport { forwardRef, useEffect, useRef, useState } from \"react\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { mergeRefs } from \"../../utils\";\nimport { REQUIRED_TRUSTPILOT_CLASS_NAME, TRUSTPILOT_WIDGET } from \"./constants\";\nimport { getDefaultProps } from \"./getDefaultProps\";\nimport { TrustElementType, TrustProps, TrustRef } from \"./types\";\n\nexport const Trust: ForwardedRefComponent<TrustProps, TrustElementType> =\n forwardRef((props: TrustProps, ref: TrustRef) => {\n const {\n elementType: Element = \"div\",\n variant,\n theme,\n ...otherProps\n } = props;\n const [isMounted, setIsMounted] = useState(false);\n const trustRef = useRef(null);\n\n const { link, ...defaultProps } = getDefaultProps(props);\n const { className: variantClassName, styles } = TRUSTPILOT_WIDGET[variant];\n\n const classes = classNames(\n \"mobius\",\n \"mobius-trust\",\n REQUIRED_TRUSTPILOT_CLASS_NAME,\n {\n [`--is-${theme}`]: theme,\n [variantClassName]: variant,\n },\n otherProps.className,\n );\n\n useEffect(() => {\n const hasTrustpilotLoaded =\n trustRef.current &&\n window?.Trustpilot &&\n window?.Trustpilot.loadFromElement;\n // If window.Trustpilot is available it means that we need to load the TrustBox from our ref.\n if (isMounted && hasTrustpilotLoaded) {\n window.Trustpilot.loadFromElement(trustRef.current, true);\n }\n }, [isMounted]);\n\n useEffect(() => {\n setIsMounted(true);\n }, []);\n\n // Load `<Trust>` client-side only to avoid SSR hydration issues\n if (!isMounted) return <div style={styles} />;\n\n return (\n <Element\n ref={mergeRefs([trustRef, ref])}\n {...defaultProps}\n {...otherProps}\n className={classes}\n style={styles}\n >\n <a\n href={link}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"mobius-trust__link\"\n >\n Trustpilot\n </a>\n </Element>\n );\n });\n"],"names":["Trust","forwardRef","props","ref","elementType","Element","variant","theme","otherProps","isMounted","setIsMounted","useState","trustRef","useRef","link","defaultProps","getDefaultProps","className","variantClassName","styles","TRUSTPILOT_WIDGET","classes","classNames","REQUIRED_TRUSTPILOT_CLASS_NAME","useEffect","window","hasTrustpilotLoaded","current","Trustpilot","loadFromElement","div","style","mergeRefs","a","href","target","rel"],"mappings":";;;;+BAQaA;;;eAAAA;;;;+DARU;uBACiC;uBAE9B;2BACwC;iCAClC;;;;;;AAGzB,MAAMA,sBACXC,IAAAA,iBAAU,EAAC,CAACC,OAAmBC;IAC7B,MAAM,EACJC,aAAaC,UAAU,KAAK,EAC5BC,OAAO,EACPC,KAAK,EACL,GAAGC,YACJ,GAAGN;IACJ,MAAM,CAACO,WAAWC,aAAa,GAAGC,IAAAA,eAAQ,EAAC;IAC3C,MAAMC,WAAWC,IAAAA,aAAM,EAAC;IAExB,MAAM,EAAEC,IAAI,EAAE,GAAGC,cAAc,GAAGC,IAAAA,gCAAe,EAACd;IAClD,MAAM,EAAEe,WAAWC,gBAAgB,EAAEC,MAAM,EAAE,GAAGC,4BAAiB,CAACd,QAAQ;IAE1E,MAAMe,UAAUC,IAAAA,eAAU,EACxB,UACA,gBACAC,yCAA8B,EAC9B;QACE,CAAC,CAAC,KAAK,EAAEhB,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Trust/Trust.tsx"],"sourcesContent":["import classNames from \"classnames/dedupe\";\nimport { forwardRef, useEffect, useRef, useState } from \"react\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { mergeRefs } from \"../../utils\";\nimport { REQUIRED_TRUSTPILOT_CLASS_NAME, TRUSTPILOT_WIDGET } from \"./constants\";\nimport { getDefaultProps } from \"./getDefaultProps\";\nimport { TrustElementType, TrustProps, TrustRef } from \"./types\";\n\nexport const Trust: ForwardedRefComponent<TrustProps, TrustElementType> =\n forwardRef((props: TrustProps, ref: TrustRef) => {\n const {\n elementType: Element = \"div\",\n variant,\n theme,\n ...otherProps\n } = props;\n const [isMounted, setIsMounted] = useState(false);\n const trustRef = useRef(null);\n\n const { link, ...defaultProps } = getDefaultProps(props);\n const { className: variantClassName, styles } = TRUSTPILOT_WIDGET[variant];\n\n const classes = classNames(\n \"mobius\",\n \"mobius-trust\",\n REQUIRED_TRUSTPILOT_CLASS_NAME,\n {\n [`--is-${theme}`]: theme,\n [variantClassName]: variant,\n },\n otherProps.className,\n );\n\n useEffect(() => {\n const hasTrustpilotLoaded =\n trustRef.current &&\n window?.Trustpilot &&\n window?.Trustpilot.loadFromElement;\n // If window.Trustpilot is available it means that we need to load the TrustBox from our ref.\n if (isMounted && hasTrustpilotLoaded) {\n window.Trustpilot.loadFromElement(trustRef.current, true);\n }\n }, [isMounted]);\n\n useEffect(() => {\n setIsMounted(true);\n }, []);\n\n // Load `<Trust>` client-side only to avoid SSR hydration issues\n if (!isMounted) return <div style={styles} />;\n\n return (\n <Element\n ref={mergeRefs([trustRef, ref])}\n {...defaultProps}\n {...otherProps}\n className={classes}\n style={styles}\n >\n <a\n href={link}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"mobius-trust__link\"\n >\n Trustpilot\n </a>\n </Element>\n );\n });\n"],"names":["Trust","forwardRef","props","ref","elementType","Element","variant","theme","otherProps","isMounted","setIsMounted","useState","trustRef","useRef","link","defaultProps","getDefaultProps","className","variantClassName","styles","TRUSTPILOT_WIDGET","classes","classNames","REQUIRED_TRUSTPILOT_CLASS_NAME","useEffect","window","hasTrustpilotLoaded","current","Trustpilot","loadFromElement","div","style","mergeRefs","a","href","target","rel"],"mappings":";;;;+BAQaA;;;eAAAA;;;;+DARU;uBACiC;uBAE9B;2BACwC;iCAClC;;;;;;AAGzB,MAAMA,sBACXC,IAAAA,iBAAU,EAAC,CAACC,OAAmBC;IAC7B,MAAM,EACJC,aAAaC,UAAU,KAAK,EAC5BC,OAAO,EACPC,KAAK,EACL,GAAGC,YACJ,GAAGN;IACJ,MAAM,CAACO,WAAWC,aAAa,GAAGC,IAAAA,eAAQ,EAAC;IAC3C,MAAMC,WAAWC,IAAAA,aAAM,EAAC;IAExB,MAAM,EAAEC,IAAI,EAAE,GAAGC,cAAc,GAAGC,IAAAA,gCAAe,EAACd;IAClD,MAAM,EAAEe,WAAWC,gBAAgB,EAAEC,MAAM,EAAE,GAAGC,4BAAiB,CAACd,QAAQ;IAE1E,MAAMe,UAAUC,IAAAA,eAAU,EACxB,UACA,gBACAC,yCAA8B,EAC9B;QACE,CAAC,CAAC,KAAK,EAAEhB,OAAO,CAAC,EAAEA;QACnB,CAACW,iBAAiB,EAAEZ;IACtB,GACAE,WAAWS,SAAS;IAGtBO,IAAAA,gBAAS,EAAC;YAGNC,SACAA;QAHF,MAAMC,sBACJd,SAASe,OAAO,MAChBF,UAAAA,oBAAAA,8BAAAA,QAAQG,UAAU,OAClBH,WAAAA,oBAAAA,+BAAAA,SAAQG,UAAU,CAACC,eAAe;QACpC,6FAA6F;QAC7F,IAAIpB,aAAaiB,qBAAqB;YACpCD,OAAOG,UAAU,CAACC,eAAe,CAACjB,SAASe,OAAO,EAAE;QACtD;IACF,GAAG;QAAClB;KAAU;IAEde,IAAAA,gBAAS,EAAC;QACRd,aAAa;IACf,GAAG,EAAE;IAEL,gEAAgE;IAChE,IAAI,CAACD,WAAW,qBAAO,qBAACqB;QAAIC,OAAOZ;;IAEnC,qBACE,qBAACd;QACCF,KAAK6B,IAAAA,gBAAS,EAAC;YAACpB;YAAUT;SAAI;QAC7B,GAAGY,YAAY;QACf,GAAGP,UAAU;QACdS,WAAWI;QACXU,OAAOZ;kBAEP,cAAA,qBAACc;YACCC,MAAMpB;YACNqB,QAAO;YACPC,KAAI;YACJnB,WAAU;sBACX;;;AAKP"}
|
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "useButton", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _react = require("react");
|
|
12
|
-
function useButton({ elementType = "button", type = "button", isDisabled = false, href, target, rel, role, onClick, onPress }) {
|
|
12
|
+
function useButton({ elementType = "button", type = "button", isDisabled = false, href, target, rel, role, name, value, onClick, onPress }) {
|
|
13
13
|
const realOnClick = (0, _react.useCallback)((event)=>{
|
|
14
14
|
if (isDisabled) {
|
|
15
15
|
return;
|
|
@@ -43,6 +43,8 @@ function useButton({ elementType = "button", type = "button", isDisabled = false
|
|
|
43
43
|
tabIndex: isDisabled ? -1 : 0,
|
|
44
44
|
disabled: isDisabled || undefined,
|
|
45
45
|
"aria-disabled": isDisabled || undefined,
|
|
46
|
+
name: elementType === "input" || elementType === "button" ? name : undefined,
|
|
47
|
+
value: elementType === "input" || elementType === "button" ? value : undefined,
|
|
46
48
|
...extraProps,
|
|
47
49
|
onClick: realOnClick
|
|
48
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/hooks/useButton/useButton.tsx"],"sourcesContent":["import { JSXElementConstructor, useCallback } from \"react\";\n\nexport interface UseButtonProps {\n elementType?:\n | \"button\"\n | \"a\"\n | \"span\"\n | \"input\"\n | JSXElementConstructor<any>\n | undefined;\n type?: \"button\" | \"submit\" | \"reset\";\n isDisabled?: boolean;\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onPress?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n href?: string;\n target?: string;\n rel?: string;\n role?: string;\n}\n\nexport function useButton({\n elementType = \"button\",\n type = \"button\",\n isDisabled = false,\n href,\n target,\n rel,\n role,\n onClick,\n onPress,\n}: UseButtonProps) {\n const realOnClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n if (isDisabled) {\n return;\n }\n\n onClick?.(event);\n onPress?.(event);\n },\n [isDisabled, onClick, onPress],\n );\n\n function getRole() {\n if (role) {\n return role;\n }\n\n if (elementType === \"a\") {\n return undefined;\n }\n\n return \"button\";\n }\n\n const extraProps =\n elementType === \"button\"\n ? { type }\n : {\n role: getRole(),\n };\n\n return {\n buttonProps: {\n href: elementType === \"a\" ? href : undefined,\n target: elementType === \"a\" ? target : undefined,\n rel: elementType === \"a\" ? rel : undefined,\n tabIndex: isDisabled ? -1 : 0,\n disabled: isDisabled || undefined,\n \"aria-disabled\": isDisabled || undefined,\n ...extraProps,\n onClick: realOnClick,\n },\n };\n}\n"],"names":["useButton","elementType","type","isDisabled","href","target","rel","role","onClick","onPress","realOnClick","useCallback","event","getRole","undefined","extraProps","buttonProps","tabIndex","disabled"],"mappings":";;;;+
|
|
1
|
+
{"version":3,"sources":["../../../../src/hooks/useButton/useButton.tsx"],"sourcesContent":["import { JSXElementConstructor, useCallback } from \"react\";\n\nexport interface UseButtonProps {\n elementType?:\n | \"button\"\n | \"a\"\n | \"span\"\n | \"input\"\n | JSXElementConstructor<any>\n | undefined;\n type?: \"button\" | \"submit\" | \"reset\";\n isDisabled?: boolean;\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onPress?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n href?: string;\n target?: string;\n rel?: string;\n role?: string;\n name?: string | undefined;\n value?: string | undefined;\n}\n\nexport function useButton({\n elementType = \"button\",\n type = \"button\",\n isDisabled = false,\n href,\n target,\n rel,\n role,\n name,\n value,\n onClick,\n onPress,\n}: UseButtonProps) {\n const realOnClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n if (isDisabled) {\n return;\n }\n\n onClick?.(event);\n onPress?.(event);\n },\n [isDisabled, onClick, onPress],\n );\n\n function getRole() {\n if (role) {\n return role;\n }\n\n if (elementType === \"a\") {\n return undefined;\n }\n\n return \"button\";\n }\n\n const extraProps =\n elementType === \"button\"\n ? { type }\n : {\n role: getRole(),\n };\n\n return {\n buttonProps: {\n href: elementType === \"a\" ? href : undefined,\n target: elementType === \"a\" ? target : undefined,\n rel: elementType === \"a\" ? rel : undefined,\n tabIndex: isDisabled ? -1 : 0,\n disabled: isDisabled || undefined,\n \"aria-disabled\": isDisabled || undefined,\n name:\n elementType === \"input\" || elementType === \"button\" ? name : undefined,\n value:\n elementType === \"input\" || elementType === \"button\" ? value : undefined,\n ...extraProps,\n onClick: realOnClick,\n },\n };\n}\n"],"names":["useButton","elementType","type","isDisabled","href","target","rel","role","name","value","onClick","onPress","realOnClick","useCallback","event","getRole","undefined","extraProps","buttonProps","tabIndex","disabled"],"mappings":";;;;+BAsBgBA;;;eAAAA;;;uBAtBmC;AAsB5C,SAASA,UAAU,EACxBC,cAAc,QAAQ,EACtBC,OAAO,QAAQ,EACfC,aAAa,KAAK,EAClBC,IAAI,EACJC,MAAM,EACNC,GAAG,EACHC,IAAI,EACJC,IAAI,EACJC,KAAK,EACLC,OAAO,EACPC,OAAO,EACQ;IACf,MAAMC,cAAcC,IAAAA,kBAAW,EAC7B,CAACC;QACC,IAAIX,YAAY;YACd;QACF;QAEAO,oBAAAA,8BAAAA,QAAUI;QACVH,oBAAAA,8BAAAA,QAAUG;IACZ,GACA;QAACX;QAAYO;QAASC;KAAQ;IAGhC,SAASI;QACP,IAAIR,MAAM;YACR,OAAOA;QACT;QAEA,IAAIN,gBAAgB,KAAK;YACvB,OAAOe;QACT;QAEA,OAAO;IACT;IAEA,MAAMC,aACJhB,gBAAgB,WACZ;QAAEC;IAAK,IACP;QACEK,MAAMQ;IACR;IAEN,OAAO;QACLG,aAAa;YACXd,MAAMH,gBAAgB,MAAMG,OAAOY;YACnCX,QAAQJ,gBAAgB,MAAMI,SAASW;YACvCV,KAAKL,gBAAgB,MAAMK,MAAMU;YACjCG,UAAUhB,aAAa,CAAC,IAAI;YAC5BiB,UAAUjB,cAAca;YACxB,iBAAiBb,cAAca;YAC/BR,MACEP,gBAAgB,WAAWA,gBAAgB,WAAWO,OAAOQ;YAC/DP,OACER,gBAAgB,WAAWA,gBAAgB,WAAWQ,QAAQO;YAChE,GAAGC,UAAU;YACbP,SAASE;QACX;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/hooks/useLabel/useLabel.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport { LabelHTMLAttributes, useId, useRef } from \"react\";\n\nexport type UseLabelProps = {\n id?: string | undefined;\n label?: string | undefined;\n \"aria-label\"?: string | undefined;\n \"aria-labelledby\"?: string | undefined;\n labelElementType?: \"label\" | \"span\" | undefined;\n};\n\nexport type UseLabelReturn = {\n labelProps: {\n id?: string | undefined;\n } & LabelHTMLAttributes<HTMLLabelElement>;\n fieldProps: LabellingProps;\n};\n\nexport type LabellingProps = {\n id?: string | undefined;\n \"aria-label\"?: string | undefined;\n \"aria-labelledby\"?: string | undefined;\n \"aria-describedby\"?: string | undefined;\n \"aria-details\"?: string | undefined;\n};\n\nexport function useLabel({\n id: providedId,\n label,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n labelElementType = \"label\",\n}: UseLabelProps) {\n let labelProps: UseLabelReturn[\"labelProps\"] = {};\n let fieldProps: UseLabelReturn[\"fieldProps\"] = {};\n\n const hasWarnedAboutMissingLabels = useRef(false);\n\n const fallbackId = useId();\n const id = providedId || fallbackId;\n const labelId = useId();\n\n if (label) {\n // eslint-disable-next-line no-param-reassign\n ariaLabelledby = ariaLabelledby ? `${labelId} ${ariaLabelledby}` : labelId;\n labelProps = {\n id: labelId,\n htmlFor: labelElementType === \"label\" ? id : undefined,\n };\n } else if (\n !ariaLabelledby &&\n !ariaLabel &&\n !hasWarnedAboutMissingLabels.current\n ) {\n hasWarnedAboutMissingLabels.current = true;\n console.warn(\n \"If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility\",\n );\n }\n\n fieldProps = {\n id,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n };\n\n return {\n labelProps,\n fieldProps,\n };\n}\n"],"names":["useLabel","id","providedId","label","ariaLabel","ariaLabelledby","labelElementType","labelProps","fieldProps","hasWarnedAboutMissingLabels","useRef","fallbackId","useId","labelId","htmlFor","undefined","current","console","warn"],"mappings":"AAAA,6BAA6B;;;;+BA0BbA;;;eAAAA;;;uBAzBmC;AAyB5C,SAASA,SAAS,EACvBC,IAAIC,UAAU,EACdC,KAAK,EACL,cAAcC,SAAS,EACvB,mBAAmBC,cAAc,EACjCC,mBAAmB,OAAO,EACZ;IACd,IAAIC,aAA2C,CAAC;IAChD,IAAIC,aAA2C,CAAC;IAEhD,MAAMC,8BAA8BC,IAAAA,aAAM,EAAC;IAE3C,MAAMC,aAAaC,IAAAA,YAAK;IACxB,MAAMX,KAAKC,cAAcS;IACzB,MAAME,UAAUD,IAAAA,YAAK;IAErB,IAAIT,OAAO;QACT,6CAA6C;QAC7CE,iBAAiBA,iBAAiB,
|
|
1
|
+
{"version":3,"sources":["../../../../src/hooks/useLabel/useLabel.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport { LabelHTMLAttributes, useId, useRef } from \"react\";\n\nexport type UseLabelProps = {\n id?: string | undefined;\n label?: string | undefined;\n \"aria-label\"?: string | undefined;\n \"aria-labelledby\"?: string | undefined;\n labelElementType?: \"label\" | \"span\" | undefined;\n};\n\nexport type UseLabelReturn = {\n labelProps: {\n id?: string | undefined;\n } & LabelHTMLAttributes<HTMLLabelElement>;\n fieldProps: LabellingProps;\n};\n\nexport type LabellingProps = {\n id?: string | undefined;\n \"aria-label\"?: string | undefined;\n \"aria-labelledby\"?: string | undefined;\n \"aria-describedby\"?: string | undefined;\n \"aria-details\"?: string | undefined;\n};\n\nexport function useLabel({\n id: providedId,\n label,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n labelElementType = \"label\",\n}: UseLabelProps) {\n let labelProps: UseLabelReturn[\"labelProps\"] = {};\n let fieldProps: UseLabelReturn[\"fieldProps\"] = {};\n\n const hasWarnedAboutMissingLabels = useRef(false);\n\n const fallbackId = useId();\n const id = providedId || fallbackId;\n const labelId = useId();\n\n if (label) {\n // eslint-disable-next-line no-param-reassign\n ariaLabelledby = ariaLabelledby ? `${labelId} ${ariaLabelledby}` : labelId;\n labelProps = {\n id: labelId,\n htmlFor: labelElementType === \"label\" ? id : undefined,\n };\n } else if (\n !ariaLabelledby &&\n !ariaLabel &&\n !hasWarnedAboutMissingLabels.current\n ) {\n hasWarnedAboutMissingLabels.current = true;\n console.warn(\n \"If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility\",\n );\n }\n\n fieldProps = {\n id,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n };\n\n return {\n labelProps,\n fieldProps,\n };\n}\n"],"names":["useLabel","id","providedId","label","ariaLabel","ariaLabelledby","labelElementType","labelProps","fieldProps","hasWarnedAboutMissingLabels","useRef","fallbackId","useId","labelId","htmlFor","undefined","current","console","warn"],"mappings":"AAAA,6BAA6B;;;;+BA0BbA;;;eAAAA;;;uBAzBmC;AAyB5C,SAASA,SAAS,EACvBC,IAAIC,UAAU,EACdC,KAAK,EACL,cAAcC,SAAS,EACvB,mBAAmBC,cAAc,EACjCC,mBAAmB,OAAO,EACZ;IACd,IAAIC,aAA2C,CAAC;IAChD,IAAIC,aAA2C,CAAC;IAEhD,MAAMC,8BAA8BC,IAAAA,aAAM,EAAC;IAE3C,MAAMC,aAAaC,IAAAA,YAAK;IACxB,MAAMX,KAAKC,cAAcS;IACzB,MAAME,UAAUD,IAAAA,YAAK;IAErB,IAAIT,OAAO;QACT,6CAA6C;QAC7CE,iBAAiBA,iBAAiB,GAAGQ,QAAQ,CAAC,EAAER,gBAAgB,GAAGQ;QACnEN,aAAa;YACXN,IAAIY;YACJC,SAASR,qBAAqB,UAAUL,KAAKc;QAC/C;IACF,OAAO,IACL,CAACV,kBACD,CAACD,aACD,CAACK,4BAA4BO,OAAO,EACpC;QACAP,4BAA4BO,OAAO,GAAG;QACtCC,QAAQC,IAAI,CACV;IAEJ;IAEAV,aAAa;QACXP;QACA,cAAcG;QACd,mBAAmBC;IACrB;IAEA,OAAO;QACLE;QACAC;IACF;AACF"}
|