@vritti/quantum-ui 0.1.1 → 0.1.3

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.
Files changed (104) hide show
  1. package/dist/Button-CQn3Mpx0.js +83 -0
  2. package/dist/Button-CQn3Mpx0.js.map +1 -0
  3. package/dist/Card-C5V_kLq7.js +41 -0
  4. package/dist/Card-C5V_kLq7.js.map +1 -0
  5. package/dist/TextField-CBAo3cUz.js +138 -0
  6. package/dist/TextField-CBAo3cUz.js.map +1 -0
  7. package/dist/ThemeToggle-C8VWQYpc.js +186 -0
  8. package/dist/ThemeToggle-C8VWQYpc.js.map +1 -0
  9. package/dist/Typography-BCxuB5sP.js +100 -0
  10. package/dist/Typography-BCxuB5sP.js.map +1 -0
  11. package/dist/components/Button.js +1 -19
  12. package/dist/components/Button.js.map +1 -1
  13. package/dist/components/Card.js +2 -0
  14. package/dist/components/Card.js.map +1 -0
  15. package/dist/components/TextField.js +1 -28
  16. package/dist/components/TextField.js.map +1 -1
  17. package/dist/components/ThemeToggle.js +2 -0
  18. package/dist/components/ThemeToggle.js.map +1 -0
  19. package/dist/components/Typography.js +1 -41
  20. package/dist/components/Typography.js.map +1 -1
  21. package/dist/index-B_dX4wQk.js +123 -0
  22. package/dist/index-B_dX4wQk.js.map +1 -0
  23. package/dist/index.js +6 -92
  24. package/dist/index.js.map +1 -1
  25. package/dist/lib/components/Button/Button.d.ts +2 -0
  26. package/dist/lib/components/Button/Button.d.ts.map +1 -0
  27. package/dist/lib/components/Button/index.d.ts +2 -0
  28. package/dist/lib/components/Button/index.d.ts.map +1 -0
  29. package/dist/lib/components/Card/Card.d.ts +2 -0
  30. package/dist/lib/components/Card/Card.d.ts.map +1 -0
  31. package/dist/lib/components/Card/index.d.ts +2 -0
  32. package/dist/lib/components/Card/index.d.ts.map +1 -0
  33. package/dist/lib/components/TextField/TextField.d.ts +9 -0
  34. package/dist/lib/components/TextField/TextField.d.ts.map +1 -0
  35. package/dist/lib/components/TextField/index.d.ts +2 -0
  36. package/dist/lib/components/TextField/index.d.ts.map +1 -0
  37. package/dist/lib/components/ThemeToggle/ThemeToggle.d.ts +7 -0
  38. package/dist/lib/components/ThemeToggle/ThemeToggle.d.ts.map +1 -0
  39. package/dist/lib/components/ThemeToggle/index.d.ts +2 -0
  40. package/dist/lib/components/ThemeToggle/index.d.ts.map +1 -0
  41. package/dist/lib/components/Typography/Typography.d.ts +10 -0
  42. package/dist/lib/components/Typography/Typography.d.ts.map +1 -0
  43. package/dist/lib/components/Typography/index.d.ts +2 -0
  44. package/dist/lib/components/Typography/index.d.ts.map +1 -0
  45. package/dist/lib/components/index.d.ts +6 -0
  46. package/dist/lib/components/index.d.ts.map +1 -0
  47. package/dist/lib/index.d.ts +3 -0
  48. package/dist/lib/index.d.ts.map +1 -0
  49. package/dist/utils-BLJyPY44.js +2963 -0
  50. package/dist/utils-BLJyPY44.js.map +1 -0
  51. package/package.json +28 -18
  52. package/readme.md +72 -60
  53. package/dist/ThemeScript-BcAiGxU5.js +0 -1586
  54. package/dist/ThemeScript-BcAiGxU5.js.map +0 -1
  55. package/dist/components/Button/Button.d.ts +0 -11
  56. package/dist/components/Button/Button.d.ts.map +0 -1
  57. package/dist/components/Button/index.d.ts +0 -3
  58. package/dist/components/Button/index.d.ts.map +0 -1
  59. package/dist/components/Paper/Paper.d.ts +0 -14
  60. package/dist/components/Paper/Paper.d.ts.map +0 -1
  61. package/dist/components/Paper/index.d.ts +0 -3
  62. package/dist/components/Paper/index.d.ts.map +0 -1
  63. package/dist/components/Paper.js +0 -27
  64. package/dist/components/Paper.js.map +0 -1
  65. package/dist/components/TextField/TextField.d.ts +0 -13
  66. package/dist/components/TextField/TextField.d.ts.map +0 -1
  67. package/dist/components/TextField/index.d.ts +0 -3
  68. package/dist/components/TextField/index.d.ts.map +0 -1
  69. package/dist/components/Typography/Typography.d.ts +0 -8
  70. package/dist/components/Typography/Typography.d.ts.map +0 -1
  71. package/dist/components/Typography/index.d.ts +0 -3
  72. package/dist/components/Typography/index.d.ts.map +0 -1
  73. package/dist/components/index.d.ts +0 -9
  74. package/dist/components/index.d.ts.map +0 -1
  75. package/dist/index.d.ts +0 -8
  76. package/dist/index.d.ts.map +0 -1
  77. package/dist/next.d.ts +0 -4
  78. package/dist/next.d.ts.map +0 -1
  79. package/dist/next.js +0 -2
  80. package/dist/next.js.map +0 -1
  81. package/dist/theme/ThemeProvider.d.ts +0 -9
  82. package/dist/theme/ThemeProvider.d.ts.map +0 -1
  83. package/dist/theme/ThemeScript.d.ts +0 -11
  84. package/dist/theme/ThemeScript.d.ts.map +0 -1
  85. package/dist/theme/components/Button.d.ts +0 -3
  86. package/dist/theme/components/Button.d.ts.map +0 -1
  87. package/dist/theme/components/Paper.d.ts +0 -3
  88. package/dist/theme/components/Paper.d.ts.map +0 -1
  89. package/dist/theme/components/TextField.d.ts +0 -3
  90. package/dist/theme/components/TextField.d.ts.map +0 -1
  91. package/dist/theme/components/index.d.ts +0 -4
  92. package/dist/theme/components/index.d.ts.map +0 -1
  93. package/dist/theme/createTheme.d.ts +0 -2
  94. package/dist/theme/createTheme.d.ts.map +0 -1
  95. package/dist/theme/cssVariableGenerator.d.ts +0 -4
  96. package/dist/theme/cssVariableGenerator.d.ts.map +0 -1
  97. package/dist/theme/index.d.ts +0 -8
  98. package/dist/theme/index.d.ts.map +0 -1
  99. package/dist/theme/palette.d.ts +0 -88
  100. package/dist/theme/palette.d.ts.map +0 -1
  101. package/dist/theme/semanticTokens.d.ts +0 -142
  102. package/dist/theme/semanticTokens.d.ts.map +0 -1
  103. package/dist/theme/useTheme.d.ts +0 -12
  104. package/dist/theme/useTheme.d.ts.map +0 -1
@@ -1,20 +1,2 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import MuiButton from '@mui/material/Button';
3
- import React from 'react';
4
-
5
- const INTENT_TO_MUI_PROPS = {
6
- primary: { variant: "contained", color: "primary" },
7
- secondary: { variant: "outlined", color: "primary" },
8
- destructive: { variant: "contained", color: "error" },
9
- ghost: { variant: "text", color: "inherit" }
10
- };
11
- const Button = React.memo(
12
- ({ intent = "primary", size = "medium", children, ...props }) => {
13
- const muiProps = INTENT_TO_MUI_PROPS[intent];
14
- return /* @__PURE__ */ jsx(MuiButton, { ...muiProps, size, "data-intent": intent, ...props, children });
15
- }
16
- );
17
- Button.displayName = "Button";
18
-
19
- export { Button };
1
+ export { B as Button, b as buttonVariants } from '../Button-CQn3Mpx0.js';
20
2
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../lib/components/Button/Button.tsx"],"sourcesContent":["import type { ButtonProps as MuiButtonProps } from \"@mui/material/Button\";\nimport MuiButton from \"@mui/material/Button\";\nimport React from \"react\";\n\nexport interface ButtonProps extends Omit<MuiButtonProps, \"variant\" | \"color\"> {\n /**\n * The intent/purpose of the button\n * - primary: Main actions, CTAs (solid blue)\n * - secondary: Secondary actions (outlined blue)\n * - destructive: Dangerous actions (solid red)\n * - ghost: Subtle actions (text only)\n */\n intent?: \"primary\" | \"secondary\" | \"destructive\" | \"ghost\";\n\n /**\n * Size of the button\n */\n size?: \"small\" | \"medium\" | \"large\";\n\n /**\n * Whether the button should take full width\n */\n fullWidth?: boolean;\n\n /**\n * Whether the button is disabled\n */\n disabled?: boolean;\n\n /**\n * Button content\n */\n children: React.ReactNode;\n}\n\n// ✅ Optimized: Constant lookup instead of function calls\nconst INTENT_TO_MUI_PROPS = {\n primary: { variant: \"contained\" as const, color: \"primary\" as const },\n secondary: { variant: \"outlined\" as const, color: \"primary\" as const },\n destructive: { variant: \"contained\" as const, color: \"error\" as const },\n ghost: { variant: \"text\" as const, color: \"inherit\" as const },\n} as const;\n\nexport const Button = React.memo<ButtonProps>(\n ({ intent = \"primary\", size = \"medium\", children, ...props }) => {\n // ✅ Direct lookup - no function calls\n const muiProps = INTENT_TO_MUI_PROPS[intent];\n\n return (\n <MuiButton {...muiProps} size={size} data-intent={intent} {...props}>\n {children}\n </MuiButton>\n );\n }\n);\n\nButton.displayName = \"Button\";\n"],"names":[],"mappings":";;;;AAoCA,MAAM,mBAAsB,GAAA;AAAA,EAC1B,OAAS,EAAA,EAAE,OAAS,EAAA,WAAA,EAAsB,OAAO,SAAmB,EAAA;AAAA,EACpE,SAAW,EAAA,EAAE,OAAS,EAAA,UAAA,EAAqB,OAAO,SAAmB,EAAA;AAAA,EACrE,WAAa,EAAA,EAAE,OAAS,EAAA,WAAA,EAAsB,OAAO,OAAiB,EAAA;AAAA,EACtE,KAAO,EAAA,EAAE,OAAS,EAAA,MAAA,EAAiB,OAAO,SAAmB;AAC/D,CAAA;AAEO,MAAM,SAAS,KAAM,CAAA,IAAA;AAAA,EAC1B,CAAC,EAAE,MAAS,GAAA,SAAA,EAAW,OAAO,QAAU,EAAA,QAAA,EAAU,GAAG,KAAA,EAAY,KAAA;AAE/D,IAAM,MAAA,QAAA,GAAW,oBAAoB,MAAM,CAAA;AAE3C,IACE,uBAAA,GAAA,CAAC,aAAW,GAAG,QAAA,EAAU,MAAY,aAAa,EAAA,MAAA,EAAS,GAAG,KAAA,EAC3D,QACH,EAAA,CAAA;AAAA;AAGN;AAEA,MAAA,CAAO,WAAc,GAAA,QAAA;;;;"}
1
+ {"version":3,"file":"Button.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export { C as Card, a as CardContent, b as CardDescription, c as CardFooter, d as CardHeader, e as CardTitle } from '../Card-C5V_kLq7.js';
2
+ //# sourceMappingURL=Card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Card.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,29 +1,2 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import MuiTextField from '@mui/material/TextField';
3
- import React from 'react';
4
-
5
- const STATE_TO_COLOR_MAP = {
6
- normal: "primary",
7
- error: "error",
8
- success: "success",
9
- warning: "warning"
10
- };
11
- const TextField = React.memo(
12
- ({ state = "normal", message, fullWidth = true, ...props }) => {
13
- return /* @__PURE__ */ jsx(
14
- MuiTextField,
15
- {
16
- variant: "filled",
17
- color: STATE_TO_COLOR_MAP[state],
18
- error: state === "error",
19
- helperText: message,
20
- fullWidth,
21
- ...props
22
- }
23
- );
24
- }
25
- );
26
- TextField.displayName = "TextField";
27
-
28
- export { TextField };
1
+ export { T as TextField } from '../TextField-CBAo3cUz.js';
29
2
  //# sourceMappingURL=TextField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.js","sources":["../../lib/components/TextField/TextField.tsx"],"sourcesContent":["import type { TextFieldProps as MuiTextFieldProps } from \"@mui/material/TextField\";\nimport MuiTextField from \"@mui/material/TextField\";\nimport React from \"react\";\n\nexport interface TextFieldProps\n extends Omit<MuiTextFieldProps, \"variant\" | \"color\"> {\n /**\n * The current state of the field for validation feedback\n */\n state?: \"normal\" | \"error\" | \"success\" | \"warning\";\n\n /**\n * Label for the field\n */\n label?: string;\n\n /**\n * Helper or error message to display below the field\n */\n message?: string;\n\n /**\n * Placeholder text when field is empty\n */\n placeholder?: string;\n\n /**\n * Whether the field is required\n */\n required?: boolean;\n\n /**\n * Whether the field is disabled\n */\n disabled?: boolean;\n\n /**\n * Whether the field should take full width\n */\n fullWidth?: boolean;\n}\n\n// ✅ Optimized: Constant mappings instead of functions\nconst STATE_TO_COLOR_MAP = {\n normal: \"primary\",\n error: \"error\",\n success: \"success\",\n warning: \"warning\",\n} as const;\n\nexport const TextField = React.memo<TextFieldProps>(\n ({ state = \"normal\", message, fullWidth = true, ...props }) => {\n return (\n <MuiTextField\n variant=\"filled\"\n color={STATE_TO_COLOR_MAP[state]}\n error={state === \"error\"}\n helperText={message}\n fullWidth={fullWidth}\n {...props}\n />\n );\n }\n);\n\nTextField.displayName = \"TextField\";\n"],"names":[],"mappings":";;;;AA2CA,MAAM,kBAAqB,GAAA;AAAA,EACzB,MAAQ,EAAA,SAAA;AAAA,EACR,KAAO,EAAA,OAAA;AAAA,EACP,OAAS,EAAA,SAAA;AAAA,EACT,OAAS,EAAA;AACX,CAAA;AAEO,MAAM,YAAY,KAAM,CAAA,IAAA;AAAA,EAC7B,CAAC,EAAE,KAAQ,GAAA,QAAA,EAAU,SAAS,SAAY,GAAA,IAAA,EAAM,GAAG,KAAA,EAAY,KAAA;AAC7D,IACE,uBAAA,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,OAAQ,EAAA,QAAA;AAAA,QACR,KAAA,EAAO,mBAAmB,KAAK,CAAA;AAAA,QAC/B,OAAO,KAAU,KAAA,OAAA;AAAA,QACjB,UAAY,EAAA,OAAA;AAAA,QACZ,SAAA;AAAA,QACC,GAAG;AAAA;AAAA,KACN;AAAA;AAGN;AAEA,SAAA,CAAU,WAAc,GAAA,WAAA;;;;"}
1
+ {"version":3,"file":"TextField.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export { T as ThemeToggle } from '../ThemeToggle-C8VWQYpc.js';
2
+ //# sourceMappingURL=ThemeToggle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeToggle.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,42 +1,2 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import MuiTypography from '@mui/material/Typography';
3
- import React from 'react';
4
-
5
- const INTENT_TO_CSS_VAR_MAP = {
6
- primary: "var(--quantum-color-text-primary)",
7
- secondary: "var(--quantum-color-text-secondary)",
8
- disabled: "var(--quantum-color-text-disabled)",
9
- success: "var(--quantum-color-feedback-success)",
10
- // Success green from CSS vars
11
- warning: "var(--quantum-color-feedback-warning)",
12
- // Warning from CSS vars
13
- brand: "var(--quantum-color-action-primary)"
14
- // Brand blue
15
- };
16
- const Typography = React.memo(
17
- ({ intent = "primary", color, children, variant = "body1", sx, ...props }) => {
18
- const cssVariableColor = INTENT_TO_CSS_VAR_MAP[intent];
19
- const finalSx = {
20
- // Use CSS variable for theme-aware colors
21
- color: color || cssVariableColor,
22
- // Ensure proper line height and font weights
23
- lineHeight: variant?.includes("h") ? 1.2 : variant === "body1" ? 1.6 : 1.4,
24
- // Add theme transition
25
- transition: "color 0.3s ease",
26
- ...sx
27
- };
28
- return /* @__PURE__ */ jsx(
29
- MuiTypography,
30
- {
31
- variant,
32
- sx: finalSx,
33
- ...props,
34
- children
35
- }
36
- );
37
- }
38
- );
39
- Typography.displayName = "Typography";
40
-
41
- export { Typography };
1
+ export { T as Typography } from '../Typography-BCxuB5sP.js';
42
2
  //# sourceMappingURL=Typography.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Typography.js","sources":["../../lib/components/Typography/Typography.tsx"],"sourcesContent":["import type { TypographyProps as MuiTypographyProps } from \"@mui/material/Typography\";\nimport MuiTypography from \"@mui/material/Typography\";\nimport React from \"react\";\n\nexport interface TypographyProps extends MuiTypographyProps {\n /**\n * Semantic intent for text color\n * - primary: Primary text color (default)\n * - secondary: Secondary text color\n * - disabled: Disabled text color\n * - success: Success/positive state color\n * - warning: Warning state color\n * - brand: Brand blue color for logos and highlights\n */\n intent?: \"primary\" | \"secondary\" | \"disabled\" | \"success\" | \"warning\" | \"brand\";\n\n /**\n * Typography content\n */\n children: React.ReactNode;\n}\n\n// ✅ Enhanced: CSS Variables mapping for theme-aware colors\nconst INTENT_TO_CSS_VAR_MAP = {\n primary: \"var(--quantum-color-text-primary)\",\n secondary: \"var(--quantum-color-text-secondary)\", \n disabled: \"var(--quantum-color-text-disabled)\",\n success: \"var(--quantum-color-feedback-success)\", // Success green from CSS vars\n warning: \"var(--quantum-color-feedback-warning)\", // Warning from CSS vars\n brand: \"var(--quantum-color-action-primary)\", // Brand blue\n} as const;\n\n\nexport const Typography = React.memo<TypographyProps>(\n ({ intent = \"primary\", color, children, variant = \"body1\", sx, ...props }) => {\n // Use CSS variable for theme-aware colors\n const cssVariableColor = INTENT_TO_CSS_VAR_MAP[intent];\n \n const finalSx = {\n // Use CSS variable for theme-aware colors\n color: color || cssVariableColor,\n // Ensure proper line height and font weights\n lineHeight: variant?.includes('h') ? 1.2 : variant === 'body1' ? 1.6 : 1.4,\n // Add theme transition\n transition: 'color 0.3s ease',\n ...sx,\n };\n\n return (\n <MuiTypography \n variant={variant} \n sx={finalSx}\n {...props}\n >\n {children}\n </MuiTypography>\n );\n }\n);\n\nTypography.displayName = \"Typography\";\n"],"names":[],"mappings":";;;;AAuBA,MAAM,qBAAwB,GAAA;AAAA,EAC5B,OAAS,EAAA,mCAAA;AAAA,EACT,SAAW,EAAA,qCAAA;AAAA,EACX,QAAU,EAAA,oCAAA;AAAA,EACV,OAAS,EAAA,uCAAA;AAAA;AAAA,EACT,OAAS,EAAA,uCAAA;AAAA;AAAA,EACT,KAAO,EAAA;AAAA;AACT,CAAA;AAGO,MAAM,aAAa,KAAM,CAAA,IAAA;AAAA,EAC9B,CAAC,EAAE,MAAA,GAAS,SAAW,EAAA,KAAA,EAAO,QAAU,EAAA,OAAA,GAAU,OAAS,EAAA,EAAA,EAAI,GAAG,KAAA,EAAY,KAAA;AAE5E,IAAM,MAAA,gBAAA,GAAmB,sBAAsB,MAAM,CAAA;AAErD,IAAA,MAAM,OAAU,GAAA;AAAA;AAAA,MAEd,OAAO,KAAS,IAAA,gBAAA;AAAA;AAAA,MAEhB,UAAA,EAAY,SAAS,QAAS,CAAA,GAAG,IAAI,GAAM,GAAA,OAAA,KAAY,UAAU,GAAM,GAAA,GAAA;AAAA;AAAA,MAEvE,UAAY,EAAA,iBAAA;AAAA,MACZ,GAAG;AAAA,KACL;AAEA,IACE,uBAAA,GAAA;AAAA,MAAC,aAAA;AAAA,MAAA;AAAA,QACC,OAAA;AAAA,QACA,EAAI,EAAA,OAAA;AAAA,QACH,GAAG,KAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA;AAGN;AAEA,UAAA,CAAW,WAAc,GAAA,YAAA;;;;"}
1
+ {"version":3,"file":"Typography.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,123 @@
1
+ import * as React from 'react';
2
+ import { jsx } from 'react/jsx-runtime';
3
+
4
+ // packages/react/compose-refs/src/compose-refs.tsx
5
+ function setRef(ref, value) {
6
+ if (typeof ref === "function") {
7
+ return ref(value);
8
+ } else if (ref !== null && ref !== void 0) {
9
+ ref.current = value;
10
+ }
11
+ }
12
+ function composeRefs(...refs) {
13
+ return (node) => {
14
+ let hasCleanup = false;
15
+ const cleanups = refs.map((ref) => {
16
+ const cleanup = setRef(ref, node);
17
+ if (!hasCleanup && typeof cleanup == "function") {
18
+ hasCleanup = true;
19
+ }
20
+ return cleanup;
21
+ });
22
+ if (hasCleanup) {
23
+ return () => {
24
+ for (let i = 0; i < cleanups.length; i++) {
25
+ const cleanup = cleanups[i];
26
+ if (typeof cleanup == "function") {
27
+ cleanup();
28
+ } else {
29
+ setRef(refs[i], null);
30
+ }
31
+ }
32
+ };
33
+ }
34
+ };
35
+ }
36
+
37
+ // src/slot.tsx
38
+ // @__NO_SIDE_EFFECTS__
39
+ function createSlot(ownerName) {
40
+ const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
41
+ const Slot2 = React.forwardRef((props, forwardedRef) => {
42
+ const { children, ...slotProps } = props;
43
+ const childrenArray = React.Children.toArray(children);
44
+ const slottable = childrenArray.find(isSlottable);
45
+ if (slottable) {
46
+ const newElement = slottable.props.children;
47
+ const newChildren = childrenArray.map((child) => {
48
+ if (child === slottable) {
49
+ if (React.Children.count(newElement) > 1) return React.Children.only(null);
50
+ return React.isValidElement(newElement) ? newElement.props.children : null;
51
+ } else {
52
+ return child;
53
+ }
54
+ });
55
+ return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
56
+ }
57
+ return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
58
+ });
59
+ Slot2.displayName = `${ownerName}.Slot`;
60
+ return Slot2;
61
+ }
62
+ var Slot = /* @__PURE__ */ createSlot("Slot");
63
+ // @__NO_SIDE_EFFECTS__
64
+ function createSlotClone(ownerName) {
65
+ const SlotClone = React.forwardRef((props, forwardedRef) => {
66
+ const { children, ...slotProps } = props;
67
+ if (React.isValidElement(children)) {
68
+ const childrenRef = getElementRef(children);
69
+ const props2 = mergeProps(slotProps, children.props);
70
+ if (children.type !== React.Fragment) {
71
+ props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
72
+ }
73
+ return React.cloneElement(children, props2);
74
+ }
75
+ return React.Children.count(children) > 1 ? React.Children.only(null) : null;
76
+ });
77
+ SlotClone.displayName = `${ownerName}.SlotClone`;
78
+ return SlotClone;
79
+ }
80
+ var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
81
+ function isSlottable(child) {
82
+ return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
83
+ }
84
+ function mergeProps(slotProps, childProps) {
85
+ const overrideProps = { ...childProps };
86
+ for (const propName in childProps) {
87
+ const slotPropValue = slotProps[propName];
88
+ const childPropValue = childProps[propName];
89
+ const isHandler = /^on[A-Z]/.test(propName);
90
+ if (isHandler) {
91
+ if (slotPropValue && childPropValue) {
92
+ overrideProps[propName] = (...args) => {
93
+ const result = childPropValue(...args);
94
+ slotPropValue(...args);
95
+ return result;
96
+ };
97
+ } else if (slotPropValue) {
98
+ overrideProps[propName] = slotPropValue;
99
+ }
100
+ } else if (propName === "style") {
101
+ overrideProps[propName] = { ...slotPropValue, ...childPropValue };
102
+ } else if (propName === "className") {
103
+ overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
104
+ }
105
+ }
106
+ return { ...slotProps, ...overrideProps };
107
+ }
108
+ function getElementRef(element) {
109
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
110
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
111
+ if (mayWarn) {
112
+ return element.ref;
113
+ }
114
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
115
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
116
+ if (mayWarn) {
117
+ return element.props.ref;
118
+ }
119
+ return element.props.ref || element.ref;
120
+ }
121
+
122
+ export { Slot as S, createSlot as c };
123
+ //# sourceMappingURL=index-B_dX4wQk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-B_dX4wQk.js","sources":["../node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../node_modules/@radix-ui/react-slot/dist/index.mjs"],"sourcesContent":["// packages/react/compose-refs/src/compose-refs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n","// src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;;AAAA;AAEA,SAAS,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE;AAC5B,EAAE,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;AACjC,IAAI,OAAO,GAAG,CAAC,KAAK,CAAC;AACrB,EAAE,CAAC,MAAM,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,MAAM,EAAE;AAC7C,IAAI,GAAG,CAAC,OAAO,GAAG,KAAK;AACvB,EAAE;AACF;AACA,SAAS,WAAW,CAAC,GAAG,IAAI,EAAE;AAC9B,EAAE,OAAO,CAAC,IAAI,KAAK;AACnB,IAAI,IAAI,UAAU,GAAG,KAAK;AAC1B,IAAI,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;AACvC,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC;AACvC,MAAM,IAAI,CAAC,UAAU,IAAI,OAAO,OAAO,IAAI,UAAU,EAAE;AACvD,QAAQ,UAAU,GAAG,IAAI;AACzB,MAAM;AACN,MAAM,OAAO,OAAO;A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zC;;;;","x_google_ignoreList":[0,1]}
package/dist/index.js CHANGED
@@ -1,93 +1,7 @@
1
- import { c as createQuantumTheme } from './ThemeScript-BcAiGxU5.js';
2
- export { S as SEMANTIC_TOKENS, T as ThemeScript, g as getThemeScript } from './ThemeScript-BcAiGxU5.js';
3
- import { jsx, jsxs } from 'react/jsx-runtime';
4
- import CssBaseline from '@mui/material/CssBaseline';
5
- import { ThemeProvider as ThemeProvider$1 } from '@mui/material/styles';
6
- import { createContext, useContext, useState, useMemo, useEffect, useCallback } from 'react';
7
-
8
- const ThemeContext = createContext(void 0);
9
- const useTheme = () => {
10
- const context = useContext(ThemeContext);
11
- if (!context) {
12
- throw new Error(
13
- "useTheme must be used within a ThemeProvider. Make sure to wrap your app with <ThemeProvider>."
14
- );
15
- }
16
- return context;
17
- };
18
- const useIsClient = () => {
19
- const { isHydrated } = useTheme();
20
- return isHydrated;
21
- };
22
-
23
- const ThemeProvider = ({
24
- children,
25
- defaultColorScheme = "light",
26
- storageKey = "quantum-color-scheme",
27
- attribute = "data-theme"
28
- }) => {
29
- const [colorScheme, setColorScheme] = useState(
30
- defaultColorScheme
31
- );
32
- const [isHydrated, setIsHydrated] = useState(false);
33
- const theme = useMemo(() => createQuantumTheme(colorScheme), [colorScheme]);
34
- useEffect(() => {
35
- if (typeof window === "undefined") return;
36
- const syncWithDOM = () => {
37
- const domTheme = document.documentElement.getAttribute(attribute);
38
- const isValidTheme = domTheme === "light" || domTheme === "dark";
39
- if (isValidTheme && !isHydrated) {
40
- setColorScheme(domTheme);
41
- }
42
- setIsHydrated(true);
43
- };
44
- if (document.readyState === "loading") {
45
- document.addEventListener("DOMContentLoaded", syncWithDOM);
46
- return () => document.removeEventListener("DOMContentLoaded", syncWithDOM);
47
- } else {
48
- syncWithDOM();
49
- }
50
- }, [attribute]);
51
- useEffect(() => {
52
- if (typeof window === "undefined") return;
53
- if (!isHydrated) return;
54
- document.documentElement.setAttribute(attribute, colorScheme);
55
- try {
56
- localStorage.setItem(storageKey, colorScheme);
57
- } catch (error) {
58
- console.warn("Failed to save theme preference:", error);
59
- }
60
- }, [colorScheme, isHydrated, storageKey, attribute]);
61
- const toggleColorScheme = useCallback(() => {
62
- setColorScheme((current) => current === "light" ? "dark" : "light");
63
- }, []);
64
- const setTheme = useCallback((newTheme) => {
65
- setColorScheme(newTheme);
66
- }, []);
67
- const contextValue = useMemo(
68
- () => ({
69
- colorScheme,
70
- toggleColorScheme,
71
- setTheme,
72
- isHydrated,
73
- // Expose configuration for debugging/advanced usage
74
- storageKey,
75
- attribute
76
- }),
77
- [
78
- colorScheme,
79
- toggleColorScheme,
80
- setTheme,
81
- isHydrated,
82
- storageKey,
83
- attribute
84
- ]
85
- );
86
- return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(ThemeProvider$1, { theme, children: [
87
- /* @__PURE__ */ jsx(CssBaseline, {}),
88
- children
89
- ] }) });
90
- };
91
-
92
- export { ThemeProvider, createQuantumTheme, useIsClient, useTheme };
1
+ export { c as cn } from './utils-BLJyPY44.js';
2
+ export { B as Button, b as buttonVariants } from './Button-CQn3Mpx0.js';
3
+ export { C as Card, a as CardContent, b as CardDescription, c as CardFooter, d as CardHeader, e as CardTitle } from './Card-C5V_kLq7.js';
4
+ export { T as TextField } from './TextField-CBAo3cUz.js';
5
+ export { T as ThemeToggle } from './ThemeToggle-C8VWQYpc.js';
6
+ export { T as Typography } from './Typography-BCxuB5sP.js';
93
7
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../lib/theme/useTheme.ts","../lib/theme/ThemeProvider.tsx"],"sourcesContent":["import { useContext, createContext } from \"react\";\n\nexport interface ThemeContextType {\n /** Current color scheme */\n colorScheme: \"light\" | \"dark\";\n /** Toggle between light and dark themes */\n toggleColorScheme: () => void;\n /** Set specific theme (useful for theme selection UI) */\n setTheme: (theme: \"light\" | \"dark\") => void;\n /** Whether React has finished hydrating (safe to show theme-dependent content) */\n isHydrated: boolean;\n /** localStorage key used for persistence */\n storageKey: string;\n /** HTML attribute used for theme */\n attribute: string;\n}\n\nexport const ThemeContext = createContext<ThemeContextType | undefined>(undefined);\n\n/**\n * Hook to access and control theme state.\n * \n * @example Basic usage\n * ```tsx\n * function ThemeToggle() {\n * const { colorScheme, toggleColorScheme } = useTheme();\n * \n * return (\n * <button onClick={toggleColorScheme}>\n * Current: {colorScheme}\n * </button>\n * );\n * }\n * ```\n * \n * @example Theme selection UI\n * ```tsx\n * function ThemeSelector() {\n * const { colorScheme, setTheme } = useTheme();\n * \n * return (\n * <div>\n * <button \n * onClick={() => setTheme('light')}\n * data-active={colorScheme === 'light'}\n * >\n * Light\n * </button>\n * <button \n * onClick={() => setTheme('dark')}\n * data-active={colorScheme === 'dark'}\n * >\n * Dark\n * </button>\n * </div>\n * );\n * }\n * ```\n * \n * @example Conditional rendering based on hydration\n * ```tsx\n * function ClientOnlyComponent() {\n * const { isHydrated } = useTheme();\n * \n * if (!isHydrated) {\n * return <div>Loading...</div>;\n * }\n * \n * return <ComplexInteractiveWidget />;\n * }\n * ```\n */\nexport const useTheme = (): ThemeContextType => {\n const context = useContext(ThemeContext);\n \n if (!context) {\n throw new Error(\n \"useTheme must be used within a ThemeProvider. \" +\n \"Make sure to wrap your app with <ThemeProvider>.\"\n );\n }\n \n return context;\n};\n\n/**\n * Utility hook for components that need to check if they're running on the client\n * after hydration. This is useful for components that should only render on the client.\n * \n * @example\n * ```tsx\n * function ClientOnlyWidget() {\n * const isClient = useIsClient();\n * \n * if (!isClient) return null;\n * \n * return <ComplexClientFeature />;\n * }\n * ```\n */\nexport const useIsClient = (): boolean => {\n const { isHydrated } = useTheme();\n return isHydrated;\n};","import CssBaseline from \"@mui/material/CssBaseline\";\nimport { ThemeProvider as MuiThemeProvider } from \"@mui/material/styles\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { createQuantumTheme } from \"./createTheme\";\nimport { ThemeContext } from \"./useTheme\";\n\nexport interface ThemeProviderProps {\n children: React.ReactNode;\n /**\n * Default color scheme to use on first load\n * Should match the defaultColorScheme used in ThemeScript\n * @default \"light\"\n */\n defaultColorScheme?: \"light\" | \"dark\";\n /**\n * localStorage key to sync theme preference\n * Should match the storageKey used in ThemeScript\n * @default \"quantum-color-scheme\"\n */\n storageKey?: string;\n /**\n * HTML attribute that ThemeScript uses for theme\n * Should match the attribute used in ThemeScript\n * @default \"data-theme\"\n */\n attribute?: string;\n}\n\n/**\n * Enhanced ThemeProvider that works seamlessly with ThemeScript.\n *\n * ThemeScript handles:\n * - Initial DOM theme application (prevents flickering)\n * - Blocking script execution before React loads\n *\n * ThemeProvider handles:\n * - React state management and context\n * - SSR-safe hydration\n * - Theme toggling and persistence\n * - Performance optimization\n *\n * @example\n * ```tsx\n * // 1. Add ThemeScript to prevent flickering\n * <ThemeScript defaultColorScheme=\"light\" />\n *\n * // 2. Wrap app with ThemeProvider\n * <ThemeProvider defaultColorScheme=\"light\">\n * <App />\n * </ThemeProvider>\n * ```\n */\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({\n children,\n defaultColorScheme = \"light\",\n storageKey = \"quantum-color-scheme\",\n attribute = \"data-theme\",\n}) => {\n // SSR-safe state initialization - always start with default\n const [colorScheme, setColorScheme] = useState<\"light\" | \"dark\">(\n defaultColorScheme\n );\n const [isHydrated, setIsHydrated] = useState(false);\n\n // Memoized theme creation - only recreate when colorScheme changes\n const theme = useMemo(() => createQuantumTheme(colorScheme), [colorScheme]);\n\n // Hydration effect - sync with ThemeScript's applied theme\n useEffect(() => {\n // Skip on server\n if (typeof window === \"undefined\") return;\n\n const syncWithDOM = () => {\n // Read the actual theme from DOM (set by ThemeScript)\n const domTheme = document.documentElement.getAttribute(attribute);\n const isValidTheme = domTheme === \"light\" || domTheme === \"dark\";\n\n // Only sync with DOM on initial hydration, not on subsequent renders\n if (isValidTheme && !isHydrated) {\n setColorScheme(domTheme as \"light\" | \"dark\");\n }\n\n setIsHydrated(true);\n };\n\n // Sync immediately if DOM is ready, otherwise wait\n if (document.readyState === \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", syncWithDOM);\n return () =>\n document.removeEventListener(\"DOMContentLoaded\", syncWithDOM);\n } else {\n syncWithDOM();\n }\n }, [attribute]); // Remove isHydrated dependency to prevent re-runs\n\n // Theme change effect - update DOM and localStorage when React state changes\n useEffect(() => {\n // Skip on server\n if (typeof window === \"undefined\") return;\n \n // Skip if not hydrated yet (let the hydration effect handle initial sync)\n if (!isHydrated) return;\n\n // Update DOM attribute\n document.documentElement.setAttribute(attribute, colorScheme);\n\n // Persist to localStorage\n try {\n localStorage.setItem(storageKey, colorScheme);\n } catch (error) {\n // Gracefully handle localStorage errors (private browsing, etc.)\n console.warn(\"Failed to save theme preference:\", error);\n }\n }, [colorScheme, isHydrated, storageKey, attribute]);\n\n // Optimized theme toggle function\n const toggleColorScheme = useCallback(() => {\n setColorScheme((current) => (current === \"light\" ? \"dark\" : \"light\"));\n }, []);\n\n // Set specific theme (useful for theme selection UI)\n const setTheme = useCallback((newTheme: \"light\" | \"dark\") => {\n setColorScheme(newTheme);\n }, []);\n\n // Memoized context value to prevent unnecessary re-renders\n const contextValue = useMemo(\n () => ({\n colorScheme,\n toggleColorScheme,\n setTheme,\n isHydrated,\n // Expose configuration for debugging/advanced usage\n storageKey,\n attribute,\n }),\n [\n colorScheme,\n toggleColorScheme,\n setTheme,\n isHydrated,\n storageKey,\n attribute,\n ]\n );\n\n return (\n <ThemeContext.Provider value={contextValue}>\n <MuiThemeProvider theme={theme}>\n <CssBaseline />\n {children}\n </MuiThemeProvider>\n </ThemeContext.Provider>\n );\n};\n"],"names":["MuiThemeProvider"],"mappings":";;;;;;;AAiBa,MAAA,YAAA,GAAe,cAA4C,MAAS,CAAA;AAuD1E,MAAM,WAAW,MAAwB;AAC9C,EAAM,MAAA,OAAA,GAAU,WAAW,YAAY,CAAA;AAEvC,EAAA,IAAI,CAAC,OAAS,EAAA;A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A,IACZ;AAAA,GAAA,EACH,CACF,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -0,0 +1,2 @@
1
+ export { Button, buttonVariants } from '../../../shadcn/shadcnButton';
2
+ //# sourceMappingURL=Button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../lib/components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Button, buttonVariants } from './Button';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/components/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '../../../shadcn/shadcnCard';
2
+ //# sourceMappingURL=Card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../lib/components/Card/Card.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,IAAI,EACJ,UAAU,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,EACV,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from './Card';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/components/Card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ export interface TextFieldProps extends React.ComponentProps<'input'> {
3
+ label?: string;
4
+ message?: string;
5
+ required?: boolean;
6
+ error?: boolean;
7
+ }
8
+ export declare const TextField: React.FC<TextFieldProps>;
9
+ //# sourceMappingURL=TextField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../../lib/components/TextField/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC;IAInE,KAAK,CAAC,EAAE,MAAM,CAAC;IAKf,OAAO,CAAC,EAAE,MAAM,CAAC;IAKjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAKnB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAGD,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAmD9C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { TextField } from './TextField';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/components/TextField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ export interface ThemeToggleProps {
3
+ className?: string;
4
+ size?: 'sm' | 'md' | 'lg';
5
+ }
6
+ export declare const ThemeToggle: React.FC<ThemeToggleProps>;
7
+ //# sourceMappingURL=ThemeToggle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeToggle.d.ts","sourceRoot":"","sources":["../../../../lib/components/ThemeToggle/ThemeToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAIzD,MAAM,WAAW,gBAAgB;IAI/B,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAkClD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { ThemeToggle } from './ThemeToggle';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/components/ThemeToggle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ export interface TypographyProps {
3
+ children: React.ReactNode;
4
+ variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body1' | 'body2' | 'caption' | 'overline' | 'subtitle1' | 'subtitle2' | 'button' | 'code' | 'blockquote';
5
+ intent?: 'default' | 'primary' | 'secondary' | 'muted' | 'success' | 'warning' | 'error';
6
+ align?: 'left' | 'center' | 'right' | 'justify';
7
+ className?: string;
8
+ }
9
+ export declare const Typography: React.FC<TypographyProps>;
10
+ //# sourceMappingURL=Typography.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../../../../lib/components/Typography/Typography.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,eAAe;IAI9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAK1B,OAAO,CAAC,EACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,OAAO,GACP,OAAO,GACP,SAAS,GACT,UAAU,GACV,WAAW,GACX,WAAW,GACX,QAAQ,GACR,MAAM,GACN,YAAY,CAAC;IAKjB,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAKzF,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IAKhD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAoBD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAoFhD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Typography } from './Typography';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/components/Typography/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './Button';
2
+ export * from './Card';
3
+ export * from './TextField';
4
+ export * from './ThemeToggle';
5
+ export * from './Typography';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './components';
2
+ export { cn } from '../shadcn/utils';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAG7B,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC"}