@synnaxlabs/pluto 0.21.7 → 0.21.9
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/{Center-hbwH7rg9.js → Center-BK9Rcaa0.js} +2 -2
- package/dist/{Center-hbwH7rg9.js.map → Center-BK9Rcaa0.js.map} +1 -1
- package/dist/{Center-5NJ61qfA.cjs → Center-Cc_rR5pQ.cjs} +2 -2
- package/dist/{Center-5NJ61qfA.cjs.map → Center-Cc_rR5pQ.cjs.map} +1 -1
- package/dist/{Keyboard-DaFraUsQ.cjs → Keyboard-Byx8rGZt.cjs} +3 -3
- package/dist/{Keyboard-DaFraUsQ.cjs.map → Keyboard-Byx8rGZt.cjs.map} +1 -1
- package/dist/{Keyboard-nDIAR7Rj.js → Keyboard-D31SwhYT.js} +3 -3
- package/dist/{Keyboard-nDIAR7Rj.js.map → Keyboard-D31SwhYT.js.map} +1 -1
- package/dist/{LinePlot-BZDm4uxJ.cjs → LinePlot-Bnb8Ufob.cjs} +96 -65
- package/dist/LinePlot-Bnb8Ufob.cjs.map +1 -0
- package/dist/{LinePlot-tOiSUMjC.js → LinePlot-KYwy1D7H.js} +281 -250
- package/dist/LinePlot-KYwy1D7H.js.map +1 -0
- package/dist/{Link-BdWFvK8v.cjs → Link-Bq38h1dw.cjs} +2 -2
- package/dist/{Link-BdWFvK8v.cjs.map → Link-Bq38h1dw.cjs.map} +1 -1
- package/dist/{Link-d3CXVSaO.js → Link-DQKdkwWL.js} +2 -2
- package/dist/{Link-d3CXVSaO.js.map → Link-DQKdkwWL.js.map} +1 -1
- package/dist/{List-DcsWFiLT.js → List-BmP_se57.js} +3 -3
- package/dist/{List-DcsWFiLT.js.map → List-BmP_se57.js.map} +1 -1
- package/dist/{List-PlMTfEHi.cjs → List-BnB-C5vQ.cjs} +3 -3
- package/dist/{List-PlMTfEHi.cjs.map → List-BnB-C5vQ.cjs.map} +1 -1
- package/dist/{Toggle-C6Z8WPT3.cjs → Toggle-D3iCEbO1.cjs} +46 -46
- package/dist/{Toggle-C6Z8WPT3.cjs.map → Toggle-D3iCEbO1.cjs.map} +1 -1
- package/dist/{Toggle-DGLgYCOX.js → Toggle-bT5RpwfA.js} +399 -399
- package/dist/{Toggle-DGLgYCOX.js.map → Toggle-bT5RpwfA.js.map} +1 -1
- package/dist/Video-B4sma9fk.cjs +14 -0
- package/dist/Video-B4sma9fk.cjs.map +1 -0
- package/dist/Video-Cp6XjjOK.js +15 -0
- package/dist/Video-Cp6XjjOK.js.map +1 -0
- package/dist/{aggregator-BgImZc4o.js → aggregator-B8fg7W2s.js} +106 -106
- package/dist/aggregator-B8fg7W2s.js.map +1 -0
- package/dist/{aggregator-BpfMBUD1.cjs → aggregator-Bh2Kyzkg.cjs} +100 -100
- package/dist/aggregator-Bh2Kyzkg.cjs.map +1 -0
- package/dist/align.cjs +1 -1
- package/dist/align.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/{color-DV-YGUvp.js → color-CjdRh-aN.js} +2 -2
- package/dist/{color-DV-YGUvp.js.map → color-CjdRh-aN.js.map} +1 -1
- package/dist/{color-BVVyrgRF.cjs → color-DBNbbjJy.cjs} +2 -2
- package/dist/{color-BVVyrgRF.cjs.map → color-DBNbbjJy.cjs.map} +1 -1
- package/dist/color.cjs +1 -1
- package/dist/color.js +1 -1
- package/dist/{css-Pf9qxhQ4.cjs → css-Ci8WUD5E.cjs} +112 -108
- package/dist/css-Ci8WUD5E.cjs.map +1 -0
- package/dist/{css-DoalWJF6.js → css-DKKmdhSr.js} +114 -110
- package/dist/css-DKKmdhSr.js.map +1 -0
- package/dist/css.cjs +2 -2
- package/dist/css.js +2 -2
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/ether.cjs +3 -3
- package/dist/ether.js +5 -5
- package/dist/{external-Cu6T11fi.cjs → external-9_cqFQy3.cjs} +6 -6
- package/dist/{external-Cu6T11fi.cjs.map → external-9_cqFQy3.cjs.map} +1 -1
- package/dist/{external-Blx0rtt2.cjs → external-B-zN2e5z.cjs} +6 -6
- package/dist/{external-Blx0rtt2.cjs.map → external-B-zN2e5z.cjs.map} +1 -1
- package/dist/{external-DeheWVb-.js → external-BM82B8W2.js} +6 -6
- package/dist/{external-DeheWVb-.js.map → external-BM82B8W2.js.map} +1 -1
- package/dist/{external-96EinZfY.js → external-BYqTC99W.js} +3 -3
- package/dist/external-BYqTC99W.js.map +1 -0
- package/dist/{external-5przQjJD.js → external-BfZYUV3z.js} +11 -11
- package/dist/{external-5przQjJD.js.map → external-BfZYUV3z.js.map} +1 -1
- package/dist/{external-SxB9IH0p.js → external-BpqCp_M1.js} +2 -2
- package/dist/external-BpqCp_M1.js.map +1 -0
- package/dist/{external-C6GmnG49.js → external-BrW40HJx.js} +6 -6
- package/dist/{external-C6GmnG49.js.map → external-BrW40HJx.js.map} +1 -1
- package/dist/{external-1osPryUV.js → external-CAOQcoqL.js} +5 -5
- package/dist/{external-1osPryUV.js.map → external-CAOQcoqL.js.map} +1 -1
- package/dist/{external-D8dWmF4U.cjs → external-CIVsFXOp.cjs} +2 -2
- package/dist/external-CIVsFXOp.cjs.map +1 -0
- package/dist/{external-BAdU6u03.js → external-CnNdgPsB.js} +5 -5
- package/dist/{external-BAdU6u03.js.map → external-CnNdgPsB.js.map} +1 -1
- package/dist/{external-DiFhWWS-.js → external-CwjCCHPi.js} +7 -7
- package/dist/{external-DiFhWWS-.js.map → external-CwjCCHPi.js.map} +1 -1
- package/dist/{external-DarqsFzT.js → external-DNHMAfGi.js} +5 -5
- package/dist/{external-DarqsFzT.js.map → external-DNHMAfGi.js.map} +1 -1
- package/dist/{external-0PM7JrzG.cjs → external-DVQ2SRoH.cjs} +5 -5
- package/dist/{external-0PM7JrzG.cjs.map → external-DVQ2SRoH.cjs.map} +1 -1
- package/dist/{external-16K8slq8.cjs → external-D_yXh8rn.cjs} +11 -11
- package/dist/{external-16K8slq8.cjs.map → external-D_yXh8rn.cjs.map} +1 -1
- package/dist/{external-CPx8XA9-.cjs → external-Df0D1YYb.cjs} +7 -7
- package/dist/{external-CPx8XA9-.cjs.map → external-Df0D1YYb.cjs.map} +1 -1
- package/dist/{external-DvGqQHd8.cjs → external-DhPBdJpR.cjs} +3 -3
- package/dist/external-DhPBdJpR.cjs.map +1 -0
- package/dist/{external-D7XrxOVE.cjs → external-DhiN6pEk.cjs} +4 -4
- package/dist/{external-D7XrxOVE.cjs.map → external-DhiN6pEk.cjs.map} +1 -1
- package/dist/{external-CsO29OsF.cjs → external-DjYXzP7v.cjs} +7 -7
- package/dist/{external-CsO29OsF.cjs.map → external-DjYXzP7v.cjs.map} +1 -1
- package/dist/{external-B3ly2-jy.js → external-FWIwgLzc.js} +7 -7
- package/dist/{external-B3ly2-jy.js.map → external-FWIwgLzc.js.map} +1 -1
- package/dist/{external-B0z7uXZV.cjs → external-Iv2mRce8.cjs} +5 -5
- package/dist/{external-B0z7uXZV.cjs.map → external-Iv2mRce8.cjs.map} +1 -1
- package/dist/{external-CzJYG1hX.cjs → external-P6zP6dBA.cjs} +3 -3
- package/dist/external-P6zP6dBA.cjs.map +1 -0
- package/dist/{external-D4ur_D1S.cjs → external-d-vI8EHK.cjs} +5 -5
- package/dist/{external-D4ur_D1S.cjs.map → external-d-vI8EHK.cjs.map} +1 -1
- package/dist/{external-DQkw1ko0.js → external-giUMrk8w.js} +4 -4
- package/dist/{external-DQkw1ko0.js.map → external-giUMrk8w.js.map} +1 -1
- package/dist/{external-CgMwmBnF.js → external-zG96smqq.js} +3 -3
- package/dist/external-zG96smqq.js.map +1 -0
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/index.cjs +30 -30
- package/dist/index.js +55 -55
- package/dist/index.js.map +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/src/telem/client/cache/cache.d.ts +3 -8
- package/dist/src/telem/client/cache/cache.d.ts.map +1 -1
- package/dist/src/telem/client/cache/dynamic.d.ts +13 -3
- package/dist/src/telem/client/cache/dynamic.d.ts.map +1 -1
- package/dist/src/telem/client/client.d.ts +1 -1
- package/dist/src/video/Video.d.ts +2 -2
- package/dist/src/video/Video.d.ts.map +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/theming.cjs +2 -2
- package/dist/theming.js +2 -2
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/triggers.cjs +1 -1
- package/dist/triggers.js +1 -1
- package/dist/video.cjs +1 -1
- package/dist/video.js +1 -1
- package/package.json +1 -1
- package/dist/LinePlot-BZDm4uxJ.cjs.map +0 -1
- package/dist/LinePlot-tOiSUMjC.js.map +0 -1
- package/dist/Video-B1oW8NLd.js +0 -11
- package/dist/Video-B1oW8NLd.js.map +0 -1
- package/dist/Video-BGNx94bQ.cjs +0 -10
- package/dist/Video-BGNx94bQ.cjs.map +0 -1
- package/dist/aggregator-BgImZc4o.js.map +0 -1
- package/dist/aggregator-BpfMBUD1.cjs.map +0 -1
- package/dist/css-DoalWJF6.js.map +0 -1
- package/dist/css-Pf9qxhQ4.cjs.map +0 -1
- package/dist/external-96EinZfY.js.map +0 -1
- package/dist/external-CgMwmBnF.js.map +0 -1
- package/dist/external-CzJYG1hX.cjs.map +0 -1
- package/dist/external-D8dWmF4U.cjs.map +0 -1
- package/dist/external-DvGqQHd8.cjs.map +0 -1
- package/dist/external-SxB9IH0p.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from "./jsx-runtime-mMz73N64.js";
|
|
2
2
|
import { forwardRef, createElement } from "react";
|
|
3
|
-
import { d as f, C as CSS } from "./css-
|
|
3
|
+
import { d as f, C as CSS } from "./css-DKKmdhSr.js";
|
|
4
4
|
const CoreElement = ({ el, children, ...props }, ref) => createElement(el, { ...props, ref }, children);
|
|
5
5
|
const Element = forwardRef(CoreElement);
|
|
6
6
|
const Generic = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -146,4 +146,4 @@ export {
|
|
|
146
146
|
CoreCenter as a,
|
|
147
147
|
shouldReverse as s
|
|
148
148
|
};
|
|
149
|
-
//# sourceMappingURL=Center-
|
|
149
|
+
//# sourceMappingURL=Center-BK9Rcaa0.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Center-hbwH7rg9.js","sources":["../src/generic/Generic.tsx","../src/align/Space.tsx","../src/align/Pack.tsx","../src/align/Center.tsx"],"sourcesContent":["// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport {\n type ComponentPropsWithRef,\n createElement,\n type ForwardedRef,\n forwardRef,\n type ReactElement,\n} from \"react\";\n\nexport type JSXElementType = keyof JSX.IntrinsicElements;\n\nconst CoreElement = <E extends JSXElementType>(\n { el, children, ...props }: ElementProps<E>,\n ref: ForwardedRef<JSX.IntrinsicElements[E]>,\n): ReactElement => createElement(el, { ...props, ref }, children);\n\nexport type ElementProps<E extends JSXElementType> = ComponentPropsWithRef<E> & {\n el: E;\n};\n\n/**\n * Generic renders a component with the given element type .\n *\n * @param props - Props for the generic component. All props not defined below are passed to\n * the underlying element.\n * @param props.el - The element type to render.\n */\nexport const Element = forwardRef(CoreElement) as <E extends JSXElementType>(\n props: ElementProps<E>,\n) => ReactElement;\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport {\n type CSSProperties,\n type ForwardedRef,\n type ReactElement,\n forwardRef,\n} from \"react\";\n\nimport { direction } from \"@synnaxlabs/x/spatial\";\n\nimport { CSS } from \"@/css\";\nimport { Generic } from \"@/generic\";\nimport { type ComponentSize } from \"@/util/component\";\n\nimport \"@/align/Space.css\";\n\n/** All possible alignments for the cross axis of a space */\nexport const ALIGNMENTS = [\"start\", \"center\", \"end\", \"stretch\"] as const;\n\n/** The alignments for the cross axis of a space */\nexport type Alignment = (typeof ALIGNMENTS)[number];\n\n/** All possible justifications for the main axis of a space */\nexport const JUSTIFICATIONS = [\n \"start\",\n \"center\",\n \"end\",\n \"spaceBetween\",\n \"spaceAround\",\n \"spaceEvenly\",\n] as const;\n\n/** The justification for the main axis of a space */\nexport type Justification = (typeof JUSTIFICATIONS)[number];\n\nexport type SpaceElementType =\n | \"div\"\n | \"header\"\n | \"nav\"\n | \"section\"\n | \"article\"\n | \"aside\"\n | \"footer\"\n | \"button\"\n | \"dialog\"\n | \"a\"\n | \"form\";\n\nexport interface SpaceExtensionProps {\n empty?: boolean;\n size?: ComponentSize | number;\n direction?: direction.Crude;\n reverse?: boolean;\n justify?: Justification;\n align?: Alignment;\n grow?: boolean | number;\n shrink?: boolean | number;\n wrap?: boolean;\n el?: SpaceElementType;\n bordered?: boolean;\n rounded?: boolean;\n}\n\nexport type SpaceProps<E extends SpaceElementType = \"div\"> = Omit<\n Generic.ElementProps<E>,\n \"el\"\n> &\n SpaceExtensionProps;\n\nexport const shouldReverse = (direction: direction.Crude, reverse?: boolean): boolean =>\n reverse ?? (direction === \"right\" || direction === \"bottom\");\n\nconst CoreSpace = <E extends SpaceElementType>(\n {\n style,\n align,\n className,\n grow,\n shrink,\n empty = false,\n size = \"medium\",\n justify = \"start\",\n reverse,\n direction: direction_ = \"y\",\n wrap = false,\n bordered = false,\n rounded = false,\n el = \"div\",\n ...props\n }: SpaceProps<E>,\n ref: ForwardedRef<JSX.IntrinsicElements[E]>,\n): ReactElement => {\n const dir = direction.construct(direction_);\n reverse = shouldReverse(direction_, reverse);\n\n let gap: number | string | undefined;\n if (empty) [size, gap] = [0, 0];\n else if (typeof size === \"number\") gap = `${size}rem`;\n\n style = {\n gap,\n flexDirection: flexDirection(dir, reverse),\n justifyContent: justifications[justify],\n alignItems: align,\n flexWrap: wrap ? \"wrap\" : \"nowrap\",\n ...style,\n };\n\n if (grow != null) style.flexGrow = Number(grow);\n if (shrink != null) style.flexShrink = Number(shrink);\n\n return (\n // @ts-expect-error - TODO: fix generic element props\n <Generic.Element<E>\n el={el}\n ref={ref}\n className={CSS(\n CSS.B(\"space\"),\n CSS.dir(dir),\n CSS.bordered(bordered),\n CSS.rounded(rounded),\n typeof size === \"string\" && CSS.BM(\"space\", size),\n className,\n )}\n style={style}\n {...props}\n />\n );\n};\nCoreSpace.displayName = \"Space\";\n\n/**\n * A component that orients its children in a row or column and adds\n * space between them. This is essentially a thin wrapped around a\n * flex component that makes it more 'reacty' to use.\n *\n * @param props - The props for the component. All unlisted props will be passed\n * to the underlying root element.\n * @param props.align - The off axis alignment of the children. The 'off' axis is the\n * opposite direction of props.direction. For example, if direction is 'x', then the\n * off axis is 'y'. See the {@link Alignment} for available options.\n * @param props.justify - The main axis justification of the children. The 'main' axis\n * is the same direction as props.direction. For example, if direction is 'x', then the\n * main axis is 'x'. See the {@link Justification} for available options.\n * @param props.grow - A boolean or number value that determines if the space should\n * grow in the flex-box sense. A value of true will set css flex-grow to 1. A value of\n * false will leave the css flex-grow unset. A number value will set the css flex-grow\n * to that number.\n * @param props.size - A string or number value that determines the amount of spacing\n * between items. If set to \"small\", \"medium\", or \"large\", the spacing will be determined\n * by the theme. If set to a number, the spacing will be that number of rem.\n * @param props.wrap - A boolean value that determines if the space should wrap its\n * children.\n * @param props.el - The element type to render as. Defaults to 'div'.\n */\nexport const Space = forwardRef(CoreSpace) as <E extends SpaceElementType = \"div\">(\n props: SpaceProps<E>,\n) => ReactElement;\n\ntype FlexDirection = CSSProperties[\"flexDirection\"];\n\nconst flexDirection = (\n direction: direction.Direction,\n reverse: boolean,\n): FlexDirection => {\n const base = direction === \"x\" ? \"row\" : \"column\";\n return reverse ? ((base + \"-reverse\") as FlexDirection) : base;\n};\n\nconst justifications: Record<Justification, CSSProperties[\"justifyContent\"]> = {\n start: \"flex-start\",\n center: \"center\",\n end: \"flex-end\",\n spaceBetween: \"space-between\",\n spaceAround: \"space-around\",\n spaceEvenly: \"space-evenly\",\n};\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ForwardedRef, type ReactElement, forwardRef } from \"react\";\n\nimport { Space, type SpaceElementType, type SpaceProps } from \"@/align/Space\";\nimport { CSS } from \"@/css\";\n\nimport \"@/align/Pack.css\";\n\n/** Props for the {@link Pack} component. */\nexport type PackProps<E extends SpaceElementType = \"div\"> = Omit<\n SpaceProps<E>,\n \"empty\"\n> & {\n shadow?: boolean;\n};\n\nconst CorePack = <E extends SpaceElementType = \"div\">(\n {\n className,\n size = \"medium\",\n reverse = false,\n direction = \"x\",\n bordered = true,\n rounded = true,\n shadow = false,\n ...props\n }: PackProps<E>,\n // select the correct type for the ref\n ref: ForwardedRef<JSX.IntrinsicElements[E]>,\n): ReactElement => (\n // @ts-expect-error\n <Space<E>\n ref={ref}\n direction={direction}\n reverse={reverse}\n className={CSS(\n CSS.B(\"pack\"),\n shadow && CSS.BM(\"pack\", \"shadow\"),\n CSS.dir(direction),\n typeof size !== \"number\" && CSS.BM(\"pack\", size),\n reverse && CSS.BM(\"pack\", \"reverse\"),\n className,\n )}\n bordered={bordered}\n rounded={rounded}\n {...props}\n empty\n />\n);\n\n/**\n * Packs elements together, setting their size and styling the borders between them so\n * that they appear as a single element. This is useful for buttons that represent a\n * selection state, for example.\n *\n * @param props - The props for the pack. Any extra props will be passed to the\n * underlying Space component.\n * @param props.children - The children to pack together. These must satisfy the\n * {@link PackChildProps} interface.\n * @param props.direction - The direction to pack the children in. Defaults to\n * \"x\".\n * @param props.size - The size to set on the children. Any sizes already set on the\n * children will be overridden. Defaults to \"medium\".\n * @param props.el - The element type to use as the root element for the Pack.\n * Defaults to \"div\".\n */\nexport const Pack = forwardRef(CorePack) as <E extends SpaceElementType = \"div\">(\n props: PackProps<E>,\n) => ReactElement;\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ForwardedRef, type ReactElement, forwardRef } from \"react\";\n\nimport { Space, type SpaceElementType, type SpaceProps } from \"@/align/Space\";\nimport { CSS } from \"@/css\";\n\nimport \"@/align/Center.css\";\n\nexport const CoreCenter = <E extends SpaceElementType = \"div\">(\n { className, justify = \"center\", align = \"center\", ...props }: SpaceProps<E>,\n ref: ForwardedRef<JSX.IntrinsicElements[E]>,\n): ReactElement => (\n // @ts-expect-error\n <Space<E>\n ref={ref}\n justify={justify}\n align={align}\n className={CSS(CSS.BM(\"space\", \"centered\"), className)}\n {...props}\n />\n);\n\n/**\n * An element whose width and height is 100% and whose alignment and justification\n * is centered. Props are the same as {@link Space}.\n */\nexport const Center = forwardRef(CoreCenter) as <E extends SpaceElementType = \"div\">(\n props: SpaceProps<E>,\n) => ReactElement;\n"],"names":["direction","jsx","Generic.Element"],"mappings":";;;AAmBA,MAAM,cAAc,CAClB,EAAE,IAAI,UAAU,GAAG,MAAM,GACzB,QACiB,cAAc,IAAI,EAAE,GAAG,OAAO,OAAO,QAAQ;AAanD,MAAA,UAAU,WAAW,WAAW;;;;;ACVtC,MAAM,aAAa,CAAC,SAAS,UAAU,OAAO,SAAS;AAMvD,MAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AA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BF,YACA,YACkB;AACZ,QAAA,OAAOA,eAAc,MAAM,QAAQ;AAClC,SAAA,UAAY,OAAO,aAAgC;AAC5D;AAEA,MAAM,iBAAyE;AAAA,EAC7E,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,cAAc;AAAA,EACd,aAAa;AAAA,EACb,aAAa;AACf;AChKA,MAAM,WAAW,CACf;AAAA,EACE;AAAA,EACA,OAAO;AAAA,EACP,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,UAAU;AAAA,EACV,SAAS;AAAA,EACT,GAAG;AACL,GAEA;AAAA;AAAA,EAGAC,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT,IAAI,EAAE,MAAM;AAAA,QACZ,UAAU,IAAI,GAAG,QAAQ,QAAQ;AAAA,QACjC,IAAI,IAAI,SAAS;AAAA,QACjB,OAAO,SAAS,YAAY,IAAI,GAAG,QAAQ,IAAI;AAAA,QAC/C,WAAW,IAAI,GAAG,QAAQ,SAAS;AAAA,QACnC;AAAA,MACF;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MACJ,OAAK;AAAA,IAAA;AAAA,EACP;AAAA;AAmBW,MAAA,OAAO,WAAW,QAAQ;AC1D1B,MAAA,aAAa,CACxB,EAAE,WAAW,UAAU,UAAU,QAAQ,UAAU,GAAG,MAAA,GACtD;AAAA;AAAA,EAGAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW,IAAI,IAAI,GAAG,SAAS,UAAU,GAAG,SAAS;AAAA,MACpD,GAAG;AAAA,IAAA;AAAA,EACN;AAAA;AAOW,MAAA,SAAS,WAAW,UAAU;"}
|
|
1
|
+
{"version":3,"file":"Center-BK9Rcaa0.js","sources":["../src/generic/Generic.tsx","../src/align/Space.tsx","../src/align/Pack.tsx","../src/align/Center.tsx"],"sourcesContent":["// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport {\n type ComponentPropsWithRef,\n createElement,\n type ForwardedRef,\n forwardRef,\n type ReactElement,\n} from \"react\";\n\nexport type JSXElementType = keyof JSX.IntrinsicElements;\n\nconst CoreElement = <E extends JSXElementType>(\n { el, children, ...props }: ElementProps<E>,\n ref: ForwardedRef<JSX.IntrinsicElements[E]>,\n): ReactElement => createElement(el, { ...props, ref }, children);\n\nexport type ElementProps<E extends JSXElementType> = ComponentPropsWithRef<E> & {\n el: E;\n};\n\n/**\n * Generic renders a component with the given element type .\n *\n * @param props - Props for the generic component. All props not defined below are passed to\n * the underlying element.\n * @param props.el - The element type to render.\n */\nexport const Element = forwardRef(CoreElement) as <E extends JSXElementType>(\n props: ElementProps<E>,\n) => ReactElement;\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport {\n type CSSProperties,\n type ForwardedRef,\n type ReactElement,\n forwardRef,\n} from \"react\";\n\nimport { direction } from \"@synnaxlabs/x/spatial\";\n\nimport { CSS } from \"@/css\";\nimport { Generic } from \"@/generic\";\nimport { type ComponentSize } from \"@/util/component\";\n\nimport \"@/align/Space.css\";\n\n/** All possible alignments for the cross axis of a space */\nexport const ALIGNMENTS = [\"start\", \"center\", \"end\", \"stretch\"] as const;\n\n/** The alignments for the cross axis of a space */\nexport type Alignment = (typeof ALIGNMENTS)[number];\n\n/** All possible justifications for the main axis of a space */\nexport const JUSTIFICATIONS = [\n \"start\",\n \"center\",\n \"end\",\n \"spaceBetween\",\n \"spaceAround\",\n \"spaceEvenly\",\n] as const;\n\n/** The justification for the main axis of a space */\nexport type Justification = (typeof JUSTIFICATIONS)[number];\n\nexport type SpaceElementType =\n | \"div\"\n | \"header\"\n | \"nav\"\n | \"section\"\n | \"article\"\n | \"aside\"\n | \"footer\"\n | \"button\"\n | \"dialog\"\n | \"a\"\n | \"form\";\n\nexport interface SpaceExtensionProps {\n empty?: boolean;\n size?: ComponentSize | number;\n direction?: direction.Crude;\n reverse?: boolean;\n justify?: Justification;\n align?: Alignment;\n grow?: boolean | number;\n shrink?: boolean | number;\n wrap?: boolean;\n el?: SpaceElementType;\n bordered?: boolean;\n rounded?: boolean;\n}\n\nexport type SpaceProps<E extends SpaceElementType = \"div\"> = Omit<\n Generic.ElementProps<E>,\n \"el\"\n> &\n SpaceExtensionProps;\n\nexport const shouldReverse = (direction: direction.Crude, reverse?: boolean): boolean =>\n reverse ?? (direction === \"right\" || direction === \"bottom\");\n\nconst CoreSpace = <E extends SpaceElementType>(\n {\n style,\n align,\n className,\n grow,\n shrink,\n empty = false,\n size = \"medium\",\n justify = \"start\",\n reverse,\n direction: direction_ = \"y\",\n wrap = false,\n bordered = false,\n rounded = false,\n el = \"div\",\n ...props\n }: SpaceProps<E>,\n ref: ForwardedRef<JSX.IntrinsicElements[E]>,\n): ReactElement => {\n const dir = direction.construct(direction_);\n reverse = shouldReverse(direction_, reverse);\n\n let gap: number | string | undefined;\n if (empty) [size, gap] = [0, 0];\n else if (typeof size === \"number\") gap = `${size}rem`;\n\n style = {\n gap,\n flexDirection: flexDirection(dir, reverse),\n justifyContent: justifications[justify],\n alignItems: align,\n flexWrap: wrap ? \"wrap\" : \"nowrap\",\n ...style,\n };\n\n if (grow != null) style.flexGrow = Number(grow);\n if (shrink != null) style.flexShrink = Number(shrink);\n\n return (\n // @ts-expect-error - TODO: fix generic element props\n <Generic.Element<E>\n el={el}\n ref={ref}\n className={CSS(\n CSS.B(\"space\"),\n CSS.dir(dir),\n CSS.bordered(bordered),\n CSS.rounded(rounded),\n typeof size === \"string\" && CSS.BM(\"space\", size),\n className,\n )}\n style={style}\n {...props}\n />\n );\n};\nCoreSpace.displayName = \"Space\";\n\n/**\n * A component that orients its children in a row or column and adds\n * space between them. This is essentially a thin wrapped around a\n * flex component that makes it more 'reacty' to use.\n *\n * @param props - The props for the component. All unlisted props will be passed\n * to the underlying root element.\n * @param props.align - The off axis alignment of the children. The 'off' axis is the\n * opposite direction of props.direction. For example, if direction is 'x', then the\n * off axis is 'y'. See the {@link Alignment} for available options.\n * @param props.justify - The main axis justification of the children. The 'main' axis\n * is the same direction as props.direction. For example, if direction is 'x', then the\n * main axis is 'x'. See the {@link Justification} for available options.\n * @param props.grow - A boolean or number value that determines if the space should\n * grow in the flex-box sense. A value of true will set css flex-grow to 1. A value of\n * false will leave the css flex-grow unset. A number value will set the css flex-grow\n * to that number.\n * @param props.size - A string or number value that determines the amount of spacing\n * between items. If set to \"small\", \"medium\", or \"large\", the spacing will be determined\n * by the theme. If set to a number, the spacing will be that number of rem.\n * @param props.wrap - A boolean value that determines if the space should wrap its\n * children.\n * @param props.el - The element type to render as. Defaults to 'div'.\n */\nexport const Space = forwardRef(CoreSpace) as <E extends SpaceElementType = \"div\">(\n props: SpaceProps<E>,\n) => ReactElement;\n\ntype FlexDirection = CSSProperties[\"flexDirection\"];\n\nconst flexDirection = (\n direction: direction.Direction,\n reverse: boolean,\n): FlexDirection => {\n const base = direction === \"x\" ? \"row\" : \"column\";\n return reverse ? ((base + \"-reverse\") as FlexDirection) : base;\n};\n\nconst justifications: Record<Justification, CSSProperties[\"justifyContent\"]> = {\n start: \"flex-start\",\n center: \"center\",\n end: \"flex-end\",\n spaceBetween: \"space-between\",\n spaceAround: \"space-around\",\n spaceEvenly: \"space-evenly\",\n};\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ForwardedRef, type ReactElement, forwardRef } from \"react\";\n\nimport { Space, type SpaceElementType, type SpaceProps } from \"@/align/Space\";\nimport { CSS } from \"@/css\";\n\nimport \"@/align/Pack.css\";\n\n/** Props for the {@link Pack} component. */\nexport type PackProps<E extends SpaceElementType = \"div\"> = Omit<\n SpaceProps<E>,\n \"empty\"\n> & {\n shadow?: boolean;\n};\n\nconst CorePack = <E extends SpaceElementType = \"div\">(\n {\n className,\n size = \"medium\",\n reverse = false,\n direction = \"x\",\n bordered = true,\n rounded = true,\n shadow = false,\n ...props\n }: PackProps<E>,\n // select the correct type for the ref\n ref: ForwardedRef<JSX.IntrinsicElements[E]>,\n): ReactElement => (\n // @ts-expect-error\n <Space<E>\n ref={ref}\n direction={direction}\n reverse={reverse}\n className={CSS(\n CSS.B(\"pack\"),\n shadow && CSS.BM(\"pack\", \"shadow\"),\n CSS.dir(direction),\n typeof size !== \"number\" && CSS.BM(\"pack\", size),\n reverse && CSS.BM(\"pack\", \"reverse\"),\n className,\n )}\n bordered={bordered}\n rounded={rounded}\n {...props}\n empty\n />\n);\n\n/**\n * Packs elements together, setting their size and styling the borders between them so\n * that they appear as a single element. This is useful for buttons that represent a\n * selection state, for example.\n *\n * @param props - The props for the pack. Any extra props will be passed to the\n * underlying Space component.\n * @param props.children - The children to pack together. These must satisfy the\n * {@link PackChildProps} interface.\n * @param props.direction - The direction to pack the children in. Defaults to\n * \"x\".\n * @param props.size - The size to set on the children. Any sizes already set on the\n * children will be overridden. Defaults to \"medium\".\n * @param props.el - The element type to use as the root element for the Pack.\n * Defaults to \"div\".\n */\nexport const Pack = forwardRef(CorePack) as <E extends SpaceElementType = \"div\">(\n props: PackProps<E>,\n) => ReactElement;\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ForwardedRef, type ReactElement, forwardRef } from \"react\";\n\nimport { Space, type SpaceElementType, type SpaceProps } from \"@/align/Space\";\nimport { CSS } from \"@/css\";\n\nimport \"@/align/Center.css\";\n\nexport const CoreCenter = <E extends SpaceElementType = \"div\">(\n { className, justify = \"center\", align = \"center\", ...props }: SpaceProps<E>,\n ref: ForwardedRef<JSX.IntrinsicElements[E]>,\n): ReactElement => (\n // @ts-expect-error\n <Space<E>\n ref={ref}\n justify={justify}\n align={align}\n className={CSS(CSS.BM(\"space\", \"centered\"), className)}\n {...props}\n />\n);\n\n/**\n * An element whose width and height is 100% and whose alignment and justification\n * is centered. Props are the same as {@link Space}.\n */\nexport const Center = forwardRef(CoreCenter) as <E extends SpaceElementType = \"div\">(\n props: SpaceProps<E>,\n) => ReactElement;\n"],"names":["direction","jsx","Generic.Element"],"mappings":";;;AAmBA,MAAM,cAAc,CAClB,EAAE,IAAI,UAAU,GAAG,MAAM,GACzB,QACiB,cAAc,IAAI,EAAE,GAAG,OAAO,OAAO,QAAQ;AAanD,MAAA,UAAU,WAAW,WAAW;;;;;ACVtC,MAAM,aAAa,CAAC,SAAS,UAAU,OAAO,SAAS;AAMvD,MAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAuCO,MAAM,gBAAgB,CAACA,YAA4B,YACxD,YAAYA,eAAc,WAAWA,eAAc;AAErD,MAAM,YAAY,CAChB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AAAA,EACV;AAAA,EACA,WAAW,aAAa;AAAA,EACxB,OAAO;AAAA,EACP,WAAW;AAAA,EACX,UAAU;AAAA,EACV,KAAK;AAAA,EACL,GAAG;AACL,GACA,QACiB;AACX,QAAA,MAAMA,EAAU,UAAU,UAAU;AAChC,YAAA,cAAc,YAAY,OAAO;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AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT,IAAI,EAAE,MAAM;AAAA,QACZ,UAAU,IAAI,GAAG,QAAQ,QAAQ;AAAA,QACjC,IAAI,IAAI,SAAS;AAAA,QACjB,OAAO,SAAS,YAAY,IAAI,GAAG,QAAQ,IAAI;AAAA,QAC/C,WAAW,IAAI,GAAG,QAAQ,SAAS;AAAA,QACnC;AAAA,MACF;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MACJ,OAAK;AAAA,IAAA;AAAA,EACP;AAAA;AAmBW,MAAA,OAAO,WAAW,QAAQ;AC1D1B,MAAA,aAAa,CACxB,EAAE,WAAW,UAAU,UAAU,QAAQ,UAAU,GAAG,MAAA,GACtD;AAAA;AAAA,EAGAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW,IAAI,IAAI,GAAG,SAAS,UAAU,GAAG,SAAS;AAAA,MACpD,GAAG;AAAA,IAAA;AAAA,EACN;AAAA;AAOW,MAAA,SAAS,WAAW,UAAU;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jsxRuntime = require("./jsx-runtime-B3vWrP5x.cjs");
|
|
3
3
|
const React = require("react");
|
|
4
|
-
const css = require("./css-
|
|
4
|
+
const css = require("./css-Ci8WUD5E.cjs");
|
|
5
5
|
const CoreElement = ({ el, children, ...props }, ref) => React.createElement(el, { ...props, ref }, children);
|
|
6
6
|
const Element = React.forwardRef(CoreElement);
|
|
7
7
|
const Generic = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -145,4 +145,4 @@ exports.JUSTIFICATIONS = JUSTIFICATIONS;
|
|
|
145
145
|
exports.Pack = Pack;
|
|
146
146
|
exports.Space = Space;
|
|
147
147
|
exports.shouldReverse = shouldReverse;
|
|
148
|
-
//# sourceMappingURL=Center-
|
|
148
|
+
//# sourceMappingURL=Center-Cc_rR5pQ.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Center-5NJ61qfA.cjs","sources":["../src/generic/Generic.tsx","../src/align/Space.tsx","../src/align/Pack.tsx","../src/align/Center.tsx"],"sourcesContent":["// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport {\n type ComponentPropsWithRef,\n createElement,\n type ForwardedRef,\n forwardRef,\n type ReactElement,\n} from \"react\";\n\nexport type JSXElementType = keyof JSX.IntrinsicElements;\n\nconst CoreElement = <E extends JSXElementType>(\n { el, children, ...props }: ElementProps<E>,\n ref: ForwardedRef<JSX.IntrinsicElements[E]>,\n): ReactElement => createElement(el, { ...props, ref }, children);\n\nexport type ElementProps<E extends JSXElementType> = ComponentPropsWithRef<E> & {\n el: E;\n};\n\n/**\n * Generic renders a component with the given element type .\n *\n * @param props - Props for the generic component. All props not defined below are passed to\n * the underlying element.\n * @param props.el - The element type to render.\n */\nexport const Element = forwardRef(CoreElement) as <E extends JSXElementType>(\n props: ElementProps<E>,\n) => ReactElement;\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport {\n type CSSProperties,\n type ForwardedRef,\n type ReactElement,\n forwardRef,\n} from \"react\";\n\nimport { direction } from \"@synnaxlabs/x/spatial\";\n\nimport { CSS } from \"@/css\";\nimport { Generic } from \"@/generic\";\nimport { type ComponentSize } from \"@/util/component\";\n\nimport \"@/align/Space.css\";\n\n/** All possible alignments for the cross axis of a space */\nexport const ALIGNMENTS = [\"start\", \"center\", \"end\", \"stretch\"] as const;\n\n/** The alignments for the cross axis of a space */\nexport type Alignment = (typeof ALIGNMENTS)[number];\n\n/** All possible justifications for the main axis of a space */\nexport const JUSTIFICATIONS = [\n \"start\",\n \"center\",\n \"end\",\n \"spaceBetween\",\n \"spaceAround\",\n \"spaceEvenly\",\n] as const;\n\n/** The justification for the main axis of a space */\nexport type Justification = (typeof JUSTIFICATIONS)[number];\n\nexport type SpaceElementType =\n | \"div\"\n | \"header\"\n | \"nav\"\n | \"section\"\n | \"article\"\n | \"aside\"\n | \"footer\"\n | \"button\"\n | \"dialog\"\n | \"a\"\n | \"form\";\n\nexport interface SpaceExtensionProps {\n empty?: boolean;\n size?: ComponentSize | number;\n direction?: direction.Crude;\n reverse?: boolean;\n justify?: Justification;\n align?: Alignment;\n grow?: boolean | number;\n shrink?: boolean | number;\n wrap?: boolean;\n el?: SpaceElementType;\n bordered?: boolean;\n rounded?: boolean;\n}\n\nexport type SpaceProps<E extends SpaceElementType = \"div\"> = Omit<\n Generic.ElementProps<E>,\n \"el\"\n> &\n SpaceExtensionProps;\n\nexport const shouldReverse = (direction: direction.Crude, reverse?: boolean): boolean =>\n reverse ?? (direction === \"right\" || direction === \"bottom\");\n\nconst CoreSpace = <E extends SpaceElementType>(\n {\n style,\n align,\n className,\n grow,\n shrink,\n empty = false,\n size = \"medium\",\n justify = \"start\",\n reverse,\n direction: direction_ = \"y\",\n wrap = false,\n bordered = false,\n rounded = false,\n el = \"div\",\n ...props\n }: SpaceProps<E>,\n ref: ForwardedRef<JSX.IntrinsicElements[E]>,\n): ReactElement => {\n const dir = direction.construct(direction_);\n reverse = shouldReverse(direction_, reverse);\n\n let gap: number | string | undefined;\n if (empty) [size, gap] = [0, 0];\n else if (typeof size === \"number\") gap = `${size}rem`;\n\n style = {\n gap,\n flexDirection: flexDirection(dir, reverse),\n justifyContent: justifications[justify],\n alignItems: align,\n flexWrap: wrap ? \"wrap\" : \"nowrap\",\n ...style,\n };\n\n if (grow != null) style.flexGrow = Number(grow);\n if (shrink != null) style.flexShrink = Number(shrink);\n\n return (\n // @ts-expect-error - TODO: fix generic element props\n <Generic.Element<E>\n el={el}\n ref={ref}\n className={CSS(\n CSS.B(\"space\"),\n CSS.dir(dir),\n CSS.bordered(bordered),\n CSS.rounded(rounded),\n typeof size === \"string\" && CSS.BM(\"space\", size),\n className,\n )}\n style={style}\n {...props}\n />\n );\n};\nCoreSpace.displayName = \"Space\";\n\n/**\n * A component that orients its children in a row or column and adds\n * space between them. This is essentially a thin wrapped around a\n * flex component that makes it more 'reacty' to use.\n *\n * @param props - The props for the component. All unlisted props will be passed\n * to the underlying root element.\n * @param props.align - The off axis alignment of the children. The 'off' axis is the\n * opposite direction of props.direction. For example, if direction is 'x', then the\n * off axis is 'y'. See the {@link Alignment} for available options.\n * @param props.justify - The main axis justification of the children. The 'main' axis\n * is the same direction as props.direction. For example, if direction is 'x', then the\n * main axis is 'x'. See the {@link Justification} for available options.\n * @param props.grow - A boolean or number value that determines if the space should\n * grow in the flex-box sense. A value of true will set css flex-grow to 1. A value of\n * false will leave the css flex-grow unset. A number value will set the css flex-grow\n * to that number.\n * @param props.size - A string or number value that determines the amount of spacing\n * between items. If set to \"small\", \"medium\", or \"large\", the spacing will be determined\n * by the theme. If set to a number, the spacing will be that number of rem.\n * @param props.wrap - A boolean value that determines if the space should wrap its\n * children.\n * @param props.el - The element type to render as. Defaults to 'div'.\n */\nexport const Space = forwardRef(CoreSpace) as <E extends SpaceElementType = \"div\">(\n props: SpaceProps<E>,\n) => ReactElement;\n\ntype FlexDirection = CSSProperties[\"flexDirection\"];\n\nconst flexDirection = (\n direction: direction.Direction,\n reverse: boolean,\n): FlexDirection => {\n const base = direction === \"x\" ? \"row\" : \"column\";\n return reverse ? ((base + \"-reverse\") as FlexDirection) : base;\n};\n\nconst justifications: Record<Justification, CSSProperties[\"justifyContent\"]> = {\n start: \"flex-start\",\n center: \"center\",\n end: \"flex-end\",\n spaceBetween: \"space-between\",\n spaceAround: \"space-around\",\n spaceEvenly: \"space-evenly\",\n};\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ForwardedRef, type ReactElement, forwardRef } from \"react\";\n\nimport { Space, type SpaceElementType, type SpaceProps } from \"@/align/Space\";\nimport { CSS } from \"@/css\";\n\nimport \"@/align/Pack.css\";\n\n/** Props for the {@link Pack} component. */\nexport type PackProps<E extends SpaceElementType = \"div\"> = Omit<\n SpaceProps<E>,\n \"empty\"\n> & {\n shadow?: boolean;\n};\n\nconst CorePack = <E extends SpaceElementType = \"div\">(\n {\n className,\n size = \"medium\",\n reverse = false,\n direction = \"x\",\n bordered = true,\n rounded = true,\n shadow = false,\n ...props\n }: PackProps<E>,\n // select the correct type for the ref\n ref: ForwardedRef<JSX.IntrinsicElements[E]>,\n): ReactElement => (\n // @ts-expect-error\n <Space<E>\n ref={ref}\n direction={direction}\n reverse={reverse}\n className={CSS(\n CSS.B(\"pack\"),\n shadow && CSS.BM(\"pack\", \"shadow\"),\n CSS.dir(direction),\n typeof size !== \"number\" && CSS.BM(\"pack\", size),\n reverse && CSS.BM(\"pack\", \"reverse\"),\n className,\n )}\n bordered={bordered}\n rounded={rounded}\n {...props}\n empty\n />\n);\n\n/**\n * Packs elements together, setting their size and styling the borders between them so\n * that they appear as a single element. This is useful for buttons that represent a\n * selection state, for example.\n *\n * @param props - The props for the pack. Any extra props will be passed to the\n * underlying Space component.\n * @param props.children - The children to pack together. These must satisfy the\n * {@link PackChildProps} interface.\n * @param props.direction - The direction to pack the children in. Defaults to\n * \"x\".\n * @param props.size - The size to set on the children. Any sizes already set on the\n * children will be overridden. Defaults to \"medium\".\n * @param props.el - The element type to use as the root element for the Pack.\n * Defaults to \"div\".\n */\nexport const Pack = forwardRef(CorePack) as <E extends SpaceElementType = \"div\">(\n props: PackProps<E>,\n) => ReactElement;\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ForwardedRef, type ReactElement, forwardRef } from \"react\";\n\nimport { Space, type SpaceElementType, type SpaceProps } from \"@/align/Space\";\nimport { CSS } from \"@/css\";\n\nimport \"@/align/Center.css\";\n\nexport const CoreCenter = <E extends SpaceElementType = \"div\">(\n { className, justify = \"center\", align = \"center\", ...props }: SpaceProps<E>,\n ref: ForwardedRef<JSX.IntrinsicElements[E]>,\n): ReactElement => (\n // @ts-expect-error\n <Space<E>\n ref={ref}\n justify={justify}\n align={align}\n className={CSS(CSS.BM(\"space\", \"centered\"), className)}\n {...props}\n />\n);\n\n/**\n * An element whose width and height is 100% and whose alignment and justification\n * is centered. Props are the same as {@link Space}.\n */\nexport const Center = forwardRef(CoreCenter) as <E extends SpaceElementType = \"div\">(\n props: SpaceProps<E>,\n) => ReactElement;\n"],"names":["createElement","forwardRef","direction","jsx","Generic.Element","CSS"],"mappings":";;;;AAmBA,MAAM,cAAc,CAClB,EAAE,IAAI,UAAU,GAAG,MAAM,GACzB,QACiBA,MAAAA,cAAc,IAAI,EAAE,GAAG,OAAO,OAAO,QAAQ;AAanD,MAAA,UAAUC,iBAAW,WAAW;;;;;ACVtC,MAAM,aAAa,CAAC,SAAS,UAAU,OAAO,SAAS;AAMvD,MAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAuCO,MAAM,gBAAgB,CAACC,YAA4B,YACxD,YAAYA,eAAc,WAAWA,eAAc;AAErD,MAAM,YAAY,CAChB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,OAAO;AAAA,E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P,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,cAAc;AAAA,EACd,aAAa;AAAA,EACb,aAAa;AACf;AChKA,MAAM,WAAW,CACf;AAAA,EACE;AAAA,EACA,OAAO;AAAA,EACP,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,UAAU;AAAA,EACV,SAAS;AAAA,EACT,GAAG;AACL,GAEA;AAAA;AAAA,EAGAC,2BAAA,kBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAWE,IAAA;AAAA,QACTA,IAAA,IAAI,EAAE,MAAM;AAAA,QACZ,UAAUA,IAAA,IAAI,GAAG,QAAQ,QAAQ;AAAA,QACjCA,IAAA,IAAI,IAAI,SAAS;AAAA,QACjB,OAAO,SAAS,YAAYA,IAAAA,IAAI,GAAG,QAAQ,IAAI;AAAA,QAC/C,WAAWA,IAAA,IAAI,GAAG,QAAQ,SAAS;AAAA,QACnC;AAAA,MACF;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MACJ,OAAK;AAAA,IAAA;AAAA,EACP;AAAA;AAmBW,MAAA,OAAOJ,iBAAW,QAAQ;AC1D1B,MAAA,aAAa,CACxB,EAAE,WAAW,UAAU,UAAU,QAAQ,UAAU,GAAG,MAAA,GACtD;AAAA;AAAA,EAGAE,2BAAA,kBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAWE,IAAI,IAAAA,QAAI,GAAG,SAAS,UAAU,GAAG,SAAS;AAAA,MACpD,GAAG;AAAA,IAAA;AAAA,EACN;AAAA;AAOW,MAAA,SAASJ,iBAAW,UAAU;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Center-Cc_rR5pQ.cjs","sources":["../src/generic/Generic.tsx","../src/align/Space.tsx","../src/align/Pack.tsx","../src/align/Center.tsx"],"sourcesContent":["// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport {\n type ComponentPropsWithRef,\n createElement,\n type ForwardedRef,\n forwardRef,\n type ReactElement,\n} from \"react\";\n\nexport type JSXElementType = keyof JSX.IntrinsicElements;\n\nconst CoreElement = <E extends JSXElementType>(\n { el, children, ...props }: ElementProps<E>,\n ref: ForwardedRef<JSX.IntrinsicElements[E]>,\n): ReactElement => createElement(el, { ...props, ref }, children);\n\nexport type ElementProps<E extends JSXElementType> = ComponentPropsWithRef<E> & {\n el: E;\n};\n\n/**\n * Generic renders a component with the given element type .\n *\n * @param props - Props for the generic component. All props not defined below are passed to\n * the underlying element.\n * @param props.el - The element type to render.\n */\nexport const Element = forwardRef(CoreElement) as <E extends JSXElementType>(\n props: ElementProps<E>,\n) => ReactElement;\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport {\n type CSSProperties,\n type ForwardedRef,\n type ReactElement,\n forwardRef,\n} from \"react\";\n\nimport { direction } from \"@synnaxlabs/x/spatial\";\n\nimport { CSS } from \"@/css\";\nimport { Generic } from \"@/generic\";\nimport { type ComponentSize } from \"@/util/component\";\n\nimport \"@/align/Space.css\";\n\n/** All possible alignments for the cross axis of a space */\nexport const ALIGNMENTS = [\"start\", \"center\", \"end\", \"stretch\"] as const;\n\n/** The alignments for the cross axis of a space */\nexport type Alignment = (typeof ALIGNMENTS)[number];\n\n/** All possible justifications for the main axis of a space */\nexport const JUSTIFICATIONS = [\n \"start\",\n \"center\",\n \"end\",\n \"spaceBetween\",\n \"spaceAround\",\n \"spaceEvenly\",\n] as const;\n\n/** The justification for the main axis of a space */\nexport type Justification = (typeof JUSTIFICATIONS)[number];\n\nexport type SpaceElementType =\n | \"div\"\n | \"header\"\n | \"nav\"\n | \"section\"\n | \"article\"\n | \"aside\"\n | \"footer\"\n | \"button\"\n | \"dialog\"\n | \"a\"\n | \"form\";\n\nexport interface SpaceExtensionProps {\n empty?: boolean;\n size?: ComponentSize | number;\n direction?: direction.Crude;\n reverse?: boolean;\n justify?: Justification;\n align?: Alignment;\n grow?: boolean | number;\n shrink?: boolean | number;\n wrap?: boolean;\n el?: SpaceElementType;\n bordered?: boolean;\n rounded?: boolean;\n}\n\nexport type SpaceProps<E extends SpaceElementType = \"div\"> = Omit<\n Generic.ElementProps<E>,\n \"el\"\n> &\n SpaceExtensionProps;\n\nexport const shouldReverse = (direction: direction.Crude, reverse?: boolean): boolean =>\n reverse ?? (direction === \"right\" || direction === \"bottom\");\n\nconst CoreSpace = <E extends SpaceElementType>(\n {\n style,\n align,\n className,\n grow,\n shrink,\n empty = false,\n size = \"medium\",\n justify = \"start\",\n reverse,\n direction: direction_ = \"y\",\n wrap = false,\n bordered = false,\n rounded = false,\n el = \"div\",\n ...props\n }: SpaceProps<E>,\n ref: ForwardedRef<JSX.IntrinsicElements[E]>,\n): ReactElement => {\n const dir = direction.construct(direction_);\n reverse = shouldReverse(direction_, reverse);\n\n let gap: number | string | undefined;\n if (empty) [size, gap] = [0, 0];\n else if (typeof size === \"number\") gap = `${size}rem`;\n\n style = {\n gap,\n flexDirection: flexDirection(dir, reverse),\n justifyContent: justifications[justify],\n alignItems: align,\n flexWrap: wrap ? \"wrap\" : \"nowrap\",\n ...style,\n };\n\n if (grow != null) style.flexGrow = Number(grow);\n if (shrink != null) style.flexShrink = Number(shrink);\n\n return (\n // @ts-expect-error - TODO: fix generic element props\n <Generic.Element<E>\n el={el}\n ref={ref}\n className={CSS(\n CSS.B(\"space\"),\n CSS.dir(dir),\n CSS.bordered(bordered),\n CSS.rounded(rounded),\n typeof size === \"string\" && CSS.BM(\"space\", size),\n className,\n )}\n style={style}\n {...props}\n />\n );\n};\nCoreSpace.displayName = \"Space\";\n\n/**\n * A component that orients its children in a row or column and adds\n * space between them. This is essentially a thin wrapped around a\n * flex component that makes it more 'reacty' to use.\n *\n * @param props - The props for the component. All unlisted props will be passed\n * to the underlying root element.\n * @param props.align - The off axis alignment of the children. The 'off' axis is the\n * opposite direction of props.direction. For example, if direction is 'x', then the\n * off axis is 'y'. See the {@link Alignment} for available options.\n * @param props.justify - The main axis justification of the children. The 'main' axis\n * is the same direction as props.direction. For example, if direction is 'x', then the\n * main axis is 'x'. See the {@link Justification} for available options.\n * @param props.grow - A boolean or number value that determines if the space should\n * grow in the flex-box sense. A value of true will set css flex-grow to 1. A value of\n * false will leave the css flex-grow unset. A number value will set the css flex-grow\n * to that number.\n * @param props.size - A string or number value that determines the amount of spacing\n * between items. If set to \"small\", \"medium\", or \"large\", the spacing will be determined\n * by the theme. If set to a number, the spacing will be that number of rem.\n * @param props.wrap - A boolean value that determines if the space should wrap its\n * children.\n * @param props.el - The element type to render as. Defaults to 'div'.\n */\nexport const Space = forwardRef(CoreSpace) as <E extends SpaceElementType = \"div\">(\n props: SpaceProps<E>,\n) => ReactElement;\n\ntype FlexDirection = CSSProperties[\"flexDirection\"];\n\nconst flexDirection = (\n direction: direction.Direction,\n reverse: boolean,\n): FlexDirection => {\n const base = direction === \"x\" ? \"row\" : \"column\";\n return reverse ? ((base + \"-reverse\") as FlexDirection) : base;\n};\n\nconst justifications: Record<Justification, CSSProperties[\"justifyContent\"]> = {\n start: \"flex-start\",\n center: \"center\",\n end: \"flex-end\",\n spaceBetween: \"space-between\",\n spaceAround: \"space-around\",\n spaceEvenly: \"space-evenly\",\n};\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ForwardedRef, type ReactElement, forwardRef } from \"react\";\n\nimport { Space, type SpaceElementType, type SpaceProps } from \"@/align/Space\";\nimport { CSS } from \"@/css\";\n\nimport \"@/align/Pack.css\";\n\n/** Props for the {@link Pack} component. */\nexport type PackProps<E extends SpaceElementType = \"div\"> = Omit<\n SpaceProps<E>,\n \"empty\"\n> & {\n shadow?: boolean;\n};\n\nconst CorePack = <E extends SpaceElementType = \"div\">(\n {\n className,\n size = \"medium\",\n reverse = false,\n direction = \"x\",\n bordered = true,\n rounded = true,\n shadow = false,\n ...props\n }: PackProps<E>,\n // select the correct type for the ref\n ref: ForwardedRef<JSX.IntrinsicElements[E]>,\n): ReactElement => (\n // @ts-expect-error\n <Space<E>\n ref={ref}\n direction={direction}\n reverse={reverse}\n className={CSS(\n CSS.B(\"pack\"),\n shadow && CSS.BM(\"pack\", \"shadow\"),\n CSS.dir(direction),\n typeof size !== \"number\" && CSS.BM(\"pack\", size),\n reverse && CSS.BM(\"pack\", \"reverse\"),\n className,\n )}\n bordered={bordered}\n rounded={rounded}\n {...props}\n empty\n />\n);\n\n/**\n * Packs elements together, setting their size and styling the borders between them so\n * that they appear as a single element. This is useful for buttons that represent a\n * selection state, for example.\n *\n * @param props - The props for the pack. Any extra props will be passed to the\n * underlying Space component.\n * @param props.children - The children to pack together. These must satisfy the\n * {@link PackChildProps} interface.\n * @param props.direction - The direction to pack the children in. Defaults to\n * \"x\".\n * @param props.size - The size to set on the children. Any sizes already set on the\n * children will be overridden. Defaults to \"medium\".\n * @param props.el - The element type to use as the root element for the Pack.\n * Defaults to \"div\".\n */\nexport const Pack = forwardRef(CorePack) as <E extends SpaceElementType = \"div\">(\n props: PackProps<E>,\n) => ReactElement;\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ForwardedRef, type ReactElement, forwardRef } from \"react\";\n\nimport { Space, type SpaceElementType, type SpaceProps } from \"@/align/Space\";\nimport { CSS } from \"@/css\";\n\nimport \"@/align/Center.css\";\n\nexport const CoreCenter = <E extends SpaceElementType = \"div\">(\n { className, justify = \"center\", align = \"center\", ...props }: SpaceProps<E>,\n ref: ForwardedRef<JSX.IntrinsicElements[E]>,\n): ReactElement => (\n // @ts-expect-error\n <Space<E>\n ref={ref}\n justify={justify}\n align={align}\n className={CSS(CSS.BM(\"space\", \"centered\"), className)}\n {...props}\n />\n);\n\n/**\n * An element whose width and height is 100% and whose alignment and justification\n * is centered. Props are the same as {@link Space}.\n */\nexport const Center = forwardRef(CoreCenter) as <E extends SpaceElementType = \"div\">(\n props: SpaceProps<E>,\n) => ReactElement;\n"],"names":["createElement","forwardRef","direction","jsx","Generic.Element","CSS"],"mappings":";;;;AAmBA,MAAM,cAAc,CAClB,EAAE,IAAI,UAAU,GAAG,MAAM,GACzB,QACiBA,MAAAA,cAAc,IAAI,EAAE,GAAG,OAAO,OAAO,QAAQ;AAanD,MAAA,UAAUC,iBAAW,WAAW;;;;;ACVtC,MAAM,aAAa,CAAC,SAAS,UAAU,OAAO,SAAS;AAMvD,MAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAuCO,MAAM,gBAAgB,CAACC,YAA4B,YACxD,YAAYA,eAAc,WAAWA,eAAc;AAErD,MAAM,YAAY,CAChB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AAAA,EACV;AAAA,EACA,WAAW,aAAa;AAAA,EACxB,OAAO;AAAA,EACP,WAAW;AAAA,EACX,UAAU;AAAA,EACV,KAAK;AAAA,EACL,GAAG;AACL,GACA,QACiB;AACX,QAAA,MAAMA,IAAAA,EAAU,UAAU,UAAU;AAChC,YAAA,cAAc,YAAY,OAAO;AAEvC,MAAA;AAC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;AACL,GAEA;AAAA;AAAA,EAGAC,2BAAA,kBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAWE,IAAA;AAAA,QACTA,IAAA,IAAI,EAAE,MAAM;AAAA,QACZ,UAAUA,IAAA,IAAI,GAAG,QAAQ,QAAQ;AAAA,QACjCA,IAAA,IAAI,IAAI,SAAS;AAAA,QACjB,OAAO,SAAS,YAAYA,IAAAA,IAAI,GAAG,QAAQ,IAAI;AAAA,QAC/C,WAAWA,IAAA,IAAI,GAAG,QAAQ,SAAS;AAAA,QACnC;AAAA,MACF;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MACJ,OAAK;AAAA,IAAA;AAAA,EACP;AAAA;AAmBW,MAAA,OAAOJ,iBAAW,QAAQ;AC1D1B,MAAA,aAAa,CACxB,EAAE,WAAW,UAAU,UAAU,QAAQ,UAAU,GAAG,MAAA,GACtD;AAAA;AAAA,EAGAE,2BAAA,kBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAWE,IAAI,IAAAA,QAAI,GAAG,SAAS,UAAU,GAAG,SAAS;AAAA,MACpD,GAAG;AAAA,IAAA;AAAA,EACN;AAAA;AAOW,MAAA,SAASJ,iBAAW,UAAU;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jsxRuntime = require("./jsx-runtime-B3vWrP5x.cjs");
|
|
3
|
-
const css = require("./css-
|
|
4
|
-
const Toggle = require("./Toggle-
|
|
3
|
+
const css = require("./css-Ci8WUD5E.cjs");
|
|
4
|
+
const Toggle = require("./Toggle-D3iCEbO1.cjs");
|
|
5
5
|
const Keyboard = ({
|
|
6
6
|
className,
|
|
7
7
|
...props
|
|
@@ -10,4 +10,4 @@ const Keyboard = ({
|
|
|
10
10
|
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(Toggle.Text, { className: css.CSS(className, css.CSS.BM("text", "keyboard")), ...props })
|
|
11
11
|
);
|
|
12
12
|
exports.Keyboard = Keyboard;
|
|
13
|
-
//# sourceMappingURL=Keyboard-
|
|
13
|
+
//# sourceMappingURL=Keyboard-Byx8rGZt.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Keyboard-
|
|
1
|
+
{"version":3,"file":"Keyboard-Byx8rGZt.cjs","sources":["../src/text/Keyboard.tsx"],"sourcesContent":["// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ReactElement } from \"react\";\n\nimport { CSS } from \"@/css\";\nimport { type text } from \"@/text/core\";\nimport { type TextProps, Text } from \"@/text/Text\";\n\nimport \"@/text/Keyboard.css\";\n\nexport type KeyboardProps<L extends text.Level = \"h1\"> = TextProps<L>;\n\nexport const Keyboard = <L extends text.Level = \"p\">({\n className,\n ...props\n}: KeyboardProps<L>): ReactElement => (\n // @ts-expect-error\n <Text<L> className={CSS(className, CSS.BM(\"text\", \"keyboard\"))} {...props} />\n);\n"],"names":["jsx","Text","CSS"],"mappings":";;;;AAmBO,MAAM,WAAW,CAA6B;AAAA,EACnD;AAAA,EACA,GAAG;AACL;AAAA;AAAA,EAEGA,2BAAAA,kBAAAA,IAAAC,OAAAA,MAAA,EAAQ,WAAWC,IAAAA,IAAI,WAAWA,IAAAA,IAAI,GAAG,QAAQ,UAAU,CAAC,GAAI,GAAG,MAAO,CAAA;AAAA;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from "./jsx-runtime-mMz73N64.js";
|
|
2
|
-
import { C as CSS } from "./css-
|
|
3
|
-
import { e as Text } from "./Toggle-
|
|
2
|
+
import { C as CSS } from "./css-DKKmdhSr.js";
|
|
3
|
+
import { e as Text } from "./Toggle-bT5RpwfA.js";
|
|
4
4
|
const Keyboard = ({
|
|
5
5
|
className,
|
|
6
6
|
...props
|
|
@@ -11,4 +11,4 @@ const Keyboard = ({
|
|
|
11
11
|
export {
|
|
12
12
|
Keyboard as K
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=Keyboard-
|
|
14
|
+
//# sourceMappingURL=Keyboard-D31SwhYT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Keyboard-
|
|
1
|
+
{"version":3,"file":"Keyboard-D31SwhYT.js","sources":["../src/text/Keyboard.tsx"],"sourcesContent":["// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ReactElement } from \"react\";\n\nimport { CSS } from \"@/css\";\nimport { type text } from \"@/text/core\";\nimport { type TextProps, Text } from \"@/text/Text\";\n\nimport \"@/text/Keyboard.css\";\n\nexport type KeyboardProps<L extends text.Level = \"h1\"> = TextProps<L>;\n\nexport const Keyboard = <L extends text.Level = \"p\">({\n className,\n ...props\n}: KeyboardProps<L>): ReactElement => (\n // @ts-expect-error\n <Text<L> className={CSS(className, CSS.BM(\"text\", \"keyboard\"))} {...props} />\n);\n"],"names":["jsx"],"mappings":";;;AAmBO,MAAM,WAAW,CAA6B;AAAA,EACnD;AAAA,EACA,GAAG;AACL;AAAA;AAAA,EAEGA,kCAAAA,IAAA,MAAA,EAAQ,WAAW,IAAI,WAAW,IAAI,GAAG,QAAQ,UAAU,CAAC,GAAI,GAAG,MAAO,CAAA;AAAA;"}
|