@vikram-hegde/skeletal 0.0.1
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/README.md +35 -0
- package/dist/alert-dialog/index.d.ts +2 -0
- package/dist/alert-dialog/index.js +2 -0
- package/dist/alert-dialog-1hxVC_5N.js +71 -0
- package/dist/badge/index.d.ts +2 -0
- package/dist/badge/index.js +2 -0
- package/dist/badge-C3p1L0E7.css +53 -0
- package/dist/badge-C3p1L0E7.js +32 -0
- package/dist/button/index.d.ts +2 -0
- package/dist/button/index.js +2 -0
- package/dist/button-B48UNbaC.css +152 -0
- package/dist/button-B48UNbaC.js +46 -0
- package/dist/button-Dvd4n2U4.d.ts +56 -0
- package/dist/checkbox/index.d.ts +2 -0
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox-wh2BoiSj.css +76 -0
- package/dist/checkbox-wh2BoiSj.js +112 -0
- package/dist/cluster-BJ4m5uGN.css +9 -0
- package/dist/cluster-BJ4m5uGN.js +21 -0
- package/dist/combobox/index.d.ts +2 -0
- package/dist/combobox/index.js +2 -0
- package/dist/combobox-DWH7uSsx.css +389 -0
- package/dist/combobox-DWH7uSsx.js +327 -0
- package/dist/command-palette/index.d.ts +2 -0
- package/dist/command-palette/index.js +2 -0
- package/dist/command-palette-DF4XJ8qz.css +164 -0
- package/dist/command-palette-DF4XJ8qz.js +191 -0
- package/dist/dialog/index.d.ts +6 -0
- package/dist/dialog/index.js +2 -0
- package/dist/dialog-C4yqxII_.js +73 -0
- package/dist/dialog-footer-Br9KZP4v.js +29 -0
- package/dist/dialog-footer-bNVIVPbu.d.ts +56 -0
- package/dist/dialog-portal-B21WFYkQ.css +131 -0
- package/dist/dialog-portal-B21WFYkQ.js +26 -0
- package/dist/dialog-portal-BF89FBeX.d.ts +15 -0
- package/dist/dialog-title-DRYRIxCp.js +35 -0
- package/dist/dialog-title-jyf86Q8C.d.ts +36 -0
- package/dist/dialog-viewport-CaMWJrCJ.d.ts +42 -0
- package/dist/dialog-viewport-vpbsq7Ib.js +21 -0
- package/dist/drawer/index.d.ts +2 -0
- package/dist/drawer/index.js +2 -0
- package/dist/drawer-DQmz_uCP.css +214 -0
- package/dist/drawer-DQmz_uCP.js +180 -0
- package/dist/icon/index.d.ts +2 -0
- package/dist/icon/index.js +2 -0
- package/dist/icon-DBOdxNvH.css +6 -0
- package/dist/icon-DBOdxNvH.js +20 -0
- package/dist/index-A2QmU5r9.d.ts +37 -0
- package/dist/index-B0uNLS7z.d.ts +301 -0
- package/dist/index-B63PSP58.d.ts +94 -0
- package/dist/index-BBOkTl3h.d.ts +261 -0
- package/dist/index-BLFVnve3.d.ts +53 -0
- package/dist/index-BXPUT5u-.d.ts +72 -0
- package/dist/index-BngvATZx.d.ts +35 -0
- package/dist/index-Br2NrBW_.d.ts +444 -0
- package/dist/index-CUy-9csi.d.ts +135 -0
- package/dist/index-CbMW32E9.d.ts +82 -0
- package/dist/index-CyTcR6iv.d.ts +433 -0
- package/dist/index-CznsZ_1M.d.ts +85 -0
- package/dist/index-D-6gOciw.d.ts +350 -0
- package/dist/index-DdqDyczP.d.ts +209 -0
- package/dist/index-GOGpFujX.d.ts +144 -0
- package/dist/index-W3ozKcis.d.ts +245 -0
- package/dist/index-kpw3_4q_.d.ts +50 -0
- package/dist/index-rH7TJeJt.d.ts +334 -0
- package/dist/index-rQ7sRkqg.d.ts +122 -0
- package/dist/index.css +93 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +26 -0
- package/dist/input/index.d.ts +2 -0
- package/dist/input/index.js +2 -0
- package/dist/input-CQ_ean8e.css +129 -0
- package/dist/input-CQ_ean8e.js +65 -0
- package/dist/layout/index.d.ts +2 -0
- package/dist/layout/index.js +4 -0
- package/dist/layout-qoyutnKU.css +181 -0
- package/dist/layout-qoyutnKU.js +169 -0
- package/dist/menu/index.d.ts +2 -0
- package/dist/menu/index.js +2 -0
- package/dist/menu-DRdGMI_-.css +236 -0
- package/dist/menu-DRdGMI_-.js +243 -0
- package/dist/merge-class-name-C4KJJGuK.js +15 -0
- package/dist/popover/index.d.ts +2 -0
- package/dist/popover/index.js +2 -0
- package/dist/popover-CenynT0Z.css +139 -0
- package/dist/popover-CenynT0Z.js +174 -0
- package/dist/radio/index.d.ts +2 -0
- package/dist/radio/index.js +2 -0
- package/dist/radio-BJrvdkga.css +80 -0
- package/dist/radio-BJrvdkga.js +75 -0
- package/dist/scroll-area/index.d.ts +2 -0
- package/dist/scroll-area/index.js +2 -0
- package/dist/scroll-area-DkORxJE9.css +175 -0
- package/dist/scroll-area-DkORxJE9.js +114 -0
- package/dist/select/index.d.ts +2 -0
- package/dist/select/index.js +2 -0
- package/dist/select-BaqBHUac.css +273 -0
- package/dist/select-BaqBHUac.js +254 -0
- package/dist/skeleton/index.d.ts +2 -0
- package/dist/skeleton/index.js +2 -0
- package/dist/skeleton-W6fwO5pf.css +88 -0
- package/dist/skeleton-W6fwO5pf.js +97 -0
- package/dist/spinner/index.d.ts +2 -0
- package/dist/spinner/index.js +2 -0
- package/dist/spinner-DB6ap8Si.css +43 -0
- package/dist/spinner-DB6ap8Si.js +27 -0
- package/dist/stack-BzFVrsmT.css +12 -0
- package/dist/stack-BzFVrsmT.js +52 -0
- package/dist/style-vars-ZSrCUzKx.js +13 -0
- package/dist/switch/index.d.ts +2 -0
- package/dist/switch/index.js +2 -0
- package/dist/switch-DizP31iF.css +76 -0
- package/dist/switch-DizP31iF.js +58 -0
- package/dist/tooltip/index.d.ts +2 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/tooltip-CQk2WjUS.css +92 -0
- package/dist/tooltip-CQk2WjUS.js +138 -0
- package/package.json +68 -0
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Skeletal
|
|
2
|
+
|
|
3
|
+
My design system.
|
|
4
|
+
|
|
5
|
+
## Development
|
|
6
|
+
|
|
7
|
+
- Install dependencies:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- Run the playground:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm run play
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- Run the unit tests:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm run test
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- Build the library:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pnpm run build
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Package
|
|
32
|
+
|
|
33
|
+
- Name: `@vikram-hegde/skeletal`
|
|
34
|
+
- Internal alias: `@skeletal` → `src/*` (tsconfig, tsdown, vite)
|
|
35
|
+
- Consumers: `import { Button } from "@vikram-hegde/skeletal"` + `import "@vikram-hegde/skeletal/index.css"`
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { t as DialogPortal } from "./dialog-portal-B21WFYkQ.js";
|
|
2
|
+
import { n as DialogBackdrop, t as DialogViewport } from "./dialog-viewport-vpbsq7Ib.js";
|
|
3
|
+
import { t as Button } from "./button-B48UNbaC.js";
|
|
4
|
+
import { n as DialogDescription, r as DialogClose, t as DialogTitle } from "./dialog-title-DRYRIxCp.js";
|
|
5
|
+
import { n as DialogContent, t as DialogFooter } from "./dialog-footer-Br9KZP4v.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { AlertDialog } from "@base-ui/react/alert-dialog";
|
|
8
|
+
//#region src/alert-dialog/alert-dialog-root.tsx
|
|
9
|
+
function AlertDialogRoot(props) {
|
|
10
|
+
return /* @__PURE__ */ jsx(AlertDialog.Root, { ...props });
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/alert-dialog/alert-dialog-trigger.tsx
|
|
14
|
+
function AlertDialogTrigger({ className, variant = "primary", size = "md", fullWidth = false, ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(AlertDialog.Trigger, {
|
|
16
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
17
|
+
variant,
|
|
18
|
+
size,
|
|
19
|
+
fullWidth,
|
|
20
|
+
className
|
|
21
|
+
}),
|
|
22
|
+
...props
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/alert-dialog/index.ts
|
|
27
|
+
/**
|
|
28
|
+
* Compound component for alert dialogs.
|
|
29
|
+
*
|
|
30
|
+
* Assemble the parts as properties of the object:
|
|
31
|
+
*
|
|
32
|
+
* ```tsx
|
|
33
|
+
* import { AlertDialog } from '@vikram-hegde/skeletal'
|
|
34
|
+
*
|
|
35
|
+
* <AlertDialog.Root>
|
|
36
|
+
* <AlertDialog.Trigger>Delete</AlertDialog.Trigger>
|
|
37
|
+
* <AlertDialog.Portal>
|
|
38
|
+
* <AlertDialog.Backdrop />
|
|
39
|
+
* <AlertDialog.Viewport>
|
|
40
|
+
* <AlertDialog.Content size="sm">
|
|
41
|
+
* <AlertDialog.Title>Delete project?</AlertDialog.Title>
|
|
42
|
+
* <AlertDialog.Description>This cannot be undone.</AlertDialog.Description>
|
|
43
|
+
* <AlertDialog.Footer>
|
|
44
|
+
* <AlertDialog.Close>Cancel</AlertDialog.Close>
|
|
45
|
+
* <AlertDialog.Close variant="destructive">Delete</AlertDialog.Close>
|
|
46
|
+
* </AlertDialog.Footer>
|
|
47
|
+
* </AlertDialog.Content>
|
|
48
|
+
* </AlertDialog.Viewport>
|
|
49
|
+
* </AlertDialog.Portal>
|
|
50
|
+
* </AlertDialog.Root>
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* An alert dialog is a dialog at heart, so `Portal`, `Backdrop`, `Content`,
|
|
54
|
+
* `Title`, `Description`, `Footer`, `Close`, and `Viewport` are the same styled
|
|
55
|
+
* parts as `Dialog`'s (their prop types live under `Dialog*Props`). Only `Root`
|
|
56
|
+
* and `Trigger` are alert-dialog specific.
|
|
57
|
+
*/
|
|
58
|
+
const AlertDialog$1 = {
|
|
59
|
+
Root: AlertDialogRoot,
|
|
60
|
+
Trigger: AlertDialogTrigger,
|
|
61
|
+
Portal: DialogPortal,
|
|
62
|
+
Backdrop: DialogBackdrop,
|
|
63
|
+
Content: DialogContent,
|
|
64
|
+
Title: DialogTitle,
|
|
65
|
+
Description: DialogDescription,
|
|
66
|
+
Footer: DialogFooter,
|
|
67
|
+
Close: DialogClose,
|
|
68
|
+
Viewport: DialogViewport
|
|
69
|
+
};
|
|
70
|
+
//#endregion
|
|
71
|
+
export { AlertDialog$1 as t };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
@layer skeletal {
|
|
2
|
+
.VYNV2G_badge {
|
|
3
|
+
border: 1px solid var(--_badge-border, transparent);
|
|
4
|
+
border-radius: var(--sk-radius);
|
|
5
|
+
background-color: var(--_badge-bg);
|
|
6
|
+
min-block-size: 1.375rem;
|
|
7
|
+
color: var(--_badge-fg);
|
|
8
|
+
white-space: nowrap;
|
|
9
|
+
user-select: none;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: .375rem;
|
|
12
|
+
padding-block: .125rem;
|
|
13
|
+
padding-inline: .625rem;
|
|
14
|
+
font-family: inherit;
|
|
15
|
+
font-size: .75rem;
|
|
16
|
+
font-weight: 500;
|
|
17
|
+
line-height: 1;
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.VYNV2G_badge__dot {
|
|
22
|
+
opacity: .75;
|
|
23
|
+
background-color: currentColor;
|
|
24
|
+
border-radius: 999px;
|
|
25
|
+
flex-shrink: 0;
|
|
26
|
+
block-size: .4375rem;
|
|
27
|
+
inline-size: .4375rem;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.VYNV2G_badge--primary {
|
|
31
|
+
--_badge-bg: var(--sk-primary);
|
|
32
|
+
--_badge-fg: var(--sk-primary-foreground);
|
|
33
|
+
--_badge-border: transparent;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.VYNV2G_badge--secondary {
|
|
37
|
+
--_badge-bg: var(--sk-secondary);
|
|
38
|
+
--_badge-fg: var(--sk-secondary-foreground);
|
|
39
|
+
--_badge-border: transparent;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.VYNV2G_badge--outline {
|
|
43
|
+
--_badge-bg: transparent;
|
|
44
|
+
--_badge-fg: var(--sk-foreground);
|
|
45
|
+
--_badge-border: var(--sk-border);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.VYNV2G_badge--destructive {
|
|
49
|
+
--_badge-bg: var(--sk-destructive);
|
|
50
|
+
--_badge-fg: var(--sk-destructive-foreground);
|
|
51
|
+
--_badge-border: transparent;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import './badge-C3p1L0E7.css';
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/badge/badge.module.css
|
|
5
|
+
var badge_module_default = {
|
|
6
|
+
"badge": "VYNV2G_badge",
|
|
7
|
+
"badge__dot": "VYNV2G_badge__dot",
|
|
8
|
+
"badge--destructive": "VYNV2G_badge--destructive",
|
|
9
|
+
"badge--outline": "VYNV2G_badge--outline",
|
|
10
|
+
"badge--primary": "VYNV2G_badge--primary",
|
|
11
|
+
"badge--secondary": "VYNV2G_badge--secondary"
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/badge/badge.tsx
|
|
15
|
+
const VARIANT_CLASS = {
|
|
16
|
+
primary: badge_module_default["badge--primary"],
|
|
17
|
+
secondary: badge_module_default["badge--secondary"],
|
|
18
|
+
outline: badge_module_default["badge--outline"],
|
|
19
|
+
destructive: badge_module_default["badge--destructive"]
|
|
20
|
+
};
|
|
21
|
+
function Badge({ variant = "secondary", dot = false, className, children, ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
23
|
+
className: clsx(badge_module_default.badge, VARIANT_CLASS[variant], className),
|
|
24
|
+
...props,
|
|
25
|
+
children: [dot ? /* @__PURE__ */ jsx("span", {
|
|
26
|
+
className: badge_module_default.badge__dot,
|
|
27
|
+
"aria-hidden": "true"
|
|
28
|
+
}) : null, children]
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { Badge as t };
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
@layer skeletal {
|
|
2
|
+
._7xeUeq_button {
|
|
3
|
+
border: 1px solid var(--_button-border, transparent);
|
|
4
|
+
border-radius: var(--sk-radius);
|
|
5
|
+
background-color: var(--_button-bg);
|
|
6
|
+
min-block-size: 2.5rem;
|
|
7
|
+
color: var(--_button-fg);
|
|
8
|
+
white-space: nowrap;
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
user-select: none;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: .5rem;
|
|
14
|
+
padding-block: 0;
|
|
15
|
+
padding-inline: 1.25rem;
|
|
16
|
+
font-family: inherit;
|
|
17
|
+
font-size: .875rem;
|
|
18
|
+
font-weight: 500;
|
|
19
|
+
line-height: 1;
|
|
20
|
+
transition: background-color .15s ease-out, border-color .15s ease-out, color .15s ease-out, transform .15s ease-out;
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
|
|
23
|
+
@media (hover: hover) {
|
|
24
|
+
&:hover:not([data-disabled]) {
|
|
25
|
+
background-color: var(--_button-hover-bg);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&:active:not([data-disabled]) {
|
|
30
|
+
transform: translateY(.5px);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&[data-disabled], &:disabled {
|
|
34
|
+
opacity: .5;
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&._7xeUeq_button--loading {
|
|
39
|
+
cursor: progress;
|
|
40
|
+
opacity: .65;
|
|
41
|
+
pointer-events: auto;
|
|
42
|
+
position: relative;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&._7xeUeq_button--loading:before {
|
|
47
|
+
content: "";
|
|
48
|
+
background-color: var(--_button-fg);
|
|
49
|
+
opacity: .15;
|
|
50
|
+
block-size: .1875rem;
|
|
51
|
+
position: absolute;
|
|
52
|
+
inset-block-end: 0;
|
|
53
|
+
inset-inline: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&._7xeUeq_button--loading:after {
|
|
57
|
+
content: "";
|
|
58
|
+
background-image: repeating-linear-gradient(90deg,
|
|
59
|
+
transparent 0%,
|
|
60
|
+
transparent 55%,
|
|
61
|
+
var(--_button-fg) 75%,
|
|
62
|
+
var(--_button-fg) 80%,
|
|
63
|
+
transparent 80%,
|
|
64
|
+
transparent 100%);
|
|
65
|
+
block-size: .1875rem;
|
|
66
|
+
inline-size: 200%;
|
|
67
|
+
animation: _7xeUeq_skeletal-button-progress var(--_button-progress-duration, 1.4s) linear infinite;
|
|
68
|
+
background-size: 50% 100%;
|
|
69
|
+
position: absolute;
|
|
70
|
+
inset-block-end: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&:focus-visible {
|
|
74
|
+
outline: 2px solid var(--sk-ring);
|
|
75
|
+
outline-offset: 2px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@media (prefers-reduced-motion: reduce) {
|
|
79
|
+
transition: none;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@keyframes _7xeUeq_skeletal-button-progress {
|
|
84
|
+
from {
|
|
85
|
+
transform: translateX(-50%);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
to {
|
|
89
|
+
transform: translateX(0);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@media (prefers-reduced-motion: reduce) {
|
|
94
|
+
._7xeUeq_button._7xeUeq_button--loading:after {
|
|
95
|
+
opacity: .4;
|
|
96
|
+
animation: none;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
._7xeUeq_button--primary {
|
|
101
|
+
--_button-bg: var(--sk-primary);
|
|
102
|
+
--_button-fg: var(--sk-primary-foreground);
|
|
103
|
+
--_button-border: transparent;
|
|
104
|
+
--_button-hover-bg: light-dark(oklch(from var(--sk-primary) calc(l - .08) c h), oklch(from var(--sk-primary) calc(l + .08) c h));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
._7xeUeq_button--secondary {
|
|
108
|
+
--_button-bg: var(--sk-secondary);
|
|
109
|
+
--_button-fg: var(--sk-secondary-foreground);
|
|
110
|
+
--_button-border: transparent;
|
|
111
|
+
--_button-hover-bg: light-dark(oklch(from var(--sk-secondary) calc(l - .08) c h), oklch(from var(--sk-secondary) calc(l + .08) c h));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
._7xeUeq_button--outline {
|
|
115
|
+
--_button-bg: transparent;
|
|
116
|
+
--_button-fg: var(--sk-foreground);
|
|
117
|
+
--_button-border: var(--sk-border);
|
|
118
|
+
--_button-hover-bg: var(--sk-muted);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
._7xeUeq_button--ghost {
|
|
122
|
+
--_button-bg: transparent;
|
|
123
|
+
--_button-fg: var(--sk-foreground);
|
|
124
|
+
--_button-border: transparent;
|
|
125
|
+
--_button-hover-bg: var(--sk-muted);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
._7xeUeq_button--destructive {
|
|
129
|
+
--_button-bg: var(--sk-destructive);
|
|
130
|
+
--_button-fg: var(--sk-destructive-foreground);
|
|
131
|
+
--_button-border: transparent;
|
|
132
|
+
--_button-hover-bg: light-dark(oklch(from var(--sk-destructive) calc(l - .08) c h), oklch(from var(--sk-destructive) calc(l + .08) c h));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
._7xeUeq_button--sm {
|
|
136
|
+
min-block-size: 2rem;
|
|
137
|
+
padding-block: 0;
|
|
138
|
+
padding-inline: .75rem;
|
|
139
|
+
font-size: .8125rem;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
._7xeUeq_button--lg {
|
|
143
|
+
min-block-size: 3rem;
|
|
144
|
+
padding-block: 0;
|
|
145
|
+
padding-inline: 1.5rem;
|
|
146
|
+
font-size: 1rem;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
._7xeUeq_button--full {
|
|
150
|
+
inline-size: 100%;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import './button-B48UNbaC.css';
|
|
2
|
+
import { t as mergeClassName } from "./merge-class-name-C4KJJGuK.js";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Button } from "@base-ui/react/button";
|
|
6
|
+
//#region src/button/button.module.css
|
|
7
|
+
var button_module_default = {
|
|
8
|
+
"button": "_7xeUeq_button",
|
|
9
|
+
"button--destructive": "_7xeUeq_button--destructive",
|
|
10
|
+
"button--full": "_7xeUeq_button--full",
|
|
11
|
+
"button--ghost": "_7xeUeq_button--ghost",
|
|
12
|
+
"button--lg": "_7xeUeq_button--lg",
|
|
13
|
+
"button--loading": "_7xeUeq_button--loading",
|
|
14
|
+
"button--outline": "_7xeUeq_button--outline",
|
|
15
|
+
"button--primary": "_7xeUeq_button--primary",
|
|
16
|
+
"button--secondary": "_7xeUeq_button--secondary",
|
|
17
|
+
"button--sm": "_7xeUeq_button--sm",
|
|
18
|
+
"skeletal-button-progress": "_7xeUeq_skeletal-button-progress"
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/button/button.tsx
|
|
22
|
+
const VARIANT_CLASS = {
|
|
23
|
+
primary: button_module_default["button--primary"],
|
|
24
|
+
secondary: button_module_default["button--secondary"],
|
|
25
|
+
outline: button_module_default["button--outline"],
|
|
26
|
+
ghost: button_module_default["button--ghost"],
|
|
27
|
+
destructive: button_module_default["button--destructive"]
|
|
28
|
+
};
|
|
29
|
+
const SIZE_CLASS = {
|
|
30
|
+
sm: button_module_default["button--sm"],
|
|
31
|
+
md: void 0,
|
|
32
|
+
lg: button_module_default["button--lg"]
|
|
33
|
+
};
|
|
34
|
+
function Button$1({ className, variant = "primary", size = "md", fullWidth = false, loading = false, disabled, focusableWhenDisabled, children, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
36
|
+
className: mergeClassName(clsx(button_module_default.button, VARIANT_CLASS[variant], SIZE_CLASS[size], fullWidth && button_module_default["button--full"], loading && button_module_default["button--loading"]), className),
|
|
37
|
+
disabled: loading ? true : disabled,
|
|
38
|
+
focusableWhenDisabled: loading ? true : focusableWhenDisabled,
|
|
39
|
+
"aria-busy": loading ? true : void 0,
|
|
40
|
+
"data-loading": loading ? true : void 0,
|
|
41
|
+
...props,
|
|
42
|
+
children
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { Button$1 as t };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ButtonProps } from "@base-ui/react/button";
|
|
2
|
+
//#region src/button/button.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* The visual emphasis of the button. Choose based on the action's importance:
|
|
5
|
+
* - `primary`: solid accent fill — the main action on a screen. Use sparingly.
|
|
6
|
+
* - `secondary`: muted fill — an alternative to primary in grouped actions.
|
|
7
|
+
* - `outline`: transparent with a border — pairs with primary/secondary, or for
|
|
8
|
+
* actions that should feel lighter.
|
|
9
|
+
* - `ghost`: no border or fill — inline/secondary actions that shouldn't draw
|
|
10
|
+
* attention; gains a subtle hover fill.
|
|
11
|
+
* - `destructive`: red fill — irreversible actions (delete, remove). Always
|
|
12
|
+
* pair with a confirmation step (e.g. an Alert Dialog).
|
|
13
|
+
*
|
|
14
|
+
* @default variant = 'primary'
|
|
15
|
+
*/
|
|
16
|
+
type ButtonVariant = "primary" | "secondary" | "outline" | "ghost" | "destructive";
|
|
17
|
+
/**
|
|
18
|
+
* The button size:
|
|
19
|
+
* - `sm`: 2rem tall — dense toolbars and inline actions.
|
|
20
|
+
* - `md`: 2.5rem tall — default; most buttons.
|
|
21
|
+
* - `lg`: 3rem tall — hero or primary form submissions.
|
|
22
|
+
*
|
|
23
|
+
* @default size = 'md'
|
|
24
|
+
*/
|
|
25
|
+
type ButtonSize = "sm" | "md" | "lg";
|
|
26
|
+
/**
|
|
27
|
+
* A styled button that triggers an action. Renders a `<button>` element.
|
|
28
|
+
*
|
|
29
|
+
* Wraps Base UI's `Button`, so every Base UI prop works: `render` to swap the
|
|
30
|
+
* element (set `nativeButton={false}` when rendering a non-`<button>` tag),
|
|
31
|
+
* `className`, `disabled`, etc.
|
|
32
|
+
*
|
|
33
|
+
* For loading states, pass `loading`: the button disables itself (preventing
|
|
34
|
+
* double-submits) while keeping focus (Base UI's `focusableWhenDisabled`), and
|
|
35
|
+
* sets `aria-busy` so assistive tech announces the pending state. The label
|
|
36
|
+
* and any icons stay fully visible — a progress bar sweeps along the bottom
|
|
37
|
+
* edge of the button to indicate the pending state, and the button is dimmed
|
|
38
|
+
* (but not as much as fully disabled) so it reads as non-interactive. The
|
|
39
|
+
* button also sets `data-loading` if you want to style the pending state
|
|
40
|
+
* yourself.
|
|
41
|
+
*
|
|
42
|
+
* All props are optional except children.
|
|
43
|
+
*/
|
|
44
|
+
interface ButtonProps$1 extends ButtonProps {
|
|
45
|
+
/** Visual emphasis of the button. @default 'primary' */
|
|
46
|
+
variant?: ButtonVariant;
|
|
47
|
+
/** Size of the button. @default 'md' */
|
|
48
|
+
size?: ButtonSize;
|
|
49
|
+
/** Whether the button stretches to fill its parent width. @default false */
|
|
50
|
+
fullWidth?: boolean;
|
|
51
|
+
/** Whether the button shows a pending state. @default false */
|
|
52
|
+
loading?: boolean;
|
|
53
|
+
}
|
|
54
|
+
declare function Button$1({ className, variant, size, fullWidth, loading, disabled, focusableWhenDisabled, children, ...props }: ButtonProps$1): import("react").JSX.Element;
|
|
55
|
+
//#endregion
|
|
56
|
+
export { ButtonVariant as i, ButtonProps$1 as n, ButtonSize as r, Button$1 as t };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
@layer skeletal {
|
|
2
|
+
.PFVgGG_checkbox__group {
|
|
3
|
+
color: var(--sk-foreground);
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
align-items: start;
|
|
6
|
+
gap: .375rem;
|
|
7
|
+
display: flex;
|
|
8
|
+
|
|
9
|
+
&[data-disabled] {
|
|
10
|
+
color: var(--sk-muted-foreground);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.PFVgGG_checkbox__root {
|
|
15
|
+
border: 1px solid var(--sk-border);
|
|
16
|
+
border-radius: var(--sk-radius);
|
|
17
|
+
background-color: var(--sk-background);
|
|
18
|
+
block-size: 1rem;
|
|
19
|
+
inline-size: 1rem;
|
|
20
|
+
color: var(--sk-primary-foreground);
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
align-items: center;
|
|
25
|
+
margin: 0;
|
|
26
|
+
padding: 0;
|
|
27
|
+
line-height: 0;
|
|
28
|
+
transition: background-color .1s ease-out, border-color .1s ease-out;
|
|
29
|
+
display: inline-flex;
|
|
30
|
+
position: relative;
|
|
31
|
+
|
|
32
|
+
&[data-unchecked]:hover:not([data-disabled]) {
|
|
33
|
+
border-color: var(--sk-ring);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&[data-checked], &[data-indeterminate] {
|
|
37
|
+
border-color: var(--sk-primary);
|
|
38
|
+
background-color: var(--sk-primary);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&[data-disabled] {
|
|
42
|
+
cursor: default;
|
|
43
|
+
opacity: .5;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:focus-visible {
|
|
47
|
+
outline: 2px solid var(--sk-ring);
|
|
48
|
+
outline-offset: 2px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@media (prefers-reduced-motion: reduce) {
|
|
52
|
+
transition: none;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.PFVgGG_checkbox__indicator {
|
|
57
|
+
place-items: center;
|
|
58
|
+
transition: scale .16s cubic-bezier(.2, .7, .3, 1), opacity .14s ease-out;
|
|
59
|
+
display: grid;
|
|
60
|
+
position: absolute;
|
|
61
|
+
inset: 0;
|
|
62
|
+
|
|
63
|
+
& > svg {
|
|
64
|
+
display: block;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&[data-starting-style], &[data-ending-style] {
|
|
68
|
+
opacity: 0;
|
|
69
|
+
scale: .72;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@media (prefers-reduced-motion: reduce) {
|
|
73
|
+
transition: none;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import './checkbox-wh2BoiSj.css';
|
|
2
|
+
import { t as mergeClassName } from "./merge-class-name-C4KJJGuK.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { CheckboxGroup } from "@base-ui/react/checkbox-group";
|
|
5
|
+
import { Checkbox } from "@base-ui/react/checkbox";
|
|
6
|
+
//#region src/checkbox/checkbox.module.css
|
|
7
|
+
var checkbox_module_default = {
|
|
8
|
+
"checkbox__group": "PFVgGG_checkbox__group",
|
|
9
|
+
"checkbox__indicator": "PFVgGG_checkbox__indicator",
|
|
10
|
+
"checkbox__root": "PFVgGG_checkbox__root"
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/checkbox/checkbox-group.tsx
|
|
14
|
+
function CheckboxGroup$1({ className, ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(CheckboxGroup, {
|
|
16
|
+
className: mergeClassName(checkbox_module_default.checkbox__group, className),
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/checkbox/checkbox-indicator.tsx
|
|
22
|
+
function CheckboxIndicator({ className, render, children, ...props }) {
|
|
23
|
+
const merged = mergeClassName(checkbox_module_default.checkbox__indicator, className);
|
|
24
|
+
if (render === void 0 && children === void 0) return /* @__PURE__ */ jsx(Checkbox.Indicator, {
|
|
25
|
+
className: merged,
|
|
26
|
+
render: (defaultProps, state) => /* @__PURE__ */ jsx("span", {
|
|
27
|
+
...defaultProps,
|
|
28
|
+
children: state.indeterminate ? /* @__PURE__ */ jsx(DashIcon, {}) : /* @__PURE__ */ jsx(CheckIcon, {})
|
|
29
|
+
}),
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
return /* @__PURE__ */ jsx(Checkbox.Indicator, {
|
|
33
|
+
className: merged,
|
|
34
|
+
...props,
|
|
35
|
+
render,
|
|
36
|
+
children
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function CheckIcon() {
|
|
40
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
41
|
+
width: "12",
|
|
42
|
+
height: "12",
|
|
43
|
+
viewBox: "0 0 16 16",
|
|
44
|
+
fill: "none",
|
|
45
|
+
"aria-hidden": "true",
|
|
46
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
47
|
+
d: "m2.5 8.5 4 4 7-9",
|
|
48
|
+
stroke: "currentColor",
|
|
49
|
+
strokeWidth: "2",
|
|
50
|
+
strokeLinecap: "round",
|
|
51
|
+
strokeLinejoin: "round"
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function DashIcon() {
|
|
56
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
57
|
+
width: "12",
|
|
58
|
+
height: "12",
|
|
59
|
+
viewBox: "0 0 16 16",
|
|
60
|
+
fill: "none",
|
|
61
|
+
"aria-hidden": "true",
|
|
62
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
63
|
+
d: "M3 8h10",
|
|
64
|
+
stroke: "currentColor",
|
|
65
|
+
strokeWidth: "2",
|
|
66
|
+
strokeLinecap: "round"
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/checkbox/checkbox-root.tsx
|
|
72
|
+
function CheckboxRoot({ className, children, ...props }) {
|
|
73
|
+
return /* @__PURE__ */ jsx(Checkbox.Root, {
|
|
74
|
+
className: mergeClassName(checkbox_module_default.checkbox__root, className),
|
|
75
|
+
...props,
|
|
76
|
+
children: children ?? /* @__PURE__ */ jsx(CheckboxIndicator, {})
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/checkbox/index.ts
|
|
81
|
+
/**
|
|
82
|
+
* Compound component for ticking one or many independent options.
|
|
83
|
+
*
|
|
84
|
+
* Assemble the parts as properties of the object:
|
|
85
|
+
*
|
|
86
|
+
* ```tsx
|
|
87
|
+
* import { Checkbox } from '@vikram-hegde/skeletal'
|
|
88
|
+
*
|
|
89
|
+
* <label>
|
|
90
|
+
* <Checkbox.Root defaultChecked name="terms" required />
|
|
91
|
+
* Accept terms and conditions
|
|
92
|
+
* </label>
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* Wrap several checkboxes in `Checkbox.Group` to manage them as one
|
|
96
|
+
* array-valued field (see the Group docs for react-hook-form / TanStack Form
|
|
97
|
+
* wiring), and add a parent checkbox with the `parent` prop + `allValues` on
|
|
98
|
+
* the group for "select all" behavior.
|
|
99
|
+
*
|
|
100
|
+
* All parts are thin styled wrappers over Base UI's `Checkbox`, so every Base
|
|
101
|
+
* UI prop, `render` override, and ref behaves the same. The hidden native
|
|
102
|
+
* input keeps native form submission and library integrations working. Part
|
|
103
|
+
* prop types are exported separately (`CheckboxProps`,
|
|
104
|
+
* `CheckboxGroupProps`, ...).
|
|
105
|
+
*/
|
|
106
|
+
const Checkbox$1 = {
|
|
107
|
+
Root: CheckboxRoot,
|
|
108
|
+
Group: CheckboxGroup$1,
|
|
109
|
+
Indicator: CheckboxIndicator
|
|
110
|
+
};
|
|
111
|
+
//#endregion
|
|
112
|
+
export { Checkbox$1 as t };
|