@guardian/stand 0.0.71 → 0.0.73

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 (89) hide show
  1. package/dist/AlertBanner.d.cts +2 -2
  2. package/dist/AlertBanner.d.ts +2 -2
  3. package/dist/Grid.d.cts +2 -2
  4. package/dist/Grid.d.ts +2 -2
  5. package/dist/HtmlPreviewLoader.d.cts +3 -1
  6. package/dist/HtmlPreviewLoader.d.ts +3 -1
  7. package/dist/Pagination.cjs +5 -0
  8. package/dist/Pagination.d.cts +5 -0
  9. package/dist/Pagination.d.ts +5 -0
  10. package/dist/Pagination.js +3 -0
  11. package/dist/ToggleSwitch.cjs +5 -0
  12. package/dist/ToggleSwitch.d.cts +5 -0
  13. package/dist/ToggleSwitch.d.ts +5 -0
  14. package/dist/ToggleSwitch.js +3 -0
  15. package/dist/Typography.d.cts +2 -2
  16. package/dist/Typography.d.ts +2 -2
  17. package/dist/UserMenu.d.cts +2 -1
  18. package/dist/UserMenu.d.ts +2 -1
  19. package/dist/components/AlertBanner/styles.d.cts +3 -2
  20. package/dist/components/AlertBanner/styles.d.ts +3 -2
  21. package/dist/components/Badge/types.d.cts +1 -1
  22. package/dist/components/Badge/types.d.ts +1 -1
  23. package/dist/components/Byline/lib.cjs +0 -1
  24. package/dist/components/Byline/lib.d.cts +0 -1
  25. package/dist/components/Byline/lib.d.ts +0 -1
  26. package/dist/components/Byline/lib.js +1 -1
  27. package/dist/components/HtmlPreviewLoader/styles.d.cts +3 -2
  28. package/dist/components/HtmlPreviewLoader/styles.d.ts +3 -2
  29. package/dist/components/Pagination/Pagination.cjs +97 -0
  30. package/dist/components/Pagination/Pagination.d.cts +5 -0
  31. package/dist/components/Pagination/Pagination.d.ts +5 -0
  32. package/dist/components/Pagination/Pagination.js +97 -0
  33. package/dist/components/Pagination/lib.cjs +30 -0
  34. package/dist/components/Pagination/lib.js +28 -0
  35. package/dist/components/Pagination/styles.cjs +112 -0
  36. package/dist/components/Pagination/styles.d.cts +8 -0
  37. package/dist/components/Pagination/styles.d.ts +8 -0
  38. package/dist/components/Pagination/styles.js +105 -0
  39. package/dist/components/Pagination/types.d.cts +59 -0
  40. package/dist/components/Pagination/types.d.ts +59 -0
  41. package/dist/components/ToggleSwitch/ToggleSwitch.cjs +41 -0
  42. package/dist/components/ToggleSwitch/ToggleSwitch.d.cts +5 -0
  43. package/dist/components/ToggleSwitch/ToggleSwitch.d.ts +5 -0
  44. package/dist/components/ToggleSwitch/ToggleSwitch.js +41 -0
  45. package/dist/components/ToggleSwitch/styles.cjs +70 -0
  46. package/dist/components/ToggleSwitch/styles.d.cts +10 -0
  47. package/dist/components/ToggleSwitch/styles.d.ts +10 -0
  48. package/dist/components/ToggleSwitch/styles.js +64 -0
  49. package/dist/components/ToggleSwitch/types.d.cts +17 -0
  50. package/dist/components/ToggleSwitch/types.d.ts +17 -0
  51. package/dist/components/UserMenu/UserMenu.d.cts +2 -3
  52. package/dist/components/UserMenu/UserMenu.d.ts +2 -3
  53. package/dist/components/UserMenu/theme.d.cts +6 -0
  54. package/dist/components/UserMenu/theme.d.ts +6 -0
  55. package/dist/index.cjs +4 -0
  56. package/dist/index.d.cts +3 -1
  57. package/dist/index.d.ts +3 -1
  58. package/dist/index.js +3 -1
  59. package/dist/styleD/build/css/component/checkbox.css +1 -1
  60. package/dist/styleD/build/css/component/pagination.css +51 -0
  61. package/dist/styleD/build/css/component/radioGroup.css +1 -1
  62. package/dist/styleD/build/css/component/sidebarStepperNavigation.css +1 -1
  63. package/dist/styleD/build/css/component/toggleSwitch.css +55 -0
  64. package/dist/styleD/build/css/semantic/colors.css +15 -3
  65. package/dist/styleD/build/css/semantic/sizing.css +1 -0
  66. package/dist/styleD/build/typescript/component/checkbox.cjs +1 -1
  67. package/dist/styleD/build/typescript/component/checkbox.js +1 -1
  68. package/dist/styleD/build/typescript/component/pagination.cjs +72 -0
  69. package/dist/styleD/build/typescript/component/pagination.d.cts +75 -0
  70. package/dist/styleD/build/typescript/component/pagination.d.ts +75 -0
  71. package/dist/styleD/build/typescript/component/pagination.js +72 -0
  72. package/dist/styleD/build/typescript/component/radioGroup.cjs +1 -1
  73. package/dist/styleD/build/typescript/component/radioGroup.js +1 -1
  74. package/dist/styleD/build/typescript/component/sidebarStepperNavigation.cjs +1 -1
  75. package/dist/styleD/build/typescript/component/sidebarStepperNavigation.js +1 -1
  76. package/dist/styleD/build/typescript/component/toggleSwitch.cjs +86 -0
  77. package/dist/styleD/build/typescript/component/toggleSwitch.d.cts +93 -0
  78. package/dist/styleD/build/typescript/component/toggleSwitch.d.ts +93 -0
  79. package/dist/styleD/build/typescript/component/toggleSwitch.js +86 -0
  80. package/dist/styleD/build/typescript/semantic/colors.cjs +16 -4
  81. package/dist/styleD/build/typescript/semantic/colors.d.cts +15 -3
  82. package/dist/styleD/build/typescript/semantic/colors.d.ts +15 -3
  83. package/dist/styleD/build/typescript/semantic/colors.js +16 -4
  84. package/dist/styleD/build/typescript/semantic/sizing.cjs +1 -0
  85. package/dist/styleD/build/typescript/semantic/sizing.d.cts +1 -0
  86. package/dist/styleD/build/typescript/semantic/sizing.d.ts +1 -0
  87. package/dist/styleD/build/typescript/semantic/sizing.js +1 -0
  88. package/package.json +46 -17
  89. package/dist/styleD/build/css/component/previewFrame.css +0 -10
@@ -0,0 +1,8 @@
1
+ import { DeepPartial, Prettify } from "../../util/types.js";
2
+ import { ComponentPagination } from "../../styleD/build/typescript/component/pagination.js";
3
+ import { SerializedStyles } from "@emotion/react";
4
+ //#region src/components/Pagination/styles.d.ts
5
+ type PaginationTheme = Prettify<ComponentPagination>;
6
+ type PartialPaginationTheme = Prettify<DeepPartial<PaginationTheme>>;
7
+ //#endregion
8
+ export { PaginationTheme, PartialPaginationTheme };
@@ -0,0 +1,105 @@
1
+ import { convertTypographyToEmotionStringStyle } from "../../styleD/utils/semantic/typography.js";
2
+ import { until } from "../../styleD/utils/semantic/mq.js";
3
+ import { componentPagination } from "../../styleD/build/typescript/component/pagination.js";
4
+ import { css } from "@emotion/react";
5
+ //#region src/components/Pagination/styles.ts
6
+ const defaultPaginationTheme = componentPagination;
7
+ const paginationStyles = (theme) => css`
8
+ display: ${theme.shared.display};
9
+ align-items: ${theme.shared.alignItems};
10
+ gap: ${theme.shared.gap};
11
+ `;
12
+ const listStyles = (theme, collapseBelow) => css`
13
+ display: ${theme.shared.display};
14
+ align-items: ${theme.shared.alignItems};
15
+ gap: ${theme.shared.gap};
16
+ margin: 0;
17
+ padding: 0;
18
+ list-style: none;
19
+
20
+ ${until[collapseBelow]} {
21
+ display: none;
22
+ }
23
+ `;
24
+ const itemStyles = (theme, isCurrent) => {
25
+ const item = theme.item;
26
+ const typography = isCurrent ? item.current.typography : item.typography;
27
+ return css`
28
+ display: inline-flex;
29
+ align-items: center;
30
+ justify-content: center;
31
+ box-sizing: border-box;
32
+ min-width: ${item.minWidth};
33
+ height: ${item.height};
34
+ padding: ${item.paddingY} ${item.paddingX};
35
+ border-radius: ${item.borderRadius};
36
+ border: ${item.borderWidth} ${item.borderStyle}
37
+ ${isCurrent ? item.current.borderColor : item.borderColor};
38
+ background-color: ${isCurrent ? item.current.backgroundColor : item.backgroundColor};
39
+ color: ${isCurrent ? item.current.color : item.color};
40
+ cursor: ${isCurrent ? "default" : item.cursor};
41
+ ${convertTypographyToEmotionStringStyle(typography)}
42
+
43
+ &[data-hovered]:not([aria-current='page']) {
44
+ background-color: ${item.hover.backgroundColor};
45
+ border-color: ${item.hover.borderColor};
46
+ }
47
+
48
+ &[data-pressed]:not([aria-current='page']) {
49
+ background-color: ${item.active.backgroundColor};
50
+ }
51
+
52
+ &[data-focus-visible] {
53
+ outline: ${item.focusVisible.outlineWidth} solid
54
+ ${item.focusVisible.outlineColor};
55
+ outline-offset: ${item.focusVisible.outlineOffset};
56
+ }
57
+
58
+ &[data-disabled] {
59
+ color: ${item.disabled.color};
60
+ background-color: ${item.disabled.backgroundColor};
61
+ border-color: ${item.disabled.borderColor};
62
+ cursor: ${item.disabled.cursor};
63
+ }
64
+ `;
65
+ };
66
+ const ellipsisStyles = (theme) => css`
67
+ box-sizing: border-box;
68
+ display: inline-flex;
69
+ align-items: center;
70
+ justify-content: center;
71
+ width: ${theme.ellipsis.minWidth};
72
+ min-width: ${theme.ellipsis.minWidth};
73
+ height: ${theme.item.height};
74
+ color: ${theme.ellipsis.color};
75
+ `;
76
+ const arrowStyles = (theme) => css`
77
+ box-sizing: border-box;
78
+ width: ${theme.item.height};
79
+ min-width: ${theme.item.height};
80
+ height: ${theme.item.height};
81
+ `;
82
+ const summaryStyles = (theme, collapseBelow) => css`
83
+ margin-left: ${theme.summary.marginLeft};
84
+ color: ${theme.summary.color};
85
+ white-space: nowrap;
86
+ ${convertTypographyToEmotionStringStyle(theme.summary.typography)}
87
+
88
+ ${until[collapseBelow]} {
89
+ display: none;
90
+ }
91
+ `;
92
+ const compactStatusStyles = (theme, collapseBelow) => css`
93
+ display: none;
94
+ flex: 1;
95
+ text-align: center;
96
+ white-space: nowrap;
97
+ color: ${theme.summary.color};
98
+ ${convertTypographyToEmotionStringStyle(theme.summary.typography)}
99
+
100
+ ${until[collapseBelow]} {
101
+ display: block;
102
+ }
103
+ `;
104
+ //#endregion
105
+ export { arrowStyles, compactStatusStyles, defaultPaginationTheme, ellipsisStyles, itemStyles, listStyles, paginationStyles, summaryStyles };
@@ -0,0 +1,59 @@
1
+ import { DefaultProps } from "../../util/types.cjs";
2
+ import { Breakpoint } from "../../styleD/utils/semantic/mq.cjs";
3
+ import { PaginationTheme } from "./styles.cjs";
4
+ import { ReactNode } from "react";
5
+ //#region src/components/Pagination/types.d.ts
6
+ interface PaginationSummaryInfo {
7
+ /** The currently active page (1-based). */
8
+ currentPage: number;
9
+ /** Total number of pages. */
10
+ totalPages: number;
11
+ /** Total number of items across all pages. */
12
+ totalItems: number;
13
+ /** Number of items shown per page. */
14
+ pageSize: number;
15
+ /** 1-based index of the first item on the current page. */
16
+ startItem: number;
17
+ /** 1-based index of the last item on the current page. */
18
+ endItem: number;
19
+ }
20
+ interface PaginationLabels {
21
+ /** Accessible label for the surrounding `nav` element. */
22
+ nav?: string;
23
+ /** Accessible label for the previous-page button. */
24
+ previous?: string;
25
+ /** Accessible label for the next-page button. */
26
+ next?: string;
27
+ /** Accessible label for a page button, given the page number. */
28
+ page?: (page: number) => string;
29
+ /** Text shown in the compact (collapsed) view below the `collapseBelow` breakpoint. */
30
+ status?: (currentPage: number, totalPages: number) => string;
31
+ }
32
+ type PaginationProps = DefaultProps<PaginationTheme> & {
33
+ /** The currently active page (1-based). */
34
+ currentPage: number;
35
+ /** Total number of items across all pages. */
36
+ totalItems: number;
37
+ /** Number of items shown per page. Used to derive the total page count. */
38
+ pageSize: number;
39
+ /** Called with the requested page number when the user navigates. */
40
+ onPageChange: (page: number) => void;
41
+ /** Number of page buttons to show either side of the current page. Defaults to 1. */
42
+ siblingCount?: number;
43
+ /** Number of page buttons to always show at the start and end. Defaults to 1. */
44
+ boundaryCount?: number;
45
+ /** Whether to render the results summary. Defaults to true. */
46
+ showSummary?: boolean;
47
+ /** Render prop to customise the results summary text. */
48
+ renderSummary?: (info: PaginationSummaryInfo) => ReactNode;
49
+ /**
50
+ * Below this breakpoint the page-number list and results summary collapse to a
51
+ * compact previous/next + "Page X of Y" view to avoid horizontal overflow.
52
+ * Defaults to 'md'.
53
+ */
54
+ collapseBelow?: Breakpoint;
55
+ /** Overrides for the accessible labels. */
56
+ labels?: PaginationLabels;
57
+ };
58
+ //#endregion
59
+ export { PaginationLabels, PaginationProps, PaginationSummaryInfo };
@@ -0,0 +1,59 @@
1
+ import { DefaultProps } from "../../util/types.js";
2
+ import { Breakpoint } from "../../styleD/utils/semantic/mq.js";
3
+ import { PaginationTheme } from "./styles.js";
4
+ import { ReactNode } from "react";
5
+ //#region src/components/Pagination/types.d.ts
6
+ interface PaginationSummaryInfo {
7
+ /** The currently active page (1-based). */
8
+ currentPage: number;
9
+ /** Total number of pages. */
10
+ totalPages: number;
11
+ /** Total number of items across all pages. */
12
+ totalItems: number;
13
+ /** Number of items shown per page. */
14
+ pageSize: number;
15
+ /** 1-based index of the first item on the current page. */
16
+ startItem: number;
17
+ /** 1-based index of the last item on the current page. */
18
+ endItem: number;
19
+ }
20
+ interface PaginationLabels {
21
+ /** Accessible label for the surrounding `nav` element. */
22
+ nav?: string;
23
+ /** Accessible label for the previous-page button. */
24
+ previous?: string;
25
+ /** Accessible label for the next-page button. */
26
+ next?: string;
27
+ /** Accessible label for a page button, given the page number. */
28
+ page?: (page: number) => string;
29
+ /** Text shown in the compact (collapsed) view below the `collapseBelow` breakpoint. */
30
+ status?: (currentPage: number, totalPages: number) => string;
31
+ }
32
+ type PaginationProps = DefaultProps<PaginationTheme> & {
33
+ /** The currently active page (1-based). */
34
+ currentPage: number;
35
+ /** Total number of items across all pages. */
36
+ totalItems: number;
37
+ /** Number of items shown per page. Used to derive the total page count. */
38
+ pageSize: number;
39
+ /** Called with the requested page number when the user navigates. */
40
+ onPageChange: (page: number) => void;
41
+ /** Number of page buttons to show either side of the current page. Defaults to 1. */
42
+ siblingCount?: number;
43
+ /** Number of page buttons to always show at the start and end. Defaults to 1. */
44
+ boundaryCount?: number;
45
+ /** Whether to render the results summary. Defaults to true. */
46
+ showSummary?: boolean;
47
+ /** Render prop to customise the results summary text. */
48
+ renderSummary?: (info: PaginationSummaryInfo) => ReactNode;
49
+ /**
50
+ * Below this breakpoint the page-number list and results summary collapse to a
51
+ * compact previous/next + "Page X of Y" view to avoid horizontal overflow.
52
+ * Defaults to 'md'.
53
+ */
54
+ collapseBelow?: Breakpoint;
55
+ /** Overrides for the accessible labels. */
56
+ labels?: PaginationLabels;
57
+ };
58
+ //#endregion
59
+ export { PaginationLabels, PaginationProps, PaginationSummaryInfo };
@@ -0,0 +1,41 @@
1
+ const require_mergeDeep = require("../../util/mergeDeep.cjs");
2
+ const require_Icon = require("../Icon/Icon.cjs");
3
+ const require_styles = require("./styles.cjs");
4
+ let _emotion_react_jsx_runtime = require("@emotion/react/jsx-runtime");
5
+ let react_aria_components = require("react-aria-components");
6
+ //#region src/components/ToggleSwitch/ToggleSwitch.tsx
7
+ function ToggleSwitch({ children, description, size = "md", theme = {}, cssOverrides, ...props }) {
8
+ const mergedTheme = require_mergeDeep.mergeDeep(require_styles.defaultToggleSwitchTheme, theme);
9
+ return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(react_aria_components.Switch, {
10
+ css: [require_styles.toggleSwitchStyles(mergedTheme, { size }), cssOverrides],
11
+ ...props,
12
+ children: ({ isSelected, isDisabled, isFocusVisible }) => /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)(_emotion_react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("div", {
13
+ css: require_styles.toggleSwitchTrackStyles(mergedTheme, {
14
+ size,
15
+ isSelected,
16
+ isDisabled,
17
+ isFocusVisible
18
+ }),
19
+ children: /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("div", {
20
+ css: require_styles.toggleSwitchThumbStyles(mergedTheme, {
21
+ size,
22
+ isSelected,
23
+ isDisabled
24
+ }),
25
+ children: /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(require_Icon.Icon, {
26
+ symbol: "check",
27
+ size: size === "sm" ? "sm" : "md",
28
+ cssOverrides: require_styles.toggleSwitchIconStyles(isSelected)
29
+ })
30
+ })
31
+ }), children && /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)("span", {
32
+ css: require_styles.toggleSwitchLabelStyles(mergedTheme),
33
+ children: [/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("span", { children }), description && /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("span", {
34
+ css: require_styles.toggleSwitchDescriptionStyles(mergedTheme),
35
+ children: description
36
+ })]
37
+ })] })
38
+ });
39
+ }
40
+ //#endregion
41
+ exports.ToggleSwitch = ToggleSwitch;
@@ -0,0 +1,5 @@
1
+ import { ToggleSwitchProps } from "./types.cjs";
2
+ //#region src/components/ToggleSwitch/ToggleSwitch.d.ts
3
+ declare function ToggleSwitch({ children, description, size, theme, cssOverrides, ...props }: ToggleSwitchProps): import("@emotion/react/jsx-runtime").JSX.Element;
4
+ //#endregion
5
+ export { ToggleSwitch };
@@ -0,0 +1,5 @@
1
+ import { ToggleSwitchProps } from "./types.js";
2
+ //#region src/components/ToggleSwitch/ToggleSwitch.d.ts
3
+ declare function ToggleSwitch({ children, description, size, theme, cssOverrides, ...props }: ToggleSwitchProps): import("@emotion/react/jsx-runtime").JSX.Element;
4
+ //#endregion
5
+ export { ToggleSwitch };
@@ -0,0 +1,41 @@
1
+ import { mergeDeep } from "../../util/mergeDeep.js";
2
+ import { Icon } from "../Icon/Icon.js";
3
+ import { defaultToggleSwitchTheme, toggleSwitchDescriptionStyles, toggleSwitchIconStyles, toggleSwitchLabelStyles, toggleSwitchStyles, toggleSwitchThumbStyles, toggleSwitchTrackStyles } from "./styles.js";
4
+ import { Fragment, jsx, jsxs } from "@emotion/react/jsx-runtime";
5
+ import { Switch } from "react-aria-components";
6
+ //#region src/components/ToggleSwitch/ToggleSwitch.tsx
7
+ function ToggleSwitch({ children, description, size = "md", theme = {}, cssOverrides, ...props }) {
8
+ const mergedTheme = mergeDeep(defaultToggleSwitchTheme, theme);
9
+ return /* @__PURE__ */ jsx(Switch, {
10
+ css: [toggleSwitchStyles(mergedTheme, { size }), cssOverrides],
11
+ ...props,
12
+ children: ({ isSelected, isDisabled, isFocusVisible }) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
13
+ css: toggleSwitchTrackStyles(mergedTheme, {
14
+ size,
15
+ isSelected,
16
+ isDisabled,
17
+ isFocusVisible
18
+ }),
19
+ children: /* @__PURE__ */ jsx("div", {
20
+ css: toggleSwitchThumbStyles(mergedTheme, {
21
+ size,
22
+ isSelected,
23
+ isDisabled
24
+ }),
25
+ children: /* @__PURE__ */ jsx(Icon, {
26
+ symbol: "check",
27
+ size: size === "sm" ? "sm" : "md",
28
+ cssOverrides: toggleSwitchIconStyles(isSelected)
29
+ })
30
+ })
31
+ }), children && /* @__PURE__ */ jsxs("span", {
32
+ css: toggleSwitchLabelStyles(mergedTheme),
33
+ children: [/* @__PURE__ */ jsx("span", { children }), description && /* @__PURE__ */ jsx("span", {
34
+ css: toggleSwitchDescriptionStyles(mergedTheme),
35
+ children: description
36
+ })]
37
+ })] })
38
+ });
39
+ }
40
+ //#endregion
41
+ export { ToggleSwitch };
@@ -0,0 +1,70 @@
1
+ const require_typography = require("../../styleD/utils/semantic/typography.cjs");
2
+ const require_toggleSwitch = require("../../styleD/build/typescript/component/toggleSwitch.cjs");
3
+ let _emotion_react = require("@emotion/react");
4
+ //#region src/components/ToggleSwitch/styles.ts
5
+ const defaultToggleSwitchTheme = require_toggleSwitch.componentToggleSwitch;
6
+ const toggleSwitchStyles = (theme, { size }) => _emotion_react.css`
7
+ display: ${theme.shared.display};
8
+ align-items: ${theme.shared.alignItems};
9
+ gap: ${theme.shared.gap};
10
+ cursor: ${theme.shared.cursor};
11
+ ${require_typography.convertTypographyToEmotionStringStyle(theme[size].typography)}
12
+ color: ${theme.shared.color};
13
+
14
+ &[data-disabled] {
15
+ color: ${theme.shared.disabled.color};
16
+ cursor: ${theme.shared.disabled.cursor};
17
+ }
18
+ `;
19
+ const toggleSwitchLabelStyles = (theme) => _emotion_react.css`
20
+ display: ${theme.shared.label.display};
21
+ flex-direction: ${theme.shared.label.flexDirection};
22
+ align-items: ${theme.shared.label.alignItems};
23
+ padding-block: ${theme.shared.label.paddingBlock};
24
+ `;
25
+ const toggleSwitchDescriptionStyles = (theme) => _emotion_react.css`
26
+ ${require_typography.convertTypographyToEmotionStringStyle(theme.shared.description.typography)}
27
+ color: ${theme.shared.description.color};
28
+ `;
29
+ const toggleSwitchTrackStyles = (theme, { size, isSelected, isDisabled, isFocusVisible }) => {
30
+ let backgroundColor = theme.shared.track.backgroundColor;
31
+ if (isSelected) backgroundColor = theme.shared.track.selected.backgroundColor;
32
+ if (isDisabled) backgroundColor = theme.shared.track.disabled.backgroundColor;
33
+ return _emotion_react.css`
34
+ display: ${theme.shared.track.display};
35
+ align-items: ${theme.shared.track.alignItems};
36
+ width: ${theme[size].track.width};
37
+ height: ${theme[size].track.height};
38
+ padding: ${theme.shared.track.padding};
39
+ border-radius: ${theme.shared.track.borderRadius};
40
+ background-color: ${backgroundColor};
41
+ transition: ${theme.shared.track.transition};
42
+ ${isFocusVisible && _emotion_react.css`
43
+ outline: ${theme.shared.track.focusVisible.outline};
44
+ outline-offset: ${theme.shared.track.focusVisible.outlineOffset};
45
+ `}
46
+ `;
47
+ };
48
+ const toggleSwitchThumbStyles = (theme, { size, isSelected, isDisabled }) => _emotion_react.css`
49
+ display: flex;
50
+ align-items: center;
51
+ justify-content: center;
52
+ width: ${theme[size].thumb.size};
53
+ height: ${theme[size].thumb.size};
54
+ border-radius: ${theme.shared.thumb.borderRadius};
55
+ background-color: ${theme.shared.thumb.backgroundColor};
56
+ color: ${isDisabled ? theme.shared.thumb.disabled.color : theme.shared.thumb.color};
57
+ transform: ${isSelected ? `translateX(${theme[size].thumb.translateX})` : "none"};
58
+ transition: ${theme.shared.thumb.transition};
59
+ `;
60
+ const toggleSwitchIconStyles = (isSelected) => _emotion_react.css`
61
+ opacity: ${isSelected ? 1 : 0};
62
+ `;
63
+ //#endregion
64
+ exports.defaultToggleSwitchTheme = defaultToggleSwitchTheme;
65
+ exports.toggleSwitchDescriptionStyles = toggleSwitchDescriptionStyles;
66
+ exports.toggleSwitchIconStyles = toggleSwitchIconStyles;
67
+ exports.toggleSwitchLabelStyles = toggleSwitchLabelStyles;
68
+ exports.toggleSwitchStyles = toggleSwitchStyles;
69
+ exports.toggleSwitchThumbStyles = toggleSwitchThumbStyles;
70
+ exports.toggleSwitchTrackStyles = toggleSwitchTrackStyles;
@@ -0,0 +1,10 @@
1
+ import { DeepPartial, Prettify } from "../../util/types.cjs";
2
+ import { ComponentToggleSwitch } from "../../styleD/build/typescript/component/toggleSwitch.cjs";
3
+ import "./types.cjs";
4
+ import { SerializedStyles } from "@emotion/react";
5
+ import "react-aria-components";
6
+ //#region src/components/ToggleSwitch/styles.d.ts
7
+ type ToggleSwitchTheme = Prettify<ComponentToggleSwitch>;
8
+ type PartialToggleSwitchTheme = Prettify<DeepPartial<ToggleSwitchTheme>>;
9
+ //#endregion
10
+ export { PartialToggleSwitchTheme, ToggleSwitchTheme };
@@ -0,0 +1,10 @@
1
+ import { DeepPartial, Prettify } from "../../util/types.js";
2
+ import { ComponentToggleSwitch } from "../../styleD/build/typescript/component/toggleSwitch.js";
3
+ import "./types.js";
4
+ import { SerializedStyles } from "@emotion/react";
5
+ import "react-aria-components";
6
+ //#region src/components/ToggleSwitch/styles.d.ts
7
+ type ToggleSwitchTheme = Prettify<ComponentToggleSwitch>;
8
+ type PartialToggleSwitchTheme = Prettify<DeepPartial<ToggleSwitchTheme>>;
9
+ //#endregion
10
+ export { PartialToggleSwitchTheme, ToggleSwitchTheme };
@@ -0,0 +1,64 @@
1
+ import { convertTypographyToEmotionStringStyle } from "../../styleD/utils/semantic/typography.js";
2
+ import { componentToggleSwitch } from "../../styleD/build/typescript/component/toggleSwitch.js";
3
+ import { css } from "@emotion/react";
4
+ //#region src/components/ToggleSwitch/styles.ts
5
+ const defaultToggleSwitchTheme = componentToggleSwitch;
6
+ const toggleSwitchStyles = (theme, { size }) => css`
7
+ display: ${theme.shared.display};
8
+ align-items: ${theme.shared.alignItems};
9
+ gap: ${theme.shared.gap};
10
+ cursor: ${theme.shared.cursor};
11
+ ${convertTypographyToEmotionStringStyle(theme[size].typography)}
12
+ color: ${theme.shared.color};
13
+
14
+ &[data-disabled] {
15
+ color: ${theme.shared.disabled.color};
16
+ cursor: ${theme.shared.disabled.cursor};
17
+ }
18
+ `;
19
+ const toggleSwitchLabelStyles = (theme) => css`
20
+ display: ${theme.shared.label.display};
21
+ flex-direction: ${theme.shared.label.flexDirection};
22
+ align-items: ${theme.shared.label.alignItems};
23
+ padding-block: ${theme.shared.label.paddingBlock};
24
+ `;
25
+ const toggleSwitchDescriptionStyles = (theme) => css`
26
+ ${convertTypographyToEmotionStringStyle(theme.shared.description.typography)}
27
+ color: ${theme.shared.description.color};
28
+ `;
29
+ const toggleSwitchTrackStyles = (theme, { size, isSelected, isDisabled, isFocusVisible }) => {
30
+ let backgroundColor = theme.shared.track.backgroundColor;
31
+ if (isSelected) backgroundColor = theme.shared.track.selected.backgroundColor;
32
+ if (isDisabled) backgroundColor = theme.shared.track.disabled.backgroundColor;
33
+ return css`
34
+ display: ${theme.shared.track.display};
35
+ align-items: ${theme.shared.track.alignItems};
36
+ width: ${theme[size].track.width};
37
+ height: ${theme[size].track.height};
38
+ padding: ${theme.shared.track.padding};
39
+ border-radius: ${theme.shared.track.borderRadius};
40
+ background-color: ${backgroundColor};
41
+ transition: ${theme.shared.track.transition};
42
+ ${isFocusVisible && css`
43
+ outline: ${theme.shared.track.focusVisible.outline};
44
+ outline-offset: ${theme.shared.track.focusVisible.outlineOffset};
45
+ `}
46
+ `;
47
+ };
48
+ const toggleSwitchThumbStyles = (theme, { size, isSelected, isDisabled }) => css`
49
+ display: flex;
50
+ align-items: center;
51
+ justify-content: center;
52
+ width: ${theme[size].thumb.size};
53
+ height: ${theme[size].thumb.size};
54
+ border-radius: ${theme.shared.thumb.borderRadius};
55
+ background-color: ${theme.shared.thumb.backgroundColor};
56
+ color: ${isDisabled ? theme.shared.thumb.disabled.color : theme.shared.thumb.color};
57
+ transform: ${isSelected ? `translateX(${theme[size].thumb.translateX})` : "none"};
58
+ transition: ${theme.shared.thumb.transition};
59
+ `;
60
+ const toggleSwitchIconStyles = (isSelected) => css`
61
+ opacity: ${isSelected ? 1 : 0};
62
+ `;
63
+ //#endregion
64
+ export { defaultToggleSwitchTheme, toggleSwitchDescriptionStyles, toggleSwitchIconStyles, toggleSwitchLabelStyles, toggleSwitchStyles, toggleSwitchThumbStyles, toggleSwitchTrackStyles };
@@ -0,0 +1,17 @@
1
+ import { DefaultPropsWithChildren } from "../../util/types.cjs";
2
+ import { ToggleSwitchTheme } from "./styles.cjs";
3
+ import { SwitchProps } from "react-aria-components";
4
+ //#region src/components/ToggleSwitch/types.d.ts
5
+ interface ToggleSwitchProps extends DefaultPropsWithChildren<ToggleSwitchTheme, SwitchProps['className']>, Omit<SwitchProps, 'children'> {
6
+ /**
7
+ * Size variant of the ToggleSwitch.
8
+ * @default 'md'
9
+ */
10
+ size?: keyof Omit<ToggleSwitchTheme, 'shared'>;
11
+ /**
12
+ * Supporting text rendered below the switch label.
13
+ */
14
+ description?: React.ReactNode;
15
+ }
16
+ //#endregion
17
+ export { ToggleSwitchProps };
@@ -0,0 +1,17 @@
1
+ import { DefaultPropsWithChildren } from "../../util/types.js";
2
+ import { ToggleSwitchTheme } from "./styles.js";
3
+ import { SwitchProps } from "react-aria-components";
4
+ //#region src/components/ToggleSwitch/types.d.ts
5
+ interface ToggleSwitchProps extends DefaultPropsWithChildren<ToggleSwitchTheme, SwitchProps['className']>, Omit<SwitchProps, 'children'> {
6
+ /**
7
+ * Size variant of the ToggleSwitch.
8
+ * @default 'md'
9
+ */
10
+ size?: keyof Omit<ToggleSwitchTheme, 'shared'>;
11
+ /**
12
+ * Supporting text rendered below the switch label.
13
+ */
14
+ description?: React.ReactNode;
15
+ }
16
+ //#endregion
17
+ export { ToggleSwitchProps };
@@ -1,10 +1,9 @@
1
- import { DeepPartial } from "../../util/types.cjs";
2
- import { ComponentUserMenu } from "../../styleD/build/typescript/component/userMenu.cjs";
3
1
  import { Option } from "./model.cjs";
2
+ import { PartialUserMenuTheme } from "./theme.cjs";
4
3
  import { UserPreferences } from "./types.cjs";
5
4
  //#region src/components/UserMenu/UserMenu.d.ts
6
5
  interface UserMenuProps {
7
- theme?: DeepPartial<ComponentUserMenu>;
6
+ theme?: PartialUserMenuTheme;
8
7
  feedBacklink?: string;
9
8
  preferences: UserPreferences;
10
9
  updatePreferences: {
@@ -1,10 +1,9 @@
1
- import { DeepPartial } from "../../util/types.js";
2
- import { ComponentUserMenu } from "../../styleD/build/typescript/component/userMenu.js";
3
1
  import { Option } from "./model.js";
2
+ import { PartialUserMenuTheme } from "./theme.js";
4
3
  import { UserPreferences } from "./types.js";
5
4
  //#region src/components/UserMenu/UserMenu.d.ts
6
5
  interface UserMenuProps {
7
- theme?: DeepPartial<ComponentUserMenu>;
6
+ theme?: PartialUserMenuTheme;
8
7
  feedBacklink?: string;
9
8
  preferences: UserPreferences;
10
9
  updatePreferences: {
@@ -0,0 +1,6 @@
1
+ import { DeepPartial, Prettify } from "../../util/types.cjs";
2
+ import { ComponentUserMenu } from "../../styleD/build/typescript/component/userMenu.cjs";
3
+ //#region src/components/UserMenu/theme.d.ts
4
+ type PartialUserMenuTheme = Prettify<DeepPartial<ComponentUserMenu>>;
5
+ //#endregion
6
+ export { PartialUserMenuTheme };
@@ -0,0 +1,6 @@
1
+ import { DeepPartial, Prettify } from "../../util/types.js";
2
+ import { ComponentUserMenu } from "../../styleD/build/typescript/component/userMenu.js";
3
+ //#region src/components/UserMenu/theme.d.ts
4
+ type PartialUserMenuTheme = Prettify<DeepPartial<ComponentUserMenu>>;
5
+ //#endregion
6
+ export { PartialUserMenuTheme };
package/dist/index.cjs CHANGED
@@ -12,6 +12,8 @@ const require_autocomplete = require("./styleD/build/typescript/component/autoco
12
12
  const require_tagTable = require("./styleD/build/typescript/component/tagTable.cjs");
13
13
  const require_userMenu = require("./styleD/build/typescript/component/userMenu.cjs");
14
14
  const require_intendedAudienceSignifier = require("./styleD/build/typescript/component/intendedAudienceSignifier.cjs");
15
+ const require_pagination = require("./styleD/build/typescript/component/pagination.cjs");
16
+ const require_toggleSwitch = require("./styleD/build/typescript/component/toggleSwitch.cjs");
15
17
  const require_favicon = require("./styleD/build/typescript/component/favicon.cjs");
16
18
  const require_datePicker = require("./styleD/build/typescript/component/datePicker.cjs");
17
19
  const require_grid = require("./styleD/build/typescript/component/grid.cjs");
@@ -69,6 +71,7 @@ exports.componentLayout = require_layout.componentLayout;
69
71
  exports.componentLink = require_link.componentLink;
70
72
  exports.componentMenu = require_menu.componentMenu;
71
73
  exports.componentModal = require_modal.componentModal;
74
+ exports.componentPagination = require_pagination.componentPagination;
72
75
  exports.componentRadioGroup = require_radioGroup.componentRadioGroup;
73
76
  exports.componentSelect = require_select.componentSelect;
74
77
  exports.componentSidebarStepperNavigation = require_sidebarStepperNavigation.componentSidebarStepperNavigation;
@@ -78,6 +81,7 @@ exports.componentTagTable = require_tagTable.componentTagTable;
78
81
  exports.componentTextArea = require_textArea.componentTextArea;
79
82
  exports.componentTextInput = require_textInput.componentTextInput;
80
83
  exports.componentTextListInput = require_textListInput.componentTextListInput;
84
+ exports.componentToggleSwitch = require_toggleSwitch.componentToggleSwitch;
81
85
  exports.componentTooltip = require_tooltip.componentTooltip;
82
86
  exports.componentTopBar = require_topBar.componentTopBar;
83
87
  exports.componentTypography = require_typography.componentTypography;
package/dist/index.d.cts CHANGED
@@ -19,6 +19,7 @@ import { ComponentLayout, componentLayout } from "./styleD/build/typescript/comp
19
19
  import { ComponentLink, componentLink } from "./styleD/build/typescript/component/link.cjs";
20
20
  import { ComponentMenu, componentMenu } from "./styleD/build/typescript/component/menu.cjs";
21
21
  import { ComponentModal, componentModal } from "./styleD/build/typescript/component/modal.cjs";
22
+ import { ComponentPagination, componentPagination } from "./styleD/build/typescript/component/pagination.cjs";
22
23
  import { ComponentRadioGroup, componentRadioGroup } from "./styleD/build/typescript/component/radioGroup.cjs";
23
24
  import { ComponentSelect, componentSelect } from "./styleD/build/typescript/component/select.cjs";
24
25
  import { ComponentSidebarStepperNavigation, componentSidebarStepperNavigation } from "./styleD/build/typescript/component/sidebarStepperNavigation.cjs";
@@ -29,6 +30,7 @@ import { ComponentTagTable, componentTagTable } from "./styleD/build/typescript/
29
30
  import { ComponentTextArea, componentTextArea } from "./styleD/build/typescript/component/textArea.cjs";
30
31
  import { ComponentTextInput, componentTextInput } from "./styleD/build/typescript/component/textInput.cjs";
31
32
  import { ComponentTextListInput, componentTextListInput } from "./styleD/build/typescript/component/textListInput.cjs";
33
+ import { ComponentToggleSwitch, componentToggleSwitch } from "./styleD/build/typescript/component/toggleSwitch.cjs";
32
34
  import { ComponentTooltip, componentTooltip } from "./styleD/build/typescript/component/tooltip.cjs";
33
35
  import { ComponentTopBar, componentTopBar } from "./styleD/build/typescript/component/topBar.cjs";
34
36
  import { ComponentUserFeedbackSummary, componentUserFeedbackSummary } from "./styleD/build/typescript/component/userFeedbackSummary.cjs";
@@ -44,4 +46,4 @@ import { SemanticSizing, semanticSizing } from "./styleD/build/typescript/semant
44
46
  import { SemanticShadow, semanticShadow } from "./styleD/build/typescript/semantic/shadow.cjs";
45
47
  import { SemanticRadius, semanticRadius } from "./styleD/build/typescript/semantic/radius.cjs";
46
48
  import { SemanticSpacing, semanticSpacing } from "./styleD/build/typescript/semantic/spacing.cjs";
47
- export { type BaseColors, type BaseRadius, type BaseSizing, type BaseSpacing, type BaseTypography, type ComponentAlertBanner, type ComponentAutocomplete, type ComponentAvatar, type ComponentBadge, type ComponentButton, type ComponentButtonGroup, type ComponentByline, type ComponentCheckbox, type ComponentDatePicker, type ComponentFavicon, type ComponentForm, type ComponentGrid, type ComponentIcon, type ComponentInlineMessage, type ComponentIntendedAudienceSignifier, type ComponentLayout, type ComponentLink, type ComponentMenu, type ComponentModal, type ComponentRadioGroup, type ComponentSelect, type ComponentSidebarStepperNavigation, type ComponentTable, type ComponentTabs, type ComponentTagTable, type ComponentTextArea, type ComponentTextInput, type ComponentTextListInput, type ComponentTooltip, type ComponentTopBar, type ComponentTypography, type ComponentUserFeedbackSummary, type ComponentUserMenu, type SemanticBreakpoints, type SemanticColors, type SemanticGrid, type SemanticRadius, type SemanticShadow, type SemanticSizing, type SemanticSpacing, type SemanticTypography, baseColors, baseRadius, baseSizing, baseSpacing, baseTypography, componentAlertBanner, componentAutocomplete, componentAvatar, componentBadge, componentButton, componentButtonGroup, componentByline, componentCheckbox, componentDatePicker, componentFavicon, componentForm, componentGrid, componentIcon, componentInlineMessage, componentIntendedAudienceSignifier, componentLayout, componentLink, componentMenu, componentModal, componentRadioGroup, componentSelect, componentSidebarStepperNavigation, componentTable, componentTabs, componentTagTable, componentTextArea, componentTextInput, componentTextListInput, componentTooltip, componentTopBar, componentTypography, componentUserFeedbackSummary, componentUserMenu, semanticBreakpoints, semanticColors, semanticGrid, semanticRadius, semanticShadow, semanticSizing, semanticSpacing, semanticTypography };
49
+ export { type BaseColors, type BaseRadius, type BaseSizing, type BaseSpacing, type BaseTypography, type ComponentAlertBanner, type ComponentAutocomplete, type ComponentAvatar, type ComponentBadge, type ComponentButton, type ComponentButtonGroup, type ComponentByline, type ComponentCheckbox, type ComponentDatePicker, type ComponentFavicon, type ComponentForm, type ComponentGrid, type ComponentIcon, type ComponentInlineMessage, type ComponentIntendedAudienceSignifier, type ComponentLayout, type ComponentLink, type ComponentMenu, type ComponentModal, type ComponentPagination, type ComponentRadioGroup, type ComponentSelect, type ComponentSidebarStepperNavigation, type ComponentTable, type ComponentTabs, type ComponentTagTable, type ComponentTextArea, type ComponentTextInput, type ComponentTextListInput, type ComponentToggleSwitch, type ComponentTooltip, type ComponentTopBar, type ComponentTypography, type ComponentUserFeedbackSummary, type ComponentUserMenu, type SemanticBreakpoints, type SemanticColors, type SemanticGrid, type SemanticRadius, type SemanticShadow, type SemanticSizing, type SemanticSpacing, type SemanticTypography, baseColors, baseRadius, baseSizing, baseSpacing, baseTypography, componentAlertBanner, componentAutocomplete, componentAvatar, componentBadge, componentButton, componentButtonGroup, componentByline, componentCheckbox, componentDatePicker, componentFavicon, componentForm, componentGrid, componentIcon, componentInlineMessage, componentIntendedAudienceSignifier, componentLayout, componentLink, componentMenu, componentModal, componentPagination, componentRadioGroup, componentSelect, componentSidebarStepperNavigation, componentTable, componentTabs, componentTagTable, componentTextArea, componentTextInput, componentTextListInput, componentToggleSwitch, componentTooltip, componentTopBar, componentTypography, componentUserFeedbackSummary, componentUserMenu, semanticBreakpoints, semanticColors, semanticGrid, semanticRadius, semanticShadow, semanticSizing, semanticSpacing, semanticTypography };