@knkcs/anker 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atoms/index.d.ts +16 -3
- package/dist/atoms/index.js +89 -6
- package/dist/atoms/index.js.map +1 -1
- package/dist/chunk-5YDCDC4B.js +12 -0
- package/dist/chunk-5YDCDC4B.js.map +1 -0
- package/dist/{chunk-C4JI3JNA.js → chunk-6H4LQUMM.js} +4 -33
- package/dist/chunk-6H4LQUMM.js.map +1 -0
- package/dist/{chunk-PZCL4M6I.js → chunk-E7KRPPCQ.js} +5 -18
- package/dist/chunk-E7KRPPCQ.js.map +1 -0
- package/dist/{chunk-GJTQLZ4O.js → chunk-KVPN6T6J.js} +6 -28
- package/dist/chunk-KVPN6T6J.js.map +1 -0
- package/dist/chunk-OU6H3KU4.js +21 -0
- package/dist/chunk-OU6H3KU4.js.map +1 -0
- package/dist/chunk-SJ6YXNZW.js +30 -0
- package/dist/chunk-SJ6YXNZW.js.map +1 -0
- package/dist/chunk-SJIYWHIV.js +51 -0
- package/dist/chunk-SJIYWHIV.js.map +1 -0
- package/dist/chunk-WEP2AIQ5.js +37 -0
- package/dist/chunk-WEP2AIQ5.js.map +1 -0
- package/dist/chunk-WQIEF5N3.js +52 -0
- package/dist/chunk-WQIEF5N3.js.map +1 -0
- package/dist/{chunk-QU3FF5WI.js → chunk-ZFBDVERP.js} +4 -8
- package/dist/chunk-ZFBDVERP.js.map +1 -0
- package/dist/components/index.d.ts +171 -3
- package/dist/components/index.js +685 -11
- package/dist/components/index.js.map +1 -1
- package/dist/feedback/index.d.ts +20 -1
- package/dist/feedback/index.js +121 -4
- package/dist/feedback/index.js.map +1 -1
- package/dist/forms/index.d.ts +23 -15
- package/dist/forms/index.js +71 -47
- package/dist/forms/index.js.map +1 -1
- package/dist/primitives/index.js +8 -49
- package/dist/primitives/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-7UJ4QEUW.js +0 -37
- package/dist/chunk-7UJ4QEUW.js.map +0 -1
- package/dist/chunk-C4JI3JNA.js.map +0 -1
- package/dist/chunk-GJTQLZ4O.js.map +0 -1
- package/dist/chunk-PZCL4M6I.js.map +0 -1
- package/dist/chunk-QU3FF5WI.js.map +0 -1
- package/dist/chunk-RJPEVNMJ.js +0 -23
- package/dist/chunk-RJPEVNMJ.js.map +0 -1
package/package.json
CHANGED
package/dist/chunk-7UJ4QEUW.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Skeleton as Skeleton$1, Stack, Circle } from '@chakra-ui/react';
|
|
2
|
-
export { Box, Center, Code, Container, Flex, Grid, GridItem, HStack, Heading, Link, Spacer, Stack, Text, VStack } from '@chakra-ui/react';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
// src/primitives/layout.tsx
|
|
6
|
-
var Skeleton = (props) => {
|
|
7
|
-
return /* @__PURE__ */ jsx(Skeleton$1, { ...props });
|
|
8
|
-
};
|
|
9
|
-
Skeleton.displayName = "Skeleton";
|
|
10
|
-
var SkeletonText = ({
|
|
11
|
-
lines = 3,
|
|
12
|
-
gap = 3
|
|
13
|
-
}) => {
|
|
14
|
-
return /* @__PURE__ */ jsx(Stack, { gap, children: Array.from({ length: lines }).map((_, i) => {
|
|
15
|
-
const isLast = i === lines - 1;
|
|
16
|
-
return /* @__PURE__ */ jsx(
|
|
17
|
-
Skeleton$1,
|
|
18
|
-
{
|
|
19
|
-
height: "3",
|
|
20
|
-
width: isLast ? "80%" : "100%",
|
|
21
|
-
borderRadius: "sm"
|
|
22
|
-
},
|
|
23
|
-
isLast ? "last" : `line-${String(i)}`
|
|
24
|
-
);
|
|
25
|
-
}) });
|
|
26
|
-
};
|
|
27
|
-
SkeletonText.displayName = "SkeletonText";
|
|
28
|
-
var SkeletonCircle = ({
|
|
29
|
-
size = 10
|
|
30
|
-
}) => {
|
|
31
|
-
return /* @__PURE__ */ jsx(Circle, { asChild: true, size, children: /* @__PURE__ */ jsx(Skeleton$1, {}) });
|
|
32
|
-
};
|
|
33
|
-
SkeletonCircle.displayName = "SkeletonCircle";
|
|
34
|
-
|
|
35
|
-
export { Skeleton, SkeletonCircle, SkeletonText };
|
|
36
|
-
//# sourceMappingURL=chunk-7UJ4QEUW.js.map
|
|
37
|
-
//# sourceMappingURL=chunk-7UJ4QEUW.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/primitives/skeleton.tsx"],"names":["ChakraSkeleton","Stack"],"mappings":";;;;;AAWO,IAAM,QAAA,GAAoC,CAAC,KAAA,KAAU;AAC3D,EAAA,uBAAO,GAAA,CAACA,UAAA,EAAA,EAAgB,GAAG,KAAA,EAAO,CAAA;AACnC;AACA,QAAA,CAAS,WAAA,GAAc,UAAA;AAUhB,IAAM,eAA4C,CAAC;AAAA,EACzD,KAAA,GAAQ,CAAA;AAAA,EACR,GAAA,GAAM;AACP,CAAA,KAAM;AACL,EAAA,uBACC,GAAA,CAACC,KAAAA,EAAA,EAAM,GAAA,EACL,gBAAM,IAAA,CAAK,EAAE,MAAA,EAAQ,KAAA,EAAO,CAAA,CAAE,GAAA,CAAI,CAAC,GAAG,CAAA,KAAM;AAC5C,IAAA,MAAM,MAAA,GAAS,MAAM,KAAA,GAAQ,CAAA;AAC7B,IAAA,uBACC,GAAA;AAAA,MAACD,UAAA;AAAA,MAAA;AAAA,QAEA,MAAA,EAAO,GAAA;AAAA,QACP,KAAA,EAAO,SAAS,KAAA,GAAQ,MAAA;AAAA,QACxB,YAAA,EAAa;AAAA,OAAA;AAAA,MAHR,MAAA,GAAS,MAAA,GAAS,CAAA,KAAA,EAAQ,MAAA,CAAO,CAAC,CAAC,CAAA;AAAA,KAIzC;AAAA,EAEF,CAAC,CAAA,EACF,CAAA;AAEF;AACA,YAAA,CAAa,WAAA,GAAc,cAAA;AAGpB,IAAM,iBAAuD,CAAC;AAAA,EACpE,IAAA,GAAO;AACR,CAAA,KAAM;AACL,EAAA,2BACE,MAAA,EAAA,EAAO,OAAA,EAAO,MAAC,IAAA,EACf,QAAA,kBAAA,GAAA,CAACA,cAAe,CAAA,EACjB,CAAA;AAEF;AACA,cAAA,CAAe,WAAA,GAAc,gBAAA","file":"chunk-7UJ4QEUW.js","sourcesContent":["import {\n\tSkeleton as ChakraSkeleton,\n\ttype SkeletonProps as ChakraSkeletonProps,\n\tCircle,\n\tStack,\n} from \"@chakra-ui/react\";\nimport type React from \"react\";\n\nexport type SkeletonProps = ChakraSkeletonProps;\n\n/** Rectangular skeleton placeholder. */\nexport const Skeleton: React.FC<SkeletonProps> = (props) => {\n\treturn <ChakraSkeleton {...props} />;\n};\nSkeleton.displayName = \"Skeleton\";\n\nexport interface SkeletonTextProps {\n\t/** Number of text lines. @default 3 */\n\tlines?: number;\n\t/** Gap between lines. @default 3 */\n\tgap?: number | string;\n}\n\n/** Multi-line text skeleton placeholder. */\nexport const SkeletonText: React.FC<SkeletonTextProps> = ({\n\tlines = 3,\n\tgap = 3,\n}) => {\n\treturn (\n\t\t<Stack gap={gap}>\n\t\t\t{Array.from({ length: lines }).map((_, i) => {\n\t\t\t\tconst isLast = i === lines - 1;\n\t\t\t\treturn (\n\t\t\t\t\t<ChakraSkeleton\n\t\t\t\t\t\tkey={isLast ? \"last\" : `line-${String(i)}`}\n\t\t\t\t\t\theight=\"3\"\n\t\t\t\t\t\twidth={isLast ? \"80%\" : \"100%\"}\n\t\t\t\t\t\tborderRadius=\"sm\"\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t})}\n\t\t</Stack>\n\t);\n};\nSkeletonText.displayName = \"SkeletonText\";\n\n/** Circular skeleton placeholder for avatars. */\nexport const SkeletonCircle: React.FC<{ size?: string | number }> = ({\n\tsize = 10,\n}) => {\n\treturn (\n\t\t<Circle asChild size={size}>\n\t\t\t<ChakraSkeleton />\n\t\t</Circle>\n\t);\n};\nSkeletonCircle.displayName = \"SkeletonCircle\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/primitives/leave-page-confirmation.tsx","../src/primitives/native-select.tsx","../src/primitives/number-input.tsx","../src/primitives/popover.tsx","../src/primitives/radio.tsx"],"names":["NativeSelect","jsxs","ChakraNativeSelect","jsx","NumberInput","ChakraNumberInput","Popover","ChakraPopover","PopoverContent","Portal","Radio","ChakraRadioGroup"],"mappings":";;;;;AAqBO,IAAM,qBAAA,GAA8D,CAC1E,KAAA,KACI;AACJ,EAAA,MAAM;AAAA,IACL,OAAA;AAAA,IACA,cAAA;AAAA,IACA,aAAA;AAAA,IACA,KAAA,GAAQ,0BAAA;AAAA,IACR,OAAA,GAAU,qEAAA;AAAA,IACV,YAAA,GAAe,OAAA;AAAA,IACf,WAAA,GAAc;AAAA,GACf,GAAI,KAAA;AAEJ,EAAA,MAAM,SAAA,GAAY,OAAiC,IAAI,CAAA;AAEvD,EAAA,uBACC,GAAA;AAAA,IAAC,MAAA,CAAO,IAAA;AAAA,IAAP;AAAA,MACA,IAAA,EAAM,OAAA;AAAA,MACN,cAAA,EAAgB,MAAM,SAAA,CAAU,OAAA;AAAA,MAChC,IAAA,EAAK,aAAA;AAAA,MACL,YAAA,EAAc,CAAC,CAAA,KAAM;AACpB,QAAA,IAAI,CAAC,EAAE,IAAA,EAAM;AACZ,UAAA,aAAA,EAAc;AAAA,QACf;AAAA,MACD,CAAA;AAAA,MAEA,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EACA,QAAA,kBAAA,GAAA,CAAC,MAAA,CAAO,QAAA,EAAP,EACA,QAAA,kBAAA,GAAA,CAAC,MAAA,CAAO,UAAA,EAAP,EACA,QAAA,kBAAA,IAAA,CAAC,MAAA,CAAO,SAAP,EACA,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,OAAO,MAAA,EAAP,EAAc,UAAS,IAAA,EAAK,UAAA,EAAW,QACtC,QAAA,EAAA,KAAA,EACF,CAAA;AAAA,wBACA,GAAA,CAAC,MAAA,CAAO,IAAA,EAAP,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AA,EAAuD;AACtD,EAAA,MAAM,EAAE,QAAA,EAAU,UAAA,EAAY,OAAA,EAAS,GAAG,MAAK,GAAI,KAAA;AACnD,EAAA,uBACCT,KAACU,YAAA,CAAiB,IAAA,EAAjB,EAAsB,GAAA,EAAK,OAAA,EAAU,GAAG,IAAA,EACxC,QAAA,EAAA;AAAA,oBAAAR,IAACQ,YAAA,CAAiB,eAAA,EAAjB,EAAiC,GAAA,EAAW,GAAG,UAAA,EAAY,CAAA;AAAA,oBAC5DR,GAAAA,CAACQ,YAAA,CAAiB,aAAA,EAAjB,EAA+B,CAAA;AAAA,IAC/B,4BACAR,GAAAA,CAACQ,YAAA,CAAiB,QAAA,EAAjB,EAA2B,QAAA,EAAS;AAAA,GAAA,EAEvC,CAAA;AAEF;AACA,KAAA,CAAM,WAAA,GAAc,OAAA;AAEb,IAAM,aAAaA,YAAA,CAAiB;AAC3C,UAAA,CAAW,WAAA,GAAc,YAAA","file":"chunk-C4JI3JNA.js","sourcesContent":["import { Button, ButtonGroup, Dialog, Portal } from \"@chakra-ui/react\";\nimport type React from \"react\";\nimport { useRef } from \"react\";\n\nexport interface LeavePageConfirmationProps {\n\t/** Whether the dialog is currently open (i.e., navigation is blocked). */\n\tblocked: boolean;\n\t/** Called when the user confirms they want to leave. */\n\tonConfirmLeave: () => void;\n\t/** Called when the user cancels and wants to stay. */\n\tonCancelLeave: () => void;\n\t/** Dialog title. Defaults to \"You have unsaved changes\". */\n\ttitle?: string;\n\t/** Dialog message body. Defaults to a generic unsaved-changes prompt. */\n\tmessage?: string;\n\t/** Label for the confirm/leave button. Defaults to \"Leave\". */\n\tconfirmLabel?: string;\n\t/** Label for the cancel/stay button. Defaults to \"Stay\". */\n\tcancelLabel?: string;\n}\n\nexport const LeavePageConfirmation: React.FC<LeavePageConfirmationProps> = (\n\tprops,\n) => {\n\tconst {\n\t\tblocked,\n\t\tonConfirmLeave,\n\t\tonCancelLeave,\n\t\ttitle = \"You have unsaved changes\",\n\t\tmessage = \"Are you sure you want to leave this page? You have unsaved changes.\",\n\t\tconfirmLabel = \"Leave\",\n\t\tcancelLabel = \"Stay\",\n\t} = props;\n\n\tconst cancelRef = useRef<HTMLButtonElement | null>(null);\n\n\treturn (\n\t\t<Dialog.Root\n\t\t\topen={blocked}\n\t\t\tinitialFocusEl={() => cancelRef.current}\n\t\t\trole=\"alertdialog\"\n\t\t\tonOpenChange={(e) => {\n\t\t\t\tif (!e.open) {\n\t\t\t\t\tonCancelLeave();\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t<Portal>\n\t\t\t\t<Dialog.Backdrop>\n\t\t\t\t\t<Dialog.Positioner>\n\t\t\t\t\t\t<Dialog.Content>\n\t\t\t\t\t\t\t<Dialog.Header fontSize=\"lg\" fontWeight=\"bold\">\n\t\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t\t</Dialog.Header>\n\t\t\t\t\t\t\t<Dialog.Body>{message}</Dialog.Body>\n\t\t\t\t\t\t\t<Dialog.Footer>\n\t\t\t\t\t\t\t\t<ButtonGroup>\n\t\t\t\t\t\t\t\t\t<Button variant=\"solid\" onClick={onConfirmLeave}>\n\t\t\t\t\t\t\t\t\t\t{confirmLabel}\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\t\t\tonClick={onCancelLeave}\n\t\t\t\t\t\t\t\t\t\tref={cancelRef}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{cancelLabel}\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t</ButtonGroup>\n\t\t\t\t\t\t\t</Dialog.Footer>\n\t\t\t\t\t\t</Dialog.Content>\n\t\t\t\t\t</Dialog.Positioner>\n\t\t\t\t</Dialog.Backdrop>\n\t\t\t</Portal>\n\t\t</Dialog.Root>\n\t);\n};\nLeavePageConfirmation.displayName = \"LeavePageConfirmation\";\n","import {\n\tNativeSelect as ChakraNativeSelect,\n\ttype NativeSelectFieldProps,\n\ttype NativeSelectRootProps,\n} from \"@chakra-ui/react\";\nimport type * as React from \"react\";\n\nexport interface NativeSelectProps\n\textends Omit<NativeSelectFieldProps, \"placeholder\"> {\n\t/** Props forwarded to the root wrapper. */\n\tsize?: NativeSelectRootProps[\"size\"];\n\tvariant?: NativeSelectRootProps[\"variant\"];\n\tdisabled?: NativeSelectRootProps[\"disabled\"];\n\tinvalid?: NativeSelectRootProps[\"invalid\"];\n\tunstyled?: NativeSelectRootProps[\"unstyled\"];\n\t/** Rendered as a disabled first <option> */\n\tplaceholder?: string;\n}\n\nexport const NativeSelect = function NativeSelect({\n\tref,\n\t...props\n}: NativeSelectProps & { ref?: React.Ref<HTMLSelectElement> }) {\n\tconst {\n\t\tsize,\n\t\tvariant,\n\t\tdisabled,\n\t\tinvalid,\n\t\tunstyled,\n\t\tplaceholder,\n\t\tchildren,\n\t\t...fieldProps\n\t} = props;\n\n\treturn (\n\t\t<ChakraNativeSelect.Root\n\t\t\tsize={size}\n\t\t\tvariant={variant}\n\t\t\tdisabled={disabled}\n\t\t\tinvalid={invalid}\n\t\t\tunstyled={unstyled}\n\t\t>\n\t\t\t<ChakraNativeSelect.Field ref={ref} {...fieldProps}>\n\t\t\t\t{placeholder && (\n\t\t\t\t\t<option value=\"\" disabled>\n\t\t\t\t\t\t{placeholder}\n\t\t\t\t\t</option>\n\t\t\t\t)}\n\t\t\t\t{children}\n\t\t\t</ChakraNativeSelect.Field>\n\t\t\t<ChakraNativeSelect.Indicator />\n\t\t</ChakraNativeSelect.Root>\n\t);\n};\nNativeSelect.displayName = \"NativeSelect\";\n","import { NumberInput as ChakraNumberInput } from \"@chakra-ui/react\";\nimport type * as React from \"react\";\n\nexport interface NumberInputProps extends ChakraNumberInput.RootProps {\n\tshowStepper?: boolean;\n}\n\nexport const NumberInputRoot = function NumberInput({\n\tref,\n\t...props\n}: NumberInputProps & { ref?: React.Ref<HTMLDivElement> }) {\n\tconst { children, showStepper = true, ...rest } = props;\n\treturn (\n\t\t<ChakraNumberInput.Root ref={ref} variant=\"outline\" {...rest}>\n\t\t\t{children}\n\t\t\t{showStepper && (\n\t\t\t\t<ChakraNumberInput.Control>\n\t\t\t\t\t<ChakraNumberInput.IncrementTrigger />\n\t\t\t\t\t<ChakraNumberInput.DecrementTrigger />\n\t\t\t\t</ChakraNumberInput.Control>\n\t\t\t)}\n\t\t</ChakraNumberInput.Root>\n\t);\n};\nNumberInputRoot.displayName = \"NumberInputRoot\";\n\nexport const NumberInputField = ChakraNumberInput.Input;\nNumberInputField.displayName = \"NumberInputField\";\nexport const NumberInputScrubber = ChakraNumberInput.Scrubber;\nNumberInputScrubber.displayName = \"NumberInputScrubber\";\nexport const NumberInputLabel = ChakraNumberInput.Label;\nNumberInputLabel.displayName = \"NumberInputLabel\";\n","import { Popover as ChakraPopover, Portal } from \"@chakra-ui/react\";\nimport type * as React from \"react\";\n\nexport type PopoverProps = ChakraPopover.RootProps;\n\nexport const Popover = function Popover(props: PopoverProps) {\n\treturn <ChakraPopover.Root {...props}>{props.children}</ChakraPopover.Root>;\n};\nPopover.displayName = \"Popover\";\n\nexport const PopoverTrigger = ChakraPopover.Trigger;\nPopoverTrigger.displayName = \"PopoverTrigger\";\n\nexport interface PopoverContentProps extends ChakraPopover.ContentProps {\n\t/** Whether to show an arrow. @default false */\n\tshowArrow?: boolean;\n\t/** Whether to render in a portal. @default true */\n\tportalled?: boolean;\n\t/** Container ref for portal. */\n\tportalRef?: React.RefObject<HTMLElement | null>;\n}\n\nexport const PopoverContent = function PopoverContent({\n\tref,\n\t...props\n}: PopoverContentProps & { ref?: React.Ref<HTMLDivElement> }) {\n\tconst { showArrow, portalled = true, portalRef, children, ...rest } = props;\n\treturn (\n\t\t<Portal disabled={!portalled} container={portalRef}>\n\t\t\t<ChakraPopover.Positioner>\n\t\t\t\t<ChakraPopover.Content ref={ref} {...rest}>\n\t\t\t\t\t{showArrow && (\n\t\t\t\t\t\t<ChakraPopover.Arrow>\n\t\t\t\t\t\t\t<ChakraPopover.ArrowTip />\n\t\t\t\t\t\t</ChakraPopover.Arrow>\n\t\t\t\t\t)}\n\t\t\t\t\t{children}\n\t\t\t\t</ChakraPopover.Content>\n\t\t\t</ChakraPopover.Positioner>\n\t\t</Portal>\n\t);\n};\nPopoverContent.displayName = \"PopoverContent\";\n\nexport const PopoverHeader = ChakraPopover.Header;\nPopoverHeader.displayName = \"PopoverHeader\";\n\nexport const PopoverBody = ChakraPopover.Body;\nPopoverBody.displayName = \"PopoverBody\";\n\nexport const PopoverFooter = ChakraPopover.Footer;\nPopoverFooter.displayName = \"PopoverFooter\";\n\nexport const PopoverCloseTrigger = ChakraPopover.CloseTrigger;\nPopoverCloseTrigger.displayName = \"PopoverCloseTrigger\";\n\nexport const PopoverTitle = ChakraPopover.Title;\nPopoverTitle.displayName = \"PopoverTitle\";\n\nexport const PopoverDescription = ChakraPopover.Description;\nPopoverDescription.displayName = \"PopoverDescription\";\n","import { RadioGroup as ChakraRadioGroup } from \"@chakra-ui/react\";\nimport type * as React from \"react\";\n\nexport interface RadioProps extends ChakraRadioGroup.ItemProps {\n\t/** Ref attached to the root element. */\n\trootRef?: React.RefObject<HTMLDivElement | null>;\n\t/** Additional props forwarded to the hidden input element. */\n\tinputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n}\n\nexport const Radio = function Radio({\n\tref,\n\t...props\n}: RadioProps & { ref?: React.Ref<HTMLInputElement> }) {\n\tconst { children, inputProps, rootRef, ...rest } = props;\n\treturn (\n\t\t<ChakraRadioGroup.Item ref={rootRef} {...rest}>\n\t\t\t<ChakraRadioGroup.ItemHiddenInput ref={ref} {...inputProps} />\n\t\t\t<ChakraRadioGroup.ItemIndicator />\n\t\t\t{children && (\n\t\t\t\t<ChakraRadioGroup.ItemText>{children}</ChakraRadioGroup.ItemText>\n\t\t\t)}\n\t\t</ChakraRadioGroup.Item>\n\t);\n};\nRadio.displayName = \"Radio\";\n\nexport const RadioGroup = ChakraRadioGroup.Root;\nRadioGroup.displayName = \"RadioGroup\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/atoms/button/button.tsx","../src/atoms/button/icon-button.tsx","../src/atoms/datetime/utils/relative-date-time-utils.ts","../src/atoms/status-badge/status-badge.tsx"],"names":["ChakraButton","jsx","ChakraIconButton"],"mappings":";;;;;;;;;;AAIO,IAAM,SAAS,CAAC;AAAA,EACtB,GAAA;AAAA,EACA,GAAG;AACJ,CAAA,KAA4D;AAC3D,EAAA,uBACC,GAAA;AAAA,IAACA,QAAA;AAAA,IAAA;AAAA,MACA,IAAA,EAAK,IAAA;AAAA,MACL,OAAA,EAAS,WAAA;AAAA,MACT,GAAA;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF;AACA,MAAA,CAAO,WAAA,GAAc,QAAA;ACVd,IAAM,aAAa,CAAC;AAAA,EAC1B,GAAA;AAAA,EACA,GAAG;AACJ,CAAA,KAAgE;AAC/D,EAAA,uBAAOC,IAACC,YAAA,EAAA,EAAiB,IAAA,EAAK,MAAK,OAAA,EAAQ,OAAA,EAAQ,GAAA,EAAW,GAAG,KAAA,EAAO,CAAA;AACzE;AACA,UAAA,CAAW,WAAA,GAAc,YAAA;ACRzB,KAAA,CAAM,OAAO,SAAS,CAAA;AACtB,KAAA,CAAM,OAAO,YAAY,CAAA;AACzB,KAAA,CAAM,OAAO,cAAc,CAAA;AAmBpB,SAAS,sBAAA,CACf,IAAA,EACA,QAAA,mBAAqB,IAAI,MAAK,EAC7B;AACD,EAAA,OAAO,KAAA,CAAM,IAAI,CAAA,CAAE,IAAA,CAAK,QAAQ,CAAA;AACjC;AAmBO,SAAS,mCAAA,CACf,IAAA,EACA,QAAA,mBAAqB,IAAI,MAAK,EAC7B;AACD,EAAA,MAAM,UAAU,KAAA,CAAM,IAAI,CAAA,CAAE,MAAA,CAAO,UAAU,KAAK,CAAA;AAElD,EAAA,IAAI,CAAC,OAAA,EAAS;AAGb,IAAA,OAAO,KAAA,CAAM,IAAI,CAAA,CAAE,QAAA,CAAS,QAAA,EAAU;AAAA,MACrC,QAAA,EAAU;AAAA,KACV,CAAA;AAAA,EACF;AAGA,EAAA,OAAO,sBAAA,CAAuB,MAAM,QAAQ,CAAA;AAC7C;ACtDO,IAAM,WAAA,GAA0C,CAAC,KAAA,KAAU;AACjE,EAAA,MAAM,EAAE,KAAA,EAAO,KAAA,EAAM,GAAI,KAAA;AAEzB,EAAA,MAAM,SAAA,GAAY,QAAQ,MAAM;AAC/B,IAAA,IAAI;AACH,MAAA,OAAO,cAAc,KAAK,CAAA;AAAA,IAC3B,CAAA,CAAA,MAAQ;AACP,MAAA,OAAO,OAAA;AAAA,IACR;AAAA,EACD,CAAA,EAAG,CAAC,KAAK,CAAC,CAAA;AAEV,EAAA,uBACCD,GAAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACA,EAAA,EAAI,KAAA;AAAA,MACJ,KAAA,EAAO,SAAA;AAAA,MACP,OAAA,EAAQ,MAAA;AAAA,MACR,EAAA,EAAI,CAAA;AAAA,MACJ,iBAAA,EAAmB,CAAA;AAAA,MAElB,QAAA,EAAA;AAAA;AAAA,GACF;AAEF;AAEA,WAAA,CAAY,WAAA,GAAc,aAAA","file":"chunk-GJTQLZ4O.js","sourcesContent":["import { type ButtonProps, Button as ChakraButton } from \"@chakra-ui/react\";\n\nexport type { ButtonProps };\n\nexport const Button = ({\n\tref,\n\t...props\n}: ButtonProps & { ref?: React.Ref<HTMLButtonElement> }) => {\n\treturn (\n\t\t<ChakraButton\n\t\t\tsize=\"md\"\n\t\t\tvariant={\"secondary\" as ButtonProps[\"variant\"]}\n\t\t\tref={ref}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\nButton.displayName = \"Button\";\n","import {\n\tIconButton as ChakraIconButton,\n\ttype IconButtonProps,\n} from \"@chakra-ui/react\";\n\nexport type { IconButtonProps };\n\nexport const IconButton = ({\n\tref,\n\t...props\n}: IconButtonProps & { ref?: React.Ref<HTMLButtonElement> }) => {\n\treturn <ChakraIconButton size=\"md\" variant=\"ghost\" ref={ref} {...props} />;\n};\nIconButton.displayName = \"IconButton\";\n","import dayjs from \"dayjs\";\nimport calendarPlugin from \"dayjs/plugin/calendar.js\";\nimport relativeTime from \"dayjs/plugin/relativeTime.js\";\nimport utcPlugin from \"dayjs/plugin/utc.js\";\n\ndayjs.extend(utcPlugin);\ndayjs.extend(relativeTime);\ndayjs.extend(calendarPlugin);\n\nimport type { DateType } from \"../types\";\n\n/**\n * A function that will return a string with how far a given date is in the past or future,\n * using a baseDate as reference. If the baseDate is not passed, the function will use today as reference.\n *\n * @param date - the date to be formatted\n * @param baseDate - the date that should be used as a reference (default is \"today\")\n * @returns a relative date\n *\n * @example\n * // Considering today as 18.08.2021\n * formatRelativeDateTime('2021-08-17T15:45:00') // returns \"a day ago\"\n *\n * @example\n * formatRelativeDateTime('2021-08-17T15:45:00', '2021-08-16') // returns \"in a day\"\n */\nexport function formatRelativeDateTime(\n\tdate: DateType,\n\tbaseDate: DateType = new Date(),\n) {\n\treturn dayjs(date).from(baseDate);\n}\n\n/**\n * A function that formats a date relative to Today or to the `baseDate` if passed.\n * If the date is not today, it will return a string with \"Yesterday ...\", \"Tomorrow ...\", etc\n * If the date is not in the current week, it return a string with \"DD MMM YYYY\" format\n * If the date is today, it will return a string with \"... ago\" or \"in ...\"\n *\n * @param date - the date to be formatted\n * @param baseDate - the date that should be used as a reference (default is \"today\")\n * @returns a relative date\n *\n * @example\n * // Considering today as 18.08.2021\n * formatRelativeToCurrentWeekDateTime('2021-08-17T15:45:00') // returns \"Yesterday at 3:45 PM\"\n *\n * @example\n * formatRelativeToCurrentWeekDateTime('2021-08-17T15:45:00', '2021-08-16') // returns \"Tomorrow at 3:45 PM\"\n */\nexport function formatRelativeToCurrentWeekDateTime(\n\tdate: DateType,\n\tbaseDate: DateType = new Date(),\n) {\n\tconst isToday = dayjs(date).isSame(baseDate, \"day\");\n\n\tif (!isToday) {\n\t\t// if the date is not today, we display it with \"Yesterday\", \"Tomorrow\", etc.\n\t\t// and if the date is not in the current week then it will display \"17 Aug 2021\"\n\t\treturn dayjs(date).calendar(baseDate, {\n\t\t\tsameElse: \"DD MMM YYYY\",\n\t\t});\n\t}\n\n\t// returns \"... ago\"\n\treturn formatRelativeDateTime(date, baseDate);\n}\n","import { Badge } from \"@chakra-ui/react\";\nimport { readableColor } from \"color2k\";\nimport type React from \"react\";\nimport { useMemo } from \"react\";\n\nexport interface StatusBadgeProps {\n\t/** The display label for the badge */\n\tlabel: string;\n\t/** The background color for the badge (hex format, e.g. \"#ff0000\") */\n\tcolor: string;\n}\n\nexport const StatusBadge: React.FC<StatusBadgeProps> = (props) => {\n\tconst { label, color } = props;\n\n\tconst textColor = useMemo(() => {\n\t\ttry {\n\t\t\treturn readableColor(color);\n\t\t} catch {\n\t\t\treturn \"black\";\n\t\t}\n\t}, [color]);\n\n\treturn (\n\t\t<Badge\n\t\t\tbg={color}\n\t\t\tcolor={textColor}\n\t\t\trounded=\"base\"\n\t\t\tpx={2}\n\t\t\tmarginInlineStart={1}\n\t\t>\n\t\t\t{label}\n\t\t</Badge>\n\t);\n};\n\nStatusBadge.displayName = \"StatusBadge\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/forms/search-input.tsx","../src/atoms/text-input/text-input.tsx"],"names":["jsx","Input"],"mappings":";;;;;;;AAmBO,IAAM,WAAA,GAA0C,CAAC,KAAA,KAAU;AACjE,EAAA,MAAM;AAAA,IACL,QAAA;AAAA,IACA,UAAA,GAAa,GAAA;AAAA,IACb,WAAA,GAAc,WAAA;AAAA,IACd,YAAA,GAAe,EAAA;AAAA,IACf,QAAA,GAAW,MAAA;AAAA,IACX,GAAG;AAAA,GACJ,GAAI,KAAA;AAEJ,EAAA,MAAM,eAAA,GAAkB,OAAA;AAAA,IACvB,MAAM,QAAA,CAAS,CAAC,SAAiB,QAAA,CAAS,IAAI,G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,EAAa,GAAG,IAAA,EAAM,GAAA,EAAU,CAAA;AAAA,IAChD,UAAU,MAAA,KAAW,EAAA,oBAAMD,GAAAA,CAAC,cAAY,QAAA,EAAA,MAAA,EAAO;AAAA,GAAA,EACjD,CAAA;AAEF,CAAA;AACA,SAAA,CAAU,WAAA,GAAc,WAAA;AAExB,IAAO,kBAAA,GAAQ","file":"chunk-PZCL4M6I.js","sourcesContent":["import { Input, InputGroup, type InputProps } from \"@chakra-ui/react\";\nimport debounce from \"lodash.debounce\";\nimport { Search } from \"lucide-react\";\nimport type React from \"react\";\nimport { useCallback, useEffect, useMemo } from \"react\";\n\nexport interface SearchInputProps\n\textends Omit<InputProps, \"onChange\" | \"defaultValue\"> {\n\t/** Called with the search query after debounce. */\n\tonSearch: (query: string) => void;\n\t/** Debounce delay in milliseconds. @default 300 */\n\tdebounceMs?: number;\n\t/** Placeholder text. @default \"Search...\" */\n\tplaceholder?: string;\n\t/** Initial value. */\n\tdefaultValue?: string;\n\tmaxWidth?: string;\n}\n\nexport const SearchInput: React.FC<SearchInputProps> = (props) => {\n\tconst {\n\t\tonSearch,\n\t\tdebounceMs = 300,\n\t\tplaceholder = \"Search...\",\n\t\tdefaultValue = \"\",\n\t\tmaxWidth = \"full\",\n\t\t...restProps\n\t} = props;\n\n\tconst debouncedSearch = useMemo(\n\t\t() => debounce((term: string) => onSearch(term), debounceMs),\n\t\t[onSearch, debounceMs],\n\t);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tdebouncedSearch.cancel();\n\t\t};\n\t}, [debouncedSearch]);\n\n\tconst handleChange = useCallback(\n\t\t(e: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tdebouncedSearch(e.target.value);\n\t\t},\n\t\t[debouncedSearch],\n\t);\n\n\treturn (\n\t\t<InputGroup maxWidth={maxWidth} startElement={<Search size={16} />}>\n\t\t\t<Input\n\t\t\t\tvariant=\"outline\"\n\t\t\t\ttype=\"text\"\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\tonChange={handleChange}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t</InputGroup>\n\t);\n};\nSearchInput.displayName = \"SearchInput\";\n","import { Group, Input, InputAddon, type InputProps } from \"@chakra-ui/react\";\nimport type React from \"react\";\n\nexport interface TextInputProps extends InputProps {\n\tappend?: string | React.ReactElement;\n\tprepend?: string | React.ReactElement;\n}\n\nconst TextInput = ({\n\tref,\n\t...props\n}: TextInputProps & { ref?: React.Ref<HTMLInputElement> }) => {\n\tconst { name, append, prepend, size, ...rest } = props;\n\treturn (\n\t\t<Group attached w=\"full\">\n\t\t\t{prepend && prepend !== \"\" && <InputAddon>{prepend}</InputAddon>}\n\t\t\t<Input id={name} size={size} {...rest} ref={ref} />\n\t\t\t{append && append !== \"\" && <InputAddon>{append}</InputAddon>}\n\t\t</Group>\n\t);\n};\nTextInput.displayName = \"TextInput\";\n\nexport default TextInput;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/primitives/avatar.tsx","../src/primitives/prose.tsx","../src/primitives/spinner.tsx"],"names":["Avatar","ChakraAvatar","ChakraAvatarGroup","jsx","ChakraSpinner"],"mappings":";;;;AAuBO,IAAM,MAAA,GAAS,SAASA,OAAAA,CAAO;AAAA,EACrC,GAAA;AAAA,EACA,GAAG;AACJ,CAAA,EAAsD;AACrD,EAAA,MAAM,EAAE,IAAA,EAAM,GAAA,EAAK,MAAA,EAAQ,OAAA,EAAS,MAAM,QAAA,EAAU,QAAA,EAAU,GAAG,IAAA,EAAK,GACrE,KAAA;AACD,EAAA,4BACEC,QAAA,CAAa,IAAA,EAAb,EAAkB,GAAA,EAAW,GAAG,IAAA,EAChC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAACA,QAAA,CAAa,QAAA,EAAb,EAAsB,IAAA,EACrB,kBAAQ,QAAA,EACV,CAAA;AAAA,wBACCA,QAAA,CAAa,KAAA,EAAb,EAAmB,GAAA,EAAU,QAAgB,OAAA,EAAkB,CAAA;AAAA,IAC/D;AAAA,GAAA,EACF,CAAA;AAEF;AACA,MAAA,CAAO,WAAA,GAAc,QAAA;AAEd,IAAM,WAAA,GAAcC;AAC3B,WAAA,CAAY,WAAA,GAAc,aAAA;ACnCnB,IAAM,QAAQ,CAAC;AAAA,EACrB,GAAA;AAAA,EACA,IAAA;AAAA,EACA,GAAG;AACJ,CAAA,KAAwD;AACvD,EAAA,MAAM,MAAA,GAAS,SAAA,CAAU,EAAE,GAAA,EAAK,SAAS,CAAA;AACzC,EAAA,MAAM,MAAA,GAAS,MAAA,CAAO,EAAE,IAAA,EAAM,CAAA;AAC9B,EAAA,uBAAOC,IAAC,MAAA,CAAO,GAAA,EAAP,EAAW,GAAA,EAAU,GAAA,EAAK,MAAA,EAAS,GAAG,KAAA,EAAO,CAAA;AACtD;AACA,KAAA,CAAM,WAAA,GAAc,OAAA;ACRb,IAAM,OAAA,GAAkC,CAAC,KAAA,KAAU;AACzD,EAAA,uBAAOA,GAAAA,CAACC,SAAA,EAAA,EAAe,GAAG,KAAA,EAAO,CAAA;AAClC;AACA,OAAA,CAAQ,WAAA,GAAc,SAAA","file":"chunk-QU3FF5WI.js","sourcesContent":["import {\n\tAvatar as ChakraAvatar,\n\tAvatarGroup as ChakraAvatarGroup,\n} from \"@chakra-ui/react\";\nimport type * as React from \"react\";\n\ntype ImageProps = React.ImgHTMLAttributes<HTMLImageElement>;\n\nexport interface AvatarProps extends ChakraAvatar.RootProps {\n\t/** Display name used to generate initials for the fallback. */\n\tname?: string;\n\t/** Image source URL. */\n\tsrc?: string;\n\t/** Image srcSet attribute for responsive images. */\n\tsrcSet?: string;\n\t/** Image loading strategy. */\n\tloading?: ImageProps[\"loading\"];\n\t/** Custom icon element shown as fallback. */\n\ticon?: React.ReactElement;\n\t/** Custom fallback content when no image or icon is provided. */\n\tfallback?: React.ReactNode;\n}\n\nexport const Avatar = function Avatar({\n\tref,\n\t...props\n}: AvatarProps & { ref?: React.Ref<HTMLDivElement> }) {\n\tconst { name, src, srcSet, loading, icon, fallback, children, ...rest } =\n\t\tprops;\n\treturn (\n\t\t<ChakraAvatar.Root ref={ref} {...rest}>\n\t\t\t<ChakraAvatar.Fallback name={name}>\n\t\t\t\t{icon || fallback}\n\t\t\t</ChakraAvatar.Fallback>\n\t\t\t<ChakraAvatar.Image src={src} srcSet={srcSet} loading={loading} />\n\t\t\t{children}\n\t\t</ChakraAvatar.Root>\n\t);\n};\nAvatar.displayName = \"Avatar\";\n\nexport const AvatarGroup = ChakraAvatarGroup;\nAvatarGroup.displayName = \"AvatarGroup\";\n","import { chakra, type HTMLChakraProps, useRecipe } from \"@chakra-ui/react\";\nimport type React from \"react\";\n\nexport interface ProseProps extends HTMLChakraProps<\"div\"> {\n\tsize?: \"md\" | \"lg\";\n}\n\nexport const Prose = ({\n\tref,\n\tsize,\n\t...props\n}: ProseProps & { ref?: React.Ref<HTMLDivElement> }) => {\n\tconst recipe = useRecipe({ key: \"prose\" });\n\tconst styles = recipe({ size });\n\treturn <chakra.div ref={ref} css={styles} {...props} />;\n};\nProse.displayName = \"Prose\";\n","import {\n\tSpinner as ChakraSpinner,\n\ttype SpinnerProps as ChakraSpinnerProps,\n} from \"@chakra-ui/react\";\nimport type React from \"react\";\n\nexport type SpinnerProps = ChakraSpinnerProps;\n\nexport const Spinner: React.FC<SpinnerProps> = (props) => {\n\treturn <ChakraSpinner {...props} />;\n};\nSpinner.displayName = \"Spinner\";\n"]}
|
package/dist/chunk-RJPEVNMJ.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Switch as Switch$1 } from '@chakra-ui/react';
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
// src/primitives/switch.tsx
|
|
5
|
-
var Switch = function Switch2({
|
|
6
|
-
ref,
|
|
7
|
-
...props
|
|
8
|
-
}) {
|
|
9
|
-
const { inputProps, children, rootRef, trackLabel, thumbLabel, ...rest } = props;
|
|
10
|
-
return /* @__PURE__ */ jsxs(Switch$1.Root, { ref: rootRef, ...rest, children: [
|
|
11
|
-
/* @__PURE__ */ jsx(Switch$1.HiddenInput, { ref, ...inputProps }),
|
|
12
|
-
/* @__PURE__ */ jsxs(Switch$1.Control, { children: [
|
|
13
|
-
/* @__PURE__ */ jsx(Switch$1.Thumb, { children: thumbLabel && /* @__PURE__ */ jsx(Switch$1.ThumbIndicator, { fallback: thumbLabel?.off, children: thumbLabel?.on }) }),
|
|
14
|
-
trackLabel && /* @__PURE__ */ jsx(Switch$1.Indicator, { fallback: trackLabel.off, children: trackLabel.on })
|
|
15
|
-
] }),
|
|
16
|
-
children != null && /* @__PURE__ */ jsx(Switch$1.Label, { children })
|
|
17
|
-
] });
|
|
18
|
-
};
|
|
19
|
-
Switch.displayName = "Switch";
|
|
20
|
-
|
|
21
|
-
export { Switch };
|
|
22
|
-
//# sourceMappingURL=chunk-RJPEVNMJ.js.map
|
|
23
|
-
//# sourceMappingURL=chunk-RJPEVNMJ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/primitives/switch.tsx"],"names":["Switch","ChakraSwitch"],"mappings":";;;;AAcO,IAAM,MAAA,GAAS,SAASA,OAAAA,CAAO;AAAA,EACrC,GAAA;AAAA,EACA,GAAG;AACJ,CAAA,EAAwD;AACvD,EAAA,MAAM,EAAE,YAAY,QAAA,EAAU,OAAA,EAAS,YAAY,UAAA,EAAY,GAAG,MAAK,GACtE,KAAA;AAED,EAAA,4BACEC,QAAA,CAAa,IAAA,EAAb,EAAkB,GAAA,EAAK,OAAA,EAAU,GAAG,IAAA,EACpC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAACA,QAAA,CAAa,WAAA,EAAb,EAAyB,GAAA,EAAW,GAAG,UAAA,EAAY,CAAA;AAAA,oBACpD,IAAA,CAACA,QAAA,CAAa,OAAA,EAAb,EACA,QAAA,EAAA;AAAA,sBAAA,GAAA,CAACA,QAAA,CAAa,KAAA,EAAb,EACC,QAAA,EAAA,UAAA,oBACA,GAAA,CAACA,QAAA,CAAa,cAAA,EAAb,EAA4B,QAAA,EAAU,UAAA,EAAY,GAAA,EACjD,QAAA,EAAA,UAAA,EAAY,IACd,CAAA,EAEF,CAAA;AAAA,MACC,UAAA,wBACCA,QAAA,CAAa,SAAA,EAAb,EAAuB,QAAA,EAAU,UAAA,CAAW,GAAA,EAC3C,QAAA,EAAA,UAAA,CAAW,EAAA,EACb;AAAA,KAAA,EAEF,CAAA;AAAA,IACC,YAAY,IAAA,oBAAQ,GAAA,CAACA,QAAA,CAAa,KAAA,EAAb,EAAoB,QAAA,EAAS;AAAA,GAAA,EACpD,CAAA;AAEF;AACA,MAAA,CAAO,WAAA,GAAc,QAAA","file":"chunk-RJPEVNMJ.js","sourcesContent":["import { Switch as ChakraSwitch } from \"@chakra-ui/react\";\nimport type * as React from \"react\";\n\nexport interface SwitchProps extends ChakraSwitch.RootProps {\n\t/** Additional props forwarded to the hidden input element. */\n\tinputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n\t/** Ref attached to the root label element. */\n\trootRef?: React.RefObject<HTMLLabelElement | null>;\n\t/** Labels displayed inside the track for on/off states. */\n\ttrackLabel?: { on: React.ReactNode; off: React.ReactNode };\n\t/** Labels displayed inside the thumb for on/off states. */\n\tthumbLabel?: { on: React.ReactNode; off: React.ReactNode };\n}\n\nexport const Switch = function Switch({\n\tref,\n\t...props\n}: SwitchProps & { ref?: React.Ref<HTMLInputElement> }) {\n\tconst { inputProps, children, rootRef, trackLabel, thumbLabel, ...rest } =\n\t\tprops;\n\n\treturn (\n\t\t<ChakraSwitch.Root ref={rootRef} {...rest}>\n\t\t\t<ChakraSwitch.HiddenInput ref={ref} {...inputProps} />\n\t\t\t<ChakraSwitch.Control>\n\t\t\t\t<ChakraSwitch.Thumb>\n\t\t\t\t\t{thumbLabel && (\n\t\t\t\t\t\t<ChakraSwitch.ThumbIndicator fallback={thumbLabel?.off}>\n\t\t\t\t\t\t\t{thumbLabel?.on}\n\t\t\t\t\t\t</ChakraSwitch.ThumbIndicator>\n\t\t\t\t\t)}\n\t\t\t\t</ChakraSwitch.Thumb>\n\t\t\t\t{trackLabel && (\n\t\t\t\t\t<ChakraSwitch.Indicator fallback={trackLabel.off}>\n\t\t\t\t\t\t{trackLabel.on}\n\t\t\t\t\t</ChakraSwitch.Indicator>\n\t\t\t\t)}\n\t\t\t</ChakraSwitch.Control>\n\t\t\t{children != null && <ChakraSwitch.Label>{children}</ChakraSwitch.Label>}\n\t\t</ChakraSwitch.Root>\n\t);\n};\nSwitch.displayName = \"Switch\";\n"]}
|