@ai-matrx/design-system 0.5.0 → 0.5.2
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/CHANGELOG.md +28 -1
- package/dist/index.cjs +7 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -151,7 +151,7 @@ declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<H
|
|
|
151
151
|
|
|
152
152
|
type CheckboxSize = "sm" | "md";
|
|
153
153
|
interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
|
|
154
|
-
/** Box size. Default `
|
|
154
|
+
/** Box size. Default `md` (the stock 16px control); `sm` is the dense 14px one. */
|
|
155
155
|
size?: CheckboxSize;
|
|
156
156
|
}
|
|
157
157
|
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1029,10 +1029,10 @@ declare function TabbedBottomSheet({ open, onOpenChange, title, tabs, }: TabbedB
|
|
|
1029
1029
|
*/
|
|
1030
1030
|
|
|
1031
1031
|
type TableSize = "sm" | "md";
|
|
1032
|
-
/** The density the nearest enclosing `<Table>` declared. `
|
|
1032
|
+
/** The density the nearest enclosing `<Table>` declared. `md` outside one. */
|
|
1033
1033
|
declare function useTableSize(): TableSize;
|
|
1034
1034
|
interface TableProps extends React.HTMLAttributes<HTMLTableElement> {
|
|
1035
|
-
/** Cell density for this table. Default `
|
|
1035
|
+
/** Cell density for this table. Default `md` (`p-3`); `sm` is `p-2`. */
|
|
1036
1036
|
size?: TableSize;
|
|
1037
1037
|
/**
|
|
1038
1038
|
* Wrap the table in its own horizontal scroll container. Default `true`.
|
package/dist/index.d.ts
CHANGED
|
@@ -151,7 +151,7 @@ declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<H
|
|
|
151
151
|
|
|
152
152
|
type CheckboxSize = "sm" | "md";
|
|
153
153
|
interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
|
|
154
|
-
/** Box size. Default `
|
|
154
|
+
/** Box size. Default `md` (the stock 16px control); `sm` is the dense 14px one. */
|
|
155
155
|
size?: CheckboxSize;
|
|
156
156
|
}
|
|
157
157
|
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1029,10 +1029,10 @@ declare function TabbedBottomSheet({ open, onOpenChange, title, tabs, }: TabbedB
|
|
|
1029
1029
|
*/
|
|
1030
1030
|
|
|
1031
1031
|
type TableSize = "sm" | "md";
|
|
1032
|
-
/** The density the nearest enclosing `<Table>` declared. `
|
|
1032
|
+
/** The density the nearest enclosing `<Table>` declared. `md` outside one. */
|
|
1033
1033
|
declare function useTableSize(): TableSize;
|
|
1034
1034
|
interface TableProps extends React.HTMLAttributes<HTMLTableElement> {
|
|
1035
|
-
/** Cell density for this table. Default `
|
|
1035
|
+
/** Cell density for this table. Default `md` (`p-3`); `sm` is `p-2`. */
|
|
1036
1036
|
size?: TableSize;
|
|
1037
1037
|
/**
|
|
1038
1038
|
* Wrap the table in its own horizontal scroll container. Default `true`.
|
package/dist/index.js
CHANGED
|
@@ -563,7 +563,7 @@ var CHECKBOX_SIZES = {
|
|
|
563
563
|
sm: { root: "h-3.5 w-3.5 rounded-xs", glyph: "h-3 w-3" },
|
|
564
564
|
md: { root: "h-4 w-4 rounded-sm", glyph: "h-3.5 w-3.5" }
|
|
565
565
|
};
|
|
566
|
-
var Checkbox = React6.forwardRef(({ className, size = "
|
|
566
|
+
var Checkbox = React6.forwardRef(({ className, size = "md", ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
567
567
|
CheckboxPrimitive.Root,
|
|
568
568
|
{
|
|
569
569
|
ref,
|
|
@@ -625,11 +625,14 @@ function useIsMobile() {
|
|
|
625
625
|
const [hasMounted, setHasMounted] = React8.useState(false);
|
|
626
626
|
React8.useEffect(() => {
|
|
627
627
|
setHasMounted(true);
|
|
628
|
-
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
629
628
|
const onChange = () => {
|
|
630
629
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
631
630
|
};
|
|
632
631
|
onChange();
|
|
632
|
+
if (typeof window.matchMedia !== "function") {
|
|
633
|
+
return void 0;
|
|
634
|
+
}
|
|
635
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
633
636
|
mql.addEventListener("change", onChange);
|
|
634
637
|
return () => mql.removeEventListener("change", onChange);
|
|
635
638
|
}, []);
|
|
@@ -2638,12 +2641,12 @@ var TABLE_SIZES = {
|
|
|
2638
2641
|
sm: { head: "px-2", cell: "p-2" },
|
|
2639
2642
|
md: { head: "px-3", cell: "p-3" }
|
|
2640
2643
|
};
|
|
2641
|
-
var TableSizeContext = React23.createContext("
|
|
2644
|
+
var TableSizeContext = React23.createContext("md");
|
|
2642
2645
|
function useTableSize() {
|
|
2643
2646
|
return React23.useContext(TableSizeContext);
|
|
2644
2647
|
}
|
|
2645
2648
|
var Table = React23.forwardRef(
|
|
2646
|
-
({ className, size = "
|
|
2649
|
+
({ className, size = "md", wrap = true, wrapperClassName, ...props }, ref) => {
|
|
2647
2650
|
const table = /* @__PURE__ */ jsx30(
|
|
2648
2651
|
"table",
|
|
2649
2652
|
{
|