@cryptlex/web-components 5.2.0 → 5.3.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/data-table/data-table-filter.d.ts +27 -0
- package/dist/components/data-table/data-table-filter.js +112 -0
- package/dist/components/data-table/data-table.d.ts +73 -0
- package/dist/components/data-table/data-table.js +265 -0
- package/dist/components/data-table/table-commons.d.ts +56 -0
- package/dist/components/data-table/table-commons.js +137 -0
- package/dist/components/inputs/checkbox.d.ts +8 -0
- package/dist/components/inputs/checkbox.js +25 -0
- package/dist/components/inputs/date-picker.d.ts +11 -0
- package/dist/components/inputs/date-picker.js +22 -0
- package/dist/components/inputs/datefield.d.ts +14 -0
- package/dist/components/inputs/datefield.js +25 -0
- package/dist/components/inputs/field.d.ts +21 -0
- package/dist/components/inputs/field.js +48 -0
- package/dist/components/inputs/id-search.d.ts +20 -0
- package/dist/components/inputs/id-search.js +40 -0
- package/dist/components/inputs/input-otp.d.ts +8 -0
- package/dist/components/inputs/input-otp.js +19 -0
- package/dist/components/inputs/multi-select.d.ts +17 -0
- package/dist/components/inputs/multi-select.js +18 -0
- package/dist/components/inputs/numberfield.d.ts +7 -0
- package/dist/components/inputs/numberfield.js +25 -0
- package/dist/components/inputs/searchfield.d.ts +5 -0
- package/dist/components/inputs/searchfield.js +24 -0
- package/dist/components/inputs/select-options.d.ts +8 -0
- package/dist/components/inputs/select-options.js +286 -0
- package/dist/components/inputs/select.d.ts +17 -0
- package/dist/components/inputs/select.js +34 -0
- package/dist/components/inputs/textfield.d.ts +7 -0
- package/dist/components/inputs/textfield.js +28 -0
- package/dist/components/key-value-card/key-value-card.d.ts +17 -0
- package/dist/components/key-value-card/key-value-card.js +40 -0
- package/dist/components/ui/alert.d.ts +8 -0
- package/dist/components/ui/alert.js +18 -0
- package/dist/components/ui/avatar.d.ts +8 -0
- package/dist/components/ui/avatar.js +5 -0
- package/dist/components/ui/badge.d.ts +2 -0
- package/dist/components/ui/badge.js +5 -0
- package/dist/components/ui/breadcrumbs.d.ts +10 -0
- package/dist/components/ui/breadcrumbs.js +28 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/button.js +34 -0
- package/dist/components/ui/calendar.d.ts +17 -0
- package/dist/components/ui/calendar.js +63 -0
- package/dist/components/ui/card.d.ts +7 -0
- package/dist/components/ui/card.js +20 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/dialog.js +42 -0
- package/dist/components/ui/disclosure.d.ts +19 -0
- package/dist/components/ui/disclosure.js +20 -0
- package/dist/components/ui/list-box.d.ts +5 -0
- package/dist/components/ui/list-box.js +24 -0
- package/dist/components/ui/loader.d.ts +5 -0
- package/dist/components/ui/loader.js +6 -0
- package/dist/components/ui/menu.d.ts +25 -0
- package/dist/components/ui/menu.js +38 -0
- package/dist/components/ui/popover.d.ts +4 -0
- package/dist/components/ui/popover.js +14 -0
- package/dist/components/ui/sidebar.d.ts +53 -0
- package/dist/components/ui/sidebar.js +177 -0
- package/dist/components/ui/skeleton.d.ts +1 -0
- package/dist/components/ui/skeleton.js +5 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/sonner.js +14 -0
- package/dist/components/ui/table.d.ts +9 -0
- package/dist/components/ui/table.js +26 -0
- package/dist/components/ui/tabs.d.ts +5 -0
- package/dist/components/ui/tabs.js +25 -0
- package/dist/components/ui/timeline.d.ts +15 -0
- package/dist/components/ui/timeline.js +31 -0
- package/dist/components/ui/tooltip.d.ts +4 -0
- package/dist/components/ui/tooltip.js +12 -0
- package/dist/utils/form-context.d.ts +4 -0
- package/{lib/utils/form-context.tsx → dist/utils/form-context.js} +1 -3
- package/dist/utils/form-hook.d.ts +25 -0
- package/{lib/utils/form-hook.tsx → dist/utils/form-hook.js} +15 -18
- package/dist/utils/primitives.d.ts +30 -0
- package/{lib/utils/primitives.ts → dist/utils/primitives.js} +8 -37
- package/dist/utils/resource-names.d.ts +23 -0
- package/{lib/utils/resource-names.tsx → dist/utils/resource-names.js} +42 -75
- package/dist/utils/use-mobile.d.ts +1 -0
- package/dist/utils/use-mobile.js +15 -0
- package/package.json +10 -5
- package/lib/components/data-table/data-table-filter.tsx +0 -220
- package/lib/components/data-table/data-table.tsx +0 -593
- package/lib/components/data-table/table-commons.tsx +0 -233
- package/lib/components/inputs/checkbox.tsx +0 -72
- package/lib/components/inputs/date-picker.tsx +0 -130
- package/lib/components/inputs/datefield.tsx +0 -109
- package/lib/components/inputs/field.tsx +0 -106
- package/lib/components/inputs/id-search.tsx +0 -83
- package/lib/components/inputs/input-otp.tsx +0 -63
- package/lib/components/inputs/multi-select.tsx +0 -62
- package/lib/components/inputs/numberfield.tsx +0 -110
- package/lib/components/inputs/searchfield.tsx +0 -87
- package/lib/components/inputs/select-options.tsx +0 -303
- package/lib/components/inputs/select.tsx +0 -140
- package/lib/components/inputs/textfield.tsx +0 -96
- package/lib/components/key-value-card/key-value-card.tsx +0 -115
- package/lib/components/ui/alert.tsx +0 -32
- package/lib/components/ui/avatar.tsx +0 -22
- package/lib/components/ui/badge.tsx +0 -19
- package/lib/components/ui/breadcrumbs.tsx +0 -104
- package/lib/components/ui/button.tsx +0 -66
- package/lib/components/ui/calendar.tsx +0 -220
- package/lib/components/ui/card.tsx +0 -58
- package/lib/components/ui/dialog.tsx +0 -172
- package/lib/components/ui/disclosure.tsx +0 -113
- package/lib/components/ui/list-box.tsx +0 -86
- package/lib/components/ui/loader.tsx +0 -10
- package/lib/components/ui/menu.tsx +0 -168
- package/lib/components/ui/popover.tsx +0 -37
- package/lib/components/ui/sidebar.tsx +0 -552
- package/lib/components/ui/skeleton.tsx +0 -7
- package/lib/components/ui/sonner.tsx +0 -26
- package/lib/components/ui/table.tsx +0 -79
- package/lib/components/ui/tabs.tsx +0 -82
- package/lib/components/ui/timeline.tsx +0 -52
- package/lib/components/ui/tooltip.tsx +0 -30
- package/lib/tokens.scss +0 -89
- package/lib/utils/use-mobile.tsx +0 -21
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Tab as AriaTab,
|
|
3
|
-
TabList as AriaTabList,
|
|
4
|
-
TabListProps as AriaTabListProps,
|
|
5
|
-
TabPanel as AriaTabPanel,
|
|
6
|
-
TabPanelProps as AriaTabPanelProps,
|
|
7
|
-
TabProps as AriaTabProps,
|
|
8
|
-
Tabs as AriaTabs,
|
|
9
|
-
TabsProps as AriaTabsProps,
|
|
10
|
-
composeRenderProps,
|
|
11
|
-
} from "react-aria-components"
|
|
12
|
-
|
|
13
|
-
import { cn } from "lib/utils/primitives"
|
|
14
|
-
|
|
15
|
-
export function Tabs({ className, ...props }: AriaTabsProps) {
|
|
16
|
-
return (
|
|
17
|
-
<AriaTabs
|
|
18
|
-
className={composeRenderProps(className, (className) =>
|
|
19
|
-
cn(
|
|
20
|
-
"group flex flex-col gap-2",
|
|
21
|
-
/* Orientation */
|
|
22
|
-
"data-[orientation=vertical]:flex-row",
|
|
23
|
-
className
|
|
24
|
-
)
|
|
25
|
-
)}
|
|
26
|
-
{...props}
|
|
27
|
-
/>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function TabList<T extends object>({
|
|
32
|
-
className,
|
|
33
|
-
...props
|
|
34
|
-
}: AriaTabListProps<T>) {
|
|
35
|
-
return (
|
|
36
|
-
<AriaTabList
|
|
37
|
-
className={composeRenderProps(className, (className) =>
|
|
38
|
-
cn(
|
|
39
|
-
"inline-flex items-center border-b text-muted-foreground",
|
|
40
|
-
/* Orientation */
|
|
41
|
-
"data-[orientation=vertical]:h-auto data-[orientation=vertical]:flex-col",
|
|
42
|
-
className
|
|
43
|
-
)
|
|
44
|
-
)}
|
|
45
|
-
{...props}
|
|
46
|
-
/>
|
|
47
|
-
)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function Tab({ className, ...props }: AriaTabProps) {
|
|
51
|
-
return (
|
|
52
|
-
<AriaTab
|
|
53
|
-
className={composeRenderProps(className, (className) =>
|
|
54
|
-
cn(
|
|
55
|
-
"btn btn-ghost leading-none text-accent h-input truncate inline-flex items-center px-3 body font-medium transition-all",
|
|
56
|
-
/* Selected */
|
|
57
|
-
"data-[selected]:bg-primary/20 data-[selected]:text-primary",
|
|
58
|
-
/* Orientation */
|
|
59
|
-
"group-data-[orientation=vertical]:w-full",
|
|
60
|
-
className
|
|
61
|
-
)
|
|
62
|
-
)}
|
|
63
|
-
{...props}
|
|
64
|
-
/>
|
|
65
|
-
)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export function TabPanel({ className, ...props }: AriaTabPanelProps) {
|
|
69
|
-
return (
|
|
70
|
-
<AriaTabPanel
|
|
71
|
-
className={composeRenderProps(className, (className) =>
|
|
72
|
-
cn(
|
|
73
|
-
"ring-offset-background",
|
|
74
|
-
/* Focus Visible */
|
|
75
|
-
"focus-ring",
|
|
76
|
-
className
|
|
77
|
-
)
|
|
78
|
-
)}
|
|
79
|
-
{...props}
|
|
80
|
-
/>
|
|
81
|
-
)
|
|
82
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
-
import { cn } from "lib/utils/primitives";
|
|
3
|
-
import type { LucideIcon } from "lucide-react";
|
|
4
|
-
|
|
5
|
-
export function Timeline({ className, ...props }: React.ComponentProps<'ol'>) {
|
|
6
|
-
return <ol className={cn("grid grid-col-1 gap-icon", className)} {...props} />
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function TimelineItem({ className, ...props }: React.ComponentProps<'li'> & {}) {
|
|
10
|
-
return (
|
|
11
|
-
<li className={cn("grid grid-cols-[4rem_2rem_1fr] grid-rows-subgrid list-none gap-icon", className)} {...props} />
|
|
12
|
-
)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const timelineIconVariants = cva(
|
|
16
|
-
`p-1 rounded-full`,
|
|
17
|
-
{
|
|
18
|
-
variants: {
|
|
19
|
-
variant: {
|
|
20
|
-
destructive: "text-destructive-foreground bg-destructive",
|
|
21
|
-
success: "text-success-foreground bg-success",
|
|
22
|
-
muted: "text-muted-foreground bg-muted",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
defaultVariants: {
|
|
26
|
-
variant: "muted",
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
export function TimelineIcon({ icon: Icon, className, variant, ...props }: Omit<React.ComponentProps<'div'>, 'children'> & VariantProps<typeof timelineIconVariants> & {
|
|
32
|
-
icon: LucideIcon
|
|
33
|
-
}) {
|
|
34
|
-
return <div {...props} className="flex flex-col items-center gap-2">
|
|
35
|
-
<div className={cn(timelineIconVariants({ variant, className }))}>
|
|
36
|
-
<Icon className="size-icon " />
|
|
37
|
-
</div>
|
|
38
|
-
<div className="h-full w-[1px]" />
|
|
39
|
-
</div>
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function TimelineDate({ className, date, dateFormatter, ...props }: Omit<React.ComponentProps<'time'>, 'dateTime' | 'children'> & {
|
|
43
|
-
date: Date
|
|
44
|
-
dateFormatter?: (d: Date) => string;
|
|
45
|
-
}) {
|
|
46
|
-
const defaultDateDisplay = `${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getFullYear()}`;
|
|
47
|
-
return <time {...props} dateTime={date.toISOString()} className={cn("font-mono leading-none text-muted", className)}>{dateFormatter ? dateFormatter(date) : defaultDateDisplay}</time>
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function TimelineContent({ className, ...props }: React.ComponentProps<'section'>) {
|
|
51
|
-
return <section className={cn("", className)} {...props} />;
|
|
52
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Tooltip as AriaTooltip,
|
|
3
|
-
TooltipTrigger as AriaTooltipTrigger,
|
|
4
|
-
composeRenderProps,
|
|
5
|
-
type TooltipProps as AriaTooltipProps,
|
|
6
|
-
} from "react-aria-components"
|
|
7
|
-
|
|
8
|
-
import { cn } from "lib/utils/primitives"
|
|
9
|
-
|
|
10
|
-
const TooltipTrigger = AriaTooltipTrigger
|
|
11
|
-
const Tooltip = ({ className, offset = 4, ...props }: AriaTooltipProps) => (
|
|
12
|
-
<AriaTooltip
|
|
13
|
-
offset={offset}
|
|
14
|
-
className={composeRenderProps(className, (className) =>
|
|
15
|
-
cn(
|
|
16
|
-
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0",
|
|
17
|
-
/* Entering */
|
|
18
|
-
"data-[entering]:zoom-in-95",
|
|
19
|
-
/* Exiting */
|
|
20
|
-
"data-[exiting]:animate-out data-[exiting]:fade-out-0 data-[exiting]:zoom-out-95",
|
|
21
|
-
/* Placement */
|
|
22
|
-
"data-[placement=bottom]:slide-in-from-top-2 data-[placement=left]:slide-in-from-right-2 data-[placement=right]:slide-in-from-left-2 data-[placement=top]:slide-in-from-bottom-2",
|
|
23
|
-
className
|
|
24
|
-
)
|
|
25
|
-
)}
|
|
26
|
-
{...props}
|
|
27
|
-
/>
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
export { Tooltip, TooltipTrigger }
|
package/lib/tokens.scss
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/// This file is used to generate the tokens.css file in this project.
|
|
2
|
-
/// Since a single variable is used to determine most swatches and the ramps formulae are repetitive, we use Sass to generate these tokens.
|
|
3
|
-
@mixin generate-variables-for-hue($name, $value) {
|
|
4
|
-
--#{$name}-hue: #{$value};
|
|
5
|
-
|
|
6
|
-
--x#{$name}-1: oklch(0.99 0.01 var(--#{$name}-hue));
|
|
7
|
-
--x#{$name}-2: oklch(0.97 0.03 var(--#{$name}-hue));
|
|
8
|
-
--x#{$name}-3: oklch(0.9 0.04 var(--#{$name}-hue));
|
|
9
|
-
--x#{$name}-4: oklch(0.72 0.13 var(--#{$name}-hue));
|
|
10
|
-
--x#{$name}-5: oklch(0.67 0.13 var(--#{$name}-hue));
|
|
11
|
-
--x#{$name}-6: oklch(0.5 0.13 var(--#{$name}-hue));
|
|
12
|
-
--x#{$name}-7: oklch(0.35 0.13 var(--#{$name}-hue));
|
|
13
|
-
--x#{$name}-8: oklch(0.25 0.13 var(--#{$name}-hue));
|
|
14
|
-
--x#{$name}-9: oklch(0.2 0.09 var(--#{$name}-hue));
|
|
15
|
-
--x#{$name}-10: oklch(0.1 0.03 var(--#{$name}-hue));
|
|
16
|
-
|
|
17
|
-
--#{$name}-1: var(--x#{$name}-1);
|
|
18
|
-
--#{$name}-2: var(--x#{$name}-2);
|
|
19
|
-
--#{$name}-3: var(--x#{$name}-3);
|
|
20
|
-
--#{$name}-4: var(--x#{$name}-4);
|
|
21
|
-
--#{$name}-5: var(--x#{$name}-5);
|
|
22
|
-
--#{$name}-6: var(--x#{$name}-6);
|
|
23
|
-
--#{$name}-7: var(--x#{$name}-7);
|
|
24
|
-
--#{$name}-8: var(--x#{$name}-8);
|
|
25
|
-
--#{$name}-9: var(--x#{$name}-9);
|
|
26
|
-
--#{$name}-10: var(--x#{$name}-10);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/// Generates CSS variables using OKLCH for a Neutral palette.
|
|
30
|
-
@mixin generate-variables-for-neutral() {
|
|
31
|
-
--neutral-hue: var(--primary-hue);
|
|
32
|
-
--neutral-s: 0.0005;
|
|
33
|
-
|
|
34
|
-
--xneutral-1: oklch(0.985 var(--neutral-s) var(--neutral-hue));
|
|
35
|
-
--xneutral-2: oklch(0.97 var(--neutral-s) var(--neutral-hue));
|
|
36
|
-
--xneutral-3: oklch(0.95 var(--neutral-s) var(--neutral-hue));
|
|
37
|
-
--xneutral-4: oklch(0.87 var(--neutral-s) var(--neutral-hue));
|
|
38
|
-
--xneutral-5: oklch(0.708 var(--neutral-s) var(--neutral-hue));
|
|
39
|
-
--xneutral-6: oklch(0.556 var(--neutral-s) var(--neutral-hue));
|
|
40
|
-
--xneutral-7: oklch(0.439 var(--neutral-s) var(--neutral-hue));
|
|
41
|
-
--xneutral-8: oklch(0.29 var(--neutral-s) var(--neutral-hue));
|
|
42
|
-
--xneutral-9: oklch(0.269 var(--neutral-s) var(--neutral-hue));
|
|
43
|
-
--xneutral-10: oklch(0.205 var(--neutral-s) var(--neutral-hue));
|
|
44
|
-
|
|
45
|
-
--neutral-1: var(--xneutral-1);
|
|
46
|
-
--neutral-2: var(--xneutral-2);
|
|
47
|
-
--neutral-3: var(--xneutral-3);
|
|
48
|
-
--neutral-4: var(--xneutral-4);
|
|
49
|
-
--neutral-5: var(--xneutral-5);
|
|
50
|
-
--neutral-6: var(--xneutral-6);
|
|
51
|
-
--neutral-7: var(--xneutral-7);
|
|
52
|
-
--neutral-8: var(--xneutral-8);
|
|
53
|
-
--neutral-9: var(--xneutral-9);
|
|
54
|
-
--neutral-10: var(--xneutral-10);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/// Swap Swatch 1 & Swatch 10, Swatch 2 and Swatch 9, and so on.
|
|
58
|
-
@mixin generate-dark-mode($name) {
|
|
59
|
-
--#{$name}-1: var(--x#{$name}-10);
|
|
60
|
-
--#{$name}-2: var(--x#{$name}-9);
|
|
61
|
-
--#{$name}-3: var(--x#{$name}-8);
|
|
62
|
-
--#{$name}-4: var(--x#{$name}-7);
|
|
63
|
-
--#{$name}-5: var(--x#{$name}-6);
|
|
64
|
-
--#{$name}-6: var(--x#{$name}-5);
|
|
65
|
-
--#{$name}-7: var(--x#{$name}-4);
|
|
66
|
-
--#{$name}-8: var(--x#{$name}-3);
|
|
67
|
-
--#{$name}-9: var(--x#{$name}-2);
|
|
68
|
-
--#{$name}-10: var(--x#{$name}-1);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/*!
|
|
72
|
-
This CSS is generated by tokens.scss, do not modify directly.
|
|
73
|
-
Instead, compile the SCSS file again to create modifications.
|
|
74
|
-
*/
|
|
75
|
-
:root {
|
|
76
|
-
@include generate-variables-for-hue(primary, 240);
|
|
77
|
-
@include generate-variables-for-hue(secondary, calc(var(--primary-hue) + 30));
|
|
78
|
-
@include generate-variables-for-hue(destructive, calc(var(--primary-hue) - 230));
|
|
79
|
-
@include generate-variables-for-hue(success, calc(var(--primary-hue) - 90));
|
|
80
|
-
@include generate-variables-for-neutral();
|
|
81
|
-
|
|
82
|
-
@media (prefers-color-scheme: dark) {
|
|
83
|
-
@include generate-dark-mode(primary);
|
|
84
|
-
@include generate-dark-mode(secondary);
|
|
85
|
-
@include generate-dark-mode(destructive);
|
|
86
|
-
@include generate-dark-mode(success);
|
|
87
|
-
@include generate-dark-mode(neutral);
|
|
88
|
-
}
|
|
89
|
-
}
|
package/lib/utils/use-mobile.tsx
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
|
|
3
|
-
const MOBILE_BREAKPOINT = 768;
|
|
4
|
-
|
|
5
|
-
export function useIsMobile() {
|
|
6
|
-
const [isMobile, setIsMobile] = useState<boolean | undefined>(
|
|
7
|
-
undefined,
|
|
8
|
-
);
|
|
9
|
-
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
12
|
-
const onChange = () => {
|
|
13
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
14
|
-
};
|
|
15
|
-
mql.addEventListener("change", onChange);
|
|
16
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
17
|
-
return () => mql.removeEventListener("change", onChange);
|
|
18
|
-
}, []);
|
|
19
|
-
|
|
20
|
-
return !!isMobile;
|
|
21
|
-
}
|