@timmbr/ui 1.4.1 → 1.5.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.js +1 -1
- package/dist/components/Accordion/Accordion.styles.d.ts.map +1 -1
- package/dist/components/Accordion/Accordion.styles.js +3 -3
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/Alert/Alert.styles.js +4 -4
- package/dist/components/AlertDialog/AlertDialog.styles.js +4 -4
- package/dist/components/AuthModal/AuthModal.d.ts +4 -0
- package/dist/components/AuthModal/AuthModal.d.ts.map +1 -0
- package/dist/components/AuthModal/AuthModal.js +89 -0
- package/dist/components/AuthModal/AuthModal.labels.d.ts +6 -0
- package/dist/components/AuthModal/AuthModal.labels.d.ts.map +1 -0
- package/dist/components/AuthModal/AuthModal.labels.js +52 -0
- package/dist/components/AuthModal/AuthModal.styles.d.ts +12 -0
- package/dist/components/AuthModal/AuthModal.styles.d.ts.map +1 -0
- package/dist/components/AuthModal/AuthModal.styles.js +38 -0
- package/dist/components/AuthModal/AuthModal.types.d.ts +158 -0
- package/dist/components/AuthModal/AuthModal.types.d.ts.map +1 -0
- package/dist/components/AuthModal/index.d.ts +6 -0
- package/dist/components/AuthModal/index.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/AuthModalBanner.d.ts +11 -0
- package/dist/components/AuthModal/subcomponents/AuthModalBanner.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/AuthModalBanner.js +58 -0
- package/dist/components/AuthModal/subcomponents/AuthModalIdentifierForm.d.ts +11 -0
- package/dist/components/AuthModal/subcomponents/AuthModalIdentifierForm.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/AuthModalIdentifierForm.js +62 -0
- package/dist/components/AuthModal/subcomponents/AuthModalOAuth.d.ts +11 -0
- package/dist/components/AuthModal/subcomponents/AuthModalOAuth.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/AuthModalOAuth.js +19 -0
- package/dist/components/AuthModal/subcomponents/AuthModalOtpForm.d.ts +10 -0
- package/dist/components/AuthModal/subcomponents/AuthModalOtpForm.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/AuthModalOtpForm.js +62 -0
- package/dist/components/AuthModal/subcomponents/AuthModalParts.d.ts +44 -0
- package/dist/components/AuthModal/subcomponents/AuthModalParts.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/AuthModalParts.js +134 -0
- package/dist/components/AuthModal/subcomponents/AuthModalPasswordForm.d.ts +10 -0
- package/dist/components/AuthModal/subcomponents/AuthModalPasswordForm.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/AuthModalPasswordForm.js +54 -0
- package/dist/components/AuthModal/subcomponents/AuthModalSetPasswordForm.d.ts +10 -0
- package/dist/components/AuthModal/subcomponents/AuthModalSetPasswordForm.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/AuthModalSetPasswordForm.js +79 -0
- package/dist/components/AuthModal/subcomponents/AuthModalSuccess.d.ts +10 -0
- package/dist/components/AuthModal/subcomponents/AuthModalSuccess.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/AuthModalSuccess.js +26 -0
- package/dist/components/AuthModal/subcomponents/OAuthButton.d.ts +12 -0
- package/dist/components/AuthModal/subcomponents/OAuthButton.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/OAuthButton.js +38 -0
- package/dist/components/AuthModal/subcomponents/index.d.ts +9 -0
- package/dist/components/AuthModal/subcomponents/index.d.ts.map +1 -0
- package/dist/components/Avatar/Avatar.styles.js +11 -11
- package/dist/components/Badge/Badge.styles.js +8 -8
- package/dist/components/Button/Button.styles.js +7 -7
- package/dist/components/Card/Card.styles.d.ts.map +1 -1
- package/dist/components/Card/Card.styles.js +5 -5
- package/dist/components/Checkbox/Checkbox.js +4 -4
- package/dist/components/Checkbox/Checkbox.styles.js +1 -1
- package/dist/components/Chip/Chip.js +1 -1
- package/dist/components/Chip/Chip.styles.js +5 -5
- package/dist/components/DataList/DataList.styles.js +3 -3
- package/dist/components/Dialog/Dialog.styles.js +6 -6
- package/dist/components/Divider/Divider.js +1 -1
- package/dist/components/Drawer/Drawer.styles.js +2 -2
- package/dist/components/Dropdown/Dropdown.js +2 -2
- package/dist/components/Dropdown/Dropdown.styles.js +2 -2
- package/dist/components/EmptyState/EmptyState.js +2 -2
- package/dist/components/EmptyState/EmptyState.styles.js +3 -3
- package/dist/components/FormField/FormField.js +1 -1
- package/dist/components/Heading/Heading.styles.d.ts.map +1 -1
- package/dist/components/Heading/Heading.styles.js +12 -10
- package/dist/components/Icon/Icon.styles.js +6 -6
- package/dist/components/ImageUpload/ImageUpload.js +6 -6
- package/dist/components/ImageUpload/subcomponents/ImageUploadDropzone.js +10 -10
- package/dist/components/ImageUpload/subcomponents/ImageUploadModal.js +8 -8
- package/dist/components/ImageUpload/subcomponents/ImageUploadSinglePreview.js +7 -7
- package/dist/components/ImageUpload/subcomponents/ImageUploadThumbnailCard.js +10 -10
- package/dist/components/Input/Input.js +4 -4
- package/dist/components/Input/Input.styles.js +6 -6
- package/dist/components/Label/Label.styles.js +4 -4
- package/dist/components/LinkButton/LinkButton.styles.js +6 -6
- package/dist/components/List/List.js +1 -1
- package/dist/components/List/List.styles.js +3 -3
- package/dist/components/NavFooter/NavFooter.styles.js +9 -9
- package/dist/components/NavFooter/subcomponents/FooterBrand.js +3 -3
- package/dist/components/NavFooter/subcomponents/FooterLegalBar.js +1 -1
- package/dist/components/NavFooter/subcomponents/FooterNavSection.js +4 -4
- package/dist/components/NavFooter/subcomponents/FooterNewsletter.js +7 -7
- package/dist/components/NavFooter/subcomponents/FooterOffice.js +5 -5
- package/dist/components/NavFooter/subcomponents/FooterSocial.js +3 -3
- package/dist/components/NavHeader/NavHeader.d.ts.map +1 -1
- package/dist/components/NavHeader/NavHeader.js +11 -3
- package/dist/components/NavHeader/NavHeader.styles.js +16 -16
- package/dist/components/NavHeader/NavHeader.types.d.ts +19 -0
- package/dist/components/NavHeader/NavHeader.types.d.ts.map +1 -1
- package/dist/components/NavHeader/subcomponents/NavActionLabelSkeleton.d.ts +4 -0
- package/dist/components/NavHeader/subcomponents/NavActionLabelSkeleton.d.ts.map +1 -0
- package/dist/components/NavHeader/subcomponents/NavActionLabelSkeleton.js +16 -0
- package/dist/components/NavHeader/subcomponents/NavActionOverflow.d.ts.map +1 -1
- package/dist/components/NavHeader/subcomponents/NavActionOverflow.js +6 -5
- package/dist/components/NavHeader/subcomponents/NavActions.d.ts +9 -0
- package/dist/components/NavHeader/subcomponents/NavActions.d.ts.map +1 -1
- package/dist/components/NavHeader/subcomponents/NavActions.js +51 -15
- package/dist/components/NavHeader/subcomponents/NavBrand.d.ts.map +1 -1
- package/dist/components/NavHeader/subcomponents/NavBrand.js +14 -15
- package/dist/components/NavHeader/subcomponents/NavItems.js +3 -3
- package/dist/components/NavHeader/subcomponents/NavItemsOverflow.js +7 -7
- package/dist/components/NavHeader/subcomponents/NavMobileSearchDrawer.js +5 -5
- package/dist/components/NavHeader/subcomponents/NavMobileTabSlider.js +2 -2
- package/dist/components/NavHeader/subcomponents/NavSearch.js +5 -5
- package/dist/components/NavHeader/subcomponents/OfferBanner.js +1 -1
- package/dist/components/OtpInput/OtpInput.d.ts +4 -0
- package/dist/components/OtpInput/OtpInput.d.ts.map +1 -0
- package/dist/components/OtpInput/OtpInput.js +114 -0
- package/dist/components/OtpInput/OtpInput.styles.d.ts +10 -0
- package/dist/components/OtpInput/OtpInput.styles.d.ts.map +1 -0
- package/dist/components/OtpInput/OtpInput.styles.js +49 -0
- package/dist/components/OtpInput/OtpInput.types.d.ts +40 -0
- package/dist/components/OtpInput/OtpInput.types.d.ts.map +1 -0
- package/dist/components/OtpInput/index.d.ts +4 -0
- package/dist/components/OtpInput/index.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.styles.js +3 -3
- package/dist/components/Popover/Popover.styles.js +1 -1
- package/dist/components/Progress/Progress.js +2 -2
- package/dist/components/Radio/Radio.js +4 -4
- package/dist/components/Radio/Radio.styles.js +1 -1
- package/dist/components/RangeSlider/RangeSlider.js +3 -3
- package/dist/components/RangeSlider/RangeSlider.styles.js +1 -1
- package/dist/components/Select/Select.js +2 -2
- package/dist/components/Select/Select.styles.js +8 -8
- package/dist/components/SideBarNavigation/SideBarNavigation.styles.js +8 -8
- package/dist/components/SideBarNavigation/subcomponents/SidebarBranding.js +3 -3
- package/dist/components/SideBarNavigation/subcomponents/SidebarFooter.js +1 -1
- package/dist/components/SideBarNavigation/subcomponents/SidebarPopoverMenu.js +4 -4
- package/dist/components/SideBarNavigation/subcomponents/SidebarProfile.js +9 -9
- package/dist/components/SideBarNavigation/subcomponents/SidebarSubItem.js +2 -2
- package/dist/components/Skeleton/Skeleton.styles.js +1 -1
- package/dist/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner/Spinner.js +9 -7
- package/dist/components/Spinner/Spinner.styles.d.ts +8 -2
- package/dist/components/Spinner/Spinner.styles.d.ts.map +1 -1
- package/dist/components/Spinner/Spinner.styles.js +27 -24
- package/dist/components/Spinner/Spinner.types.d.ts +9 -0
- package/dist/components/Spinner/Spinner.types.d.ts.map +1 -1
- package/dist/components/Stat/Stat.styles.js +4 -4
- package/dist/components/Switch/Switch.js +2 -2
- package/dist/components/Switch/Switch.styles.js +1 -1
- package/dist/components/Table/Table.js +1 -1
- package/dist/components/Table/Table.styles.js +5 -5
- package/dist/components/Table/TablePagination.js +4 -4
- package/dist/components/Tabs/Tabs.js +2 -2
- package/dist/components/Tabs/Tabs.styles.js +8 -8
- package/dist/components/Text/Text.d.ts.map +1 -1
- package/dist/components/Text/Text.js +2 -0
- package/dist/components/Text/Text.styles.d.ts +1 -0
- package/dist/components/Text/Text.styles.d.ts.map +1 -1
- package/dist/components/Text/Text.styles.js +21 -13
- package/dist/components/Text/Text.types.d.ts +5 -0
- package/dist/components/Text/Text.types.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.js +4 -4
- package/dist/components/Textarea/Textarea.styles.js +6 -6
- package/dist/components/Toast/Toast.js +3 -3
- package/dist/components/Toast/Toast.styles.js +5 -5
- package/dist/components/Toast/ToastContainer.js +1 -1
- package/dist/components/Tooltip/Tooltip.styles.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -1
- package/package.json +7 -6
- package/dist/components/CrossZoneLink/CrossZoneLink.d.ts +0 -10
- package/dist/components/CrossZoneLink/CrossZoneLink.d.ts.map +0 -1
- package/dist/components/CrossZoneLink/CrossZoneLink.js +0 -111
- package/dist/components/CrossZoneLink/CrossZoneLink.styles.d.ts +0 -8
- package/dist/components/CrossZoneLink/CrossZoneLink.styles.d.ts.map +0 -1
- package/dist/components/CrossZoneLink/CrossZoneLink.styles.js +0 -33
- package/dist/components/CrossZoneLink/CrossZoneLink.types.d.ts +0 -31
- package/dist/components/CrossZoneLink/CrossZoneLink.types.d.ts.map +0 -1
- package/dist/components/CrossZoneLink/index.d.ts +0 -4
- package/dist/components/CrossZoneLink/index.d.ts.map +0 -1
|
@@ -100,7 +100,7 @@ const NavSearch = ({
|
|
|
100
100
|
"data-slot": "nav-search-trigger",
|
|
101
101
|
children: [
|
|
102
102
|
/* @__PURE__ */ jsx(Search, { size: 22, className: "shrink-0 stroke-[1.8]" }),
|
|
103
|
-
/* @__PURE__ */ jsx("span", { className: "font-
|
|
103
|
+
/* @__PURE__ */ jsx("span", { className: "font-bold text-caption tracking-[0.0926em] uppercase", children: "SEARCH" })
|
|
104
104
|
]
|
|
105
105
|
}
|
|
106
106
|
),
|
|
@@ -113,7 +113,7 @@ const NavSearch = ({
|
|
|
113
113
|
transition: { duration: 0.28, ease: [0.25, 1, 0.5, 1] },
|
|
114
114
|
className: cn("relative flex flex-col", !shouldAnimate && "transition-none", motionClass),
|
|
115
115
|
children: [
|
|
116
|
-
/* @__PURE__ */ jsxs("div", { className: "relative flex items-center w-full h-10 bg-
|
|
116
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex items-center w-full h-10 bg-grey-50 border border-grey-300 rounded-full shadow-sm focus-within:ring-2 focus-within:ring-primary/30 focus-within:border-primary overflow-hidden", children: [
|
|
117
117
|
/* @__PURE__ */ jsx(
|
|
118
118
|
Search,
|
|
119
119
|
{
|
|
@@ -134,7 +134,7 @@ const NavSearch = ({
|
|
|
134
134
|
onChange: (e) => onChange(e.target.value),
|
|
135
135
|
onFocus: () => setShowPopover(true),
|
|
136
136
|
onKeyDown: handleKeyDown,
|
|
137
|
-
className: "w-full h-full pl-10 pr-9 bg-transparent text-
|
|
137
|
+
className: "w-full h-full pl-10 pr-9 bg-transparent text-body-2 text-grey-950 placeholder:text-grey-400 border-none focus:outline-none [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden",
|
|
138
138
|
"data-slot": "nav-search-input"
|
|
139
139
|
}
|
|
140
140
|
),
|
|
@@ -165,7 +165,7 @@ const NavSearch = ({
|
|
|
165
165
|
className: cn(searchPopoverCardVariants(), !shouldAnimate && "transition-none", motionClass),
|
|
166
166
|
"data-slot": "nav-search-popover",
|
|
167
167
|
children: popoverContent ? popoverContent : /* @__PURE__ */ jsxs("div", { children: [
|
|
168
|
-
popularSearchesTitle && /* @__PURE__ */ jsx("h4", { className: "font-
|
|
168
|
+
popularSearchesTitle && /* @__PURE__ */ jsx("h4", { className: "font-bold text-body-2 tracking-wide text-destructive mb-3 uppercase flex items-center gap-1.5", children: /* @__PURE__ */ jsx("span", { children: popularSearchesTitle }) }),
|
|
169
169
|
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: popularSearches.map((tag, idx) => {
|
|
170
170
|
const resolvedTagHref = resolveNavDestination(tag.href, tag.zone, globalConfig.zones?.zones);
|
|
171
171
|
const requiresCrossZone = isCrossZoneNavigation(tag.zone, globalConfig.zones?.currentZone);
|
|
@@ -173,7 +173,7 @@ const NavSearch = ({
|
|
|
173
173
|
/* @__PURE__ */ jsx(TrendingUp, { size: 13, className: "text-grey-500 shrink-0" }),
|
|
174
174
|
/* @__PURE__ */ jsx("span", { children: tag.label })
|
|
175
175
|
] });
|
|
176
|
-
const tagClass = "inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-grey-200 bg-
|
|
176
|
+
const tagClass = "inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-grey-200 bg-grey-50 hover:border-grey-400 hover:bg-grey-50 text-body-3 font-medium text-grey-800 transition-all cursor-pointer";
|
|
177
177
|
if (resolvedTagHref) {
|
|
178
178
|
if (CustomLink && !requiresCrossZone) {
|
|
179
179
|
return /* @__PURE__ */ jsx(
|
|
@@ -80,7 +80,7 @@ const OfferBanner = ({
|
|
|
80
80
|
type: "button",
|
|
81
81
|
onClick: handleDismiss,
|
|
82
82
|
"aria-label": "Dismiss offer banner",
|
|
83
|
-
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-
|
|
83
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-bg-2/70 hover:text-bg-2 hover:bg-grey-50/10 rounded transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-grey-50",
|
|
84
84
|
children: /* @__PURE__ */ jsx(X, { size: 14 })
|
|
85
85
|
}
|
|
86
86
|
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtpInput.d.ts","sourceRoot":"","sources":["../../../src/components/OtpInput/OtpInput.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,kBAAkB,CAAC;AAsCpE,eAAO,MAAM,QAAQ,wFAwEpB,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { OTPInput } from 'input-otp';
|
|
5
|
+
import { cn } from '@timmbr/utils';
|
|
6
|
+
import { otpContainerVariants, otpSlotVariants } from './OtpInput.styles.js';
|
|
7
|
+
|
|
8
|
+
function OtpSlot({
|
|
9
|
+
char,
|
|
10
|
+
isActive,
|
|
11
|
+
hasFakeCaret,
|
|
12
|
+
variant = "default",
|
|
13
|
+
size = "md",
|
|
14
|
+
error = false,
|
|
15
|
+
disabled = false,
|
|
16
|
+
className
|
|
17
|
+
}) {
|
|
18
|
+
return /* @__PURE__ */ jsxs(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
"data-slot": "otp-slot",
|
|
22
|
+
className: cn(
|
|
23
|
+
otpSlotVariants({
|
|
24
|
+
variant,
|
|
25
|
+
size,
|
|
26
|
+
isActive,
|
|
27
|
+
hasError: error
|
|
28
|
+
}),
|
|
29
|
+
className
|
|
30
|
+
),
|
|
31
|
+
children: [
|
|
32
|
+
char,
|
|
33
|
+
hasFakeCaret && !disabled && /* @__PURE__ */ jsx(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
"data-slot": "otp-caret",
|
|
37
|
+
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
38
|
+
children: /* @__PURE__ */ jsx("div", { className: "h-4 w-0.5 animate-caret-blink bg-primary duration-1000" })
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
const OtpInput = React.forwardRef(
|
|
46
|
+
({
|
|
47
|
+
length = 6,
|
|
48
|
+
value,
|
|
49
|
+
defaultValue,
|
|
50
|
+
onChange,
|
|
51
|
+
onComplete,
|
|
52
|
+
variant = "default",
|
|
53
|
+
size = "md",
|
|
54
|
+
error = false,
|
|
55
|
+
disabled = false,
|
|
56
|
+
autoFocus = false,
|
|
57
|
+
containerClassName,
|
|
58
|
+
className,
|
|
59
|
+
...props
|
|
60
|
+
}, ref) => {
|
|
61
|
+
const hasError = Boolean(error);
|
|
62
|
+
const errorId = React.useId();
|
|
63
|
+
const errorText = typeof error === "string" && error.length > 0 ? error : null;
|
|
64
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "otp-input-root", className: "w-full flex flex-col items-center", children: [
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
OTPInput,
|
|
67
|
+
{
|
|
68
|
+
ref,
|
|
69
|
+
maxLength: length,
|
|
70
|
+
value,
|
|
71
|
+
defaultValue,
|
|
72
|
+
onChange,
|
|
73
|
+
onComplete,
|
|
74
|
+
disabled,
|
|
75
|
+
autoFocus,
|
|
76
|
+
"aria-invalid": hasError || void 0,
|
|
77
|
+
"aria-describedby": errorText ? errorId : void 0,
|
|
78
|
+
containerClassName: cn(
|
|
79
|
+
otpContainerVariants({ disabled }),
|
|
80
|
+
containerClassName
|
|
81
|
+
),
|
|
82
|
+
className: cn("disabled:cursor-not-allowed", className),
|
|
83
|
+
render: ({ slots }) => /* @__PURE__ */ jsx(Fragment, { children: slots.map((slot, idx) => /* @__PURE__ */ jsx(
|
|
84
|
+
OtpSlot,
|
|
85
|
+
{
|
|
86
|
+
char: slot.char,
|
|
87
|
+
isActive: slot.isActive,
|
|
88
|
+
hasFakeCaret: slot.hasFakeCaret,
|
|
89
|
+
variant,
|
|
90
|
+
size,
|
|
91
|
+
error: hasError,
|
|
92
|
+
disabled
|
|
93
|
+
},
|
|
94
|
+
idx
|
|
95
|
+
)) }),
|
|
96
|
+
...props
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
errorText && /* @__PURE__ */ jsx(
|
|
100
|
+
"p",
|
|
101
|
+
{
|
|
102
|
+
id: errorId,
|
|
103
|
+
role: "alert",
|
|
104
|
+
"data-slot": "otp-error",
|
|
105
|
+
className: "mt-2 text-body-3 text-destructive text-center font-medium",
|
|
106
|
+
children: errorText
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
] });
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
OtpInput.displayName = "OtpInput";
|
|
113
|
+
|
|
114
|
+
export { OtpInput };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const otpContainerVariants: (props?: ({
|
|
2
|
+
disabled?: boolean | null | undefined;
|
|
3
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
4
|
+
export declare const otpSlotVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "underline" | "filled" | null | undefined;
|
|
6
|
+
size?: "sm" | "lg" | "md" | null | undefined;
|
|
7
|
+
isActive?: boolean | null | undefined;
|
|
8
|
+
hasError?: boolean | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
//# sourceMappingURL=OtpInput.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtpInput.styles.d.ts","sourceRoot":"","sources":["../../../src/components/OtpInput/OtpInput.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB;;8EAahC,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;8EAiC3B,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
|
|
3
|
+
const otpContainerVariants = cva(
|
|
4
|
+
"flex items-center gap-2 select-none justify-center",
|
|
5
|
+
{
|
|
6
|
+
variants: {
|
|
7
|
+
disabled: {
|
|
8
|
+
true: "opacity-50 cursor-not-allowed pointer-events-none",
|
|
9
|
+
false: ""
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
disabled: false
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
const otpSlotVariants = cva(
|
|
18
|
+
"relative flex items-center justify-center tabular-nums font-semibold transition-all duration-150",
|
|
19
|
+
{
|
|
20
|
+
variants: {
|
|
21
|
+
variant: {
|
|
22
|
+
default: "rounded-lg border bg-bg-1/30 border-border-warm text-grey-950",
|
|
23
|
+
filled: "rounded-lg border border-transparent bg-bg-1 text-grey-950",
|
|
24
|
+
underline: "rounded-none border-b-2 border-t-0 border-x-0 border-border-warm bg-transparent text-grey-950"
|
|
25
|
+
},
|
|
26
|
+
size: {
|
|
27
|
+
sm: "w-8 h-10 text-body-1",
|
|
28
|
+
md: "w-11 h-13 text-h5",
|
|
29
|
+
lg: "w-13 h-15 text-h4"
|
|
30
|
+
},
|
|
31
|
+
isActive: {
|
|
32
|
+
true: "border-primary ring-2 ring-primary/25 z-10",
|
|
33
|
+
false: ""
|
|
34
|
+
},
|
|
35
|
+
hasError: {
|
|
36
|
+
true: "!border-destructive !ring-destructive/20 text-destructive",
|
|
37
|
+
false: ""
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
variant: "default",
|
|
42
|
+
size: "md",
|
|
43
|
+
isActive: false,
|
|
44
|
+
hasError: false
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
export { otpContainerVariants, otpSlotVariants };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export type OtpInputVariant = 'default' | 'filled' | 'underline';
|
|
3
|
+
export type OtpInputSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
export interface OtpInputProps extends Omit<ComponentPropsWithoutRef<'input'>, 'size' | 'onChange' | 'value' | 'defaultValue' | 'children'> {
|
|
5
|
+
/** Number of OTP character slots. Defaults to 6. */
|
|
6
|
+
length?: number;
|
|
7
|
+
/** Controlled value */
|
|
8
|
+
value?: string;
|
|
9
|
+
/** Default uncontrolled value */
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
/** Callback fired on character change */
|
|
12
|
+
onChange?: (value: string) => void;
|
|
13
|
+
/** Callback fired when all slots are filled */
|
|
14
|
+
onComplete?: (value: string) => void;
|
|
15
|
+
/** Visual variant. Defaults to 'default'. */
|
|
16
|
+
variant?: OtpInputVariant;
|
|
17
|
+
/** Size scale. Defaults to 'md'. */
|
|
18
|
+
size?: OtpInputSize;
|
|
19
|
+
/** Error state or error message */
|
|
20
|
+
error?: boolean | string;
|
|
21
|
+
/** Whether the input is disabled */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** Whether to focus automatically on mount */
|
|
24
|
+
autoFocus?: boolean;
|
|
25
|
+
/** Custom wrapper class */
|
|
26
|
+
containerClassName?: string;
|
|
27
|
+
/** Explicitly disallow children as OtpInput uses internal slot rendering */
|
|
28
|
+
children?: never;
|
|
29
|
+
}
|
|
30
|
+
export interface OtpSlotProps {
|
|
31
|
+
char: string | null;
|
|
32
|
+
isActive: boolean;
|
|
33
|
+
hasFakeCaret: boolean;
|
|
34
|
+
variant?: OtpInputVariant;
|
|
35
|
+
size?: OtpInputSize;
|
|
36
|
+
error?: boolean;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=OtpInput.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtpInput.types.d.ts","sourceRoot":"","sources":["../../../src/components/OtpInput/OtpInput.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAC;AACjE,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,CAAC;IAC5G,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,+CAA+C;IAC/C,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,6CAA6C;IAC7C,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,oCAAoC;IACpC,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,mCAAmC;IACnC,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2BAA2B;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/OtpInput/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { cva } from 'class-variance-authority';
|
|
2
2
|
|
|
3
3
|
const paginationLinkVariants = cva(
|
|
4
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-[2px]
|
|
4
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-[2px] text-body-3 font-semibold transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-pointer active:scale-95",
|
|
5
5
|
{
|
|
6
6
|
variants: {
|
|
7
7
|
isActive: {
|
|
8
|
-
true: "bg-primary text-
|
|
8
|
+
true: "bg-primary text-grey-50 shadow-xs hover:bg-primary-600",
|
|
9
9
|
false: "text-foreground hover:bg-grey-100 dark:hover:bg-grey-800 border border-grey-200 dark:border-grey-800"
|
|
10
10
|
},
|
|
11
11
|
size: {
|
|
12
12
|
sm: "h-8 min-w-8 px-2",
|
|
13
13
|
default: "h-9 min-w-9 px-3",
|
|
14
|
-
lg: "h-11 min-w-11 px-4 text-
|
|
14
|
+
lg: "h-11 min-w-11 px-4 text-body-2"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
defaultVariants: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cva } from 'class-variance-authority';
|
|
2
2
|
|
|
3
3
|
const popoverContentVariants = cva(
|
|
4
|
-
"z-50 w-72 rounded-md border border-grey-200 dark:border-grey-700 bg-
|
|
4
|
+
"z-50 w-72 rounded-md border border-grey-200 dark:border-grey-700 bg-grey-50 dark:bg-grey-900 p-4 text-foreground shadow-md outline-none font-sans transition-all duration-150 data-[state=open]:animate-scale-in data-[state=closed]:animate-scale-out"
|
|
5
5
|
);
|
|
6
6
|
|
|
7
7
|
export { popoverContentVariants };
|
|
@@ -24,9 +24,9 @@ const Progress = React.forwardRef(
|
|
|
24
24
|
const safeValue = Math.min(Math.max(value ?? 0, 0), max);
|
|
25
25
|
const percentage = Math.round(safeValue / max * 100);
|
|
26
26
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1.5 w-full font-sans", className), children: [
|
|
27
|
-
(label || showValue) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-
|
|
27
|
+
(label || showValue) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-body-3 text-foreground font-medium select-none", children: [
|
|
28
28
|
label && /* @__PURE__ */ jsx("span", { children: label }),
|
|
29
|
-
showValue && !indeterminate && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground
|
|
29
|
+
showValue && !indeterminate && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground tabular-nums ml-auto", children: [
|
|
30
30
|
percentage,
|
|
31
31
|
"%"
|
|
32
32
|
] })
|
|
@@ -50,13 +50,13 @@ const RadioItem = React.forwardRef(
|
|
|
50
50
|
{
|
|
51
51
|
htmlFor: id,
|
|
52
52
|
className: cn(
|
|
53
|
-
"text-
|
|
53
|
+
"text-body-2 font-medium text-foreground cursor-pointer leading-tight",
|
|
54
54
|
disabled && "opacity-50 cursor-not-allowed"
|
|
55
55
|
),
|
|
56
56
|
children: label
|
|
57
57
|
}
|
|
58
58
|
),
|
|
59
|
-
description && /* @__PURE__ */ jsx("span", { className: "text-
|
|
59
|
+
description && /* @__PURE__ */ jsx("span", { className: "text-body-3 text-muted-foreground mt-0.5 leading-normal", children: description })
|
|
60
60
|
] })
|
|
61
61
|
] });
|
|
62
62
|
}
|
|
@@ -79,7 +79,7 @@ const RadioGroup = React.forwardRef(
|
|
|
79
79
|
const isError = Boolean(error);
|
|
80
80
|
const errorMessage = typeof error === "string" ? error : void 0;
|
|
81
81
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 font-sans w-full", style, children: [
|
|
82
|
-
label && /* @__PURE__ */ jsx("span", { className: "text-
|
|
82
|
+
label && /* @__PURE__ */ jsx("span", { className: "text-body-3 font-semibold text-foreground tracking-wide select-none", children: label }),
|
|
83
83
|
/* @__PURE__ */ jsx(
|
|
84
84
|
RadioGroupPrimitive.Root,
|
|
85
85
|
{
|
|
@@ -110,7 +110,7 @@ const RadioGroup = React.forwardRef(
|
|
|
110
110
|
"p",
|
|
111
111
|
{
|
|
112
112
|
className: cn(
|
|
113
|
-
"text-
|
|
113
|
+
"text-body-3 mt-1 flex items-center gap-1.5",
|
|
114
114
|
isError ? "text-destructive font-medium" : "text-muted"
|
|
115
115
|
),
|
|
116
116
|
children: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cva } from 'class-variance-authority';
|
|
2
2
|
|
|
3
3
|
const radioItemVariants = cva(
|
|
4
|
-
"aspect-square rounded-full border border-grey-300 dark:border-grey-700 bg-
|
|
4
|
+
"aspect-square rounded-full border border-grey-300 dark:border-grey-700 bg-grey-50 dark:bg-grey-900 text-primary transition-all duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer flex items-center justify-center data-[state=checked]:border-primary",
|
|
5
5
|
{
|
|
6
6
|
variants: {
|
|
7
7
|
size: {
|
|
@@ -57,7 +57,7 @@ const RangeSlider = React.forwardRef(
|
|
|
57
57
|
className: cn("flex flex-col gap-2 w-full font-sans select-none", className),
|
|
58
58
|
style,
|
|
59
59
|
children: [
|
|
60
|
-
(label || showReadouts) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-
|
|
60
|
+
(label || showReadouts) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-body-2", children: [
|
|
61
61
|
label && /* @__PURE__ */ jsx("span", { className: "font-semibold text-foreground", children: label }),
|
|
62
62
|
showReadouts && /* @__PURE__ */ jsxs(
|
|
63
63
|
"div",
|
|
@@ -112,7 +112,7 @@ const RangeSlider = React.forwardRef(
|
|
|
112
112
|
type: "button",
|
|
113
113
|
onClick: handleReset,
|
|
114
114
|
disabled,
|
|
115
|
-
className: "text-
|
|
115
|
+
className: "text-body-3 font-medium text-muted hover:text-foreground transition-colors cursor-pointer disabled:opacity-50",
|
|
116
116
|
children: resetLabel
|
|
117
117
|
}
|
|
118
118
|
),
|
|
@@ -123,7 +123,7 @@ const RangeSlider = React.forwardRef(
|
|
|
123
123
|
variant: "primary",
|
|
124
124
|
onClick: handleApply,
|
|
125
125
|
disabled,
|
|
126
|
-
className: "h-8 px-4 text-
|
|
126
|
+
className: "h-8 px-4 text-body-3 font-medium",
|
|
127
127
|
children: applyLabel
|
|
128
128
|
}
|
|
129
129
|
)
|
|
@@ -10,7 +10,7 @@ const rangeSliderRangeVariants = cva(
|
|
|
10
10
|
"absolute h-full bg-primary rounded-full"
|
|
11
11
|
);
|
|
12
12
|
const rangeSliderThumbVariants = cva(
|
|
13
|
-
"block h-5 w-5 rounded-full border-2 border-primary bg-
|
|
13
|
+
"block h-5 w-5 rounded-full border-2 border-primary bg-grey-50 shadow-md transition-transform hover:scale-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-grab active:cursor-grabbing"
|
|
14
14
|
);
|
|
15
15
|
|
|
16
16
|
export { rangeSliderRangeVariants, rangeSliderRootVariants, rangeSliderThumbVariants, rangeSliderTrackVariants };
|
|
@@ -38,7 +38,7 @@ const Select = React.forwardRef(
|
|
|
38
38
|
className: cn("flex flex-col gap-1.5 w-full font-sans", containerClassName),
|
|
39
39
|
style,
|
|
40
40
|
children: [
|
|
41
|
-
label && /* @__PURE__ */ jsx("label", { className: "text-
|
|
41
|
+
label && /* @__PURE__ */ jsx("label", { className: "text-body-3 font-semibold text-foreground tracking-wide select-none", children: label }),
|
|
42
42
|
/* @__PURE__ */ jsxs(
|
|
43
43
|
SelectPrimitive.Root,
|
|
44
44
|
{
|
|
@@ -101,7 +101,7 @@ const Select = React.forwardRef(
|
|
|
101
101
|
"p",
|
|
102
102
|
{
|
|
103
103
|
className: cn(
|
|
104
|
-
"text-
|
|
104
|
+
"text-body-3 mt-1 flex items-center gap-1.5",
|
|
105
105
|
isError ? "text-destructive font-medium" : "text-muted"
|
|
106
106
|
),
|
|
107
107
|
children: [
|
|
@@ -5,14 +5,14 @@ const selectTriggerVariants = cva(
|
|
|
5
5
|
{
|
|
6
6
|
variants: {
|
|
7
7
|
variant: {
|
|
8
|
-
outline: "border-grey-300 dark:border-grey-700 bg-
|
|
9
|
-
filled: "border-transparent bg-grey-100 dark:bg-grey-800 focus:bg-
|
|
8
|
+
outline: "border-grey-300 dark:border-grey-700 bg-grey-50 dark:bg-grey-900 focus:border-primary focus:ring-primary/20",
|
|
9
|
+
filled: "border-transparent bg-grey-100 dark:bg-grey-800 focus:bg-grey-50 dark:focus:bg-grey-900 focus:border-primary focus:ring-primary/20"
|
|
10
10
|
},
|
|
11
11
|
size: {
|
|
12
|
-
sm: "h-9 px-3 text-
|
|
13
|
-
default: "h-11 px-3.5 text-
|
|
14
|
-
md: "h-11 px-3.5 text-
|
|
15
|
-
lg: "h-[52px] px-4 text-
|
|
12
|
+
sm: "h-9 px-3 text-body-3",
|
|
13
|
+
default: "h-11 px-3.5 text-body-2",
|
|
14
|
+
md: "h-11 px-3.5 text-body-2",
|
|
15
|
+
lg: "h-[52px] px-4 text-body-1"
|
|
16
16
|
},
|
|
17
17
|
isError: {
|
|
18
18
|
true: "border-destructive focus:border-destructive focus:ring-destructive/20 text-destructive",
|
|
@@ -27,10 +27,10 @@ const selectTriggerVariants = cva(
|
|
|
27
27
|
}
|
|
28
28
|
);
|
|
29
29
|
const selectContentVariants = cva(
|
|
30
|
-
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-grey-200 dark:border-grey-700 bg-
|
|
30
|
+
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-grey-200 dark:border-grey-700 bg-grey-50 dark:bg-grey-900 text-foreground shadow-md transition-all font-sans p-1"
|
|
31
31
|
);
|
|
32
32
|
const selectItemVariants = cva(
|
|
33
|
-
"relative flex w-full cursor-pointer select-none items-center rounded-sm py-2 pl-8 pr-2 text-
|
|
33
|
+
"relative flex w-full cursor-pointer select-none items-center rounded-sm py-2 pl-8 pr-2 text-body-2 outline-none transition-colors hover:bg-grey-100 dark:hover:bg-grey-800 focus:bg-grey-100 dark:focus:bg-grey-800 focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
|
|
34
34
|
);
|
|
35
35
|
|
|
36
36
|
export { selectContentVariants, selectItemVariants, selectTriggerVariants };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cva } from 'class-variance-authority';
|
|
2
2
|
|
|
3
3
|
const sidebarContainerVariants = cva(
|
|
4
|
-
"relative flex flex-col h-screen max-h-screen bg-
|
|
4
|
+
"relative flex flex-col h-screen max-h-screen bg-grey-50 border-r border-grey-200 select-none",
|
|
5
5
|
{
|
|
6
6
|
variants: {
|
|
7
7
|
collapsed: {
|
|
@@ -25,14 +25,14 @@ const sidebarContainerVariants = cva(
|
|
|
25
25
|
}
|
|
26
26
|
);
|
|
27
27
|
const sidebarToggleVariants = cva(
|
|
28
|
-
"absolute -right-3.5 top-6 z-30 flex size-7 items-center justify-center rounded-full bg-
|
|
28
|
+
"absolute -right-3.5 top-6 z-30 flex size-7 items-center justify-center rounded-full bg-grey-50 border border-grey-200 text-grey-600 shadow-xs hover:bg-grey-50 hover:text-grey-900 hover:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary cursor-pointer transition-all duration-150"
|
|
29
29
|
);
|
|
30
30
|
const navItemVariants = cva(
|
|
31
|
-
"group relative flex items-center gap-3 rounded-lg text-
|
|
31
|
+
"group relative flex items-center gap-3 rounded-lg text-body-2 transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary cursor-pointer select-none",
|
|
32
32
|
{
|
|
33
33
|
variants: {
|
|
34
34
|
active: {
|
|
35
|
-
true: "bg-primary text-
|
|
35
|
+
true: "bg-primary text-grey-50 shadow-xs font-medium",
|
|
36
36
|
false: "text-grey-700 hover:bg-grey-100 hover:text-grey-900"
|
|
37
37
|
},
|
|
38
38
|
collapsed: {
|
|
@@ -47,17 +47,17 @@ const navItemVariants = cva(
|
|
|
47
47
|
}
|
|
48
48
|
);
|
|
49
49
|
const navBadgeVariants = cva(
|
|
50
|
-
"inline-flex items-center justify-center rounded-full text-
|
|
50
|
+
"inline-flex items-center justify-center rounded-full text-body-3 font-semibold shrink-0 transition-colors",
|
|
51
51
|
{
|
|
52
52
|
variants: {
|
|
53
53
|
variant: {
|
|
54
|
-
destructive: "bg-
|
|
54
|
+
destructive: "bg-destructive text-grey-50 px-2 py-0.5",
|
|
55
55
|
primary: "bg-primary-100 text-primary-800 px-2 py-0.5",
|
|
56
56
|
secondary: "bg-grey-100 text-grey-700 px-2 py-0.5",
|
|
57
57
|
outline: "border border-grey-200 text-grey-700 px-1.5 py-0.5"
|
|
58
58
|
},
|
|
59
59
|
collapsed: {
|
|
60
|
-
true: "absolute -top-1 -right-1 size-4 p-0 text-
|
|
60
|
+
true: "absolute -top-1 -right-1 size-4 p-0 text-caption leading-none",
|
|
61
61
|
false: "ml-auto"
|
|
62
62
|
}
|
|
63
63
|
},
|
|
@@ -68,7 +68,7 @@ const navBadgeVariants = cva(
|
|
|
68
68
|
}
|
|
69
69
|
);
|
|
70
70
|
const subItemVariants = cva(
|
|
71
|
-
"flex items-center gap-2.5 w-full rounded-md px-3 py-2 text-
|
|
71
|
+
"flex items-center gap-2.5 w-full rounded-md px-3 py-2 text-body-3 transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary cursor-pointer",
|
|
72
72
|
{
|
|
73
73
|
variants: {
|
|
74
74
|
active: {
|
|
@@ -14,7 +14,7 @@ const SidebarBranding = ({
|
|
|
14
14
|
"div",
|
|
15
15
|
{
|
|
16
16
|
"data-testid": "sidebar-logo-placeholder",
|
|
17
|
-
className: "size-8 rounded-lg border border-grey-300 bg-grey-100 flex items-center justify-center shrink-0 text-grey-400 text-
|
|
17
|
+
className: "size-8 rounded-lg border border-grey-300 bg-grey-100 flex items-center justify-center shrink-0 text-grey-400 text-body-3 font-semibold",
|
|
18
18
|
children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Logo" })
|
|
19
19
|
}
|
|
20
20
|
);
|
|
@@ -37,8 +37,8 @@ const SidebarBranding = ({
|
|
|
37
37
|
variants: shouldAnimate ? sidebarContentFadeVariants : void 0,
|
|
38
38
|
className: "flex flex-col min-w-0 overflow-hidden whitespace-nowrap",
|
|
39
39
|
children: [
|
|
40
|
-
/* @__PURE__ */ jsx("span", { className: "font-
|
|
41
|
-
branding?.subtitle && /* @__PURE__ */ jsx("span", { className: "
|
|
40
|
+
/* @__PURE__ */ jsx("span", { className: "font-bold text-body-1 text-grey-900 truncate tracking-tight", children: branding?.title || "Timmbr Console" }),
|
|
41
|
+
branding?.subtitle && /* @__PURE__ */ jsx("span", { className: "text-body-3 text-grey-500 truncate", children: branding.subtitle })
|
|
42
42
|
]
|
|
43
43
|
},
|
|
44
44
|
"sidebar-branding-text"
|
|
@@ -15,7 +15,7 @@ const SidebarFooter = ({
|
|
|
15
15
|
{
|
|
16
16
|
"data-testid": "sidebar-footer",
|
|
17
17
|
className: cn(
|
|
18
|
-
"mt-auto border-t border-grey-100 bg-
|
|
18
|
+
"mt-auto border-t border-grey-100 bg-grey-50 shrink-0 overflow-hidden",
|
|
19
19
|
collapsed ? "p-2 flex flex-col items-center gap-1" : "p-3",
|
|
20
20
|
className
|
|
21
21
|
),
|
|
@@ -69,18 +69,18 @@ const SidebarPopoverMenu = ({
|
|
|
69
69
|
onMouseEnter: handleMouseEnter,
|
|
70
70
|
onMouseLeave: handleMouseLeave,
|
|
71
71
|
className: cn(
|
|
72
|
-
"z-50 min-w-48 rounded-lg bg-
|
|
72
|
+
"z-50 min-w-48 rounded-lg bg-grey-50 p-2 text-grey-900 shadow-md border border-grey-200 outline-none animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
73
73
|
!shouldAnimate && "animate-none transition-none"
|
|
74
74
|
),
|
|
75
75
|
children: [
|
|
76
76
|
/* @__PURE__ */ jsxs("div", { className: "px-3 py-1.5 border-b border-grey-100 mb-1 flex items-center justify-between", children: [
|
|
77
|
-
/* @__PURE__ */ jsx("span", { className: "font-semibold text-
|
|
77
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold text-body-3 text-grey-900 tracking-tight", children: item.label }),
|
|
78
78
|
item.badge !== void 0 && /* @__PURE__ */ jsx(
|
|
79
79
|
"span",
|
|
80
80
|
{
|
|
81
81
|
className: cn(
|
|
82
|
-
"inline-flex items-center justify-center rounded-full px-1.5 py-0.2 text-
|
|
83
|
-
item.badgeVariant === "destructive" ? "bg-
|
|
82
|
+
"inline-flex items-center justify-center rounded-full px-1.5 py-0.2 text-caption font-semibold",
|
|
83
|
+
item.badgeVariant === "destructive" ? "bg-destructive text-grey-50" : "bg-grey-100 text-grey-800"
|
|
84
84
|
),
|
|
85
85
|
children: item.badge
|
|
86
86
|
}
|