@timmbr/ui 1.11.0 → 1.13.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/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion/Accordion.js +23 -12
- package/dist/components/AuthModal/AuthModal.styles.js +1 -1
- package/dist/components/AuthModal/subcomponents/AuthModalParts.d.ts +1 -1
- package/dist/components/AuthModal/subcomponents/AuthModalParts.d.ts.map +1 -1
- package/dist/components/AuthModal/subcomponents/AuthModalParts.js +24 -42
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +10 -1
- package/dist/components/Checkbox/Checkbox.styles.js +1 -1
- package/dist/components/Checkbox/Checkbox.types.d.ts +3 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts.map +1 -1
- package/dist/components/Chip/Chip.js +1 -1
- package/dist/components/Dialog/Dialog.js +1 -1
- package/dist/components/Drawer/Drawer.js +1 -1
- package/dist/components/FilterChips/FilterChips.d.ts.map +1 -1
- package/dist/components/FilterChips/FilterChips.js +2 -9
- package/dist/components/FilterPanel/FilterPanel.d.ts.map +1 -1
- package/dist/components/FilterPanel/FilterPanel.js +9 -7
- package/dist/components/ImageUpload/subcomponents/ImageUploadThumbnailCard.js +1 -1
- package/dist/components/Inline/Inline.d.ts.map +1 -1
- package/dist/components/Inline/Inline.js +2 -1
- package/dist/components/Inline/Inline.types.d.ts +5 -0
- package/dist/components/Inline/Inline.types.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.js +2 -1
- package/dist/components/NavFooter/NavFooter.styles.js +1 -1
- package/dist/components/NavFooter/subcomponents/FooterBrand.js +1 -1
- package/dist/components/NavHeader/NavHeader.js +1 -1
- package/dist/components/NavHeader/NavHeader.styles.js +4 -4
- package/dist/components/PageProgress/PageProgress.d.ts +12 -0
- package/dist/components/PageProgress/PageProgress.d.ts.map +1 -0
- package/dist/components/PageProgress/PageProgress.js +68 -0
- package/dist/components/PageProgress/PageProgress.styles.d.ts +8 -0
- package/dist/components/PageProgress/PageProgress.styles.d.ts.map +1 -0
- package/dist/components/PageProgress/PageProgress.styles.js +32 -0
- package/dist/components/PageProgress/PageProgress.types.d.ts +18 -0
- package/dist/components/PageProgress/PageProgress.types.d.ts.map +1 -0
- package/dist/components/PageProgress/index.d.ts +3 -0
- package/dist/components/PageProgress/index.d.ts.map +1 -0
- package/dist/components/ScrollRail/ScrollRail.d.ts +4 -0
- package/dist/components/ScrollRail/ScrollRail.d.ts.map +1 -0
- package/dist/components/ScrollRail/ScrollRail.js +103 -0
- package/dist/components/ScrollRail/ScrollRail.styles.d.ts +10 -0
- package/dist/components/ScrollRail/ScrollRail.styles.d.ts.map +1 -0
- package/dist/components/ScrollRail/ScrollRail.styles.js +31 -0
- package/dist/components/ScrollRail/ScrollRail.types.d.ts +16 -0
- package/dist/components/ScrollRail/ScrollRail.types.d.ts.map +1 -0
- package/dist/components/ScrollRail/index.d.ts +4 -0
- package/dist/components/ScrollRail/index.d.ts.map +1 -0
- package/dist/components/Snackbar/Snackbar.d.ts.map +1 -1
- package/dist/components/Snackbar/Snackbar.js +6 -2
- package/dist/components/Snackbar/Snackbar.styles.d.ts +1 -0
- package/dist/components/Snackbar/Snackbar.styles.d.ts.map +1 -1
- package/dist/components/Snackbar/Snackbar.styles.js +8 -4
- package/dist/components/Snackbar/Snackbar.types.d.ts +3 -0
- package/dist/components/Snackbar/Snackbar.types.d.ts.map +1 -1
- package/dist/components/Snackbar/snackbarStore.d.ts +3 -0
- package/dist/components/Snackbar/snackbarStore.d.ts.map +1 -1
- package/dist/components/Stack/Stack.d.ts.map +1 -1
- package/dist/components/Stack/Stack.js +2 -1
- package/dist/components/Stack/Stack.types.d.ts +5 -0
- package/dist/components/Stack/Stack.types.d.ts.map +1 -1
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Switch/Switch.js +19 -2
- package/dist/components/Switch/Switch.styles.js +2 -2
- package/dist/components/Switch/Switch.types.d.ts +3 -0
- package/dist/components/Switch/Switch.types.d.ts.map +1 -1
- package/dist/components/Toast/Toast.js +2 -2
- package/dist/components/Toast/toastStore.d.ts +4 -0
- package/dist/components/Toast/toastStore.d.ts.map +1 -1
- package/dist/components/ZoneProgress/ZoneProgress.d.ts +6 -0
- package/dist/components/ZoneProgress/ZoneProgress.d.ts.map +1 -0
- package/dist/components/ZoneProgress/ZoneProgress.js +96 -0
- package/dist/components/ZoneProgress/index.d.ts +2 -0
- package/dist/components/ZoneProgress/index.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/providers/AnimationProvider.d.ts +5 -1
- package/dist/providers/AnimationProvider.d.ts.map +1 -1
- package/dist/providers/AnimationProvider.js +6 -3
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAShE,OAAO,KAAK,EAGV,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,SAAS,8JAA0B,CAAC;AAEjD,eAAO,MAAM,aAAa,iKASxB,CAAC;AAGH,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAShE,OAAO,KAAK,EAGV,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,SAAS,8JAA0B,CAAC;AAEjD,eAAO,MAAM,aAAa,iKASxB,CAAC;AAGH,eAAO,MAAM,gBAAgB,0KAsB3B,CAAC;AAGH,eAAO,MAAM,gBAAgB,8FAoB3B,CAAC"}
|
|
@@ -17,18 +17,29 @@ const AccordionItem = React.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
17
17
|
}
|
|
18
18
|
));
|
|
19
19
|
AccordionItem.displayName = "AccordionItem";
|
|
20
|
-
const AccordionTrigger = React.forwardRef(({ className, children, ...props }, ref) =>
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
const AccordionTrigger = React.forwardRef(({ className, children, ...props }, ref) => {
|
|
21
|
+
const globalMotion = useGlobalAnimation();
|
|
22
|
+
return /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
|
|
23
|
+
AccordionPrimitive.Trigger,
|
|
24
|
+
{
|
|
25
|
+
ref,
|
|
26
|
+
className: cn(accordionTriggerVariants(), className),
|
|
27
|
+
...props,
|
|
28
|
+
children: [
|
|
29
|
+
children,
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
ChevronDown,
|
|
32
|
+
{
|
|
33
|
+
className: cn(
|
|
34
|
+
"h-4 w-4 shrink-0 text-grey-500",
|
|
35
|
+
globalMotion ? "transition-transform duration-200" : "transition-none"
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
) });
|
|
42
|
+
});
|
|
32
43
|
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
33
44
|
const AccordionContent = React.forwardRef(({ className, children, motion = true, ...props }, ref) => {
|
|
34
45
|
const globalMotion = useGlobalAnimation();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cva } from 'class-variance-authority';
|
|
2
2
|
|
|
3
3
|
const authModalContainerVariants = cva(
|
|
4
|
-
"relative flex w-full max-w-[675px] bg-grey-50 overflow-hidden rounded-sm shadow-
|
|
4
|
+
"relative flex w-full max-w-[675px] bg-grey-50 overflow-hidden rounded-sm shadow-2xl flex-col sm:flex-row sm:min-h-[454px] max-h-[calc(100dvh-24px)] sm:max-h-[calc(100dvh-32px)]"
|
|
5
5
|
);
|
|
6
6
|
const authModalBannerVariants = cva(
|
|
7
7
|
"relative hidden sm:flex shrink-0 w-[320px] flex-col justify-between p-8 overflow-hidden select-none"
|
|
@@ -32,7 +32,7 @@ export declare function AuthDestination({ value, onEdit, disabled, }: {
|
|
|
32
32
|
onEdit?: () => void;
|
|
33
33
|
disabled?: boolean;
|
|
34
34
|
}): React.JSX.Element;
|
|
35
|
-
type PasswordFieldProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'type'> & {
|
|
35
|
+
type PasswordFieldProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'type' | 'size'> & {
|
|
36
36
|
id: string;
|
|
37
37
|
label: string;
|
|
38
38
|
onValueChange?: (value: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthModalParts.d.ts","sourceRoot":"","sources":["../../../../src/components/AuthModal/subcomponents/AuthModalParts.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AuthModalParts.d.ts","sourceRoot":"","sources":["../../../../src/components/AuthModal/subcomponents/AuthModalParts.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B,yEAAyE;AACzE,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,SAAS,EACT,QAAQ,GACT,EAAE;IACD,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,KAAK,IAAI,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,qBAaA;AAED,yFAAyF;AACzF,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,QAAQ,EACR,YAAoB,GACrB,EAAE;IACD,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,qBAcA;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,4BAO1F;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,qBAYA;AAED,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAQ,GACT,EAAE;IACD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,qBAWA;AAED,mFAAmF;AACnF,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,MAAM,EACN,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,qBAYA;AAED,KAAK,kBAAkB,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC,GAAG;IAC1G,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAChC,EAAE,EACF,KAAK,EACL,aAAa,EACb,OAAO,EACP,WAAW,EACX,SAAS,EACT,GAAG,UAAU,EACd,EAAE,kBAAkB,qBAcpB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs, jsx
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { cn } from '@timmbr/utils';
|
|
5
|
-
import { EyeOff, Eye } from '@timmbr/icons';
|
|
6
5
|
import { useAuthModalLabels } from '../AuthModal.labels.js';
|
|
7
|
-
import { authModalHeadingVariants, authModalSubtitleVariants,
|
|
8
|
-
import {
|
|
6
|
+
import { authModalHeadingVariants, authModalSubtitleVariants, authModalLinkVariants } from '../AuthModal.styles.js';
|
|
7
|
+
import { Button } from '../../Button/Button.js';
|
|
8
|
+
import { Input } from '../../Input/Input.js';
|
|
9
9
|
|
|
10
10
|
function AuthForm({
|
|
11
11
|
onSubmit,
|
|
@@ -49,16 +49,14 @@ function AuthSubmitButton({
|
|
|
49
49
|
children
|
|
50
50
|
}) {
|
|
51
51
|
return /* @__PURE__ */ jsx(
|
|
52
|
-
|
|
52
|
+
Button,
|
|
53
53
|
{
|
|
54
54
|
type: "submit",
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children })
|
|
61
|
-
] }) : children
|
|
55
|
+
variant: "primary",
|
|
56
|
+
fullWidth: true,
|
|
57
|
+
loading: isLoading,
|
|
58
|
+
disabled,
|
|
59
|
+
children
|
|
62
60
|
}
|
|
63
61
|
);
|
|
64
62
|
}
|
|
@@ -99,36 +97,20 @@ function AuthPasswordField({
|
|
|
99
97
|
className,
|
|
100
98
|
...inputProps
|
|
101
99
|
}) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
...inputProps
|
|
117
|
-
}
|
|
118
|
-
),
|
|
119
|
-
/* @__PURE__ */ jsx(
|
|
120
|
-
"button",
|
|
121
|
-
{
|
|
122
|
-
type: "button",
|
|
123
|
-
onClick: () => setVisible((v) => !v),
|
|
124
|
-
"aria-label": visible ? labels.hidePassword : labels.showPassword,
|
|
125
|
-
"aria-pressed": visible,
|
|
126
|
-
className: "absolute inset-y-0 right-0 flex w-12 items-center justify-center text-grey-600 hover:text-grey-950 focus:outline-none focus-visible:text-primary cursor-pointer",
|
|
127
|
-
children: visible ? /* @__PURE__ */ jsx(EyeOff, { className: "size-5", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(Eye, { className: "size-5", "aria-hidden": "true" })
|
|
128
|
-
}
|
|
129
|
-
)
|
|
130
|
-
] })
|
|
131
|
-
] });
|
|
100
|
+
return /* @__PURE__ */ jsx(
|
|
101
|
+
Input,
|
|
102
|
+
{
|
|
103
|
+
id,
|
|
104
|
+
type: "password",
|
|
105
|
+
showPasswordToggle: true,
|
|
106
|
+
"aria-label": label,
|
|
107
|
+
"aria-describedby": describedBy,
|
|
108
|
+
error: invalid,
|
|
109
|
+
containerClassName: className,
|
|
110
|
+
onChange: (e) => onValueChange?.(e.target.value),
|
|
111
|
+
...inputProps
|
|
112
|
+
}
|
|
113
|
+
);
|
|
132
114
|
}
|
|
133
115
|
|
|
134
116
|
export { AuthDestination, AuthFieldError, AuthForm, AuthPasswordField, AuthStepHeader, AuthSubmitButton, AuthTextLink };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,eAAO,MAAM,MAAM,uFAsGlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,eAAO,MAAM,QAAQ,yFA+FpB,CAAC"}
|
|
@@ -4,7 +4,9 @@ import * as React from 'react';
|
|
|
4
4
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
5
5
|
import { Check } from '@timmbr/icons';
|
|
6
6
|
import { cn } from '@timmbr/utils';
|
|
7
|
+
import { resolveMotion } from '../../types/motion.js';
|
|
7
8
|
import { checkboxIndicatorVariants, checkboxVariants } from './Checkbox.styles.js';
|
|
9
|
+
import { useGlobalAnimation } from '../../providers/AnimationProvider.js';
|
|
8
10
|
|
|
9
11
|
const Checkbox = React.forwardRef(
|
|
10
12
|
({
|
|
@@ -16,6 +18,7 @@ const Checkbox = React.forwardRef(
|
|
|
16
18
|
description,
|
|
17
19
|
error,
|
|
18
20
|
checked,
|
|
21
|
+
motion,
|
|
19
22
|
id: customId,
|
|
20
23
|
disabled,
|
|
21
24
|
...props
|
|
@@ -24,6 +27,8 @@ const Checkbox = React.forwardRef(
|
|
|
24
27
|
const id = customId || generatedId;
|
|
25
28
|
const isError = Boolean(error);
|
|
26
29
|
const errorMessage = typeof error === "string" ? error : void 0;
|
|
30
|
+
const globalMotion = useGlobalAnimation();
|
|
31
|
+
const { shouldAnimate } = resolveMotion(motion, globalMotion);
|
|
27
32
|
const checkboxElement = /* @__PURE__ */ jsx(
|
|
28
33
|
CheckboxPrimitive.Root,
|
|
29
34
|
{
|
|
@@ -31,7 +36,11 @@ const Checkbox = React.forwardRef(
|
|
|
31
36
|
id,
|
|
32
37
|
disabled,
|
|
33
38
|
...checked !== void 0 ? { checked } : {},
|
|
34
|
-
className: cn(
|
|
39
|
+
className: cn(
|
|
40
|
+
checkboxVariants({ size, isError }),
|
|
41
|
+
shouldAnimate ? "transition-all" : "transition-none",
|
|
42
|
+
!label && className
|
|
43
|
+
),
|
|
35
44
|
style: !label ? style : void 0,
|
|
36
45
|
...props,
|
|
37
46
|
children: /* @__PURE__ */ jsxs(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cva } from 'class-variance-authority';
|
|
2
2
|
|
|
3
3
|
const checkboxVariants = cva(
|
|
4
|
-
"peer shrink-0 rounded-[2px] border border-grey-300 dark:border-grey-600 bg-grey-50 dark:bg-grey-900
|
|
4
|
+
"peer shrink-0 rounded-[2px] border border-grey-300 dark:border-grey-600 bg-grey-50 dark:bg-grey-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=checked]:text-grey-50 data-[state=indeterminate]:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:text-grey-50 cursor-pointer flex items-center justify-center",
|
|
5
5
|
{
|
|
6
6
|
variants: {
|
|
7
7
|
size: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type * as React from 'react';
|
|
2
2
|
import type * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
3
3
|
import type { CheckboxVariants } from './Checkbox.styles';
|
|
4
|
+
import type { MotionProp } from '../../types/motion';
|
|
4
5
|
export interface CheckboxProps extends Omit<React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, 'size'>, CheckboxVariants {
|
|
5
6
|
/**
|
|
6
7
|
* Primary label text displayed next to the checkbox.
|
|
@@ -18,5 +19,7 @@ export interface CheckboxProps extends Omit<React.ComponentPropsWithoutRef<typeo
|
|
|
18
19
|
* Custom className for the outer container wrapper.
|
|
19
20
|
*/
|
|
20
21
|
containerClassName?: string;
|
|
22
|
+
/** Override animation behaviour. `false` disables transitions; omit to inherit global setting. */
|
|
23
|
+
motion?: MotionProp;
|
|
21
24
|
}
|
|
22
25
|
//# sourceMappingURL=Checkbox.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.types.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"Checkbox.types.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,aACf,SAAQ,IAAI,CACR,KAAK,CAAC,wBAAwB,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,EAC7D,MAAM,CACP,EACD,gBAAgB;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kGAAkG;IAClG,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB"}
|
|
@@ -70,7 +70,7 @@ const Chip = React.forwardRef(
|
|
|
70
70
|
tabIndex: isInteractive ? -1 : void 0,
|
|
71
71
|
onClick: handleRemove,
|
|
72
72
|
"aria-label": removeLabel,
|
|
73
|
-
className: "shrink-0 -mr-1
|
|
73
|
+
className: "shrink-0 -mr-1 min-w-[28px] min-h-[28px] rounded-full inline-flex items-center justify-center opacity-70 hover:opacity-100 hover:bg-grey-1000/10 dark:hover:bg-grey-50/20 transition-all cursor-pointer focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
74
74
|
children: /* @__PURE__ */ jsx(X, { className: "size-3" })
|
|
75
75
|
}
|
|
76
76
|
)
|
|
@@ -45,7 +45,7 @@ const DialogContent = React.forwardRef(({ className, children, motion, ...props
|
|
|
45
45
|
DialogPrimitive.Close,
|
|
46
46
|
{
|
|
47
47
|
"data-slot": "dialog-close",
|
|
48
|
-
className: "absolute right-
|
|
48
|
+
className: "absolute right-3 top-3 z-20 flex items-center justify-center min-w-[44px] min-h-[44px] rounded-sm text-muted hover:text-foreground opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus-visible:ring-2 focus-visible:ring-primary cursor-pointer",
|
|
49
49
|
children: [
|
|
50
50
|
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
51
51
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
@@ -53,7 +53,7 @@ const DrawerContent = React.forwardRef(({ className, children, side = "right", s
|
|
|
53
53
|
DialogPrimitive.Close,
|
|
54
54
|
{
|
|
55
55
|
"data-slot": "drawer-close",
|
|
56
|
-
className: "absolute right-
|
|
56
|
+
className: "absolute right-3 top-3 flex items-center justify-center min-w-[44px] min-h-[44px] rounded-sm text-muted hover:text-foreground opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus-visible:ring-2 focus-visible:ring-primary cursor-pointer",
|
|
57
57
|
children: [
|
|
58
58
|
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
59
59
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterChips.d.ts","sourceRoot":"","sources":["../../../src/components/FilterChips/FilterChips.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FilterChips.d.ts","sourceRoot":"","sources":["../../../src/components/FilterChips/FilterChips.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAExE;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,EAAE,EAC7D,KAAK,EACL,QAAQ,EACR,UAAU,EACV,aAA2B,EAC3B,WAA0C,EAC1C,SAAS,GACV,EAAE,gBAAgB,CAAC,CAAC,CAAC,4BA0BrB"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { cn } from '@timmbr/utils';
|
|
4
4
|
import { Chip } from '../Chip/Chip.js';
|
|
5
|
+
import { Button } from '../Button/Button.js';
|
|
5
6
|
|
|
6
7
|
function FilterChips({
|
|
7
8
|
chips,
|
|
@@ -22,15 +23,7 @@ function FilterChips({
|
|
|
22
23
|
),
|
|
23
24
|
children: [
|
|
24
25
|
/* @__PURE__ */ jsx("ul", { className: "flex shrink-0 items-center gap-2 sm:flex-wrap", children: chips.map((chip) => /* @__PURE__ */ jsx("li", { className: "shrink-0", children: /* @__PURE__ */ jsx(Chip, { color: "primary", onRemove: () => onRemove(chip), removeLabel: removeLabel(String(chip.label)), children: chip.label }) }, chip.id)) }),
|
|
25
|
-
onClearAll && chips.length > 1 && /* @__PURE__ */ jsx(
|
|
26
|
-
"button",
|
|
27
|
-
{
|
|
28
|
-
type: "button",
|
|
29
|
-
onClick: onClearAll,
|
|
30
|
-
className: "shrink-0 rounded-sm px-1 font-sans text-body-3 font-semibold text-primary underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
31
|
-
children: clearAllLabel
|
|
32
|
-
}
|
|
33
|
-
)
|
|
26
|
+
onClearAll && chips.length > 1 && /* @__PURE__ */ jsx(Button, { variant: "link", size: "sm", className: "shrink-0", onClick: onClearAll, children: clearAllLabel })
|
|
34
27
|
]
|
|
35
28
|
}
|
|
36
29
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterPanel.d.ts","sourceRoot":"","sources":["../../../src/components/FilterPanel/FilterPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAsB/B,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACvB,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,qBAAqB,EAAE,iBAYnC,CAAC;AAEF,iGAAiG;AACjG,eAAO,MAAM,gBAAgB,GAAI,QAAQ,YAAY,YAAgE,CAAC;AActH;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,QAAQ,EACR,KAAS,EACT,eAAoB,EACpB,MAAM,EAAE,cAAc,EACtB,SAAS,GACV,EAAE,qBAAqB,qBA2DvB;AAED,uDAAuD;AACvD,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD,4BAmBA;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,MAAM,EAAE,cAAc,EACtB,aAAa,EACb,WAAkB,GACnB,EAAE;IACD,KAAK,EAAE,iBAAiB,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACpC,kFAAkF;IAClF,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,qBAkCA;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"FilterPanel.d.ts","sourceRoot":"","sources":["../../../src/components/FilterPanel/FilterPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAsB/B,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACvB,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,qBAAqB,EAAE,iBAYnC,CAAC;AAEF,iGAAiG;AACjG,eAAO,MAAM,gBAAgB,GAAI,QAAQ,YAAY,YAAgE,CAAC;AActH;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,QAAQ,EACR,KAAS,EACT,eAAoB,EACpB,MAAM,EAAE,cAAc,EACtB,SAAS,GACV,EAAE,qBAAqB,qBA2DvB;AAED,uDAAuD;AACvD,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD,4BAmBA;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,MAAM,EAAE,cAAc,EACtB,aAAa,EACb,WAAkB,GACnB,EAAE;IACD,KAAK,EAAE,iBAAiB,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACpC,kFAAkF;IAClF,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,qBAkCA;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,yFA4FvB,CAAC"}
|
|
@@ -3,10 +3,11 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { Search } from '@timmbr/icons';
|
|
5
5
|
import { cn } from '@timmbr/utils';
|
|
6
|
-
import { filterOptionRowVariants,
|
|
6
|
+
import { filterOptionRowVariants, filterPanelTitleVariants, filterPanelHeaderVariants, filterToggleListVariants, filterSectionTriggerVariants, filterSectionContentVariants, filterPanelBodyVariants, filterPanelVariants, filterOptionCountVariants, filterOptionLabelVariants } from './FilterPanel.styles.js';
|
|
7
7
|
import { PRICE_GROUP_KEY } from './FilterPanel.types.js';
|
|
8
8
|
import { Input } from '../Input/Input.js';
|
|
9
9
|
import { Checkbox } from '../Checkbox/Checkbox.js';
|
|
10
|
+
import { Button } from '../Button/Button.js';
|
|
10
11
|
import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from '../Accordion/Accordion.js';
|
|
11
12
|
import { RangeSlider } from '../RangeSlider/RangeSlider.js';
|
|
12
13
|
import { Switch } from '../Switch/Switch.js';
|
|
@@ -88,10 +89,10 @@ function FilterOptionList({
|
|
|
88
89
|
visible.length === 0 && /* @__PURE__ */ jsx("li", { className: "text-body-3 text-grey-500", children: labels.noMatches })
|
|
89
90
|
] }),
|
|
90
91
|
!needle && (hidden > 0 || expanded) && matching.length > limit && /* @__PURE__ */ jsx(
|
|
91
|
-
|
|
92
|
+
Button,
|
|
92
93
|
{
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
variant: "link",
|
|
95
|
+
size: "sm",
|
|
95
96
|
"aria-expanded": expanded,
|
|
96
97
|
onClick: () => setExpanded((e) => !e),
|
|
97
98
|
children: expanded ? labels.showLess : labels.showMore(hidden)
|
|
@@ -208,10 +209,11 @@ const FilterPanel = React.forwardRef(
|
|
|
208
209
|
] }) }),
|
|
209
210
|
/* @__PURE__ */ jsxs(AccordionContent, { className: filterSectionContentVariants(), children: [
|
|
210
211
|
count > 0 && onClearGroup && /* @__PURE__ */ jsx(
|
|
211
|
-
|
|
212
|
+
Button,
|
|
212
213
|
{
|
|
213
|
-
|
|
214
|
-
|
|
214
|
+
variant: "link",
|
|
215
|
+
size: "sm",
|
|
216
|
+
className: "mb-3",
|
|
215
217
|
onClick: () => onClearGroup(group.key),
|
|
216
218
|
children: labels.clear
|
|
217
219
|
}
|
|
@@ -51,7 +51,7 @@ const ImageUploadThumbnailCard = ({
|
|
|
51
51
|
}
|
|
52
52
|
),
|
|
53
53
|
/* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1.5 pointer-events-none", children: index === 0 ? /* @__PURE__ */ jsxs("div", { className: "bg-grey-1000/65 backdrop-blur-md text-grey-50 text-caption font-semibold px-2 py-0.5 rounded-full border border-grey-50/20 shadow-md flex items-center gap-1.5", children: [
|
|
54
|
-
/* @__PURE__ */ jsx("span", { className: "size-1.5 rounded-full bg-success shadow-[
|
|
54
|
+
/* @__PURE__ */ jsx("span", { className: "size-1.5 rounded-full bg-success shadow-[0_0_6px_color-mix(in_srgb,var(--color-success)_80%,transparent)]" }),
|
|
55
55
|
/* @__PURE__ */ jsx("span", { children: "Cover" })
|
|
56
56
|
] }) : /* @__PURE__ */ jsxs("div", { className: "bg-grey-1000/55 backdrop-blur-md text-grey-50/90 text-caption font-medium px-2 py-0.5 rounded-full border border-grey-50/10 shadow-sm", children: [
|
|
57
57
|
"#",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Inline.d.ts","sourceRoot":"","sources":["../../../src/components/Inline/Inline.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"Inline.d.ts","sourceRoot":"","sources":["../../../src/components/Inline/Inline.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,eAAO,MAAM,MAAM,oFAqDlB,CAAC"}
|
|
@@ -17,11 +17,12 @@ const Inline = React.forwardRef(
|
|
|
17
17
|
justify = "start",
|
|
18
18
|
wrap = true,
|
|
19
19
|
divider,
|
|
20
|
+
as,
|
|
20
21
|
asChild = false,
|
|
21
22
|
children,
|
|
22
23
|
...props
|
|
23
24
|
}, ref) => {
|
|
24
|
-
const Component = asChild ? Slot : "div";
|
|
25
|
+
const Component = asChild ? Slot : as ?? "div";
|
|
25
26
|
const gapClass = formatGap(gap);
|
|
26
27
|
const renderChildren = () => {
|
|
27
28
|
if (!divider) return children;
|
|
@@ -14,6 +14,11 @@ export interface InlineProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
14
14
|
* Optional divider element rendered between each inline child.
|
|
15
15
|
*/
|
|
16
16
|
divider?: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Renders as a different HTML element or component while keeping Inline styles.
|
|
19
|
+
* e.g. `as="nav"`, `as="footer"`. Ignored when `asChild` is true.
|
|
20
|
+
*/
|
|
21
|
+
as?: React.ElementType;
|
|
17
22
|
/**
|
|
18
23
|
* If true, renders child element via Radix Slot.
|
|
19
24
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Inline.types.d.ts","sourceRoot":"","sources":["../../../src/components/Inline/Inline.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC,EACvD,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC;IAC7B;;OAEG;IACH,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,8DAA8D;IAC9D,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,kEAAkE;IAClE,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
1
|
+
{"version":3,"file":"Inline.types.d.ts","sourceRoot":"","sources":["../../../src/components/Inline/Inline.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC,EACvD,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC;IAC7B;;OAEG;IACH,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,8DAA8D;IAC9D,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,kEAAkE;IAClE,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,eAAO,MAAM,KAAK,qFAqNjB,CAAC"}
|
|
@@ -112,7 +112,8 @@ const Input = React.forwardRef(
|
|
|
112
112
|
{
|
|
113
113
|
htmlFor: id,
|
|
114
114
|
className: cn(
|
|
115
|
-
"absolute pointer-events-none
|
|
115
|
+
"absolute pointer-events-none select-none truncate max-w-full z-10",
|
|
116
|
+
shouldAnimate ? "transition-all duration-200" : "transition-none",
|
|
116
117
|
isFloatingActive ? "-top-2.5 left-0 px-1 bg-grey-50 dark:bg-grey-900 text-caption-lg font-semibold leading-none rounded-xs" : "top-1/2 -translate-y-1/2 left-0 text-body-2 text-muted-foreground leading-none"
|
|
117
118
|
),
|
|
118
119
|
style: {
|
|
@@ -6,7 +6,7 @@ const navFooterRootVariants = cva(
|
|
|
6
6
|
variants: {
|
|
7
7
|
tone: {
|
|
8
8
|
dark: "bg-surface-dark text-bg-2",
|
|
9
|
-
light: "bg-
|
|
9
|
+
light: "bg-bg-2 text-grey-800 border-t border-border-warm"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
defaultVariants: {
|
|
@@ -504,7 +504,7 @@ const NavHeader = React.forwardRef(
|
|
|
504
504
|
]
|
|
505
505
|
}
|
|
506
506
|
),
|
|
507
|
-
isSearchVisible && resolvedMobileSearchMode !== "icon" && /* @__PURE__ */ jsx("div", { className: "px-3 sm:px-6 pb-2.5 pt-0.5 bg-
|
|
507
|
+
isSearchVisible && resolvedMobileSearchMode !== "icon" && /* @__PURE__ */ jsx("div", { className: "px-3 sm:px-6 pb-2.5 pt-0.5 bg-bg-2", children: /* @__PURE__ */ jsxs(
|
|
508
508
|
"button",
|
|
509
509
|
{
|
|
510
510
|
type: "button",
|
|
@@ -4,11 +4,11 @@ const offerBannerVariants = cva(
|
|
|
4
4
|
"w-full bg-surface-dark text-bg-2 font-title! text-body-3 font-semibold uppercase tracking-[0.14em] py-2 px-4 flex items-center justify-center relative transition-all duration-200 z-50 border-b border-grey-1000/20"
|
|
5
5
|
);
|
|
6
6
|
const navHeaderVariants = cva(
|
|
7
|
-
"w-full bg-
|
|
7
|
+
"w-full bg-bg-2 text-grey-800 border-b border-border-warm relative z-40 transition-colors",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
sticky: {
|
|
11
|
-
true: "sticky top-0 shadow-sm backdrop-blur-md bg-
|
|
11
|
+
true: "sticky top-0 shadow-sm backdrop-blur-md bg-bg-2/95",
|
|
12
12
|
false: "relative"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
@@ -110,7 +110,7 @@ const actionOverflowItemVariants = cva(
|
|
|
110
110
|
}
|
|
111
111
|
);
|
|
112
112
|
const mobileTabSliderVariants = cva(
|
|
113
|
-
"w-full overflow-x-auto flex items-center gap-6 px-4 py-2 border-b border-border-warm bg-
|
|
113
|
+
"w-full overflow-x-auto flex items-center gap-6 px-4 py-2 border-b border-border-warm bg-bg-2 select-none scroll-smooth [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]"
|
|
114
114
|
);
|
|
115
115
|
const mobileTabItemVariants = cva(
|
|
116
116
|
"relative text-body-3 sm:text-body-2 tracking-tight whitespace-nowrap py-1.5 px-1 font-semibold transition-colors cursor-pointer select-none",
|
|
@@ -135,7 +135,7 @@ const mobileTabContentPanelVariants = cva(
|
|
|
135
135
|
"w-full bg-grey-50 border-b border-border-warm shadow-md overflow-hidden"
|
|
136
136
|
);
|
|
137
137
|
const mobileSearchDrawerVariants = cva(
|
|
138
|
-
"fixed inset-0 z-[9999] h-[100dvh] w-screen bg-
|
|
138
|
+
"fixed inset-0 z-[9999] h-[100dvh] w-screen bg-bg-2 flex flex-col overflow-hidden"
|
|
139
139
|
);
|
|
140
140
|
|
|
141
141
|
export { actionOverflowItemVariants, actionOverflowPopoverVariants, megaMenuCardVariants, mobileSearchDrawerVariants, mobileTabContentPanelVariants, mobileTabItemVariants, mobileTabSliderVariants, navActionVariants, navHeaderContainerVariants, navHeaderItemVariants, navHeaderVariants, offerBannerVariants, searchPanelOptionVariants, searchPanelSectionTitleVariants, searchPanelTextButtonVariants, searchPopoverCardVariants };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PageProgressProps } from './PageProgress.types';
|
|
3
|
+
/**
|
|
4
|
+
* NProgress-style slim line fixed at the very top of the viewport. Mount it (or set
|
|
5
|
+
* `loading={true}`) to show; unmount (or `loading={false}`) to fade out.
|
|
6
|
+
*
|
|
7
|
+
* Indeterminate mode (no `progress`): the bar sweeps left-to-right continuously until
|
|
8
|
+
* loading ends, matching the Progress component's indeterminate style.
|
|
9
|
+
* Determinate mode (`progress` 0–100): bar grows to the given percentage.
|
|
10
|
+
*/
|
|
11
|
+
export declare const PageProgress: React.ForwardRefExoticComponent<PageProgressProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
//# sourceMappingURL=PageProgress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageProgress.d.ts","sourceRoot":"","sources":["../../../src/components/PageProgress/PageProgress.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,0FA0DxB,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cn } from '@timmbr/utils';
|
|
5
|
+
import { resolveMotion } from '../../types/motion.js';
|
|
6
|
+
import { pageProgressBarVariants, pageProgressVariants } from './PageProgress.styles.js';
|
|
7
|
+
import { useGlobalAnimation } from '../../providers/AnimationProvider.js';
|
|
8
|
+
|
|
9
|
+
const PageProgress = React.forwardRef(
|
|
10
|
+
({ loading = true, progress, height = 3, zIndex = 9999, color = "bg-primary", motion }, ref) => {
|
|
11
|
+
const globalMotion = useGlobalAnimation();
|
|
12
|
+
const { shouldAnimate } = resolveMotion(motion, globalMotion);
|
|
13
|
+
const isIndeterminate = progress === void 0;
|
|
14
|
+
const safeProgress = isIndeterminate ? void 0 : Math.min(Math.max(progress, 0), 100);
|
|
15
|
+
const [visible, setVisible] = React.useState(loading);
|
|
16
|
+
const [fading, setFading] = React.useState(false);
|
|
17
|
+
React.useEffect(() => {
|
|
18
|
+
if (loading) {
|
|
19
|
+
setVisible(true);
|
|
20
|
+
setFading(false);
|
|
21
|
+
} else if (visible) {
|
|
22
|
+
if (!shouldAnimate) {
|
|
23
|
+
setVisible(false);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
setFading(true);
|
|
27
|
+
const t = setTimeout(() => {
|
|
28
|
+
setVisible(false);
|
|
29
|
+
setFading(false);
|
|
30
|
+
}, 350);
|
|
31
|
+
return () => clearTimeout(t);
|
|
32
|
+
}
|
|
33
|
+
}, [loading, shouldAnimate]);
|
|
34
|
+
if (!visible) return null;
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
ref,
|
|
39
|
+
role: "progressbar",
|
|
40
|
+
"aria-valuemin": 0,
|
|
41
|
+
"aria-valuemax": 100,
|
|
42
|
+
"aria-valuenow": safeProgress,
|
|
43
|
+
"aria-label": "Page loading",
|
|
44
|
+
"data-slot": "page-progress",
|
|
45
|
+
style: { height, zIndex },
|
|
46
|
+
className: pageProgressVariants({ fading: fading && shouldAnimate }),
|
|
47
|
+
children: /* @__PURE__ */ jsx(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
"data-slot": "page-progress-bar",
|
|
51
|
+
className: cn(
|
|
52
|
+
pageProgressBarVariants({
|
|
53
|
+
indeterminate: isIndeterminate && !fading,
|
|
54
|
+
animated: shouldAnimate
|
|
55
|
+
}),
|
|
56
|
+
color,
|
|
57
|
+
!isIndeterminate && shouldAnimate && "transition-[width] duration-300 ease-out"
|
|
58
|
+
),
|
|
59
|
+
style: isIndeterminate ? void 0 : { width: `${safeProgress}%` }
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
PageProgress.displayName = "PageProgress";
|
|
67
|
+
|
|
68
|
+
export { PageProgress };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const pageProgressVariants: (props?: ({
|
|
2
|
+
fading?: boolean | null | undefined;
|
|
3
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
4
|
+
export declare const pageProgressBarVariants: (props?: ({
|
|
5
|
+
indeterminate?: boolean | null | undefined;
|
|
6
|
+
animated?: boolean | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
//# sourceMappingURL=PageProgress.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageProgress.styles.d.ts","sourceRoot":"","sources":["../../../src/components/PageProgress/PageProgress.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB;;8EAWhC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;8EAenC,CAAC"}
|