@soroush.tech/design-system 1.0.0 → 1.1.0
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/README.md +5 -5
- package/dist/AppBar.d.cts +3 -3
- package/dist/AppBar.d.mts +3 -3
- package/dist/Avatar.d.cts +3 -3
- package/dist/Avatar.d.mts +3 -3
- package/dist/Backdrop.d.cts +1 -1
- package/dist/Backdrop.d.mts +1 -1
- package/dist/Button.cjs +0 -6
- package/dist/Button.d.cts +1 -1
- package/dist/Button.d.mts +1 -1
- package/dist/Button.mjs +0 -6
- package/dist/ButtonGroup.d.cts +1 -1
- package/dist/ButtonGroup.d.mts +1 -1
- package/dist/Card.cjs +1 -1
- package/dist/Card.d.cts +3 -3
- package/dist/Card.d.mts +3 -3
- package/dist/Card.mjs +1 -1
- package/dist/Checkbox.d.cts +2 -2
- package/dist/Checkbox.d.mts +2 -2
- package/dist/CircularProgress.d.cts +3 -3
- package/dist/CircularProgress.d.mts +3 -3
- package/dist/Drawer.d.cts +2 -2
- package/dist/Drawer.d.mts +2 -2
- package/dist/Flex.cjs +2 -6
- package/dist/Flex.d.cts +1 -1
- package/dist/Flex.d.mts +1 -1
- package/dist/Flex.mjs +2 -8
- package/dist/Form.d.cts +1 -1
- package/dist/Form.d.mts +1 -1
- package/dist/FormControl.d.cts +2 -2
- package/dist/FormControl.d.mts +2 -2
- package/dist/FormHelperText.d.cts +1 -1
- package/dist/FormHelperText.d.mts +1 -1
- package/dist/FormLabel.d.cts +1 -1
- package/dist/FormLabel.d.mts +1 -1
- package/dist/Grid.cjs +2 -25
- package/dist/Grid.d.cts +4 -11
- package/dist/Grid.d.mts +4 -11
- package/dist/Grid.mjs +2 -24
- package/dist/{Icon-zsHe7hWR.cjs → Icon-BOjk5r39.cjs} +30 -0
- package/dist/{Icon-bv8Z38l-.mjs → Icon-CYjD0Bad.mjs} +30 -0
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.d.cts +1 -1
- package/dist/Icon.d.mts +1 -1
- package/dist/Icon.mjs +1 -1
- package/dist/Image.d.cts +2 -2
- package/dist/Image.d.mts +2 -2
- package/dist/LinearProgress.d.cts +3 -3
- package/dist/LinearProgress.d.mts +3 -3
- package/dist/Link.cjs +1 -5
- package/dist/Link.d.cts +1 -2
- package/dist/Link.d.mts +1 -2
- package/dist/Link.mjs +2 -6
- package/dist/MenuItem.cjs +1 -1
- package/dist/MenuItem.d.cts +2 -2
- package/dist/MenuItem.d.mts +2 -2
- package/dist/MenuItem.mjs +1 -1
- package/dist/Modal.d.cts +1 -1
- package/dist/Modal.d.mts +1 -1
- package/dist/NativeSelect.cjs +1 -1
- package/dist/NativeSelect.d.cts +3 -3
- package/dist/NativeSelect.d.mts +3 -3
- package/dist/NativeSelect.mjs +1 -1
- package/dist/Pagination/PaginationItem.cjs +1 -1
- package/dist/Pagination/PaginationItem.d.cts +1 -1
- package/dist/Pagination/PaginationItem.d.mts +1 -1
- package/dist/Pagination/PaginationItem.mjs +1 -1
- package/dist/Pagination.d.cts +2 -2
- package/dist/Pagination.d.mts +2 -2
- package/dist/Paper.cjs +0 -2
- package/dist/Paper.d.cts +1 -1
- package/dist/Paper.d.mts +1 -1
- package/dist/Paper.mjs +0 -2
- package/dist/Popover.d.cts +4 -4
- package/dist/Popover.d.mts +4 -4
- package/dist/Pressable.cjs +123 -0
- package/dist/Pressable.d.cts +2 -0
- package/dist/Pressable.d.mts +2 -0
- package/dist/Pressable.mjs +121 -0
- package/dist/Quote.d.cts +4 -4
- package/dist/Quote.d.mts +4 -4
- package/dist/Radio.d.cts +2 -2
- package/dist/Radio.d.mts +2 -2
- package/dist/Select.cjs +1 -1
- package/dist/Select.d.cts +3 -3
- package/dist/Select.d.mts +3 -3
- package/dist/Select.mjs +1 -1
- package/dist/Sidebar/Sidebar.cjs +94 -0
- package/dist/Sidebar/Sidebar.d.cts +59 -0
- package/dist/Sidebar/Sidebar.d.mts +59 -0
- package/dist/Sidebar/Sidebar.mjs +93 -0
- package/dist/Sidebar/SidebarItem.cjs +125 -0
- package/dist/Sidebar/SidebarItem.d.cts +39 -0
- package/dist/Sidebar/SidebarItem.d.mts +39 -0
- package/dist/Sidebar/SidebarItem.mjs +124 -0
- package/dist/Sidebar.cjs +7 -0
- package/dist/Sidebar.d.cts +4 -0
- package/dist/Sidebar.d.mts +4 -0
- package/dist/Sidebar.mjs +4 -0
- package/dist/SidebarContext-DgSLwjur.mjs +10 -0
- package/dist/SidebarContext-ao6lRfTX.d.cts +37 -0
- package/dist/SidebarContext-ao6lRfTX.d.mts +37 -0
- package/dist/SidebarContext-jG6OioC-.cjs +14 -0
- package/dist/Skeleton.d.cts +2 -2
- package/dist/Skeleton.d.mts +2 -2
- package/dist/Switch.d.cts +2 -2
- package/dist/Switch.d.mts +2 -2
- package/dist/Table/Table.d.cts +3 -3
- package/dist/Table/Table.d.mts +3 -3
- package/dist/Table/TableBody.d.cts +2 -2
- package/dist/Table/TableBody.d.mts +2 -2
- package/dist/Table/TableCell.d.cts +1 -1
- package/dist/Table/TableCell.d.mts +1 -1
- package/dist/Table/TableContainer.d.cts +4 -4
- package/dist/Table/TableContainer.d.mts +4 -4
- package/dist/Table/TableControl.d.cts +1 -1
- package/dist/Table/TableControl.d.mts +1 -1
- package/dist/Table/TableFooter.d.cts +2 -2
- package/dist/Table/TableFooter.d.mts +2 -2
- package/dist/Table/TableHead.d.cts +2 -2
- package/dist/Table/TableHead.d.mts +2 -2
- package/dist/Table/TablePagination.d.cts +2 -2
- package/dist/Table/TablePagination.d.mts +2 -2
- package/dist/Table/TablePaginationActions.d.cts +1 -1
- package/dist/Table/TablePaginationActions.d.mts +1 -1
- package/dist/Table/TableRow.d.cts +2 -2
- package/dist/Table/TableRow.d.mts +2 -2
- package/dist/Table/TableSortLabel.cjs +1 -1
- package/dist/Table/TableSortLabel.d.cts +1 -1
- package/dist/Table/TableSortLabel.d.mts +1 -1
- package/dist/Table/TableSortLabel.mjs +1 -1
- package/dist/Table/hooks.d.cts +1 -1
- package/dist/Table/hooks.d.mts +1 -1
- package/dist/Table.d.cts +5 -5
- package/dist/Table.d.mts +5 -5
- package/dist/{TableContext-DOhYeOFx.d.cts → TableContext-BoOxdk8p.d.cts} +1 -1
- package/dist/{TableContext-adilRIJZ.d.mts → TableContext-DV31j6HO.d.mts} +1 -1
- package/dist/TextInput.d.cts +2 -2
- package/dist/TextInput.d.mts +2 -2
- package/dist/ToggleButton/ToggleButton.d.cts +1 -1
- package/dist/ToggleButton/ToggleButton.d.mts +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.d.cts +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.d.mts +1 -1
- package/dist/Typography.d.cts +2 -2
- package/dist/Typography.d.mts +2 -2
- package/dist/View.cjs +0 -2
- package/dist/View.d.cts +1 -1
- package/dist/View.d.mts +1 -1
- package/dist/View.mjs +0 -2
- package/dist/engine.d.cts +1 -1
- package/dist/engine.d.mts +1 -1
- package/dist/{index-DwjxjLcD.d.mts → index--mvTGo8F.d.cts} +3 -3
- package/dist/{index-CY0Czi9Z.d.cts → index-ATXjtAOY.d.mts} +2 -2
- package/dist/{index-BF2KXGBM.d.mts → index-B2hrssyF.d.mts} +2 -2
- package/dist/{index-C-UBdWKI.d.cts → index-B3FrhO2r.d.cts} +3 -3
- package/dist/{index-DCwLdUQH.d.mts → index-B7aaTHOe.d.cts} +2 -2
- package/dist/{index-BGzs2cKy.d.mts → index-BItZoGZ1.d.mts} +3 -3
- package/dist/{index-CLCtvcKA.d.mts → index-BJ8OC_Zh.d.cts} +2 -2
- package/dist/{index-D0x1ZMVG.d.mts → index-BL3jwIQU.d.mts} +5 -2
- package/dist/{index-D2H_6WLf.d.cts → index-BNP_iejT.d.cts} +3 -3
- package/dist/{index-BpLv6Y8m.d.mts → index-BfpjEqqt.d.cts} +2 -2
- package/dist/{index-0J6U39Rl.d.mts → index-BoOs5h_b.d.mts} +1 -1
- package/dist/{index-ypEBcdCx.d.mts → index-BwUnDd9W.d.mts} +2 -2
- package/dist/{index-DGqakgRN.d.mts → index-C7j38wne.d.mts} +3 -3
- package/dist/{index-DN7IvJeV.d.cts → index-CA_X-mXg.d.cts} +5 -2
- package/dist/index-CO3Qq0I0.d.mts +49 -0
- package/dist/{index-DLiHZtDi.d.mts → index-CYTaYcm3.d.cts} +3 -5
- package/dist/{index-DitJ7ss0.d.mts → index-Ca0Pj5m2.d.mts} +3 -3
- package/dist/{index-BLnOsdgc.d.cts → index-CvaEVk-f.d.cts} +2 -2
- package/dist/{index-BnCp6k4s.d.cts → index-D8U2tk1L.d.mts} +2 -2
- package/dist/{index-B66h9kbP.d.mts → index-D8b5OCLe.d.mts} +1 -1
- package/dist/{index-DhcmRr8Q.d.cts → index-DEv2QslH.d.mts} +4 -7
- package/dist/{index-C1vVYigQ.d.cts → index-DF3Hweir.d.mts} +3 -3
- package/dist/{index-BVX_Jq2G.d.cts → index-DLJ-li1B.d.cts} +1 -1
- package/dist/{index-CYNgNatZ.d.mts → index-DjtGkwRM.d.cts} +2 -4
- package/dist/{index-DdFxl06Q.d.cts → index-Ds__py2h.d.mts} +2 -2
- package/dist/{index-HnvGdPCp.d.cts → index-KZUd8B5E.d.mts} +3 -5
- package/dist/{index-CJQXZ4hq.d.cts → index-MsUtFRul.d.cts} +1 -1
- package/dist/index-dtLxevvf.d.cts +49 -0
- package/dist/{index-B8FOqBiS.d.cts → index-q6EgsH9R.d.mts} +2 -4
- package/dist/{index-BahGB82c.d.cts → index-v99yMdts.d.cts} +3 -3
- package/dist/{index-BGWm4HKR.d.cts → index-yr4HkKOj.d.cts} +2 -2
- package/dist/{index-BJcHQUga.d.mts → index-zFYi0f1t.d.cts} +4 -7
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/style.d.cts +2 -2
- package/dist/style.d.mts +2 -2
- package/dist/theme.d.cts +3 -3
- package/dist/theme.d.mts +3 -3
- package/dist/{themes-BTGww2YK.d.cts → themes-CUV79qWU.d.cts} +16 -1
- package/dist/{themes-BTGww2YK.d.mts → themes-CUV79qWU.d.mts} +16 -1
- package/dist/{useTablePagination-D6T-fQFc.d.mts → useTablePagination-7jiSvKCh.d.cts} +1 -1
- package/dist/{useTablePagination-_94Wrvj9.d.cts → useTablePagination-HaIcJPv-.d.mts} +1 -1
- package/package.json +22 -2
package/dist/Icon.cjs
CHANGED
package/dist/Icon.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as icons, n as IconProps, r as IconName, t as Icon } from "./index-
|
|
1
|
+
import { i as icons, n as IconProps, r as IconName, t as Icon } from "./index-CA_X-mXg.cjs";
|
|
2
2
|
export { Icon, type IconName, IconProps, icons };
|
package/dist/Icon.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as icons, n as IconProps, r as IconName, t as Icon } from "./index-
|
|
1
|
+
import { i as icons, n as IconProps, r as IconName, t as Icon } from "./index-BL3jwIQU.mjs";
|
|
2
2
|
export { Icon, type IconName, IconProps, icons };
|
package/dist/Icon.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as icons, t as Icon } from "./Icon-
|
|
1
|
+
import { n as icons, t as Icon } from "./Icon-CYjD0Bad.mjs";
|
|
2
2
|
export { Icon, icons };
|
package/dist/Image.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as index_d_exports } from "./index-
|
|
2
|
-
import {
|
|
1
|
+
import { r as index_d_exports } from "./index-DLJ-li1B.cjs";
|
|
2
|
+
import { h as Theme } from "./themes-CUV79qWU.cjs";
|
|
3
3
|
import { CSSProperties, ImgHTMLAttributes } from "react";
|
|
4
4
|
//#region src/Image/Image.d.ts
|
|
5
5
|
interface ImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'height' | 'width' | 'color'>, index_d_exports.LayoutProps, index_d_exports.SpaceProps, index_d_exports.BackgroundProps, index_d_exports.PositionProps {
|
package/dist/Image.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as index_d_exports } from "./index-
|
|
1
|
+
import { h as Theme } from "./themes-CUV79qWU.mjs";
|
|
2
|
+
import { r as index_d_exports } from "./index-D8b5OCLe.mjs";
|
|
3
3
|
import { CSSProperties, ImgHTMLAttributes } from "react";
|
|
4
4
|
//#region src/Image/Image.d.ts
|
|
5
5
|
interface ImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'height' | 'width' | 'color'>, index_d_exports.LayoutProps, index_d_exports.SpaceProps, index_d_exports.BackgroundProps, index_d_exports.PositionProps {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as index_d_exports } from "./index-
|
|
2
|
-
import {
|
|
3
|
-
import { n as ButtonColor } from "./index-
|
|
1
|
+
import { r as index_d_exports } from "./index-DLJ-li1B.cjs";
|
|
2
|
+
import { h as Theme } from "./themes-CUV79qWU.cjs";
|
|
3
|
+
import { n as ButtonColor } from "./index-BJ8OC_Zh.cjs";
|
|
4
4
|
import { HTMLAttributes } from "react";
|
|
5
5
|
//#region src/LinearProgress/LinearProgress.d.ts
|
|
6
6
|
type LinearProgressVariant = 'indeterminate' | 'determinate' | 'query';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as index_d_exports } from "./index-
|
|
3
|
-
import { n as ButtonColor } from "./index-
|
|
1
|
+
import { h as Theme } from "./themes-CUV79qWU.mjs";
|
|
2
|
+
import { r as index_d_exports } from "./index-D8b5OCLe.mjs";
|
|
3
|
+
import { n as ButtonColor } from "./index-D8U2tk1L.mjs";
|
|
4
4
|
import { HTMLAttributes } from "react";
|
|
5
5
|
//#region src/LinearProgress/LinearProgress.d.ts
|
|
6
6
|
type LinearProgressVariant = 'indeterminate' | 'determinate' | 'query';
|
package/dist/Link.cjs
CHANGED
|
@@ -30,10 +30,6 @@ const underlineStyles = {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
-
const linkGapSystem = (0, require_src.src_exports.system)({ gap: {
|
|
34
|
-
property: "gap",
|
|
35
|
-
scale: "space"
|
|
36
|
-
} });
|
|
37
33
|
const LinkBase = require_src.styled(require_Typography.Typography, {
|
|
38
34
|
name: "Link",
|
|
39
35
|
label: "Link",
|
|
@@ -45,7 +41,7 @@ const LinkBase = require_src.styled(require_Typography.Typography, {
|
|
|
45
41
|
outlineOffset: "4px",
|
|
46
42
|
borderRadius: theme.radii.sm
|
|
47
43
|
}
|
|
48
|
-
})
|
|
44
|
+
}));
|
|
49
45
|
function Link({ underline: underlineProp, color, variant = "inherit", target, rel, ...rest }) {
|
|
50
46
|
const theme = require_theme.useTheme();
|
|
51
47
|
const underline = underlineProp ?? require_themeDefault.themeDefault(theme, "linkUnderline", "always");
|
package/dist/Link.d.cts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { a as TypographyProps } from "./index-
|
|
1
|
+
import { a as TypographyProps } from "./index-CvaEVk-f.cjs";
|
|
2
2
|
import { AnchorHTMLAttributes } from "react";
|
|
3
3
|
//#region src/Link/Link.d.ts
|
|
4
4
|
type LinkUnderline = 'always' | 'hover' | 'none';
|
|
5
5
|
interface LinkProps extends Omit<TypographyProps, 'as'>, Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof Omit<TypographyProps, 'as'>> {
|
|
6
6
|
underline?: LinkUnderline;
|
|
7
|
-
gap?: number | string;
|
|
8
7
|
}
|
|
9
8
|
declare function Link({ underline: underlineProp, color, variant, target, rel, ...rest }: Readonly<LinkProps>): import("react").JSX.Element;
|
|
10
9
|
//#endregion
|
package/dist/Link.d.mts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { a as TypographyProps } from "./index-
|
|
1
|
+
import { a as TypographyProps } from "./index-B2hrssyF.mjs";
|
|
2
2
|
import { AnchorHTMLAttributes } from "react";
|
|
3
3
|
//#region src/Link/Link.d.ts
|
|
4
4
|
type LinkUnderline = 'always' | 'hover' | 'none';
|
|
5
5
|
interface LinkProps extends Omit<TypographyProps, 'as'>, Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof Omit<TypographyProps, 'as'>> {
|
|
6
6
|
underline?: LinkUnderline;
|
|
7
|
-
gap?: number | string;
|
|
8
7
|
}
|
|
9
8
|
declare function Link({ underline: underlineProp, color, variant, target, rel, ...rest }: Readonly<LinkProps>): import("react").JSX.Element;
|
|
10
9
|
//#endregion
|
package/dist/Link.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as styled } from "./src-BJy4dM4f.mjs";
|
|
2
2
|
import { t as themeDefault } from "./themeDefault-Z3KmyIbm.mjs";
|
|
3
3
|
import { r as useTheme } from "./theme-V6lYzd3j.mjs";
|
|
4
4
|
import { Typography } from "./Typography.mjs";
|
|
@@ -29,10 +29,6 @@ const underlineStyles = {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
const linkGapSystem = (0, src_exports.system)({ gap: {
|
|
33
|
-
property: "gap",
|
|
34
|
-
scale: "space"
|
|
35
|
-
} });
|
|
36
32
|
const LinkBase = styled(Typography, {
|
|
37
33
|
name: "Link",
|
|
38
34
|
label: "Link",
|
|
@@ -44,7 +40,7 @@ const LinkBase = styled(Typography, {
|
|
|
44
40
|
outlineOffset: "4px",
|
|
45
41
|
borderRadius: theme.radii.sm
|
|
46
42
|
}
|
|
47
|
-
})
|
|
43
|
+
}));
|
|
48
44
|
function Link({ underline: underlineProp, color, variant = "inherit", target, rel, ...rest }) {
|
|
49
45
|
const theme = useTheme();
|
|
50
46
|
const underline = underlineProp ?? themeDefault(theme, "linkUnderline", "always");
|
package/dist/MenuItem.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_src = require("./src-C8PIppTy.cjs");
|
|
3
3
|
const require_themeDefault = require("./themeDefault-Cebi08Cv.cjs");
|
|
4
4
|
const require_theme = require("./theme-Du6xgPsg.cjs");
|
|
5
|
-
const require_Icon = require("./Icon-
|
|
5
|
+
const require_Icon = require("./Icon-BOjk5r39.cjs");
|
|
6
6
|
let react = require("react");
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
8
|
//#region src/MenuItem/MenuItem.tsx
|
package/dist/MenuItem.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import {
|
|
1
|
+
import "./index-DLJ-li1B.cjs";
|
|
2
|
+
import { h as Theme } from "./themes-CUV79qWU.cjs";
|
|
3
3
|
import { ElementType, ReactNode } from "react";
|
|
4
4
|
//#region src/MenuItem/MenuItem.d.ts
|
|
5
5
|
type MenuItemColor = keyof Theme['palette'];
|
package/dist/MenuItem.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-
|
|
1
|
+
import { h as Theme } from "./themes-CUV79qWU.mjs";
|
|
2
|
+
import "./index-D8b5OCLe.mjs";
|
|
3
3
|
import { ElementType, ReactNode } from "react";
|
|
4
4
|
//#region src/MenuItem/MenuItem.d.ts
|
|
5
5
|
type MenuItemColor = keyof Theme['palette'];
|
package/dist/MenuItem.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as src_exports, o as styled, t as createShouldForwardProp } from "./src-BJy4dM4f.mjs";
|
|
2
2
|
import { t as themeDefault } from "./themeDefault-Z3KmyIbm.mjs";
|
|
3
3
|
import { r as useTheme } from "./theme-V6lYzd3j.mjs";
|
|
4
|
-
import { t as Icon } from "./Icon-
|
|
4
|
+
import { t as Icon } from "./Icon-CYjD0Bad.mjs";
|
|
5
5
|
import { useEffect, useRef, useState } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
//#region src/MenuItem/MenuItem.tsx
|
package/dist/Modal.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as Modal, c as ModalCloseReason, d as useModal, i as ariaHidden, l as UseModalParameters, n as ManagedModalProps, o as ModalProps, r as ModalManager, s as ModalScroll, t as ManagedModal, u as UseModalReturnValue } from "./index-
|
|
1
|
+
import { a as Modal, c as ModalCloseReason, d as useModal, i as ariaHidden, l as UseModalParameters, n as ManagedModalProps, o as ModalProps, r as ModalManager, s as ModalScroll, t as ManagedModal, u as UseModalReturnValue } from "./index-BfpjEqqt.cjs";
|
|
2
2
|
export { ManagedModal, ManagedModalProps, Modal, ModalCloseReason, ModalManager, ModalProps, ModalScroll, UseModalParameters, UseModalReturnValue, ariaHidden, useModal };
|
package/dist/Modal.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as Modal, c as ModalCloseReason, d as useModal, i as ariaHidden, l as UseModalParameters, n as ManagedModalProps, o as ModalProps, r as ModalManager, s as ModalScroll, t as ManagedModal, u as UseModalReturnValue } from "./index-
|
|
1
|
+
import { a as Modal, c as ModalCloseReason, d as useModal, i as ariaHidden, l as UseModalParameters, n as ManagedModalProps, o as ModalProps, r as ModalManager, s as ModalScroll, t as ManagedModal, u as UseModalReturnValue } from "./index-Ds__py2h.mjs";
|
|
2
2
|
export { ManagedModal, ManagedModalProps, Modal, ModalCloseReason, ModalManager, ModalProps, ModalScroll, UseModalParameters, UseModalReturnValue, ariaHidden, useModal };
|
package/dist/NativeSelect.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_src = require("./src-C8PIppTy.cjs");
|
|
3
3
|
const require_themeDefault = require("./themeDefault-Cebi08Cv.cjs");
|
|
4
4
|
const require_theme = require("./theme-Du6xgPsg.cjs");
|
|
5
|
-
const require_Icon = require("./Icon-
|
|
5
|
+
const require_Icon = require("./Icon-BOjk5r39.cjs");
|
|
6
6
|
const require_FormControl = require("./FormControl.cjs");
|
|
7
7
|
const require_inputVariantStyles = require("./inputVariantStyles-BBkkYQtE.cjs");
|
|
8
8
|
require("react");
|
package/dist/NativeSelect.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as index_d_exports } from "./index-
|
|
2
|
-
import {
|
|
3
|
-
import { n as IconProps, r as IconName } from "./index-
|
|
1
|
+
import { r as index_d_exports } from "./index-DLJ-li1B.cjs";
|
|
2
|
+
import { h as Theme } from "./themes-CUV79qWU.cjs";
|
|
3
|
+
import { n as IconProps, r as IconName } from "./index-CA_X-mXg.cjs";
|
|
4
4
|
import { SelectHTMLAttributes } from "react";
|
|
5
5
|
//#region src/NativeSelect/NativeSelect.d.ts
|
|
6
6
|
type NativeSelectColor = keyof Theme['palette'];
|
package/dist/NativeSelect.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as index_d_exports } from "./index-
|
|
3
|
-
import { n as IconProps, r as IconName } from "./index-
|
|
1
|
+
import { h as Theme } from "./themes-CUV79qWU.mjs";
|
|
2
|
+
import { r as index_d_exports } from "./index-D8b5OCLe.mjs";
|
|
3
|
+
import { n as IconProps, r as IconName } from "./index-BL3jwIQU.mjs";
|
|
4
4
|
import { SelectHTMLAttributes } from "react";
|
|
5
5
|
//#region src/NativeSelect/NativeSelect.d.ts
|
|
6
6
|
type NativeSelectColor = keyof Theme['palette'];
|
package/dist/NativeSelect.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as src_exports, i as props, o as styled, t as createShouldForwardProp } from "./src-BJy4dM4f.mjs";
|
|
2
2
|
import { t as themeDefault } from "./themeDefault-Z3KmyIbm.mjs";
|
|
3
3
|
import { r as useTheme } from "./theme-V6lYzd3j.mjs";
|
|
4
|
-
import { t as Icon } from "./Icon-
|
|
4
|
+
import { t as Icon } from "./Icon-CYjD0Bad.mjs";
|
|
5
5
|
import { useFormControl } from "./FormControl.mjs";
|
|
6
6
|
import { t as inputVariantStyles } from "./inputVariantStyles-CcqpGfuP.mjs";
|
|
7
7
|
import "react";
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_src = require("../src-C8PIppTy.cjs");
|
|
3
3
|
const require_themeDefault = require("../themeDefault-Cebi08Cv.cjs");
|
|
4
4
|
const require_utils = require("../utils.cjs");
|
|
5
|
-
const require_Icon = require("../Icon-
|
|
5
|
+
const require_Icon = require("../Icon-BOjk5r39.cjs");
|
|
6
6
|
require("react");
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
8
|
let _soroush_tech_styled_system_should_forward_prop = require("@soroush.tech/styled-system/should-forward-prop");
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PaginationItemSize, i as PaginationItemShape, n as PaginationItemColor, o as PaginationItemVariant, r as PaginationItemProps, t as PaginationItem } from "../index-
|
|
1
|
+
import { a as PaginationItemSize, i as PaginationItemShape, n as PaginationItemColor, o as PaginationItemVariant, r as PaginationItemProps, t as PaginationItem } from "../index-yr4HkKOj.cjs";
|
|
2
2
|
export { PaginationItem, PaginationItemColor, PaginationItemProps, PaginationItemShape, PaginationItemSize, PaginationItemVariant };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PaginationItemSize, i as PaginationItemShape, n as PaginationItemColor, o as PaginationItemVariant, r as PaginationItemProps, t as PaginationItem } from "../index-
|
|
1
|
+
import { a as PaginationItemSize, i as PaginationItemShape, n as PaginationItemColor, o as PaginationItemVariant, r as PaginationItemProps, t as PaginationItem } from "../index-BwUnDd9W.mjs";
|
|
2
2
|
export { PaginationItem, PaginationItemColor, PaginationItemProps, PaginationItemShape, PaginationItemSize, PaginationItemVariant };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as src_exports, i as props, o as styled, t as createShouldForwardProp } from "../src-BJy4dM4f.mjs";
|
|
2
2
|
import { t as themeDefault } from "../themeDefault-Z3KmyIbm.mjs";
|
|
3
3
|
import { alpha } from "../utils.mjs";
|
|
4
|
-
import { t as Icon } from "../Icon-
|
|
4
|
+
import { t as Icon } from "../Icon-CYjD0Bad.mjs";
|
|
5
5
|
import "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
//#region src/Pagination/PaginationItem/PaginationItem.tsx
|
package/dist/Pagination.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as PaginationItemSize, c as UsePaginationItem, i as PaginationItemShape, l as UsePaginationProps, n as PaginationItemColor, o as PaginationItemVariant, r as PaginationItemProps, s as PaginationItemType, t as PaginationItem, u as usePagination } from "./index-
|
|
2
|
-
import { a as PaginationSize, i as PaginationShape, n as PaginationColor, o as PaginationVariant, r as PaginationProps, t as Pagination } from "./index-
|
|
1
|
+
import { a as PaginationItemSize, c as UsePaginationItem, i as PaginationItemShape, l as UsePaginationProps, n as PaginationItemColor, o as PaginationItemVariant, r as PaginationItemProps, s as PaginationItemType, t as PaginationItem, u as usePagination } from "./index-yr4HkKOj.cjs";
|
|
2
|
+
import { a as PaginationSize, i as PaginationShape, n as PaginationColor, o as PaginationVariant, r as PaginationProps, t as Pagination } from "./index-B3FrhO2r.cjs";
|
|
3
3
|
export { Pagination, PaginationColor, PaginationItem, PaginationItemColor, PaginationItemProps, PaginationItemShape, PaginationItemSize, PaginationItemType, PaginationItemVariant, PaginationProps, PaginationShape, PaginationSize, PaginationVariant, UsePaginationItem, UsePaginationProps, usePagination };
|
package/dist/Pagination.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as PaginationItemSize, c as UsePaginationItem, i as PaginationItemShape, l as UsePaginationProps, n as PaginationItemColor, o as PaginationItemVariant, r as PaginationItemProps, s as PaginationItemType, t as PaginationItem, u as usePagination } from "./index-
|
|
2
|
-
import { a as PaginationSize, i as PaginationShape, n as PaginationColor, o as PaginationVariant, r as PaginationProps, t as Pagination } from "./index-
|
|
1
|
+
import { a as PaginationItemSize, c as UsePaginationItem, i as PaginationItemShape, l as UsePaginationProps, n as PaginationItemColor, o as PaginationItemVariant, r as PaginationItemProps, s as PaginationItemType, t as PaginationItem, u as usePagination } from "./index-BwUnDd9W.mjs";
|
|
2
|
+
import { a as PaginationSize, i as PaginationShape, n as PaginationColor, o as PaginationVariant, r as PaginationProps, t as Pagination } from "./index-Ca0Pj5m2.mjs";
|
|
3
3
|
export { Pagination, PaginationColor, PaginationItem, PaginationItemColor, PaginationItemProps, PaginationItemShape, PaginationItemSize, PaginationItemType, PaginationItemVariant, PaginationProps, PaginationShape, PaginationSize, PaginationVariant, UsePaginationItem, UsePaginationProps, usePagination };
|
package/dist/Paper.cjs
CHANGED
|
@@ -8,7 +8,6 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
8
8
|
//#region src/Paper/Paper.tsx
|
|
9
9
|
const shouldForwardProp = (0, require("@soroush.tech/styled-system/should-forward-prop").createShouldForwardProp)([
|
|
10
10
|
"elevation",
|
|
11
|
-
"aspectRatio",
|
|
12
11
|
"transition",
|
|
13
12
|
"borderColor",
|
|
14
13
|
"borderWidth",
|
|
@@ -19,7 +18,6 @@ const paperSystem = (0, require_src.src_exports.system)({
|
|
|
19
18
|
property: "boxShadow",
|
|
20
19
|
scale: "shadows"
|
|
21
20
|
},
|
|
22
|
-
aspectRatio: { property: "aspectRatio" },
|
|
23
21
|
transition: { property: "transition" },
|
|
24
22
|
borderColor: {
|
|
25
23
|
property: "borderColor",
|
package/dist/Paper.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as PaperElevation, r as PaperProps, t as Paper } from "./index-
|
|
1
|
+
import { n as PaperElevation, r as PaperProps, t as Paper } from "./index-CYTaYcm3.cjs";
|
|
2
2
|
export { Paper, PaperElevation, PaperProps };
|
package/dist/Paper.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as PaperElevation, r as PaperProps, t as Paper } from "./index-
|
|
1
|
+
import { n as PaperElevation, r as PaperProps, t as Paper } from "./index-KZUd8B5E.mjs";
|
|
2
2
|
export { Paper, PaperElevation, PaperProps };
|
package/dist/Paper.mjs
CHANGED
|
@@ -7,7 +7,6 @@ import { jsx } from "react/jsx-runtime";
|
|
|
7
7
|
//#region src/Paper/Paper.tsx
|
|
8
8
|
const shouldForwardProp = createShouldForwardProp([
|
|
9
9
|
"elevation",
|
|
10
|
-
"aspectRatio",
|
|
11
10
|
"transition",
|
|
12
11
|
"borderColor",
|
|
13
12
|
"borderWidth",
|
|
@@ -18,7 +17,6 @@ const paperSystem = (0, src_exports.system)({
|
|
|
18
17
|
property: "boxShadow",
|
|
19
18
|
scale: "shadows"
|
|
20
19
|
},
|
|
21
|
-
aspectRatio: { property: "aspectRatio" },
|
|
22
20
|
transition: { property: "transition" },
|
|
23
21
|
borderColor: {
|
|
24
22
|
property: "borderColor",
|
package/dist/Popover.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import {
|
|
3
|
-
import { n as PaperElevation, r as PaperProps } from "./index-
|
|
4
|
-
import { c as ModalCloseReason } from "./index-
|
|
1
|
+
import "./index-DLJ-li1B.cjs";
|
|
2
|
+
import { h as Theme } from "./themes-CUV79qWU.cjs";
|
|
3
|
+
import { n as PaperElevation, r as PaperProps } from "./index-CYTaYcm3.cjs";
|
|
4
|
+
import { c as ModalCloseReason } from "./index-BfpjEqqt.cjs";
|
|
5
5
|
import { ReactNode, Ref } from "react";
|
|
6
6
|
//#region src/Popover/utils/resolveAnchorEl.d.ts
|
|
7
7
|
type PopoverAnchorEl = HTMLElement | (() => HTMLElement | null) | null;
|
package/dist/Popover.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-
|
|
3
|
-
import { n as PaperElevation, r as PaperProps } from "./index-
|
|
4
|
-
import { c as ModalCloseReason } from "./index-
|
|
1
|
+
import { h as Theme } from "./themes-CUV79qWU.mjs";
|
|
2
|
+
import "./index-D8b5OCLe.mjs";
|
|
3
|
+
import { n as PaperElevation, r as PaperProps } from "./index-KZUd8B5E.mjs";
|
|
4
|
+
import { c as ModalCloseReason } from "./index-Ds__py2h.mjs";
|
|
5
5
|
import { ReactNode, Ref } from "react";
|
|
6
6
|
//#region src/Popover/utils/resolveAnchorEl.d.ts
|
|
7
7
|
type PopoverAnchorEl = HTMLElement | (() => HTMLElement | null) | null;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_src = require("./src-C8PIppTy.cjs");
|
|
3
|
+
const require_themeDefault = require("./themeDefault-Cebi08Cv.cjs");
|
|
4
|
+
const require_utils = require("./utils.cjs");
|
|
5
|
+
const require_theme = require("./theme-Du6xgPsg.cjs");
|
|
6
|
+
require("react");
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
let _soroush_tech_styled_system_should_forward_prop = require("@soroush.tech/styled-system/should-forward-prop");
|
|
9
|
+
//#region src/Pressable/Pressable.tsx
|
|
10
|
+
const shouldForwardProp = (0, _soroush_tech_styled_system_should_forward_prop.createShouldForwardProp)([
|
|
11
|
+
..._soroush_tech_styled_system_should_forward_prop.props,
|
|
12
|
+
"feedback",
|
|
13
|
+
"activeOpacity",
|
|
14
|
+
"isDisabled"
|
|
15
|
+
]);
|
|
16
|
+
const baseStyles = {
|
|
17
|
+
appearance: "none",
|
|
18
|
+
margin: 0,
|
|
19
|
+
padding: 0,
|
|
20
|
+
border: "none",
|
|
21
|
+
borderRadius: 0,
|
|
22
|
+
backgroundColor: "transparent",
|
|
23
|
+
color: "inherit",
|
|
24
|
+
font: "inherit",
|
|
25
|
+
textAlign: "inherit",
|
|
26
|
+
textDecoration: "none",
|
|
27
|
+
outline: "none",
|
|
28
|
+
cursor: "pointer",
|
|
29
|
+
display: "inline-flex",
|
|
30
|
+
userSelect: "none",
|
|
31
|
+
transition: "background-color 0.15s ease, opacity 0.15s ease",
|
|
32
|
+
"&:disabled, &[aria-disabled=\"true\"]": { cursor: "not-allowed" }
|
|
33
|
+
};
|
|
34
|
+
const feedbackStyles = ({ theme, feedback, color, activeOpacity, isDisabled }) => {
|
|
35
|
+
if (isDisabled || feedback === "none") return {};
|
|
36
|
+
if (feedback === "opacity") return { "&:active": { opacity: activeOpacity } };
|
|
37
|
+
return { "&:active": { backgroundColor: require_utils.alpha(theme.palette[color].main, .125) } };
|
|
38
|
+
};
|
|
39
|
+
const focusVisibleStyles = ({ theme }) => ({ "&:focus-visible": {
|
|
40
|
+
outline: `2px solid ${theme.palette[require_themeDefault.themeDefault(theme, "color", "primary")].main}`,
|
|
41
|
+
outlineOffset: "2px"
|
|
42
|
+
} });
|
|
43
|
+
const PressableRoot = require_src.styled("div", {
|
|
44
|
+
name: "Pressable",
|
|
45
|
+
label: "Pressable",
|
|
46
|
+
shouldForwardProp,
|
|
47
|
+
systemProps: [
|
|
48
|
+
require_src.src_exports.space,
|
|
49
|
+
require_src.src_exports.layout,
|
|
50
|
+
require_src.src_exports.typography,
|
|
51
|
+
require_src.src_exports.border
|
|
52
|
+
]
|
|
53
|
+
})(baseStyles, feedbackStyles, focusVisibleStyles);
|
|
54
|
+
/**
|
|
55
|
+
* An unstyled clickable surface — button semantics (keyboard activation, focus
|
|
56
|
+
* ring, disabled state) with none of a button's looks, so it can wrap arbitrary
|
|
57
|
+
* content without changing its layout. Use it instead of an `onClick` on a
|
|
58
|
+
* `div`, which no keyboard or screen-reader user can reach.
|
|
59
|
+
*
|
|
60
|
+
* It renders a `div` by default, because `<button>` may not legally contain a
|
|
61
|
+
* link, another button, or block-level content — the shim gives that div a
|
|
62
|
+
* `role`, a tab stop, and Enter/Space activation, so it is announced and
|
|
63
|
+
* operated as a button either way. Pass `as="button"` for a native button, or
|
|
64
|
+
* `href` for an anchor; both skip the shim and let the browser do the work.
|
|
65
|
+
*
|
|
66
|
+
* `feedback` picks what happens while it is held: nothing (default), the content
|
|
67
|
+
* dims, or the surface tints.
|
|
68
|
+
*/
|
|
69
|
+
function Pressable({ as, feedback, color, activeOpacity, href, type = "button", disabled = false, onClick, onKeyDown, onKeyUp, ...rest }) {
|
|
70
|
+
const theme = require_theme.useTheme();
|
|
71
|
+
const dp = require_theme.useDefaultProps("Pressable");
|
|
72
|
+
const resolvedFeedback = feedback ?? dp.feedback ?? "none";
|
|
73
|
+
const resolvedColor = color ?? dp.color ?? require_themeDefault.themeDefault(theme, "color", "primary");
|
|
74
|
+
const resolvedActiveOpacity = activeOpacity ?? dp.activeOpacity ?? .7;
|
|
75
|
+
const element = as ?? (href == null ? "div" : "a");
|
|
76
|
+
const isButton = element === "button";
|
|
77
|
+
const needsShim = !isButton && element !== "a";
|
|
78
|
+
const activate = (event) => {
|
|
79
|
+
event.preventDefault();
|
|
80
|
+
event.currentTarget.click();
|
|
81
|
+
};
|
|
82
|
+
const handleClick = (event) => {
|
|
83
|
+
if (disabled) {
|
|
84
|
+
event.preventDefault();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
onClick?.(event);
|
|
88
|
+
};
|
|
89
|
+
const handleKeyDown = (event) => {
|
|
90
|
+
onKeyDown?.(event);
|
|
91
|
+
if (disabled) return;
|
|
92
|
+
if (event.key === "Enter") activate(event);
|
|
93
|
+
else if (event.key === " ") event.preventDefault();
|
|
94
|
+
};
|
|
95
|
+
const handleKeyUp = (event) => {
|
|
96
|
+
onKeyUp?.(event);
|
|
97
|
+
if (!disabled && event.key === " ") activate(event);
|
|
98
|
+
};
|
|
99
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PressableRoot, {
|
|
100
|
+
as: element,
|
|
101
|
+
href,
|
|
102
|
+
type: isButton ? type : void 0,
|
|
103
|
+
disabled: isButton ? disabled : void 0,
|
|
104
|
+
feedback: resolvedFeedback,
|
|
105
|
+
color: resolvedColor,
|
|
106
|
+
activeOpacity: resolvedActiveOpacity,
|
|
107
|
+
isDisabled: disabled,
|
|
108
|
+
onClick: handleClick,
|
|
109
|
+
...needsShim ? {
|
|
110
|
+
role: "button",
|
|
111
|
+
tabIndex: disabled ? -1 : 0,
|
|
112
|
+
"aria-disabled": disabled || void 0,
|
|
113
|
+
onKeyDown: handleKeyDown,
|
|
114
|
+
onKeyUp: handleKeyUp
|
|
115
|
+
} : {
|
|
116
|
+
onKeyDown,
|
|
117
|
+
onKeyUp
|
|
118
|
+
},
|
|
119
|
+
...rest
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
exports.Pressable = Pressable;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { a as src_exports, i as props, o as styled, t as createShouldForwardProp } from "./src-BJy4dM4f.mjs";
|
|
2
|
+
import { t as themeDefault } from "./themeDefault-Z3KmyIbm.mjs";
|
|
3
|
+
import { alpha } from "./utils.mjs";
|
|
4
|
+
import { n as useDefaultProps, r as useTheme } from "./theme-V6lYzd3j.mjs";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/Pressable/Pressable.tsx
|
|
8
|
+
const shouldForwardProp = createShouldForwardProp([
|
|
9
|
+
...props,
|
|
10
|
+
"feedback",
|
|
11
|
+
"activeOpacity",
|
|
12
|
+
"isDisabled"
|
|
13
|
+
]);
|
|
14
|
+
const baseStyles = {
|
|
15
|
+
appearance: "none",
|
|
16
|
+
margin: 0,
|
|
17
|
+
padding: 0,
|
|
18
|
+
border: "none",
|
|
19
|
+
borderRadius: 0,
|
|
20
|
+
backgroundColor: "transparent",
|
|
21
|
+
color: "inherit",
|
|
22
|
+
font: "inherit",
|
|
23
|
+
textAlign: "inherit",
|
|
24
|
+
textDecoration: "none",
|
|
25
|
+
outline: "none",
|
|
26
|
+
cursor: "pointer",
|
|
27
|
+
display: "inline-flex",
|
|
28
|
+
userSelect: "none",
|
|
29
|
+
transition: "background-color 0.15s ease, opacity 0.15s ease",
|
|
30
|
+
"&:disabled, &[aria-disabled=\"true\"]": { cursor: "not-allowed" }
|
|
31
|
+
};
|
|
32
|
+
const feedbackStyles = ({ theme, feedback, color, activeOpacity, isDisabled }) => {
|
|
33
|
+
if (isDisabled || feedback === "none") return {};
|
|
34
|
+
if (feedback === "opacity") return { "&:active": { opacity: activeOpacity } };
|
|
35
|
+
return { "&:active": { backgroundColor: alpha(theme.palette[color].main, .125) } };
|
|
36
|
+
};
|
|
37
|
+
const focusVisibleStyles = ({ theme }) => ({ "&:focus-visible": {
|
|
38
|
+
outline: `2px solid ${theme.palette[themeDefault(theme, "color", "primary")].main}`,
|
|
39
|
+
outlineOffset: "2px"
|
|
40
|
+
} });
|
|
41
|
+
const PressableRoot = styled("div", {
|
|
42
|
+
name: "Pressable",
|
|
43
|
+
label: "Pressable",
|
|
44
|
+
shouldForwardProp,
|
|
45
|
+
systemProps: [
|
|
46
|
+
src_exports.space,
|
|
47
|
+
src_exports.layout,
|
|
48
|
+
src_exports.typography,
|
|
49
|
+
src_exports.border
|
|
50
|
+
]
|
|
51
|
+
})(baseStyles, feedbackStyles, focusVisibleStyles);
|
|
52
|
+
/**
|
|
53
|
+
* An unstyled clickable surface — button semantics (keyboard activation, focus
|
|
54
|
+
* ring, disabled state) with none of a button's looks, so it can wrap arbitrary
|
|
55
|
+
* content without changing its layout. Use it instead of an `onClick` on a
|
|
56
|
+
* `div`, which no keyboard or screen-reader user can reach.
|
|
57
|
+
*
|
|
58
|
+
* It renders a `div` by default, because `<button>` may not legally contain a
|
|
59
|
+
* link, another button, or block-level content — the shim gives that div a
|
|
60
|
+
* `role`, a tab stop, and Enter/Space activation, so it is announced and
|
|
61
|
+
* operated as a button either way. Pass `as="button"` for a native button, or
|
|
62
|
+
* `href` for an anchor; both skip the shim and let the browser do the work.
|
|
63
|
+
*
|
|
64
|
+
* `feedback` picks what happens while it is held: nothing (default), the content
|
|
65
|
+
* dims, or the surface tints.
|
|
66
|
+
*/
|
|
67
|
+
function Pressable({ as, feedback, color, activeOpacity, href, type = "button", disabled = false, onClick, onKeyDown, onKeyUp, ...rest }) {
|
|
68
|
+
const theme = useTheme();
|
|
69
|
+
const dp = useDefaultProps("Pressable");
|
|
70
|
+
const resolvedFeedback = feedback ?? dp.feedback ?? "none";
|
|
71
|
+
const resolvedColor = color ?? dp.color ?? themeDefault(theme, "color", "primary");
|
|
72
|
+
const resolvedActiveOpacity = activeOpacity ?? dp.activeOpacity ?? .7;
|
|
73
|
+
const element = as ?? (href == null ? "div" : "a");
|
|
74
|
+
const isButton = element === "button";
|
|
75
|
+
const needsShim = !isButton && element !== "a";
|
|
76
|
+
const activate = (event) => {
|
|
77
|
+
event.preventDefault();
|
|
78
|
+
event.currentTarget.click();
|
|
79
|
+
};
|
|
80
|
+
const handleClick = (event) => {
|
|
81
|
+
if (disabled) {
|
|
82
|
+
event.preventDefault();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
onClick?.(event);
|
|
86
|
+
};
|
|
87
|
+
const handleKeyDown = (event) => {
|
|
88
|
+
onKeyDown?.(event);
|
|
89
|
+
if (disabled) return;
|
|
90
|
+
if (event.key === "Enter") activate(event);
|
|
91
|
+
else if (event.key === " ") event.preventDefault();
|
|
92
|
+
};
|
|
93
|
+
const handleKeyUp = (event) => {
|
|
94
|
+
onKeyUp?.(event);
|
|
95
|
+
if (!disabled && event.key === " ") activate(event);
|
|
96
|
+
};
|
|
97
|
+
return /* @__PURE__ */ jsx(PressableRoot, {
|
|
98
|
+
as: element,
|
|
99
|
+
href,
|
|
100
|
+
type: isButton ? type : void 0,
|
|
101
|
+
disabled: isButton ? disabled : void 0,
|
|
102
|
+
feedback: resolvedFeedback,
|
|
103
|
+
color: resolvedColor,
|
|
104
|
+
activeOpacity: resolvedActiveOpacity,
|
|
105
|
+
isDisabled: disabled,
|
|
106
|
+
onClick: handleClick,
|
|
107
|
+
...needsShim ? {
|
|
108
|
+
role: "button",
|
|
109
|
+
tabIndex: disabled ? -1 : 0,
|
|
110
|
+
"aria-disabled": disabled || void 0,
|
|
111
|
+
onKeyDown: handleKeyDown,
|
|
112
|
+
onKeyUp: handleKeyUp
|
|
113
|
+
} : {
|
|
114
|
+
onKeyDown,
|
|
115
|
+
onKeyUp
|
|
116
|
+
},
|
|
117
|
+
...rest
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
export { Pressable };
|