asta-ui 0.4.0 → 0.5.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/dist/base/checkbox-aui-052.d.ts +2 -0
- package/dist/base/checkbox-aui-052.js +9 -0
- package/dist/base/checkbox-aui-053.d.ts +2 -0
- package/dist/base/checkbox-aui-053.js +9 -0
- package/dist/base/checkbox-aui-054.d.ts +2 -0
- package/dist/base/checkbox-aui-054.js +9 -0
- package/dist/base/combobox-aui-046.d.ts +2 -0
- package/dist/base/combobox-aui-046.js +9 -0
- package/dist/base/combobox-aui-047.d.ts +2 -0
- package/dist/base/combobox-aui-047.js +9 -0
- package/dist/base/date-picker-aui-050.d.ts +2 -0
- package/dist/base/date-picker-aui-050.js +9 -0
- package/dist/base/date-picker-aui-051.d.ts +2 -0
- package/dist/base/date-picker-aui-051.js +9 -0
- package/dist/base/input-aui-029.d.ts +2 -0
- package/dist/base/input-aui-029.js +9 -0
- package/dist/base/input-aui-030.d.ts +2 -0
- package/dist/base/input-aui-030.js +9 -0
- package/dist/base/input-aui-031.d.ts +2 -0
- package/dist/base/input-aui-031.js +9 -0
- package/dist/base/input-aui-032.d.ts +2 -0
- package/dist/base/input-aui-032.js +11 -0
- package/dist/base/input-aui-033.d.ts +2 -0
- package/dist/base/input-aui-033.js +11 -0
- package/dist/base/input-aui-034.d.ts +2 -0
- package/dist/base/input-aui-034.js +9 -0
- package/dist/base/otp-input-aui-041.d.ts +2 -0
- package/dist/base/otp-input-aui-041.js +9 -0
- package/dist/base/otp-input-aui-042.d.ts +2 -0
- package/dist/base/otp-input-aui-042.js +9 -0
- package/dist/base/password-input-aui-039.d.ts +2 -0
- package/dist/base/password-input-aui-039.js +9 -0
- package/dist/base/password-input-aui-040.d.ts +2 -0
- package/dist/base/password-input-aui-040.js +11 -0
- package/dist/base/radio-group-aui-055.d.ts +2 -0
- package/dist/base/radio-group-aui-055.js +9 -0
- package/dist/base/radio-group-aui-056.d.ts +2 -0
- package/dist/base/radio-group-aui-056.js +9 -0
- package/dist/base/radio-group-aui-057.d.ts +2 -0
- package/dist/base/radio-group-aui-057.js +9 -0
- package/dist/base/select-aui-043.d.ts +2 -0
- package/dist/base/select-aui-043.js +9 -0
- package/dist/base/select-aui-044.d.ts +2 -0
- package/dist/base/select-aui-044.js +9 -0
- package/dist/base/select-aui-045.d.ts +2 -0
- package/dist/base/select-aui-045.js +9 -0
- package/dist/base/slider-aui-061.d.ts +2 -0
- package/dist/base/slider-aui-061.js +9 -0
- package/dist/base/slider-aui-062.d.ts +2 -0
- package/dist/base/slider-aui-062.js +9 -0
- package/dist/base/slider-aui-063.d.ts +2 -0
- package/dist/base/slider-aui-063.js +9 -0
- package/dist/base/switch-aui-058.d.ts +2 -0
- package/dist/base/switch-aui-058.js +9 -0
- package/dist/base/switch-aui-059.d.ts +2 -0
- package/dist/base/switch-aui-059.js +9 -0
- package/dist/base/switch-aui-060.d.ts +2 -0
- package/dist/base/switch-aui-060.js +9 -0
- package/dist/base/tag-input-aui-048.d.ts +2 -0
- package/dist/base/tag-input-aui-048.js +9 -0
- package/dist/base/tag-input-aui-049.d.ts +2 -0
- package/dist/base/tag-input-aui-049.js +9 -0
- package/dist/base/textarea-aui-035.d.ts +2 -0
- package/dist/base/textarea-aui-035.js +9 -0
- package/dist/base/textarea-aui-036.d.ts +2 -0
- package/dist/base/textarea-aui-036.js +9 -0
- package/dist/base/textarea-aui-037.d.ts +2 -0
- package/dist/base/textarea-aui-037.js +9 -0
- package/dist/base/textarea-aui-038.d.ts +2 -0
- package/dist/base/textarea-aui-038.js +11 -0
- package/dist/base.js +239 -21
- package/dist/checkbox-aui-052.d.ts +2 -0
- package/dist/checkbox-aui-052.js +9 -0
- package/dist/checkbox-aui-053.d.ts +2 -0
- package/dist/checkbox-aui-053.js +9 -0
- package/dist/checkbox-aui-054.d.ts +2 -0
- package/dist/checkbox-aui-054.js +9 -0
- package/dist/chunk-2LSUWI2Z.js +180 -0
- package/dist/chunk-3XMVXIOF.js +267 -0
- package/dist/chunk-4YNUJFTL.js +165 -0
- package/dist/chunk-5OHHGQV6.js +175 -0
- package/dist/chunk-5TMFFW3Y.js +149 -0
- package/dist/chunk-ANZANDQM.js +107 -0
- package/dist/chunk-BIYNJDPD.js +158 -0
- package/dist/chunk-BV5HEXB5.js +339 -0
- package/dist/chunk-CDQNLDO6.js +156 -0
- package/dist/chunk-CZCZB5YP.js +142 -0
- package/dist/chunk-D6LGKFZH.js +140 -0
- package/dist/chunk-EKPTPTKK.js +93 -0
- package/dist/chunk-EVCUN45S.js +167 -0
- package/dist/chunk-FGQPCDXI.js +136 -0
- package/dist/chunk-GERWW3CA.js +311 -0
- package/dist/chunk-GJ3R6IZL.js +232 -0
- package/dist/chunk-HVFB44HO.js +219 -0
- package/dist/chunk-I2WXKWTQ.js +151 -0
- package/dist/chunk-J6GK2V2C.js +252 -0
- package/dist/chunk-JVTDNOHQ.js +173 -0
- package/dist/chunk-K5PWBSVO.js +200 -0
- package/dist/chunk-KQCXQY5K.js +155 -0
- package/dist/chunk-KXWC2UHE.js +308 -0
- package/dist/chunk-NICNFGHT.js +138 -0
- package/dist/chunk-P3USWDWR.js +331 -0
- package/dist/chunk-QYI7LQBQ.js +208 -0
- package/dist/chunk-U6N7CZYN.js +305 -0
- package/dist/chunk-UMDVPRJW.js +117 -0
- package/dist/chunk-VPZP6TCT.js +155 -0
- package/dist/chunk-VVAL2JZJ.js +332 -0
- package/dist/chunk-VWYHP4SB.js +154 -0
- package/dist/chunk-W7RITVDV.js +182 -0
- package/dist/chunk-WSTQ6WZO.js +193 -0
- package/dist/chunk-Z5GNX2S3.js +171 -0
- package/dist/chunk-ZBF2UYXP.js +225 -0
- package/dist/combobox-aui-046.d.ts +2 -0
- package/dist/combobox-aui-046.js +9 -0
- package/dist/combobox-aui-047.d.ts +2 -0
- package/dist/combobox-aui-047.js +9 -0
- package/dist/date-picker-aui-050.d.ts +2 -0
- package/dist/date-picker-aui-050.js +9 -0
- package/dist/date-picker-aui-051.d.ts +2 -0
- package/dist/date-picker-aui-051.js +9 -0
- package/dist/index.js +239 -21
- package/dist/input-aui-029.d.ts +2 -0
- package/dist/input-aui-029.js +9 -0
- package/dist/input-aui-030.d.ts +2 -0
- package/dist/input-aui-030.js +9 -0
- package/dist/input-aui-031.d.ts +2 -0
- package/dist/input-aui-031.js +9 -0
- package/dist/input-aui-032.d.ts +2 -0
- package/dist/input-aui-032.js +11 -0
- package/dist/input-aui-033.d.ts +2 -0
- package/dist/input-aui-033.js +11 -0
- package/dist/input-aui-034.d.ts +2 -0
- package/dist/input-aui-034.js +9 -0
- package/dist/otp-input-aui-041.d.ts +2 -0
- package/dist/otp-input-aui-041.js +9 -0
- package/dist/otp-input-aui-042.d.ts +2 -0
- package/dist/otp-input-aui-042.js +9 -0
- package/dist/password-input-aui-039.d.ts +2 -0
- package/dist/password-input-aui-039.js +9 -0
- package/dist/password-input-aui-040.d.ts +2 -0
- package/dist/password-input-aui-040.js +11 -0
- package/dist/radio-group-aui-055.d.ts +2 -0
- package/dist/radio-group-aui-055.js +9 -0
- package/dist/radio-group-aui-056.d.ts +2 -0
- package/dist/radio-group-aui-056.js +9 -0
- package/dist/radio-group-aui-057.d.ts +2 -0
- package/dist/radio-group-aui-057.js +9 -0
- package/dist/select-aui-043.d.ts +2 -0
- package/dist/select-aui-043.js +9 -0
- package/dist/select-aui-044.d.ts +2 -0
- package/dist/select-aui-044.js +9 -0
- package/dist/select-aui-045.d.ts +2 -0
- package/dist/select-aui-045.js +9 -0
- package/dist/slider-aui-061.d.ts +2 -0
- package/dist/slider-aui-061.js +9 -0
- package/dist/slider-aui-062.d.ts +2 -0
- package/dist/slider-aui-062.js +9 -0
- package/dist/slider-aui-063.d.ts +2 -0
- package/dist/slider-aui-063.js +9 -0
- package/dist/switch-aui-058.d.ts +2 -0
- package/dist/switch-aui-058.js +9 -0
- package/dist/switch-aui-059.d.ts +2 -0
- package/dist/switch-aui-059.js +9 -0
- package/dist/switch-aui-060.d.ts +2 -0
- package/dist/switch-aui-060.js +9 -0
- package/dist/tag-input-aui-048.d.ts +2 -0
- package/dist/tag-input-aui-048.js +9 -0
- package/dist/tag-input-aui-049.d.ts +2 -0
- package/dist/tag-input-aui-049.js +9 -0
- package/dist/textarea-aui-035.d.ts +2 -0
- package/dist/textarea-aui-035.js +9 -0
- package/dist/textarea-aui-036.d.ts +2 -0
- package/dist/textarea-aui-036.js +9 -0
- package/dist/textarea-aui-037.d.ts +2 -0
- package/dist/textarea-aui-037.js +9 -0
- package/dist/textarea-aui-038.d.ts +2 -0
- package/dist/textarea-aui-038.js +11 -0
- package/dist/types/components/kit/variants/checkbox-aui-052.d.ts +29 -0
- package/dist/types/components/kit/variants/checkbox-aui-053.d.ts +24 -0
- package/dist/types/components/kit/variants/checkbox-aui-054.d.ts +33 -0
- package/dist/types/components/kit/variants/combobox-aui-046.d.ts +23 -0
- package/dist/types/components/kit/variants/combobox-aui-047.d.ts +24 -0
- package/dist/types/components/kit/variants/date-picker-aui-050.d.ts +26 -0
- package/dist/types/components/kit/variants/date-picker-aui-051.d.ts +23 -0
- package/dist/types/components/kit/variants/input-aui-029.d.ts +21 -0
- package/dist/types/components/kit/variants/input-aui-030.d.ts +29 -0
- package/dist/types/components/kit/variants/input-aui-031.d.ts +24 -0
- package/dist/types/components/kit/variants/input-aui-032.d.ts +36 -0
- package/dist/types/components/kit/variants/input-aui-033.d.ts +23 -0
- package/dist/types/components/kit/variants/input-aui-034.d.ts +29 -0
- package/dist/types/components/kit/variants/otp-input-aui-041.d.ts +20 -0
- package/dist/types/components/kit/variants/otp-input-aui-042.d.ts +23 -0
- package/dist/types/components/kit/variants/password-input-aui-039.d.ts +16 -0
- package/dist/types/components/kit/variants/password-input-aui-040.d.ts +24 -0
- package/dist/types/components/kit/variants/radio-group-aui-055.d.ts +27 -0
- package/dist/types/components/kit/variants/radio-group-aui-056.d.ts +28 -0
- package/dist/types/components/kit/variants/radio-group-aui-057.d.ts +26 -0
- package/dist/types/components/kit/variants/select-aui-043.d.ts +29 -0
- package/dist/types/components/kit/variants/select-aui-044.d.ts +24 -0
- package/dist/types/components/kit/variants/select-aui-045.d.ts +29 -0
- package/dist/types/components/kit/variants/slider-aui-061.d.ts +20 -0
- package/dist/types/components/kit/variants/slider-aui-062.d.ts +24 -0
- package/dist/types/components/kit/variants/slider-aui-063.d.ts +17 -0
- package/dist/types/components/kit/variants/switch-aui-058.d.ts +24 -0
- package/dist/types/components/kit/variants/switch-aui-059.d.ts +20 -0
- package/dist/types/components/kit/variants/switch-aui-060.d.ts +15 -0
- package/dist/types/components/kit/variants/tag-input-aui-048.d.ts +16 -0
- package/dist/types/components/kit/variants/tag-input-aui-049.d.ts +15 -0
- package/dist/types/components/kit/variants/textarea-aui-035.d.ts +19 -0
- package/dist/types/components/kit/variants/textarea-aui-036.d.ts +23 -0
- package/dist/types/components/kit/variants/textarea-aui-037.d.ts +30 -0
- package/dist/types/components/kit/variants/textarea-aui-038.d.ts +28 -0
- package/dist/types/packages/asta-ui/src/base/checkbox-aui-052.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/checkbox-aui-053.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/checkbox-aui-054.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/combobox-aui-046.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/combobox-aui-047.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/date-picker-aui-050.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/date-picker-aui-051.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/input-aui-029.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/input-aui-030.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/input-aui-031.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/input-aui-032.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/input-aui-033.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/input-aui-034.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/otp-input-aui-041.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/otp-input-aui-042.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/password-input-aui-039.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/password-input-aui-040.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/radio-group-aui-055.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/radio-group-aui-056.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/radio-group-aui-057.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/select-aui-043.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/select-aui-044.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/select-aui-045.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/slider-aui-061.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/slider-aui-062.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/slider-aui-063.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/switch-aui-058.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/switch-aui-059.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/switch-aui-060.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tag-input-aui-048.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tag-input-aui-049.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/textarea-aui-035.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/textarea-aui-036.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/textarea-aui-037.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/textarea-aui-038.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base.d.ts +70 -0
- package/dist/types/packages/asta-ui/src/checkbox-aui-052.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/checkbox-aui-053.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/checkbox-aui-054.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/combobox-aui-046.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/combobox-aui-047.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/date-picker-aui-050.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/date-picker-aui-051.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/index.d.ts +70 -0
- package/dist/types/packages/asta-ui/src/input-aui-029.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/input-aui-030.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/input-aui-031.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/input-aui-032.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/input-aui-033.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/input-aui-034.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/otp-input-aui-041.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/otp-input-aui-042.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/password-input-aui-039.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/password-input-aui-040.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/radio-group-aui-055.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/radio-group-aui-056.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/radio-group-aui-057.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/select-aui-043.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/select-aui-044.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/select-aui-045.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/slider-aui-061.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/slider-aui-062.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/slider-aui-063.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/switch-aui-058.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/switch-aui-059.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/switch-aui-060.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tag-input-aui-048.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tag-input-aui-049.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/textarea-aui-035.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/textarea-aui-036.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/textarea-aui-037.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/textarea-aui-038.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/variants/combobox-aui-046.tsx
|
|
4
|
+
import { useEffect, useId, useMemo, useRef, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
7
|
+
var EASE = "cubic-bezier(.16,1,.3,1)";
|
|
8
|
+
var CSS = `
|
|
9
|
+
@keyframes aui046-pop { from { opacity: 0; transform: translateY(var(--aui046-y, -6px)) scale(.97) } }
|
|
10
|
+
@keyframes aui046-row { from { opacity: 0; transform: translateY(5px) } }
|
|
11
|
+
@keyframes aui046-join { 0% { opacity: 0; transform: translateX(10px) scale(.4) } 60% { opacity: 1; transform: translateX(-1px) scale(1.08) } 100% { transform: none } }
|
|
12
|
+
@keyframes aui046-roll { from { opacity: 0; transform: translateY(60%) } }
|
|
13
|
+
@keyframes aui046-draw { from { stroke-dashoffset: 16 } }
|
|
14
|
+
@media (prefers-reduced-motion: reduce) { .aui046 *, .aui046 { animation: none !important; transition: none !important } }
|
|
15
|
+
`;
|
|
16
|
+
var TEAM = [
|
|
17
|
+
{ id: "lena", name: "Lena Marsh", detail: "Design lead" },
|
|
18
|
+
{ id: "arif", name: "Arif Rahman", detail: "Frontend" },
|
|
19
|
+
{ id: "tom", name: "Tom Kessler", detail: "Product" },
|
|
20
|
+
{ id: "sari", name: "Sari Nugroho", detail: "Brand" },
|
|
21
|
+
{ id: "maya", name: "Maya Chen", detail: "Motion" },
|
|
22
|
+
{ id: "daniel", name: "Daniel Ortiz", detail: "Backend" }
|
|
23
|
+
];
|
|
24
|
+
var TONES = [
|
|
25
|
+
"bg-brand text-white",
|
|
26
|
+
"bg-ink text-paper",
|
|
27
|
+
"bg-[color-mix(in_srgb,var(--brand)_16%,var(--paper))] text-brand",
|
|
28
|
+
"bg-paper-2 text-ink shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent)]",
|
|
29
|
+
"bg-[color-mix(in_srgb,var(--ink)_70%,var(--paper))] text-paper",
|
|
30
|
+
"bg-[color-mix(in_srgb,var(--brand)_55%,var(--ink))] text-white"
|
|
31
|
+
];
|
|
32
|
+
var initials = (n) => n.split(/\s+/).map((w) => w[0]).slice(0, 2).join("").toUpperCase();
|
|
33
|
+
function Avatar({ p, tone, size = 28, ring }) {
|
|
34
|
+
return /* @__PURE__ */ jsx(
|
|
35
|
+
"span",
|
|
36
|
+
{
|
|
37
|
+
"aria-hidden": true,
|
|
38
|
+
className: cx("flex shrink-0 items-center justify-center overflow-hidden rounded-full font-semibold tracking-[-0.02em]", TONES[tone % TONES.length], ring && "shadow-[0_0_0_2px_var(--paper)]"),
|
|
39
|
+
style: { width: size, height: size, fontSize: size * 0.36 },
|
|
40
|
+
children: p.src ? /* @__PURE__ */ jsx("img", { src: p.src, alt: "", width: size, height: size, loading: "lazy", className: "h-full w-full object-cover" }) : initials(p.name)
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
function roomBelow(el, need) {
|
|
45
|
+
const r = el.getBoundingClientRect();
|
|
46
|
+
let top = 0;
|
|
47
|
+
let bottom = window.innerHeight;
|
|
48
|
+
for (let p = el.parentElement; p && p !== document.body; p = p.parentElement) {
|
|
49
|
+
if (/hidden|auto|scroll|clip/.test(getComputedStyle(p).overflowY)) {
|
|
50
|
+
const c = p.getBoundingClientRect();
|
|
51
|
+
top = c.top;
|
|
52
|
+
bottom = c.bottom;
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const below = bottom - r.bottom;
|
|
57
|
+
return below >= need || below >= r.top - top;
|
|
58
|
+
}
|
|
59
|
+
function AssignCombobox({ people = TEAM, value, defaultValue = ["lena", "arif"], onChange, label = "Assignees", maxStack = 4, name, disabled, className }) {
|
|
60
|
+
const [inner, setInner] = useState(defaultValue);
|
|
61
|
+
const ids = value ?? inner;
|
|
62
|
+
const byId = useMemo(() => new Map(people.map((p, i) => [p.id, { p, i }])), [people]);
|
|
63
|
+
const picked = ids.map((id) => byId.get(id)).filter((x) => !!x);
|
|
64
|
+
const [open, setOpen] = useState(false);
|
|
65
|
+
const [down, setDown] = useState(true);
|
|
66
|
+
const [q, setQ] = useState("");
|
|
67
|
+
const [active, setActive] = useState(0);
|
|
68
|
+
const root = useRef(null);
|
|
69
|
+
const btn = useRef(null);
|
|
70
|
+
const input = useRef(null);
|
|
71
|
+
const list = useRef(null);
|
|
72
|
+
const uid = useId();
|
|
73
|
+
const t = q.trim().toLowerCase();
|
|
74
|
+
const shown = useMemo(() => t ? people.filter((p) => `${p.name} ${p.detail ?? ""}`.toLowerCase().includes(t)) : people, [people, t]);
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (open) input.current?.focus({ preventScroll: true });
|
|
77
|
+
}, [open]);
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
if (open) list.current?.querySelector(`[data-i="${active}"]`)?.scrollIntoView({ block: "nearest" });
|
|
80
|
+
}, [active, open]);
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
if (!open) return;
|
|
83
|
+
const onDown = (e) => {
|
|
84
|
+
if (!root.current?.contains(e.target)) setOpen(false);
|
|
85
|
+
};
|
|
86
|
+
document.addEventListener("pointerdown", onDown);
|
|
87
|
+
return () => document.removeEventListener("pointerdown", onDown);
|
|
88
|
+
}, [open]);
|
|
89
|
+
const set = (next) => {
|
|
90
|
+
if (value === void 0) setInner(next);
|
|
91
|
+
onChange?.(next);
|
|
92
|
+
};
|
|
93
|
+
const toggle = (p) => {
|
|
94
|
+
if (!p) return;
|
|
95
|
+
set(ids.includes(p.id) ? ids.filter((x) => x !== p.id) : [...ids, p.id]);
|
|
96
|
+
};
|
|
97
|
+
const show = () => {
|
|
98
|
+
if (disabled || !btn.current) return;
|
|
99
|
+
setDown(roomBelow(btn.current, 240));
|
|
100
|
+
setQ("");
|
|
101
|
+
setActive(0);
|
|
102
|
+
setOpen(true);
|
|
103
|
+
};
|
|
104
|
+
const close = () => {
|
|
105
|
+
setOpen(false);
|
|
106
|
+
btn.current?.focus({ preventScroll: true });
|
|
107
|
+
};
|
|
108
|
+
const onKey = (e) => {
|
|
109
|
+
if (e.key === "ArrowDown") setActive((a) => shown.length ? (a + 1) % shown.length : 0);
|
|
110
|
+
else if (e.key === "ArrowUp") setActive((a) => shown.length ? (a - 1 + shown.length) % shown.length : 0);
|
|
111
|
+
else if (e.key === "Home") setActive(0);
|
|
112
|
+
else if (e.key === "End") setActive(Math.max(0, shown.length - 1));
|
|
113
|
+
else if (e.key === "Enter") toggle(shown[active]);
|
|
114
|
+
else if (e.key === "Escape") close();
|
|
115
|
+
else if (e.key === "Tab") return setOpen(false);
|
|
116
|
+
else if (e.key === "Backspace" && !q && ids.length) set(ids.slice(0, -1));
|
|
117
|
+
else return;
|
|
118
|
+
e.preventDefault();
|
|
119
|
+
};
|
|
120
|
+
const stack = picked.slice(0, maxStack);
|
|
121
|
+
const extra = picked.length - stack.length;
|
|
122
|
+
const summary = picked.length === 0 ? "Unassigned" : picked.length === 1 ? picked[0].p.name : picked.length === 2 ? `${picked[0].p.name.split(" ")[0]} and ${picked[1].p.name.split(" ")[0]}` : `${picked[0].p.name.split(" ")[0]} and ${picked.length - 1} others`;
|
|
123
|
+
return /* @__PURE__ */ jsxs("div", { ref: root, className: cx("aui046 relative w-full", open && "z-40", className), children: [
|
|
124
|
+
/* @__PURE__ */ jsx("style", { href: "asta-aui046", precedence: "asta", children: CSS }),
|
|
125
|
+
/* @__PURE__ */ jsxs(
|
|
126
|
+
"button",
|
|
127
|
+
{
|
|
128
|
+
ref: btn,
|
|
129
|
+
type: "button",
|
|
130
|
+
disabled,
|
|
131
|
+
"aria-haspopup": "listbox",
|
|
132
|
+
"aria-expanded": open,
|
|
133
|
+
"aria-controls": open ? `${uid}-list` : void 0,
|
|
134
|
+
"aria-label": `${label}: ${picked.map((x) => x.p.name).join(", ") || "none"}`,
|
|
135
|
+
onClick: () => open ? close() : show(),
|
|
136
|
+
onKeyDown: (e) => {
|
|
137
|
+
if (!open && e.key === "ArrowDown") {
|
|
138
|
+
e.preventDefault();
|
|
139
|
+
show();
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
className: cx(
|
|
143
|
+
"group flex h-11 w-full items-center gap-3 rounded-[10px] bg-paper pl-2 pr-3 text-left outline-none transition-[box-shadow,transform] duration-300 active:scale-[.995] disabled:cursor-not-allowed disabled:opacity-45",
|
|
144
|
+
"shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_12%,transparent)] hover:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_22%,transparent)]",
|
|
145
|
+
"focus-visible:shadow-[inset_0_0_0_1px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_14%,transparent)]",
|
|
146
|
+
open && "!shadow-[inset_0_0_0_1px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_14%,transparent)]"
|
|
147
|
+
),
|
|
148
|
+
children: [
|
|
149
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center -space-x-1.5 pl-0.5", children: [
|
|
150
|
+
stack.map(({ p, i }) => /* @__PURE__ */ jsx("span", { className: "relative inline-flex", style: { animation: `aui046-join .5s ${EASE} both` }, children: /* @__PURE__ */ jsx(Avatar, { p, tone: i, ring: true }) }, p.id)),
|
|
151
|
+
extra > 0 && /* @__PURE__ */ jsxs("span", { className: "relative flex h-7 min-w-7 items-center justify-center rounded-full bg-paper-2 px-1.5 text-[11px] font-semibold tabular-nums text-ink shadow-[0_0_0_2px_var(--paper)]", style: { animation: `aui046-join .5s ${EASE} both` }, children: [
|
|
152
|
+
"+",
|
|
153
|
+
extra
|
|
154
|
+
] }, extra),
|
|
155
|
+
picked.length === 0 && /* @__PURE__ */ jsx("span", { className: "flex h-7 w-7 items-center justify-center rounded-full text-mute shadow-[inset_0_0_0_1.5px_color-mix(in_srgb,var(--ink)_22%,transparent)]", "aria-hidden": true, children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-3.5 w-3.5", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", children: /* @__PURE__ */ jsx("path", { d: "M8 3.5v9M3.5 8h9" }) }) })
|
|
156
|
+
] }),
|
|
157
|
+
/* @__PURE__ */ jsx("span", { className: "relative min-w-0 flex-1 overflow-hidden", children: /* @__PURE__ */ jsx("span", { className: cx("block truncate text-[13.5px]", picked.length ? "text-ink" : "text-mute"), style: { animation: `aui046-roll .4s ${EASE} both` }, children: summary }, summary) }),
|
|
158
|
+
/* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: cx("h-4 w-4 shrink-0 text-mute transition-transform duration-300", open && "rotate-180"), fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "m4 6 4 4 4-4" }) })
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
name && ids.map((id) => /* @__PURE__ */ jsx("input", { type: "hidden", name, value: id }, id)),
|
|
163
|
+
open && /* @__PURE__ */ jsxs(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
className: cx(
|
|
167
|
+
"absolute left-0 z-50 w-full min-w-[280px] overflow-hidden rounded-[13px] bg-paper",
|
|
168
|
+
"shadow-[0_0_0_1px_color-mix(in_srgb,var(--ink)_9%,transparent),0_22px_48px_-16px_rgb(0_0_0/0.3),0_4px_10px_-4px_rgb(0_0_0/0.08)]",
|
|
169
|
+
down ? "top-full mt-2 origin-top" : "bottom-full mb-2 origin-bottom [--aui046-y:6px]"
|
|
170
|
+
),
|
|
171
|
+
style: { animation: `aui046-pop .3s ${EASE} both` },
|
|
172
|
+
children: [
|
|
173
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-3.5 shadow-[0_1px_0_color-mix(in_srgb,var(--ink)_7%,transparent)]", children: [
|
|
174
|
+
/* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", className: "h-3.5 w-3.5 shrink-0 text-mute", fill: "none", stroke: "currentColor", strokeWidth: "1.6", "aria-hidden": true, children: [
|
|
175
|
+
/* @__PURE__ */ jsx("circle", { cx: "7", cy: "7", r: "4.5" }),
|
|
176
|
+
/* @__PURE__ */ jsx("path", { d: "m10.5 10.5 3 3" })
|
|
177
|
+
] }),
|
|
178
|
+
/* @__PURE__ */ jsx(
|
|
179
|
+
"input",
|
|
180
|
+
{
|
|
181
|
+
ref: input,
|
|
182
|
+
value: q,
|
|
183
|
+
onChange: (e) => {
|
|
184
|
+
setQ(e.target.value);
|
|
185
|
+
setActive(0);
|
|
186
|
+
},
|
|
187
|
+
onKeyDown: onKey,
|
|
188
|
+
onBlur: (e) => !root.current?.contains(e.relatedTarget) && setOpen(false),
|
|
189
|
+
placeholder: "Assign people",
|
|
190
|
+
role: "combobox",
|
|
191
|
+
"aria-expanded": true,
|
|
192
|
+
"aria-autocomplete": "list",
|
|
193
|
+
"aria-controls": `${uid}-list`,
|
|
194
|
+
"aria-activedescendant": shown[active] ? `${uid}-o-${active}` : void 0,
|
|
195
|
+
"aria-label": `Search ${label.toLowerCase()}`,
|
|
196
|
+
className: "h-11 min-w-0 flex-1 bg-transparent text-[13.5px] text-ink outline-none placeholder:text-mute"
|
|
197
|
+
}
|
|
198
|
+
),
|
|
199
|
+
/* @__PURE__ */ jsxs(
|
|
200
|
+
"button",
|
|
201
|
+
{
|
|
202
|
+
type: "button",
|
|
203
|
+
disabled: !ids.length,
|
|
204
|
+
onPointerDown: (e) => e.preventDefault(),
|
|
205
|
+
onClick: () => set([]),
|
|
206
|
+
className: "flex items-center gap-1.5 rounded-[6px] px-1.5 py-1 text-[11.5px] text-mute outline-none transition-colors hover:bg-paper-2 hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/50 disabled:opacity-40",
|
|
207
|
+
children: [
|
|
208
|
+
/* @__PURE__ */ jsx("span", { className: "inline-block font-mono tabular-nums text-ink-2", style: { animation: `aui046-roll .35s ${EASE} both` }, children: ids.length }, ids.length),
|
|
209
|
+
"Clear"
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
)
|
|
213
|
+
] }),
|
|
214
|
+
/* @__PURE__ */ jsxs("ul", { ref: list, id: `${uid}-list`, role: "listbox", "aria-multiselectable": true, "aria-label": label, className: "max-h-[184px] overflow-y-auto overscroll-contain p-1 [scrollbar-width:thin]", children: [
|
|
215
|
+
shown.map((p, n) => {
|
|
216
|
+
const on = ids.includes(p.id);
|
|
217
|
+
return /* @__PURE__ */ jsxs(
|
|
218
|
+
"li",
|
|
219
|
+
{
|
|
220
|
+
id: `${uid}-o-${n}`,
|
|
221
|
+
"data-i": n,
|
|
222
|
+
role: "option",
|
|
223
|
+
"aria-selected": on,
|
|
224
|
+
onPointerMove: () => active !== n && setActive(n),
|
|
225
|
+
onPointerDown: (e) => e.preventDefault(),
|
|
226
|
+
onClick: () => toggle(p),
|
|
227
|
+
className: cx("flex h-11 cursor-pointer select-none items-center gap-2.5 rounded-[8px] px-2 transition-colors duration-150", n === active && "bg-paper-2"),
|
|
228
|
+
style: { animation: `aui046-row .4s ${EASE} ${Math.min(n, 6) * 30}ms both` },
|
|
229
|
+
children: [
|
|
230
|
+
/* @__PURE__ */ jsx(Avatar, { p, tone: byId.get(p.id)?.i ?? n }),
|
|
231
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
232
|
+
/* @__PURE__ */ jsx("span", { className: cx("block truncate text-[13.5px] text-ink", on && "font-medium"), children: p.name }),
|
|
233
|
+
p.detail && /* @__PURE__ */ jsx("span", { className: "block truncate text-[11.5px] text-mute", children: p.detail })
|
|
234
|
+
] }),
|
|
235
|
+
/* @__PURE__ */ jsx(
|
|
236
|
+
"span",
|
|
237
|
+
{
|
|
238
|
+
"aria-hidden": true,
|
|
239
|
+
className: cx(
|
|
240
|
+
"flex h-[18px] w-[18px] items-center justify-center rounded-[5px] transition-[background-color,box-shadow,transform] duration-300",
|
|
241
|
+
on ? "scale-100 bg-brand text-white" : "scale-90 shadow-[inset_0_0_0_1.5px_color-mix(in_srgb,var(--ink)_22%,transparent)]"
|
|
242
|
+
),
|
|
243
|
+
children: on && /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-3 w-3", fill: "none", stroke: "currentColor", strokeWidth: "2.4", strokeLinecap: "round", strokeLinejoin: "round", strokeDasharray: "16", style: { animation: `aui046-draw .35s ${EASE} both` }, children: /* @__PURE__ */ jsx("path", { d: "m4 8.5 2.6 2.5L12 5.5" }) })
|
|
244
|
+
}
|
|
245
|
+
)
|
|
246
|
+
]
|
|
247
|
+
},
|
|
248
|
+
p.id
|
|
249
|
+
);
|
|
250
|
+
}),
|
|
251
|
+
!shown.length && /* @__PURE__ */ jsxs("li", { className: "px-3 py-6 text-center text-[13px] text-mute", children: [
|
|
252
|
+
"Nobody called \u201C",
|
|
253
|
+
q.trim(),
|
|
254
|
+
"\u201D"
|
|
255
|
+
] })
|
|
256
|
+
] })
|
|
257
|
+
]
|
|
258
|
+
}
|
|
259
|
+
)
|
|
260
|
+
] });
|
|
261
|
+
}
|
|
262
|
+
var combobox_aui_046_default = AssignCombobox;
|
|
263
|
+
|
|
264
|
+
export {
|
|
265
|
+
AssignCombobox,
|
|
266
|
+
combobox_aui_046_default
|
|
267
|
+
};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/variants/slider-aui-063.tsx
|
|
4
|
+
import { useId, useRef, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
7
|
+
var EASE = "cubic-bezier(.16,1,.3,1)";
|
|
8
|
+
var SPRING = "cubic-bezier(.34,1.56,.64,1)";
|
|
9
|
+
var CSS = `
|
|
10
|
+
@keyframes aui063-rise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
|
|
11
|
+
@keyframes aui063-art { from { opacity: 0; transform: scale(.9) } to { opacity: 1; transform: none } }
|
|
12
|
+
@media (prefers-reduced-motion: reduce) { .aui063 * { animation: none !important; transition: none !important } }
|
|
13
|
+
`;
|
|
14
|
+
var rise = (i) => ({ animation: `aui063-rise .6s ${EASE} ${80 + i * 55}ms both` });
|
|
15
|
+
var HALF = 8;
|
|
16
|
+
function Speaker({ level }) {
|
|
17
|
+
const muted = level === 0;
|
|
18
|
+
const wave = (i) => {
|
|
19
|
+
const on = !muted && level > i * 33;
|
|
20
|
+
return { opacity: on ? 1 : 0, transform: on ? "scale(1)" : "scale(.6)", transformOrigin: "6px 10px", transition: `transform 360ms ${SPRING} ${i * 40}ms, opacity 240ms ${EASE} ${i * 40}ms` };
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 20 20", className: "h-[18px] w-[18px]", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
23
|
+
/* @__PURE__ */ jsx("path", { d: "M3 7.5h2.5L9.5 4v12l-4-3.5H3z", fill: "currentColor", fillOpacity: "0.12" }),
|
|
24
|
+
/* @__PURE__ */ jsx("path", { d: "M12 8a2.8 2.8 0 010 4", style: wave(0) }),
|
|
25
|
+
/* @__PURE__ */ jsx("path", { d: "M13.8 6.2a5.4 5.4 0 010 7.6", style: wave(1) }),
|
|
26
|
+
/* @__PURE__ */ jsx("path", { d: "M15.6 4.4a8 8 0 010 11.2", style: wave(2) }),
|
|
27
|
+
/* @__PURE__ */ jsx("g", { style: { opacity: muted ? 1 : 0, transform: muted ? "scale(1)" : "scale(.4)", transformOrigin: "15px 10px", transition: `transform 360ms ${SPRING}, opacity 200ms ${EASE}` }, children: /* @__PURE__ */ jsx("path", { d: "M13 8l4 4M17 8l-4 4" }) })
|
|
28
|
+
] });
|
|
29
|
+
}
|
|
30
|
+
function VolumeSlider({ value, defaultValue = 64, onValueChange, title = "Slow Tide", artist = "Mira Sol", art = "/lab/art/hoarfrost.webp", disabled, name, className }) {
|
|
31
|
+
const uid = useId();
|
|
32
|
+
const [inner, setInner] = useState(defaultValue);
|
|
33
|
+
const v = value ?? inner;
|
|
34
|
+
const k = v / 100;
|
|
35
|
+
const [drag, setDrag] = useState(false);
|
|
36
|
+
const [playing, setPlaying] = useState(true);
|
|
37
|
+
const before = useRef(defaultValue || 64);
|
|
38
|
+
const track = useRef(null);
|
|
39
|
+
const thumb = useRef(null);
|
|
40
|
+
const box = useRef(null);
|
|
41
|
+
const set = (n) => {
|
|
42
|
+
const s = Math.round(Math.min(100, Math.max(0, n)));
|
|
43
|
+
if (s === v) return;
|
|
44
|
+
if (value === void 0) setInner(s);
|
|
45
|
+
onValueChange?.(s);
|
|
46
|
+
};
|
|
47
|
+
const fromX = (x) => {
|
|
48
|
+
const b = box.current;
|
|
49
|
+
return b ? (x - b.left) / b.width * 100 : v;
|
|
50
|
+
};
|
|
51
|
+
const down = (e) => {
|
|
52
|
+
if (disabled || !track.current) return;
|
|
53
|
+
const r = track.current.getBoundingClientRect();
|
|
54
|
+
box.current = { left: r.left + HALF, width: r.width - HALF * 2 };
|
|
55
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
56
|
+
setDrag(true);
|
|
57
|
+
set(fromX(e.clientX));
|
|
58
|
+
thumb.current?.focus({ preventScroll: true });
|
|
59
|
+
};
|
|
60
|
+
const move = (e) => drag && set(fromX(e.clientX));
|
|
61
|
+
const up = () => setDrag(false);
|
|
62
|
+
const key = (e) => {
|
|
63
|
+
const map = { ArrowRight: v + 2, ArrowUp: v + 2, ArrowLeft: v - 2, ArrowDown: v - 2, PageUp: v + 10, PageDown: v - 10, Home: 0, End: 100 };
|
|
64
|
+
if (!(e.key in map)) return;
|
|
65
|
+
e.preventDefault();
|
|
66
|
+
set(map[e.key]);
|
|
67
|
+
};
|
|
68
|
+
const mute = () => {
|
|
69
|
+
if (v > 0) {
|
|
70
|
+
before.current = v;
|
|
71
|
+
set(0);
|
|
72
|
+
} else set(before.current || 50);
|
|
73
|
+
};
|
|
74
|
+
const glide = drag ? "none" : `transform 320ms ${EASE}`;
|
|
75
|
+
return /* @__PURE__ */ jsxs(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
className: cx(
|
|
79
|
+
"aui063 w-full max-w-[400px] rounded-[14px] bg-paper p-4 sm:p-5",
|
|
80
|
+
"shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent),0_1px_2px_rgb(0_0_0/0.04),0_18px_40px_-20px_rgb(0_0_0/0.25)]",
|
|
81
|
+
disabled && "opacity-60",
|
|
82
|
+
className
|
|
83
|
+
),
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ jsx("style", { href: "asta-aui063", precedence: "asta", children: CSS }),
|
|
86
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3.5", children: [
|
|
87
|
+
/* @__PURE__ */ jsx("img", { src: art, alt: "", width: 56, height: 56, loading: "lazy", decoding: "async", className: "h-14 w-14 shrink-0 rounded-[10px] object-cover shadow-[0_1px_2px_rgb(0_0_0/0.1),0_8px_18px_-10px_rgb(0_0_0/0.5)]", style: { animation: `aui063-art .7s ${EASE} 60ms both` } }),
|
|
88
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", style: rise(1), children: [
|
|
89
|
+
/* @__PURE__ */ jsx("p", { className: "font-mono text-[10.5px] uppercase tracking-[0.08em] text-mute", children: "Astabyte Radio" }),
|
|
90
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 truncate text-[16px] font-medium tracking-[-0.02em] text-ink", children: title }),
|
|
91
|
+
/* @__PURE__ */ jsx("p", { className: "truncate text-[13px] text-mute", children: artist })
|
|
92
|
+
] }),
|
|
93
|
+
/* @__PURE__ */ jsx(
|
|
94
|
+
"button",
|
|
95
|
+
{
|
|
96
|
+
type: "button",
|
|
97
|
+
"aria-label": playing ? "Pause" : "Play",
|
|
98
|
+
onClick: () => setPlaying((p) => !p),
|
|
99
|
+
className: "grid h-10 w-10 shrink-0 place-items-center rounded-full bg-ink text-paper outline-none transition-transform duration-200 hover:scale-105 active:scale-95 focus-visible:ring-2 focus-visible:ring-brand/50 focus-visible:ring-offset-2 focus-visible:ring-offset-paper",
|
|
100
|
+
style: rise(2),
|
|
101
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-3.5 w-3.5", fill: "currentColor", "aria-hidden": true, children: playing ? /* @__PURE__ */ jsx("path", { d: "M4 3h2.6v10H4zM9.4 3H12v10H9.4z" }) : /* @__PURE__ */ jsx("path", { d: "M5 3l8 5-8 5z" }) })
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
] }),
|
|
105
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 flex items-center gap-3 rounded-[11px] bg-paper-2 py-2 pl-2 pr-3.5", style: rise(3), children: [
|
|
106
|
+
/* @__PURE__ */ jsx(
|
|
107
|
+
"button",
|
|
108
|
+
{
|
|
109
|
+
type: "button",
|
|
110
|
+
onClick: mute,
|
|
111
|
+
"aria-label": v === 0 ? "Unmute" : "Mute",
|
|
112
|
+
className: "grid h-8 w-8 shrink-0 place-items-center rounded-[8px] text-ink outline-none transition-transform duration-200 hover:bg-paper active:scale-90 focus-visible:ring-2 focus-visible:ring-brand/50",
|
|
113
|
+
children: /* @__PURE__ */ jsx(Speaker, { level: v })
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
/* @__PURE__ */ jsxs("div", { ref: track, onPointerDown: down, onPointerMove: move, onPointerUp: up, onPointerCancel: up, className: cx("group/vol relative flex h-8 flex-1 touch-none select-none items-center", disabled ? "pointer-events-none" : "cursor-pointer"), children: [
|
|
117
|
+
/* @__PURE__ */ jsx("div", { className: "relative h-1.5 w-full overflow-hidden rounded-full bg-[color-mix(in_srgb,var(--ink)_10%,transparent)] transition-transform duration-300 group-hover/vol:scale-y-[1.35]", children: /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0", style: { left: HALF, right: HALF, transform: `translateX(${k * 100}%)`, transition: glide }, children: /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 right-full w-[4000px] bg-[linear-gradient(90deg,color-mix(in_srgb,var(--brand)_45%,var(--paper))_0,var(--brand)_3600px)]" }) }) }),
|
|
118
|
+
/* @__PURE__ */ jsxs("div", { className: "pointer-events-none absolute inset-y-0", style: { left: HALF, right: HALF, transform: `translateX(${k * 100}%)`, transition: glide }, children: [
|
|
119
|
+
/* @__PURE__ */ jsx(
|
|
120
|
+
"span",
|
|
121
|
+
{
|
|
122
|
+
"aria-hidden": true,
|
|
123
|
+
className: "absolute left-0 top-1/2 h-10 w-16 rounded-full bg-[radial-gradient(closest-side,color-mix(in_srgb,var(--brand)_70%,transparent),transparent)] transition-[transform,opacity] duration-300",
|
|
124
|
+
style: { opacity: v === 0 ? 0 : 0.2 + k * 0.7, transform: `translate(-80%, -50%) scale(${0.6 + k * 0.7})` }
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
/* @__PURE__ */ jsx(
|
|
128
|
+
"div",
|
|
129
|
+
{
|
|
130
|
+
ref: thumb,
|
|
131
|
+
role: "slider",
|
|
132
|
+
tabIndex: disabled ? -1 : 0,
|
|
133
|
+
"aria-label": "Volume",
|
|
134
|
+
"aria-valuemin": 0,
|
|
135
|
+
"aria-valuemax": 100,
|
|
136
|
+
"aria-valuenow": v,
|
|
137
|
+
"aria-valuetext": v === 0 ? "Muted" : `${v} percent`,
|
|
138
|
+
"aria-disabled": disabled || void 0,
|
|
139
|
+
"aria-describedby": `${uid}-n`,
|
|
140
|
+
onKeyDown: key,
|
|
141
|
+
className: "group/th pointer-events-auto absolute left-0 top-1/2 h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full outline-none",
|
|
142
|
+
children: /* @__PURE__ */ jsx(
|
|
143
|
+
"span",
|
|
144
|
+
{
|
|
145
|
+
className: "absolute inset-0 rounded-full bg-white shadow-[0_0_0_1px_color-mix(in_srgb,var(--ink)_12%,transparent),0_1px_3px_rgb(0_0_0/0.25)] transition-transform duration-300 group-focus-visible/th:shadow-[0_0_0_4px_color-mix(in_srgb,var(--brand)_30%,transparent)]",
|
|
146
|
+
style: { transform: drag ? "scale(1.25)" : "scale(1)", transitionTimingFunction: SPRING }
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
] })
|
|
152
|
+
] }),
|
|
153
|
+
/* @__PURE__ */ jsx("span", { id: `${uid}-n`, className: "w-7 shrink-0 text-right font-mono text-[12px] tabular-nums text-ink", children: v }),
|
|
154
|
+
name && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: v })
|
|
155
|
+
] })
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
var slider_aui_063_default = VolumeSlider;
|
|
161
|
+
|
|
162
|
+
export {
|
|
163
|
+
VolumeSlider,
|
|
164
|
+
slider_aui_063_default
|
|
165
|
+
};
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/variants/checkbox-aui-054.tsx
|
|
4
|
+
import { useEffect, useId, useRef, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var cx = (...c) => c.filter(Boolean).join(" ");
|
|
7
|
+
var EASE = "cubic-bezier(.16,1,.3,1)";
|
|
8
|
+
var SPRING = "cubic-bezier(.34,1.56,.64,1)";
|
|
9
|
+
var CSS = `
|
|
10
|
+
@keyframes aui054-rise { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
|
|
11
|
+
@keyframes aui054-drop { from { opacity: 0; transform: translateY(-6px) } to { opacity: 1; transform: none } }
|
|
12
|
+
@media (prefers-reduced-motion: reduce) { .aui054 * { animation: none !important; transition: none !important } }
|
|
13
|
+
`;
|
|
14
|
+
var rise = (i) => ({ animation: `aui054-rise .6s ${EASE} ${80 + i * 50}ms both` });
|
|
15
|
+
var GROUPS = [
|
|
16
|
+
{ id: "projects", label: "Projects", description: "Boards, docs and files", children: [{ id: "projects.view", label: "View projects" }, { id: "projects.edit", label: "Edit and comment" }, { id: "projects.delete", label: "Delete projects" }] },
|
|
17
|
+
{ id: "members", label: "Members", description: "People in this workspace", children: [{ id: "members.view", label: "See the member list" }, { id: "members.invite", label: "Invite people" }, { id: "members.remove", label: "Remove people" }] },
|
|
18
|
+
{ id: "billing", label: "Billing", description: "Plan, invoices and cards", children: [{ id: "billing.view", label: "Download invoices" }, { id: "billing.manage", label: "Change plan and payment" }] }
|
|
19
|
+
];
|
|
20
|
+
var PRESETS = [
|
|
21
|
+
{ name: "Viewer", ids: ["projects.view", "members.view"] },
|
|
22
|
+
{ name: "Editor", ids: ["projects.view", "projects.edit", "members.view", "members.invite"] },
|
|
23
|
+
{ name: "Admin", ids: GROUPS.flatMap((g) => g.children.map((c) => c.id)) }
|
|
24
|
+
];
|
|
25
|
+
var same = (a, b) => a.length === b.length && a.every((x) => b.includes(x));
|
|
26
|
+
function TreeCheckbox({
|
|
27
|
+
groups = GROUPS,
|
|
28
|
+
presets = PRESETS,
|
|
29
|
+
value,
|
|
30
|
+
defaultValue = PRESETS[1].ids,
|
|
31
|
+
onChange,
|
|
32
|
+
defaultOpen = ["projects", "members"],
|
|
33
|
+
title = "Permissions",
|
|
34
|
+
subject = "Maya Santos \xB7 maya@astabyte.com",
|
|
35
|
+
className
|
|
36
|
+
}) {
|
|
37
|
+
const uid = useId();
|
|
38
|
+
const [inner, setInner] = useState(defaultValue);
|
|
39
|
+
const [open, setOpen] = useState(defaultOpen);
|
|
40
|
+
const picked = value ?? inner;
|
|
41
|
+
const set = (next) => {
|
|
42
|
+
if (value === void 0) setInner(next);
|
|
43
|
+
onChange?.(next);
|
|
44
|
+
};
|
|
45
|
+
const toggleLeaf = (id) => set(picked.includes(id) ? picked.filter((x) => x !== id) : [...picked, id]);
|
|
46
|
+
const toggleGroup = (g) => {
|
|
47
|
+
const ids = g.children.map((c) => c.id);
|
|
48
|
+
const all = ids.every((x) => picked.includes(x));
|
|
49
|
+
set(all ? picked.filter((x) => !ids.includes(x)) : [...picked.filter((x) => !ids.includes(x)), ...ids]);
|
|
50
|
+
};
|
|
51
|
+
const names = [...presets.map((p) => p.name), "Custom", "No access"];
|
|
52
|
+
const match = picked.length === 0 ? names.length - 1 : Math.max(presets.findIndex((p) => same(p.ids, picked)), -1);
|
|
53
|
+
const roleIndex = match === -1 ? presets.length : match;
|
|
54
|
+
return /* @__PURE__ */ jsxs(
|
|
55
|
+
"section",
|
|
56
|
+
{
|
|
57
|
+
"aria-labelledby": `${uid}-t`,
|
|
58
|
+
className: cx(
|
|
59
|
+
"aui054 w-full max-w-[440px] rounded-[14px] bg-paper p-5 sm:p-6",
|
|
60
|
+
"shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent),0_1px_2px_rgb(0_0_0/0.04),0_18px_40px_-20px_rgb(0_0_0/0.25)]",
|
|
61
|
+
className
|
|
62
|
+
),
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsx("style", { href: "asta-aui054", precedence: "asta", children: CSS }),
|
|
65
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4", style: rise(0), children: [
|
|
66
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
67
|
+
/* @__PURE__ */ jsx("h3", { id: `${uid}-t`, className: "text-[20px] font-medium leading-tight tracking-[-0.02em] text-ink", children: title }),
|
|
68
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 truncate text-[13px] text-mute", children: subject })
|
|
69
|
+
] }),
|
|
70
|
+
/* @__PURE__ */ jsxs("div", { className: "shrink-0 text-right", children: [
|
|
71
|
+
/* @__PURE__ */ jsx("p", { className: "font-mono text-[10.5px] uppercase tracking-[0.08em] text-mute", children: "Role" }),
|
|
72
|
+
/* @__PURE__ */ jsx("span", { className: "relative mt-1 block h-5 w-[78px] overflow-hidden text-right text-[14px] font-medium tracking-[-0.01em] text-ink", "aria-live": "polite", children: /* @__PURE__ */ jsx("span", { className: "absolute inset-x-0 top-0 flex flex-col transition-transform duration-500", style: { transform: `translateY(${-roleIndex * 20}px)`, transitionTimingFunction: EASE }, children: names.map((n, i) => /* @__PURE__ */ jsx("span", { "aria-hidden": i !== roleIndex, className: cx("block h-5 leading-5", i === presets.length + 1 && "text-mute"), children: n }, n)) }) })
|
|
73
|
+
] })
|
|
74
|
+
] }),
|
|
75
|
+
/* @__PURE__ */ jsx("div", { role: "group", "aria-label": "Role presets", className: "mt-4 flex gap-1.5", style: rise(1), children: presets.map((p, i) => {
|
|
76
|
+
const on = i === match;
|
|
77
|
+
return /* @__PURE__ */ jsxs(
|
|
78
|
+
"button",
|
|
79
|
+
{
|
|
80
|
+
type: "button",
|
|
81
|
+
"aria-pressed": on,
|
|
82
|
+
onClick: () => set(p.ids),
|
|
83
|
+
className: cx(
|
|
84
|
+
"relative h-8 flex-1 rounded-[8px] text-[13px] font-medium outline-none transition-transform duration-200 active:scale-[0.97] focus-visible:ring-2 focus-visible:ring-brand/50",
|
|
85
|
+
on ? "text-white" : "text-ink"
|
|
86
|
+
),
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "absolute inset-0 rounded-[8px] bg-paper-2 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_6%,transparent)]" }),
|
|
89
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "absolute inset-0 rounded-[8px] bg-ink transition-[transform,opacity] duration-300", style: { opacity: on ? 1 : 0, transform: on ? "scale(1)" : "scale(0.92)", transitionTimingFunction: EASE } }),
|
|
90
|
+
/* @__PURE__ */ jsx("span", { className: "relative transition-colors duration-300", children: p.name })
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
p.name
|
|
94
|
+
);
|
|
95
|
+
}) }),
|
|
96
|
+
/* @__PURE__ */ jsx("ul", { className: "mt-3 -mx-2", children: groups.map((g, gi) => {
|
|
97
|
+
const ids = g.children.map((c) => c.id);
|
|
98
|
+
const n = ids.filter((x) => picked.includes(x)).length;
|
|
99
|
+
const state = n === 0 ? false : n === ids.length ? true : "mixed";
|
|
100
|
+
const isOpen = open.includes(g.id);
|
|
101
|
+
const gid = `${uid}-${g.id}`;
|
|
102
|
+
return /* @__PURE__ */ jsxs("li", { style: rise(gi + 2), children: [
|
|
103
|
+
/* @__PURE__ */ jsxs("div", { className: "group/row relative flex items-center gap-1 rounded-[10px] py-1.5 pl-1 pr-2", children: [
|
|
104
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "pointer-events-none absolute inset-0 rounded-[10px] bg-paper-2 opacity-0 transition-opacity duration-300 group-hover/row:opacity-70" }),
|
|
105
|
+
/* @__PURE__ */ jsx(
|
|
106
|
+
"button",
|
|
107
|
+
{
|
|
108
|
+
type: "button",
|
|
109
|
+
"aria-expanded": isOpen,
|
|
110
|
+
"aria-controls": `${gid}-list`,
|
|
111
|
+
"aria-label": `${isOpen ? "Collapse" : "Expand"} ${g.label}`,
|
|
112
|
+
onClick: () => setOpen((o) => o.includes(g.id) ? o.filter((x) => x !== g.id) : [...o, g.id]),
|
|
113
|
+
className: "relative grid h-7 w-7 shrink-0 place-items-center rounded-[7px] text-mute outline-none transition-colors hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/50",
|
|
114
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-3.5 w-3.5 transition-transform duration-300", style: { transform: `rotate(${isOpen ? 90 : 0}deg)`, transitionTimingFunction: EASE }, fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M6 3.5L10.5 8 6 12.5" }) })
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
/* @__PURE__ */ jsxs("label", { htmlFor: gid, className: "relative flex min-w-0 flex-1 cursor-pointer select-none items-center gap-3 rounded-[7px] py-0.5 has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-brand", children: [
|
|
118
|
+
/* @__PURE__ */ jsx(TriBox, { id: gid, state, onToggle: () => toggleGroup(g) }),
|
|
119
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
120
|
+
/* @__PURE__ */ jsx("span", { className: "block text-[14px] font-medium tracking-[-0.01em] text-ink", children: g.label }),
|
|
121
|
+
g.description && /* @__PURE__ */ jsx("span", { className: "block truncate text-[12px] text-mute", children: g.description })
|
|
122
|
+
] }),
|
|
123
|
+
/* @__PURE__ */ jsxs("span", { className: "font-mono text-[11.5px] tabular-nums text-mute", children: [
|
|
124
|
+
n,
|
|
125
|
+
"/",
|
|
126
|
+
ids.length
|
|
127
|
+
] })
|
|
128
|
+
] })
|
|
129
|
+
] }),
|
|
130
|
+
isOpen && /* @__PURE__ */ jsxs("ul", { id: `${gid}-list`, className: "relative ml-[22px] pb-1 pl-[18px]", children: [
|
|
131
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "absolute bottom-3 left-0 top-0 w-px bg-[color-mix(in_srgb,var(--ink)_12%,transparent)]" }),
|
|
132
|
+
g.children.map((c, ci) => {
|
|
133
|
+
const cid = `${uid}-${c.id}`;
|
|
134
|
+
return /* @__PURE__ */ jsx("li", { style: { animation: `aui054-drop .45s ${EASE} ${ci * 40}ms both` }, children: /* @__PURE__ */ jsxs("label", { htmlFor: cid, className: "group/leaf relative flex cursor-pointer select-none items-center gap-3 rounded-[8px] px-2 py-[7px] has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-brand", children: [
|
|
135
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "pointer-events-none absolute inset-0 rounded-[8px] bg-paper-2 opacity-0 transition-opacity duration-300 group-hover/leaf:opacity-70" }),
|
|
136
|
+
/* @__PURE__ */ jsx(TriBox, { id: cid, state: picked.includes(c.id), onToggle: () => toggleLeaf(c.id), small: true }),
|
|
137
|
+
/* @__PURE__ */ jsx("span", { className: "relative text-[13.5px] text-ink", children: c.label })
|
|
138
|
+
] }) }, c.id);
|
|
139
|
+
})
|
|
140
|
+
] })
|
|
141
|
+
] }, g.id);
|
|
142
|
+
}) })
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
function TriBox({ id, state, onToggle, small }) {
|
|
148
|
+
const ref = useRef(null);
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
if (ref.current) ref.current.indeterminate = state === "mixed";
|
|
151
|
+
}, [state]);
|
|
152
|
+
const on = state === true;
|
|
153
|
+
const mixed = state === "mixed";
|
|
154
|
+
const filled = on || mixed;
|
|
155
|
+
return /* @__PURE__ */ jsxs("span", { className: cx("relative grid shrink-0 place-items-center", small ? "h-4 w-4" : "h-[18px] w-[18px]"), children: [
|
|
156
|
+
/* @__PURE__ */ jsx("input", { ref, id, type: "checkbox", checked: on, onChange: onToggle, className: "sr-only" }),
|
|
157
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "absolute inset-0 rounded-[5px] bg-paper shadow-[inset_0_0_0_1.5px_color-mix(in_srgb,var(--ink)_24%,transparent)]" }),
|
|
158
|
+
/* @__PURE__ */ jsx(
|
|
159
|
+
"span",
|
|
160
|
+
{
|
|
161
|
+
"aria-hidden": true,
|
|
162
|
+
className: "absolute inset-0 rounded-[5px] bg-brand shadow-[inset_0_1px_0_rgb(255_255_255/0.2),0_1px_2px_rgb(0_0_0/0.2)] transition-[transform,opacity] duration-300",
|
|
163
|
+
style: { opacity: filled ? 1 : 0, transform: filled ? "scale(1)" : "scale(0.6)", transitionTimingFunction: SPRING }
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
/* @__PURE__ */ jsx("svg", { "aria-hidden": true, viewBox: "0 0 16 16", className: cx("relative text-white", small ? "h-2.5 w-2.5" : "h-3 w-3"), fill: "none", stroke: "currentColor", strokeWidth: "2.6", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("path", { d: "M3.5 8.5l3 3 6-7", pathLength: 1, strokeDasharray: "1", className: "transition-[stroke-dashoffset]", style: { strokeDashoffset: on ? 0 : 1, transitionDuration: on ? "380ms" : "120ms", transitionTimingFunction: EASE } }) }),
|
|
167
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "absolute h-[2.2px] w-2 rounded-full bg-white transition-transform duration-300", style: { transform: `scaleX(${mixed ? 1 : 0})`, transitionTimingFunction: EASE } })
|
|
168
|
+
] });
|
|
169
|
+
}
|
|
170
|
+
var checkbox_aui_054_default = TreeCheckbox;
|
|
171
|
+
|
|
172
|
+
export {
|
|
173
|
+
TreeCheckbox,
|
|
174
|
+
checkbox_aui_054_default
|
|
175
|
+
};
|