@mage-ui/components 1.0.79 → 1.0.80
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.
|
@@ -6,6 +6,7 @@ type SwitchProps = Omit<ComponentProps<'input'>, 'size' | 'children'> & {
|
|
|
6
6
|
description?: ReactNode;
|
|
7
7
|
error?: string;
|
|
8
8
|
hiddenLabel?: boolean;
|
|
9
|
+
labelPosition?: 'left' | 'right';
|
|
9
10
|
classNames?: {
|
|
10
11
|
switch?: string;
|
|
11
12
|
root?: string;
|
|
@@ -30,6 +31,7 @@ declare const Switch: {
|
|
|
30
31
|
description,
|
|
31
32
|
error,
|
|
32
33
|
required,
|
|
34
|
+
labelPosition,
|
|
33
35
|
...props
|
|
34
36
|
}: SwitchProps): ReactNode;
|
|
35
37
|
displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.mts","names":[],"sources":["../../../../src/components/controls/switch/Switch.tsx"],"mappings":";;;KAqBY,WAAA,GAAc,IAAA,CAAK,cAAA;EAC7B,KAAA,GAAQ,SAAA;EACR,WAAA,GAAc,SAAA;EACd,KAAA;EACA,WAAA;EACA,UAAA;IACE,MAAA;IACA,IAAA;IACA,KAAA;IACA,KAAA;IACA,KAAA;IACA,UAAA;IACA,IAAA;IACA,SAAA;IACA,YAAA;IACA,aAAA;IACA,KAAA;IACA,WAAA;IACA,KAAA;EAAA;AAAA;AAAA,cAIS,MAAA;EAAA
|
|
1
|
+
{"version":3,"file":"Switch.d.mts","names":[],"sources":["../../../../src/components/controls/switch/Switch.tsx"],"mappings":";;;KAqBY,WAAA,GAAc,IAAA,CAAK,cAAA;EAC7B,KAAA,GAAQ,SAAA;EACR,WAAA,GAAc,SAAA;EACd,KAAA;EACA,WAAA;EACA,aAAA;EACA,UAAA;IACE,MAAA;IACA,IAAA;IACA,KAAA;IACA,KAAA;IACA,KAAA;IACA,UAAA;IACA,IAAA;IACA,SAAA;IACA,YAAA;IACA,aAAA;IACA,KAAA;IACA,WAAA;IACA,KAAA;EAAA;AAAA;AAAA,cAIS,MAAA;EAAA;;;;;;;;;KASV,WAAA,GAAc,SAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cx as e}from"@mage-ui/styled-system/css";import{switchBody as t,switchBodyError as n,switchDescription as r,switchError as i,switchInput as a,switchLabel as o,switchLabelRequired as s,switchLabelWrapper as c,switchRecipe as l,switchRoot as u,switchThumb as d,switchTrack as f,switchTrackLabel as p}from"@mage-ui/styled-system/recipes";import{Switch as m}from"@mantine/core";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{visuallyHidden as v}from"@mage-ui/styled-system/patterns";const y=({classNames:y,label:b,hiddenLabel:x,description:S,error:C,required:w,...
|
|
1
|
+
import{cx as e}from"@mage-ui/styled-system/css";import{switchBody as t,switchBodyError as n,switchDescription as r,switchError as i,switchInput as a,switchLabel as o,switchLabelRequired as s,switchLabelWrapper as c,switchRecipe as l,switchRoot as u,switchThumb as d,switchTrack as f,switchTrackLabel as p}from"@mage-ui/styled-system/recipes";import{Switch as m}from"@mantine/core";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{visuallyHidden as v}from"@mage-ui/styled-system/patterns";const y=({classNames:y,label:b,hiddenLabel:x,description:S,error:C,required:w,labelPosition:T,...E})=>g(m,{classNames:{root:e(y?.switch??l(),y?.root??u()),input:e(y?.input??a(),`peer`),track:y?.track??f(),thumb:y?.thumb??d(),trackLabel:y?.trackLabel??p(),body:e(y?.body??t(),C&&(y?.bodyError??n())),labelWrapper:y?.labelWrapper??c(),label:e(y?.label??o(),x&&v()),description:y?.description??r(),error:y?.error??i()},label:_(h,{children:[b,g(()=>w?g(`span`,{className:y?.labelRequired??s(),children:`*`}):null,{})]}),description:S,error:C,required:w,labelPosition:T,...E});y.displayName=`Switch`;export{y as Switch};
|
|
2
2
|
//# sourceMappingURL=Switch.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.mjs","names":["Switch","MantineSwitch"],"sources":["../../../../src/components/controls/switch/Switch.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\n\nimport { cx } from '@mage-ui/styled-system/css';\nimport { visuallyHidden } from '@mage-ui/styled-system/patterns';\nimport {\n switchBody,\n switchBodyError,\n switchDescription,\n switchError,\n switchInput,\n switchLabel,\n switchLabelRequired,\n switchLabelWrapper,\n switchRecipe,\n switchRoot,\n switchThumb,\n switchTrack,\n switchTrackLabel,\n} from '@mage-ui/styled-system/recipes';\nimport { Switch as MantineSwitch } from '@mantine/core';\n\nexport type SwitchProps = Omit<ComponentProps<'input'>, 'size' | 'children'> & {\n label?: ReactNode;\n description?: ReactNode;\n error?: string;\n hiddenLabel?: boolean;\n classNames?: {\n switch?: string;\n root?: string;\n input?: string;\n track?: string;\n thumb?: string;\n trackLabel?: string;\n body?: string;\n bodyError?: string;\n labelWrapper?: string;\n labelRequired?: string;\n label?: string;\n description?: string;\n error?: string;\n };\n};\n\nexport const Switch = ({\n classNames,\n label,\n hiddenLabel,\n description,\n error,\n required,\n ...props\n}: SwitchProps): ReactNode => {\n const RequiredAsterisk = () =>\n required ? (\n <span className={classNames?.labelRequired ?? switchLabelRequired()}>\n
|
|
1
|
+
{"version":3,"file":"Switch.mjs","names":["Switch","MantineSwitch"],"sources":["../../../../src/components/controls/switch/Switch.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\n\nimport { cx } from '@mage-ui/styled-system/css';\nimport { visuallyHidden } from '@mage-ui/styled-system/patterns';\nimport {\n switchBody,\n switchBodyError,\n switchDescription,\n switchError,\n switchInput,\n switchLabel,\n switchLabelRequired,\n switchLabelWrapper,\n switchRecipe,\n switchRoot,\n switchThumb,\n switchTrack,\n switchTrackLabel,\n} from '@mage-ui/styled-system/recipes';\nimport { Switch as MantineSwitch } from '@mantine/core';\n\nexport type SwitchProps = Omit<ComponentProps<'input'>, 'size' | 'children'> & {\n label?: ReactNode;\n description?: ReactNode;\n error?: string;\n hiddenLabel?: boolean;\n labelPosition?: 'left' | 'right';\n classNames?: {\n switch?: string;\n root?: string;\n input?: string;\n track?: string;\n thumb?: string;\n trackLabel?: string;\n body?: string;\n bodyError?: string;\n labelWrapper?: string;\n labelRequired?: string;\n label?: string;\n description?: string;\n error?: string;\n };\n};\n\nexport const Switch = ({\n classNames,\n label,\n hiddenLabel,\n description,\n error,\n required,\n labelPosition,\n ...props\n}: SwitchProps): ReactNode => {\n const RequiredAsterisk = () =>\n required ? (\n <span className={classNames?.labelRequired ?? switchLabelRequired()}>\n *\n </span>\n ) : null;\n\n return (\n <MantineSwitch\n classNames={{\n root: cx(\n classNames?.switch ?? switchRecipe(),\n classNames?.root ?? switchRoot(),\n ),\n input: cx(classNames?.input ?? switchInput(), 'peer'),\n track: classNames?.track ?? switchTrack(),\n thumb: classNames?.thumb ?? switchThumb(),\n trackLabel: classNames?.trackLabel ?? switchTrackLabel(),\n body: cx(\n classNames?.body ?? switchBody(),\n error && (classNames?.bodyError ?? switchBodyError()),\n ),\n labelWrapper: classNames?.labelWrapper ?? switchLabelWrapper(),\n label: cx(\n classNames?.label ?? switchLabel(),\n hiddenLabel && visuallyHidden(),\n ),\n description: classNames?.description ?? switchDescription(),\n error: classNames?.error ?? switchError(),\n }}\n label={\n <>\n {label}\n <RequiredAsterisk />\n </>\n }\n description={description}\n error={error}\n required={required}\n labelPosition={labelPosition}\n {...props}\n />\n );\n};\n\nSwitch.displayName = 'Switch';\n"],"mappings":"8fA4CA,MAAaA,GAAU,CACrB,aACA,QACA,cACA,cACA,QACA,WACA,gBACA,GAAG,KAUD,EAACC,EAAAA,CACC,WAAY,CACV,KAAM,EACJ,GAAY,QAAU,GAAc,CACpC,GAAY,MAAQ,GAAY,CACjC,CACD,MAAO,EAAG,GAAY,OAAS,GAAa,CAAE,OAAO,CACrD,MAAO,GAAY,OAAS,GAAa,CACzC,MAAO,GAAY,OAAS,GAAa,CACzC,WAAY,GAAY,YAAc,GAAkB,CACxD,KAAM,EACJ,GAAY,MAAQ,GAAY,CAChC,IAAU,GAAY,WAAa,GAAiB,EACrD,CACD,aAAc,GAAY,cAAgB,GAAoB,CAC9D,MAAO,EACL,GAAY,OAAS,GAAa,CAClC,GAAe,GAAgB,CAChC,CACD,YAAa,GAAY,aAAe,GAAmB,CAC3D,MAAO,GAAY,OAAS,GAAa,CAC1C,CACD,MACE,EAAA,EAAA,CAAA,SAAA,CACG,EACD,MAhCN,EACE,EAAC,OAAA,CAAK,UAAW,GAAY,eAAiB,GAAqB,UAAE,KAE9D,CACL,KA4BG,EAAA,CAAmB,CAAA,CAAA,CACnB,CAEQ,cACN,QACG,WACK,gBACf,GAAI,GACJ,CAIN,EAAO,YAAc"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mage-ui/components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.80",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [],
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"rimraf": "^6.1.3",
|
|
26
26
|
"tsdown": "^0.20.3",
|
|
27
27
|
"typescript": "^5.9.3",
|
|
28
|
-
"@mage-ui/preset": "1.0.
|
|
28
|
+
"@mage-ui/preset": "1.0.80",
|
|
29
29
|
"@mage-ui/styled-system": "1.0.8"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|