@locus-ui/components 0.0.13 → 0.0.15

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/index.d.mts CHANGED
@@ -932,7 +932,7 @@ declare const Container: React$1.ForwardRefExoticComponent<{} & {
932
932
  direction?: "row" | "column" | undefined;
933
933
  } & React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
934
934
 
935
- interface PanelExternalProps extends MarginProps, PaddingProps, SpacingProp, RadiusProps, RoundnessProp {
935
+ interface PanelExternalProps extends MarginProps, PaddingProps, SpacingProp, RadiusProps, RoundnessProp, ColorProp {
936
936
  }
937
937
  /**
938
938
  * A versatile container used to provide layout and styling capabilities.
@@ -1292,7 +1292,131 @@ type SeparatorProps = AllSeparatorProps & React__default.HTMLAttributes<HTMLDivE
1292
1292
  */
1293
1293
  declare const Separator: FC<SeparatorProps>;
1294
1294
 
1295
- interface TextExternalProps extends MarginProps, PaddingProps {
1295
+ declare const SwitchIndicatorPropDefs: {
1296
+ /**
1297
+ * Sets the variant style of the switch ("solid" or "outlined").
1298
+ */
1299
+ readonly variant: {
1300
+ type: "enum";
1301
+ values: readonly ["solid", "outlined", "muted"];
1302
+ dataAttr: string;
1303
+ };
1304
+ };
1305
+ type SwitchIndicatorInternalProps = GetPropDefTypes<typeof SwitchIndicatorPropDefs>;
1306
+
1307
+ interface AllSwitchIndicatorProps extends SwitchIndicatorInternalProps, SizeProp {
1308
+ }
1309
+ type SwitchIndicatorProps = AllSwitchIndicatorProps & Omit<React__default.HTMLAttributes<HTMLSpanElement>, "children">;
1310
+
1311
+ declare const SwitchLabelPropDefs: {
1312
+ /**
1313
+ * Sets the position of the label relative to the switch.
1314
+ *
1315
+ * @example position="left" // positions the label to the left of the switch
1316
+ * @example position="top" // positions the label above the switch
1317
+ */
1318
+ readonly position: {
1319
+ type: "enum";
1320
+ values: readonly ["top", "left", "right", "bottom"];
1321
+ dataAttr: string;
1322
+ };
1323
+ };
1324
+ type SwitchLabelInternalProps = GetPropDefTypes<typeof SwitchLabelPropDefs>;
1325
+
1326
+ interface AllSwitchLabelProps extends SwitchLabelInternalProps {
1327
+ }
1328
+ type SwitchLabelProps = AllSwitchLabelProps & Omit<React__default.HTMLAttributes<HTMLLabelElement>, "children"> & {
1329
+ children?: React__default.ReactNode;
1330
+ };
1331
+
1332
+ declare const SwitchRootPropsDefs: {
1333
+ /**
1334
+ * Sets the variant style of the switch ("solid" or "outlined").
1335
+ */
1336
+ readonly variant: {
1337
+ type: "enum";
1338
+ values: readonly ["solid", "outlined", "muted"];
1339
+ dataAttr: string;
1340
+ };
1341
+ /**
1342
+ * Sets the checked state of the switch.
1343
+ *
1344
+ * When using an uncontrolled switch, use `defaultChecked` instead.
1345
+ * @default undefined
1346
+ */
1347
+ readonly checked: {
1348
+ type: "boolean";
1349
+ dataAttr: string;
1350
+ };
1351
+ /**
1352
+ * The value of the switch (checked state).
1353
+ */
1354
+ readonly value: {
1355
+ type: "boolean";
1356
+ };
1357
+ /**
1358
+ * Sets the default checked state of the switch.
1359
+ * @default undefined
1360
+ */
1361
+ readonly defaultChecked: {
1362
+ type: "boolean";
1363
+ };
1364
+ /**
1365
+ * Disables the switch component.
1366
+ * @default undefined
1367
+ */
1368
+ readonly disabled: {
1369
+ type: "boolean";
1370
+ dataAttr: string;
1371
+ };
1372
+ /**
1373
+ * Makes the switch read-only.
1374
+ * @default undefined
1375
+ */
1376
+ readonly readonly: {
1377
+ type: "boolean";
1378
+ dataAttr: string;
1379
+ };
1380
+ /**
1381
+ * Marks the switch as required.
1382
+ * @default undefined
1383
+ */
1384
+ readonly required: {
1385
+ type: "boolean";
1386
+ dataAttr: string;
1387
+ };
1388
+ /**
1389
+ * Sets the name attribute of the switch input for form control.
1390
+ * @default undefined
1391
+ */
1392
+ readonly name: {
1393
+ type: "string";
1394
+ };
1395
+ /**
1396
+ * Callback fired when the checked state changes.
1397
+ *
1398
+ * @param value - The new checked state.
1399
+ */
1400
+ readonly onCheckedChange: FunctionPropDef<(value: boolean) => void>;
1401
+ };
1402
+ type SwitchRootInternalProps = GetPropDefTypes<typeof SwitchRootPropsDefs>;
1403
+
1404
+ interface AllSwitchRootProps extends SwitchRootInternalProps, AlignProp, ColorProp, MarginProps, SizeProp {
1405
+ }
1406
+ /**
1407
+ * A versatile Switch, managing state, context, and styling.
1408
+ */
1409
+ type SwitchRootProps = AllSwitchRootProps & WithStrictChildren<HTMLAttributes<HTMLDivElement>, SwitchLabelProps | SwitchIndicatorProps>;
1410
+
1411
+ declare const Switch: React$1.FC<SwitchRootProps> & {
1412
+ Root: React$1.FC<SwitchRootProps>;
1413
+ Label: React$1.ForwardRefExoticComponent<AllSwitchLabelProps & Omit<React$1.HTMLAttributes<HTMLLabelElement>, "children"> & {
1414
+ children?: React.ReactNode;
1415
+ } & React$1.RefAttributes<HTMLLabelElement>>;
1416
+ Indicator: React$1.FC<SwitchIndicatorProps>;
1417
+ };
1418
+
1419
+ interface TextExternalProps extends MarginProps, PaddingProps, ColorProp {
1296
1420
  }
1297
1421
  /**
1298
1422
  * A component for displaying text with customizable styling and layout.
@@ -1359,4 +1483,4 @@ interface ThemeControlProps {
1359
1483
  }
1360
1484
  declare function ThemeControl({ position }: ThemeControlProps): react_jsx_runtime.JSX.Element;
1361
1485
 
1362
- export { Accordion, Badge, Box, Button, Checkbox, Container, Panel, Portal, ProgressBar, Select, Separator, Text, Theme, type ThemeAppearance, ThemeControl, type ThemeRadius, type ThemeRoundness, type ThemeSpacing, useTheme };
1486
+ export { Accordion, Badge, Box, Button, Checkbox, Container, Panel, Portal, ProgressBar, Select, Separator, Switch, Text, Theme, type ThemeAppearance, ThemeControl, type ThemeRadius, type ThemeRoundness, type ThemeSpacing, useTheme };
package/dist/index.d.ts CHANGED
@@ -932,7 +932,7 @@ declare const Container: React$1.ForwardRefExoticComponent<{} & {
932
932
  direction?: "row" | "column" | undefined;
933
933
  } & React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
934
934
 
935
- interface PanelExternalProps extends MarginProps, PaddingProps, SpacingProp, RadiusProps, RoundnessProp {
935
+ interface PanelExternalProps extends MarginProps, PaddingProps, SpacingProp, RadiusProps, RoundnessProp, ColorProp {
936
936
  }
937
937
  /**
938
938
  * A versatile container used to provide layout and styling capabilities.
@@ -1292,7 +1292,131 @@ type SeparatorProps = AllSeparatorProps & React__default.HTMLAttributes<HTMLDivE
1292
1292
  */
1293
1293
  declare const Separator: FC<SeparatorProps>;
1294
1294
 
1295
- interface TextExternalProps extends MarginProps, PaddingProps {
1295
+ declare const SwitchIndicatorPropDefs: {
1296
+ /**
1297
+ * Sets the variant style of the switch ("solid" or "outlined").
1298
+ */
1299
+ readonly variant: {
1300
+ type: "enum";
1301
+ values: readonly ["solid", "outlined", "muted"];
1302
+ dataAttr: string;
1303
+ };
1304
+ };
1305
+ type SwitchIndicatorInternalProps = GetPropDefTypes<typeof SwitchIndicatorPropDefs>;
1306
+
1307
+ interface AllSwitchIndicatorProps extends SwitchIndicatorInternalProps, SizeProp {
1308
+ }
1309
+ type SwitchIndicatorProps = AllSwitchIndicatorProps & Omit<React__default.HTMLAttributes<HTMLSpanElement>, "children">;
1310
+
1311
+ declare const SwitchLabelPropDefs: {
1312
+ /**
1313
+ * Sets the position of the label relative to the switch.
1314
+ *
1315
+ * @example position="left" // positions the label to the left of the switch
1316
+ * @example position="top" // positions the label above the switch
1317
+ */
1318
+ readonly position: {
1319
+ type: "enum";
1320
+ values: readonly ["top", "left", "right", "bottom"];
1321
+ dataAttr: string;
1322
+ };
1323
+ };
1324
+ type SwitchLabelInternalProps = GetPropDefTypes<typeof SwitchLabelPropDefs>;
1325
+
1326
+ interface AllSwitchLabelProps extends SwitchLabelInternalProps {
1327
+ }
1328
+ type SwitchLabelProps = AllSwitchLabelProps & Omit<React__default.HTMLAttributes<HTMLLabelElement>, "children"> & {
1329
+ children?: React__default.ReactNode;
1330
+ };
1331
+
1332
+ declare const SwitchRootPropsDefs: {
1333
+ /**
1334
+ * Sets the variant style of the switch ("solid" or "outlined").
1335
+ */
1336
+ readonly variant: {
1337
+ type: "enum";
1338
+ values: readonly ["solid", "outlined", "muted"];
1339
+ dataAttr: string;
1340
+ };
1341
+ /**
1342
+ * Sets the checked state of the switch.
1343
+ *
1344
+ * When using an uncontrolled switch, use `defaultChecked` instead.
1345
+ * @default undefined
1346
+ */
1347
+ readonly checked: {
1348
+ type: "boolean";
1349
+ dataAttr: string;
1350
+ };
1351
+ /**
1352
+ * The value of the switch (checked state).
1353
+ */
1354
+ readonly value: {
1355
+ type: "boolean";
1356
+ };
1357
+ /**
1358
+ * Sets the default checked state of the switch.
1359
+ * @default undefined
1360
+ */
1361
+ readonly defaultChecked: {
1362
+ type: "boolean";
1363
+ };
1364
+ /**
1365
+ * Disables the switch component.
1366
+ * @default undefined
1367
+ */
1368
+ readonly disabled: {
1369
+ type: "boolean";
1370
+ dataAttr: string;
1371
+ };
1372
+ /**
1373
+ * Makes the switch read-only.
1374
+ * @default undefined
1375
+ */
1376
+ readonly readonly: {
1377
+ type: "boolean";
1378
+ dataAttr: string;
1379
+ };
1380
+ /**
1381
+ * Marks the switch as required.
1382
+ * @default undefined
1383
+ */
1384
+ readonly required: {
1385
+ type: "boolean";
1386
+ dataAttr: string;
1387
+ };
1388
+ /**
1389
+ * Sets the name attribute of the switch input for form control.
1390
+ * @default undefined
1391
+ */
1392
+ readonly name: {
1393
+ type: "string";
1394
+ };
1395
+ /**
1396
+ * Callback fired when the checked state changes.
1397
+ *
1398
+ * @param value - The new checked state.
1399
+ */
1400
+ readonly onCheckedChange: FunctionPropDef<(value: boolean) => void>;
1401
+ };
1402
+ type SwitchRootInternalProps = GetPropDefTypes<typeof SwitchRootPropsDefs>;
1403
+
1404
+ interface AllSwitchRootProps extends SwitchRootInternalProps, AlignProp, ColorProp, MarginProps, SizeProp {
1405
+ }
1406
+ /**
1407
+ * A versatile Switch, managing state, context, and styling.
1408
+ */
1409
+ type SwitchRootProps = AllSwitchRootProps & WithStrictChildren<HTMLAttributes<HTMLDivElement>, SwitchLabelProps | SwitchIndicatorProps>;
1410
+
1411
+ declare const Switch: React$1.FC<SwitchRootProps> & {
1412
+ Root: React$1.FC<SwitchRootProps>;
1413
+ Label: React$1.ForwardRefExoticComponent<AllSwitchLabelProps & Omit<React$1.HTMLAttributes<HTMLLabelElement>, "children"> & {
1414
+ children?: React.ReactNode;
1415
+ } & React$1.RefAttributes<HTMLLabelElement>>;
1416
+ Indicator: React$1.FC<SwitchIndicatorProps>;
1417
+ };
1418
+
1419
+ interface TextExternalProps extends MarginProps, PaddingProps, ColorProp {
1296
1420
  }
1297
1421
  /**
1298
1422
  * A component for displaying text with customizable styling and layout.
@@ -1359,4 +1483,4 @@ interface ThemeControlProps {
1359
1483
  }
1360
1484
  declare function ThemeControl({ position }: ThemeControlProps): react_jsx_runtime.JSX.Element;
1361
1485
 
1362
- export { Accordion, Badge, Box, Button, Checkbox, Container, Panel, Portal, ProgressBar, Select, Separator, Text, Theme, type ThemeAppearance, ThemeControl, type ThemeRadius, type ThemeRoundness, type ThemeSpacing, useTheme };
1486
+ export { Accordion, Badge, Box, Button, Checkbox, Container, Panel, Portal, ProgressBar, Select, Separator, Switch, Text, Theme, type ThemeAppearance, ThemeControl, type ThemeRadius, type ThemeRoundness, type ThemeSpacing, useTheme };