@harpercollins/harpercollins-design-system 1.31.0 → 1.33.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.
@@ -0,0 +1,262 @@
1
+ import R from "../../../../../@babel_runtime@7.29.2/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js";
2
+ import a from "../../../../../@babel_runtime@7.29.2/node_modules/@babel/runtime/helpers/esm/extends.js";
3
+ import * as $ from "react";
4
+ import r from "../../../../../../../_virtual/index.js";
5
+ import { clsx as O } from "../../../../../clsx@2.1.1/node_modules/clsx/dist/clsx.js";
6
+ import W from "../styles/styled.js";
7
+ import M from "../styles/useThemeProps.js";
8
+ import { getLinearProgressUtilityClass as j } from "./linearProgressClasses.js";
9
+ import N from "../utils/useSlot.js";
10
+ import { resolveSxValue as I } from "../styles/styleUtils.js";
11
+ import { jsx as E } from "react/jsx-runtime";
12
+ import d from "../../../../../@mui_utils@5.17.1_@types_react@18.3.28_react@18.3.1/node_modules/@mui/utils/esm/capitalize/capitalize.js";
13
+ import H from "../../../../../@mui_utils@5.17.1_@types_react@18.3.28_react@18.3.1/node_modules/@mui/utils/esm/composeClasses/composeClasses.js";
14
+ import { css as J, keyframes as U } from "../../../../../@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1/node_modules/@emotion/react/dist/emotion-react.browser.esm.js";
15
+ const V = ["children", "className", "component", "color", "size", "variant", "thickness", "determinate", "value", "style", "slots", "slotProps"];
16
+ let P = (s) => s, m, v;
17
+ const B = U(m || (m = P`
18
+ 0% {
19
+ left: var(--_LinearProgress-progressInset);
20
+ width: var(--LinearProgress-progressMinWidth);
21
+ }
22
+
23
+ 25% {
24
+ width: var(--LinearProgress-progressMaxWidth);
25
+ }
26
+
27
+ 50% {
28
+ left: var(--_LinearProgress-progressLeft);
29
+ width: var(--LinearProgress-progressMinWidth);
30
+ }
31
+
32
+ 75% {
33
+ width: var(--LinearProgress-progressMaxWidth);
34
+ }
35
+
36
+ 100% {
37
+ left: var(--_LinearProgress-progressInset);
38
+ width: var(--LinearProgress-progressMinWidth);
39
+ }
40
+ `)), D = (s) => {
41
+ const {
42
+ determinate: e,
43
+ color: i,
44
+ variant: o,
45
+ size: n
46
+ } = s, t = {
47
+ root: ["root", e && "determinate", i && `color${d(i)}`, o && `variant${d(o)}`, n && `size${d(n)}`]
48
+ };
49
+ return H(t, j, {});
50
+ }, F = W("div", {
51
+ name: "JoyLinearProgress",
52
+ slot: "Root",
53
+ overridesResolver: (s, e) => e.root
54
+ })(({
55
+ ownerState: s,
56
+ theme: e
57
+ }) => {
58
+ var i, o, n, t;
59
+ return a({
60
+ // public variables
61
+ "--LinearProgress-radius": "var(--LinearProgress-thickness)",
62
+ "--LinearProgress-progressThickness": "var(--LinearProgress-thickness)",
63
+ "--LinearProgress-progressRadius": "max(var(--LinearProgress-radius) - var(--_LinearProgress-padding), min(var(--_LinearProgress-padding) / 2, var(--LinearProgress-radius) / 2))"
64
+ }, s.size === "sm" && {
65
+ "--LinearProgress-thickness": "4px"
66
+ }, s.size === "md" && {
67
+ "--LinearProgress-thickness": "6px"
68
+ }, s.size === "lg" && {
69
+ "--LinearProgress-thickness": "8px"
70
+ }, s.thickness && {
71
+ "--LinearProgress-thickness": `${s.thickness}px`
72
+ }, !s.determinate && {
73
+ "--LinearProgress-progressMinWidth": "calc(var(--LinearProgress-percent) * 1% / 2)",
74
+ "--LinearProgress-progressMaxWidth": "calc(var(--LinearProgress-percent) * 1%)",
75
+ "--_LinearProgress-progressLeft": "calc(100% - var(--LinearProgress-progressMinWidth) - var(--_LinearProgress-progressInset))",
76
+ "--_LinearProgress-progressInset": "calc(var(--LinearProgress-thickness) / 2 - var(--LinearProgress-progressThickness) / 2)"
77
+ }, {
78
+ minBlockSize: "var(--LinearProgress-thickness)",
79
+ boxSizing: "border-box",
80
+ borderRadius: "var(--LinearProgress-radius)",
81
+ display: "flex",
82
+ justifyContent: "center",
83
+ alignItems: "center",
84
+ flex: 1,
85
+ padding: "var(--_LinearProgress-padding)",
86
+ position: "relative"
87
+ }, (i = e.variants[s.variant]) == null ? void 0 : i[s.color], {
88
+ "--_LinearProgress-padding": "max((var(--LinearProgress-thickness) - 2 * var(--variant-borderWidth, 0px) - var(--LinearProgress-progressThickness)) / 2, 0px)",
89
+ "&::before": {
90
+ content: '""',
91
+ display: "block",
92
+ boxSizing: "inherit",
93
+ blockSize: "var(--LinearProgress-progressThickness)",
94
+ borderRadius: "var(--LinearProgress-progressRadius)",
95
+ backgroundColor: "currentColor",
96
+ color: "inherit",
97
+ position: "absolute"
98
+ // required to make `left` animation works.
99
+ }
100
+ }, s.variant === "soft" && {
101
+ backgroundColor: e.variants.soft.neutral.backgroundColor,
102
+ color: (o = e.variants.solid) == null ? void 0 : o[s.color].backgroundColor
103
+ }, s.variant === "solid" && {
104
+ backgroundColor: (n = e.variants.softHover) == null ? void 0 : n[s.color].backgroundColor,
105
+ color: (t = e.variants.solid) == null ? void 0 : t[s.color].backgroundColor
106
+ });
107
+ }, ({
108
+ ownerState: s
109
+ }) => s.determinate ? {
110
+ "&::before": {
111
+ left: "var(--_LinearProgress-padding)",
112
+ inlineSize: "calc(var(--LinearProgress-percent) * 1% - 2 * var(--_LinearProgress-padding))"
113
+ }
114
+ } : J(v || (v = P`
115
+ &::before {
116
+ animation: ${0}
117
+ var(--LinearProgress-circulation, 2.5s ease-in-out 0s infinite normal none running);
118
+ }
119
+ `), B), ({
120
+ ownerState: s,
121
+ theme: e
122
+ }) => {
123
+ const {
124
+ borderRadius: i,
125
+ height: o
126
+ } = I({
127
+ theme: e,
128
+ ownerState: s
129
+ }, ["borderRadius", "height"]);
130
+ return a({}, i !== void 0 && {
131
+ "--LinearProgress-radius": i
132
+ }, o !== void 0 && {
133
+ "--LinearProgress-thickness": o
134
+ });
135
+ }), K = /* @__PURE__ */ $.forwardRef(function(e, i) {
136
+ const o = M({
137
+ props: e,
138
+ name: "JoyLinearProgress"
139
+ }), {
140
+ children: n,
141
+ className: t,
142
+ component: c,
143
+ color: u = "primary",
144
+ size: f = "md",
145
+ variant: L = "soft",
146
+ thickness: h,
147
+ determinate: g = !1,
148
+ value: l = g ? 0 : 25,
149
+ // `25` is the 1/4 of the bar.
150
+ style: b,
151
+ slots: k = {},
152
+ slotProps: y = {}
153
+ } = o, x = R(o, V), p = a({}, o, {
154
+ component: c,
155
+ color: u,
156
+ size: f,
157
+ variant: L,
158
+ thickness: h,
159
+ value: l,
160
+ determinate: g,
161
+ instanceSize: e.size
162
+ }), _ = D(p), z = a({}, x, {
163
+ component: c,
164
+ slots: k,
165
+ slotProps: y
166
+ }), [T, C] = N("root", {
167
+ ref: i,
168
+ className: O(_.root, t),
169
+ elementType: F,
170
+ externalForwardedProps: z,
171
+ ownerState: p,
172
+ additionalProps: a({
173
+ as: c,
174
+ role: "progressbar",
175
+ style: a({}, {
176
+ "--LinearProgress-percent": l
177
+ }, b)
178
+ }, typeof l == "number" && g && {
179
+ "aria-valuenow": Math.round(l)
180
+ })
181
+ });
182
+ return /* @__PURE__ */ E(T, a({}, C, {
183
+ children: n
184
+ }));
185
+ });
186
+ process.env.NODE_ENV !== "production" && (K.propTypes = {
187
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
188
+ // │ These PropTypes are generated from the TypeScript type definitions. │
189
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
190
+ // └─────────────────────────────────────────────────────────────────────┘
191
+ /**
192
+ * @ignore
193
+ */
194
+ children: r.node,
195
+ /**
196
+ * @ignore
197
+ */
198
+ className: r.string,
199
+ /**
200
+ * The color of the component. It supports those theme colors that make sense for this component.
201
+ * @default 'primary'
202
+ */
203
+ color: r.oneOfType([r.oneOf(["danger", "neutral", "primary", "success", "warning"]), r.string]),
204
+ /**
205
+ * The component used for the root node.
206
+ * Either a string to use a HTML element or a component.
207
+ */
208
+ component: r.elementType,
209
+ /**
210
+ * The boolean to select a variant.
211
+ * Use indeterminate when there is no progress value.
212
+ * @default false
213
+ */
214
+ determinate: r.bool,
215
+ /**
216
+ * The size of the component.
217
+ * It accepts theme values between 'sm' and 'lg'.
218
+ * @default 'md'
219
+ */
220
+ size: r.oneOfType([r.oneOf(["sm", "md", "lg"]), r.string]),
221
+ /**
222
+ * The props used for each slot inside.
223
+ * @default {}
224
+ */
225
+ slotProps: r.shape({
226
+ root: r.oneOfType([r.func, r.object])
227
+ }),
228
+ /**
229
+ * The components used for each slot inside.
230
+ * @default {}
231
+ */
232
+ slots: r.shape({
233
+ root: r.elementType
234
+ }),
235
+ /**
236
+ * @ignore
237
+ */
238
+ style: r.object,
239
+ /**
240
+ * The system prop that allows defining system overrides as well as additional CSS styles.
241
+ */
242
+ sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object]),
243
+ /**
244
+ * The thickness of the bar.
245
+ */
246
+ thickness: r.number,
247
+ /**
248
+ * The value of the progress indicator for the determinate variant.
249
+ * Value between 0 and 100.
250
+ *
251
+ * @default determinate ? 0 : 25
252
+ */
253
+ value: r.number,
254
+ /**
255
+ * The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
256
+ * @default 'soft'
257
+ */
258
+ variant: r.oneOfType([r.oneOf(["outlined", "plain", "soft", "solid"]), r.string])
259
+ });
260
+ export {
261
+ K as default
262
+ };
@@ -0,0 +1,8 @@
1
+ import { generateUtilityClass as e, generateUtilityClasses as i } from "../className/index.js";
2
+ function o(r) {
3
+ return e("MuiLinearProgress", r);
4
+ }
5
+ i("MuiLinearProgress", ["root", "determinate", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "sizeSm", "sizeMd", "sizeLg", "variantPlain", "variantOutlined", "variantSoft", "variantSolid"]);
6
+ export {
7
+ o as getLinearProgressUtilityClass
8
+ };
package/dist/index.d.ts CHANGED
@@ -46,6 +46,7 @@ import { InputProps } from '@mui/joy';
46
46
  import { IStyledComponentBase } from 'styled-components/dist/types';
47
47
  import { JSX as JSX_2 } from 'react/jsx-runtime';
48
48
  import { LiHTMLAttributes } from 'react';
49
+ import { LinearProgressProps } from '@mui/joy';
49
50
  import { ListDivider } from '@mui/joy';
50
51
  import { ListItem } from '@mui/joy';
51
52
  import { ListItemButton } from '@mui/joy';
@@ -348,6 +349,8 @@ declare interface LayoutProps {
348
349
  footerCopyright?: string;
349
350
  }
350
351
 
352
+ export declare function LinearProgress(props: LinearProgressProps): JSX_2.Element;
353
+
351
354
  export declare function List(props: ListProps): JSX_2.Element;
352
355
 
353
356
  export { ListDivider }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harpercollins/harpercollins-design-system",
3
- "version": "1.31.0",
3
+ "version": "1.33.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@ssh.dev.azure.com:v3/HarperCollinsUK/HCDesignSystem/HCDesignSystem"