asta-ui 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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,149 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/variants/radio-group-aui-056.tsx
|
|
4
|
+
import { useId, 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 aui056-rise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
|
|
10
|
+
@keyframes aui056-draw { from { stroke-dashoffset: 1 } to { stroke-dashoffset: 0 } }
|
|
11
|
+
@keyframes aui056-fade { from { opacity: 0 } to { opacity: 1 } }
|
|
12
|
+
@keyframes aui056-pop { 0% { opacity: 0; transform: scale(.2) } 60% { opacity: 1; transform: scale(1.25) } 100% { opacity: 1; transform: scale(1) } }
|
|
13
|
+
@media (prefers-reduced-motion: reduce) { .aui056 * { animation: none !important; transition: none !important } }
|
|
14
|
+
`;
|
|
15
|
+
var rise = (i) => ({ animation: `aui056-rise .6s ${EASE} ${80 + i * 50}ms both` });
|
|
16
|
+
var wave = (seed, trend, n = 28) => Array.from({ length: n }, (_, i) => 50 + trend * i + 6 * Math.sin(i * 0.55 + seed) + 2.2 * Math.sin(i * 1.7 + seed * 2));
|
|
17
|
+
var OPTIONS = [
|
|
18
|
+
{ value: "1d", label: "1D", figure: "1,284", change: 3.2, points: wave(1, 0.5), axis: ["00:00", "12:00", "Now"] },
|
|
19
|
+
{ value: "1w", label: "1W", figure: "9,640", change: 8.1, points: wave(2.4, 0.9), axis: ["Thu", "Mon", "Today"] },
|
|
20
|
+
{ value: "1m", label: "1M", figure: "48,210", change: 12.4, points: wave(4, 1.3), axis: ["Oct 19", "Nov 4", "Nov 19"] },
|
|
21
|
+
{ value: "3m", label: "3M", figure: "131,900", change: -2.3, points: wave(5.5, -0.35), axis: ["Aug", "Oct", "Nov"] },
|
|
22
|
+
{ value: "1y", label: "1Y", figure: "512,400", change: 41, points: wave(7, 2), axis: ["2025", "Jun", "2026"] }
|
|
23
|
+
];
|
|
24
|
+
var W = 300;
|
|
25
|
+
var H = 100;
|
|
26
|
+
function paths(points) {
|
|
27
|
+
const lo = Math.min(...points);
|
|
28
|
+
const hi = Math.max(...points);
|
|
29
|
+
const xy = points.map((p, i) => [i / (points.length - 1) * W, 8 + (1 - (p - lo) / (hi - lo || 1)) * (H - 16)]);
|
|
30
|
+
let d = `M${xy[0][0].toFixed(1)} ${xy[0][1].toFixed(1)}`;
|
|
31
|
+
for (let i = 1; i < xy.length; i++) {
|
|
32
|
+
const [x0, y0] = xy[i - 1];
|
|
33
|
+
const [x1, y1] = xy[i];
|
|
34
|
+
const mx = (x0 + x1) / 2;
|
|
35
|
+
d += ` C${mx.toFixed(1)} ${y0.toFixed(1)} ${mx.toFixed(1)} ${y1.toFixed(1)} ${x1.toFixed(1)} ${y1.toFixed(1)}`;
|
|
36
|
+
}
|
|
37
|
+
return { line: d, area: `${d} L${W} ${H} L0 ${H} Z`, end: xy[xy.length - 1] };
|
|
38
|
+
}
|
|
39
|
+
function Roll({ text }) {
|
|
40
|
+
const chars = text.split("");
|
|
41
|
+
return /* @__PURE__ */ jsxs("span", { className: "inline-flex tabular-nums", children: [
|
|
42
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: text }),
|
|
43
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "inline-flex", children: chars.map(
|
|
44
|
+
(ch, i) => /\d/.test(ch) ? /* @__PURE__ */ jsx("span", { className: "relative inline-block h-[1em] w-[0.6em] overflow-hidden", children: /* @__PURE__ */ jsx("span", { className: "absolute inset-x-0 top-0 flex flex-col transition-transform duration-700", style: { transform: `translateY(${-Number(ch) * 10}%)`, transitionTimingFunction: EASE, transitionDelay: `${(chars.length - 1 - i) * 35}ms` }, children: Array.from({ length: 10 }, (_, n) => /* @__PURE__ */ jsx("span", { className: "block h-[1em] text-center leading-[1em]", children: n }, n)) }) }, chars.length - i) : /* @__PURE__ */ jsx("span", { className: "w-[0.28em] leading-[1em]", children: ch }, `c${chars.length - i}`)
|
|
45
|
+
) })
|
|
46
|
+
] });
|
|
47
|
+
}
|
|
48
|
+
function SegmentRadio({ options = OPTIONS, value, defaultValue = "1w", onChange, label = "Net revenue", currency = "$", name, className }) {
|
|
49
|
+
const uid = useId();
|
|
50
|
+
const [inner, setInner] = useState(defaultValue);
|
|
51
|
+
const current = value ?? inner;
|
|
52
|
+
const index = Math.max(0, options.findIndex((o) => o.value === current));
|
|
53
|
+
const opt = options[index];
|
|
54
|
+
const { line, area, end } = paths(opt.points);
|
|
55
|
+
const up = opt.change >= 0;
|
|
56
|
+
const pick = (v) => {
|
|
57
|
+
if (value === void 0) setInner(v);
|
|
58
|
+
onChange?.(v);
|
|
59
|
+
};
|
|
60
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("aui056 relative w-full max-w-[420px] overflow-hidden rounded-[14px] bg-ink p-5 text-paper shadow-[0_1px_2px_rgb(0_0_0/0.1),0_24px_48px_-24px_rgb(0_0_0/0.55)] sm:p-6", className), children: [
|
|
61
|
+
/* @__PURE__ */ jsx("style", { href: "asta-aui056", precedence: "asta", children: CSS }),
|
|
62
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "pointer-events-none absolute -right-20 -top-24 h-64 w-64 rounded-full bg-[radial-gradient(closest-side,color-mix(in_srgb,var(--brand)_45%,transparent),transparent)] opacity-60" }),
|
|
63
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", style: rise(0), children: [
|
|
64
|
+
/* @__PURE__ */ jsxs("p", { className: "font-mono text-[11px] uppercase tracking-[0.08em] text-paper/50", children: [
|
|
65
|
+
"Astabyte \xB7 ",
|
|
66
|
+
label
|
|
67
|
+
] }),
|
|
68
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-2 flex items-end gap-3", children: [
|
|
69
|
+
/* @__PURE__ */ jsxs("p", { className: "flex items-start text-[36px] font-medium leading-none tracking-[-0.045em]", children: [
|
|
70
|
+
/* @__PURE__ */ jsx("span", { className: "mr-0.5 mt-[4px] text-[15px] tracking-normal text-paper/50", children: currency }),
|
|
71
|
+
/* @__PURE__ */ jsx(Roll, { text: opt.figure })
|
|
72
|
+
] }),
|
|
73
|
+
/* @__PURE__ */ jsxs(
|
|
74
|
+
"span",
|
|
75
|
+
{
|
|
76
|
+
className: cx("mb-1 inline-flex h-6 items-center gap-1 rounded-[6px] px-2 text-[12px] font-medium tabular-nums", up ? "bg-[color-mix(in_srgb,var(--brand)_30%,transparent)] text-paper" : "bg-paper/10 text-paper/70"),
|
|
77
|
+
style: { animation: `aui056-fade .4s ${EASE} both` },
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ jsx("svg", { viewBox: "0 0 12 12", className: "h-2.5 w-2.5", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, style: { transform: up ? "none" : "rotate(180deg)" }, children: /* @__PURE__ */ jsx("path", { d: "M6 9.5v-7M2.5 6L6 2.5 9.5 6" }) }),
|
|
80
|
+
up ? "+" : "\u2212",
|
|
81
|
+
Math.abs(opt.change).toFixed(1),
|
|
82
|
+
"%"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
opt.value
|
|
86
|
+
)
|
|
87
|
+
] })
|
|
88
|
+
] }),
|
|
89
|
+
/* @__PURE__ */ jsxs("div", { className: "relative mt-4", style: rise(1), children: [
|
|
90
|
+
/* @__PURE__ */ jsxs("svg", { viewBox: `0 0 ${W} ${H}`, preserveAspectRatio: "none", className: "block h-[104px] w-full overflow-visible", role: "img", "aria-label": `${label} over ${opt.label}: ${currency}${opt.figure}`, children: [
|
|
91
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: `${uid}-g`, x1: "0", x2: "0", y1: "0", y2: "1", children: [
|
|
92
|
+
/* @__PURE__ */ jsx("stop", { offset: "0", stopColor: "var(--brand)", stopOpacity: "0.45" }),
|
|
93
|
+
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "var(--brand)", stopOpacity: "0" })
|
|
94
|
+
] }) }),
|
|
95
|
+
[0.25, 0.5, 0.75].map((y) => /* @__PURE__ */ jsx("line", { x1: "0", x2: W, y1: H * y, y2: H * y, stroke: "currentColor", strokeOpacity: "0.07", vectorEffect: "non-scaling-stroke" }, y)),
|
|
96
|
+
/* @__PURE__ */ jsx("path", { d: area, fill: `url(#${uid}-g)`, style: { animation: `aui056-fade .8s ${EASE} 200ms both` } }),
|
|
97
|
+
/* @__PURE__ */ jsx(
|
|
98
|
+
"path",
|
|
99
|
+
{
|
|
100
|
+
d: line,
|
|
101
|
+
fill: "none",
|
|
102
|
+
stroke: "color-mix(in srgb, var(--brand) 55%, var(--paper))",
|
|
103
|
+
strokeWidth: "2",
|
|
104
|
+
strokeLinecap: "round",
|
|
105
|
+
vectorEffect: "non-scaling-stroke",
|
|
106
|
+
pathLength: 1,
|
|
107
|
+
strokeDasharray: "1",
|
|
108
|
+
style: { animation: `aui056-draw .9s ${EASE} both` }
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
] }, opt.value),
|
|
112
|
+
/* @__PURE__ */ jsx(
|
|
113
|
+
"span",
|
|
114
|
+
{
|
|
115
|
+
"aria-hidden": true,
|
|
116
|
+
className: "pointer-events-none absolute h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2",
|
|
117
|
+
style: { left: `${end[0] / W * 100}%`, top: `${end[1] / H * 104}px` },
|
|
118
|
+
children: /* @__PURE__ */ jsx("span", { className: "block h-full w-full rounded-full bg-paper shadow-[0_0_0_3px_color-mix(in_srgb,var(--brand)_60%,transparent)]", style: { animation: `aui056-pop .5s ${EASE} 750ms both` } })
|
|
119
|
+
},
|
|
120
|
+
`d${opt.value}`
|
|
121
|
+
),
|
|
122
|
+
/* @__PURE__ */ jsx("div", { className: "mt-2 flex justify-between font-mono text-[10.5px] tracking-[0.04em] text-paper/40", children: (opt.axis ?? ["", "", ""]).map((a, i) => /* @__PURE__ */ jsx("span", { children: a }, i)) })
|
|
123
|
+
] }),
|
|
124
|
+
/* @__PURE__ */ jsxs("div", { role: "radiogroup", "aria-label": "Range", className: "relative mt-4 grid rounded-[9px] bg-paper/[0.07] p-1 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--paper)_8%,transparent)]", style: { ...rise(2), gridTemplateColumns: `repeat(${options.length}, minmax(0, 1fr))` }, children: [
|
|
125
|
+
/* @__PURE__ */ jsx(
|
|
126
|
+
"span",
|
|
127
|
+
{
|
|
128
|
+
"aria-hidden": true,
|
|
129
|
+
className: "pointer-events-none absolute bottom-1 left-1 top-1 rounded-[7px] bg-paper shadow-[0_1px_2px_rgb(0_0_0/0.3),0_4px_12px_-4px_rgb(0_0_0/0.5)] transition-transform duration-500",
|
|
130
|
+
style: { width: `calc((100% - 8px) / ${options.length})`, transform: `translateX(${index * 100}%)`, transitionTimingFunction: EASE }
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
options.map((o, i) => {
|
|
134
|
+
const on = i === index;
|
|
135
|
+
const id = `${uid}-${o.value}`;
|
|
136
|
+
return /* @__PURE__ */ jsxs("label", { htmlFor: id, className: "group/seg relative grid h-8 cursor-pointer select-none place-items-center rounded-[7px] has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-1 has-[:focus-visible]:outline-[color-mix(in_srgb,var(--brand)_70%,var(--paper))]", children: [
|
|
137
|
+
/* @__PURE__ */ jsx("input", { id, type: "radio", name: name ?? uid, value: o.value, checked: on, onChange: () => pick(o.value), className: "sr-only" }),
|
|
138
|
+
/* @__PURE__ */ jsx("span", { className: cx("relative text-[12.5px] font-medium tabular-nums transition-colors duration-300", on ? "text-ink" : "text-paper/55 group-hover/seg:text-paper"), children: o.label })
|
|
139
|
+
] }, o.value);
|
|
140
|
+
})
|
|
141
|
+
] })
|
|
142
|
+
] });
|
|
143
|
+
}
|
|
144
|
+
var radio_group_aui_056_default = SegmentRadio;
|
|
145
|
+
|
|
146
|
+
export {
|
|
147
|
+
SegmentRadio,
|
|
148
|
+
radio_group_aui_056_default
|
|
149
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/variants/switch-aui-059.tsx
|
|
4
|
+
import { useId, 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 aui059-rise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
|
|
11
|
+
@keyframes aui059-ring { 0% { transform: rotate(0) } 15% { transform: rotate(18deg) } 30% { transform: rotate(-14deg) } 45% { transform: rotate(10deg) } 60% { transform: rotate(-6deg) } 75% { transform: rotate(3deg) } 100% { transform: rotate(0) } }
|
|
12
|
+
@media (prefers-reduced-motion: reduce) { .aui059 * { animation: none !important; transition: none !important } }
|
|
13
|
+
`;
|
|
14
|
+
var rise = (i) => ({ animation: `aui059-rise .6s ${EASE} ${80 + i * 55}ms both` });
|
|
15
|
+
function IconSwitch({
|
|
16
|
+
checked,
|
|
17
|
+
defaultChecked = true,
|
|
18
|
+
onCheckedChange,
|
|
19
|
+
title = "Notifications",
|
|
20
|
+
onText = "Delivering to 3 devices",
|
|
21
|
+
offText = "Paused until 9:00 AM",
|
|
22
|
+
devices = ["MacBook", "iPhone", "Email"],
|
|
23
|
+
name,
|
|
24
|
+
className
|
|
25
|
+
}) {
|
|
26
|
+
const uid = useId();
|
|
27
|
+
const [inner, setInner] = useState(defaultChecked);
|
|
28
|
+
const [rings, setRings] = useState(0);
|
|
29
|
+
const on = checked ?? inner;
|
|
30
|
+
const toggle = () => {
|
|
31
|
+
const next = !on;
|
|
32
|
+
if (checked === void 0) setInner(next);
|
|
33
|
+
if (next) setRings((r) => r + 1);
|
|
34
|
+
onCheckedChange?.(next);
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("aui059 relative w-full max-w-[400px] overflow-hidden rounded-[14px] bg-ink p-5 text-paper shadow-[0_1px_2px_rgb(0_0_0/0.1),0_24px_48px_-24px_rgb(0_0_0/0.55)] sm:p-6", className), children: [
|
|
37
|
+
/* @__PURE__ */ jsx("style", { href: "asta-aui059", precedence: "asta", children: CSS }),
|
|
38
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "pointer-events-none absolute -left-16 -top-20 h-56 w-56 rounded-full bg-[radial-gradient(closest-side,color-mix(in_srgb,var(--brand)_50%,transparent),transparent)] transition-opacity duration-700", style: { opacity: on ? 0.55 : 0 } }),
|
|
39
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex items-center justify-between gap-4", style: rise(0), children: [
|
|
40
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
41
|
+
/* @__PURE__ */ jsx("p", { className: "font-mono text-[11px] uppercase tracking-[0.08em] text-paper/45", children: "Astabyte \xB7 Focus" }),
|
|
42
|
+
/* @__PURE__ */ jsx("label", { htmlFor: uid, className: "mt-1.5 block cursor-pointer text-[20px] font-medium leading-tight tracking-[-0.02em]", children: title }),
|
|
43
|
+
/* @__PURE__ */ jsx("span", { id: `${uid}-d`, className: "relative mt-1 block h-5 overflow-hidden text-[13px] text-paper/55", children: /* @__PURE__ */ jsxs("span", { className: "absolute inset-x-0 top-0 flex flex-col transition-transform duration-500", style: { transform: `translateY(${on ? 0 : -20}px)`, transitionTimingFunction: EASE }, children: [
|
|
44
|
+
/* @__PURE__ */ jsx("span", { className: "block h-5 truncate leading-5", "aria-hidden": !on, children: onText }),
|
|
45
|
+
/* @__PURE__ */ jsx("span", { className: "block h-5 truncate leading-5", "aria-hidden": on, children: offText })
|
|
46
|
+
] }) })
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ jsxs(
|
|
49
|
+
"button",
|
|
50
|
+
{
|
|
51
|
+
id: uid,
|
|
52
|
+
type: "button",
|
|
53
|
+
role: "switch",
|
|
54
|
+
"aria-checked": on,
|
|
55
|
+
"aria-describedby": `${uid}-d`,
|
|
56
|
+
name,
|
|
57
|
+
value: on ? "on" : "off",
|
|
58
|
+
onClick: toggle,
|
|
59
|
+
className: "group/sw relative h-9 w-[64px] shrink-0 rounded-full outline-none transition-transform duration-200 active:scale-[0.97] focus-visible:ring-2 focus-visible:ring-[color-mix(in_srgb,var(--brand)_70%,var(--paper))] focus-visible:ring-offset-2 focus-visible:ring-offset-ink",
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "absolute inset-0 rounded-full bg-paper/[0.12] shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--paper)_10%,transparent)]" }),
|
|
62
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "absolute inset-0 rounded-full bg-brand shadow-[inset_0_1px_0_rgb(255_255_255/0.2),0_0_18px_-2px_color-mix(in_srgb,var(--brand)_70%,transparent)] transition-opacity duration-300", style: { opacity: on ? 1 : 0 } }),
|
|
63
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "absolute left-[3px] top-[3px] grid h-[30px] w-[30px] place-items-center rounded-full bg-paper text-ink shadow-[0_1px_2px_rgb(0_0_0/0.3),0_4px_10px_-2px_rgb(0_0_0/0.35)] transition-transform duration-500", style: { transform: `translateX(${on ? 28 : 0}px)`, transitionTimingFunction: SPRING }, children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 20 20", className: "h-[15px] w-[15px] overflow-visible", fill: "none", stroke: "currentColor", strokeWidth: "1.7", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
64
|
+
/* @__PURE__ */ jsxs("g", { style: { transformOrigin: "10px 3px", animation: rings ? `aui059-ring .8s ${EASE} 120ms both` : void 0 }, children: [
|
|
65
|
+
/* @__PURE__ */ jsx("path", { d: "M5 13.5V9a5 5 0 0110 0v4.5l1.5 1.5h-13z", className: "transition-opacity duration-300", style: { opacity: on ? 1 : 0.55 } }),
|
|
66
|
+
/* @__PURE__ */ jsx("path", { d: "M8.2 17a2 2 0 003.6 0", className: "transition-opacity duration-300", style: { opacity: on ? 1 : 0.55 } })
|
|
67
|
+
] }, rings),
|
|
68
|
+
/* @__PURE__ */ jsx("path", { d: "M3 3l14 14", pathLength: 1, strokeDasharray: "1", className: "transition-[stroke-dashoffset]", style: { strokeDashoffset: on ? 1 : 0, transitionDuration: on ? "160ms" : "420ms", transitionDelay: on ? "0ms" : "140ms", transitionTimingFunction: EASE } })
|
|
69
|
+
] }) })
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
] }),
|
|
74
|
+
/* @__PURE__ */ jsxs("div", { className: "relative mt-5 h-[58px]", style: rise(1), children: [
|
|
75
|
+
/* @__PURE__ */ jsxs("div", { className: "absolute inset-0 flex items-center gap-3 rounded-[10px] bg-paper/[0.06] px-3 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--paper)_8%,transparent)] transition-[transform,opacity] duration-500", style: { opacity: on ? 1 : 0, transform: on ? "none" : "translateY(-6px) scale(.98)", transitionTimingFunction: EASE }, "aria-hidden": !on, children: [
|
|
76
|
+
/* @__PURE__ */ jsx("span", { className: "grid h-8 w-8 shrink-0 place-items-center rounded-full bg-paper/10 text-[11px] font-medium", children: "RA" }),
|
|
77
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
78
|
+
/* @__PURE__ */ jsxs("span", { className: "block truncate text-[13px]", children: [
|
|
79
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: "Rina Arif" }),
|
|
80
|
+
" ",
|
|
81
|
+
/* @__PURE__ */ jsx("span", { className: "text-paper/55", children: "commented on" }),
|
|
82
|
+
" Launch plan"
|
|
83
|
+
] }),
|
|
84
|
+
/* @__PURE__ */ jsx("span", { className: "block truncate text-[12px] text-paper/45", children: "\u201CLooks good, ship it after the copy pass.\u201D" })
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 text-[11px] text-paper/40", children: "2m" })
|
|
87
|
+
] }),
|
|
88
|
+
/* @__PURE__ */ jsxs("div", { className: "absolute inset-0 flex items-center gap-3 rounded-[10px] px-3 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--paper)_10%,transparent)] transition-[transform,opacity] duration-500", style: { opacity: on ? 0 : 1, transform: on ? "translateY(6px) scale(.98)" : "none", transitionTimingFunction: EASE }, "aria-hidden": on, children: [
|
|
89
|
+
/* @__PURE__ */ jsx("span", { className: "grid h-8 w-8 shrink-0 place-items-center rounded-full bg-paper/[0.06] text-[13px] font-medium tabular-nums", children: "3" }),
|
|
90
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1 text-[13px]", children: [
|
|
91
|
+
/* @__PURE__ */ jsx("span", { className: "block", children: "Holding 3 notifications" }),
|
|
92
|
+
/* @__PURE__ */ jsx("span", { className: "block text-[12px] text-paper/45", children: "We\u2019ll deliver them when focus ends." })
|
|
93
|
+
] })
|
|
94
|
+
] })
|
|
95
|
+
] }),
|
|
96
|
+
/* @__PURE__ */ jsx("ul", { className: "relative mt-4 flex flex-wrap gap-1.5", "aria-label": "Devices", style: rise(2), children: devices.map((d, i) => /* @__PURE__ */ jsxs("li", { className: "flex h-7 items-center gap-1.5 rounded-[7px] bg-paper/[0.06] px-2.5 text-[12px] transition-opacity duration-500", style: { opacity: on ? 1 : 0.4, transitionDelay: `${i * 60}ms` }, children: [
|
|
97
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "relative h-1.5 w-1.5 rounded-full bg-paper/30", children: /* @__PURE__ */ jsx("span", { className: "absolute inset-0 rounded-full bg-[color-mix(in_srgb,var(--brand)_60%,var(--paper))] transition-[transform,opacity] duration-500", style: { opacity: on ? 1 : 0, transform: on ? "scale(1)" : "scale(.3)", transitionDelay: `${i * 60}ms`, transitionTimingFunction: SPRING } }) }),
|
|
98
|
+
d
|
|
99
|
+
] }, d)) })
|
|
100
|
+
] });
|
|
101
|
+
}
|
|
102
|
+
var switch_aui_059_default = IconSwitch;
|
|
103
|
+
|
|
104
|
+
export {
|
|
105
|
+
IconSwitch,
|
|
106
|
+
switch_aui_059_default
|
|
107
|
+
};
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/kit/variants/radio-group-aui-055.tsx
|
|
4
|
+
import { useId, useLayoutEffect, 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 aui055-rise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
|
|
11
|
+
@keyframes aui055-fade { from { opacity: 0 } to { opacity: 1 } }
|
|
12
|
+
@media (prefers-reduced-motion: reduce) { .aui055 * { animation: none !important; transition: none !important } }
|
|
13
|
+
`;
|
|
14
|
+
var rise = (i) => ({ animation: `aui055-rise .6s ${EASE} ${80 + i * 50}ms both` });
|
|
15
|
+
var PLANS = [
|
|
16
|
+
{ value: "solo", name: "Solo", description: "One person, unlimited docs", price: 0 },
|
|
17
|
+
{ value: "team", name: "Team", description: "Shared spaces, guests and history", price: 12, tag: "Popular" },
|
|
18
|
+
{ value: "business", name: "Business", description: "SSO, audit log, priority support", price: 28 }
|
|
19
|
+
];
|
|
20
|
+
function Roll({ value }) {
|
|
21
|
+
const chars = String(value).split("");
|
|
22
|
+
return /* @__PURE__ */ jsxs("span", { className: "inline-flex tabular-nums", children: [
|
|
23
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: value }),
|
|
24
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "inline-flex", children: chars.map((ch, i) => /* @__PURE__ */ jsx("span", { className: "relative inline-block h-[1em] w-[0.6em] overflow-hidden", children: /* @__PURE__ */ jsx("span", { className: "absolute inset-x-0 top-0 flex flex-col transition-transform duration-700", style: { transform: `translateY(${-Number(ch) * 10}%)`, transitionTimingFunction: EASE, transitionDelay: `${(chars.length - 1 - i) * 50}ms` }, children: Array.from({ length: 10 }, (_, n) => /* @__PURE__ */ jsx("span", { className: "block h-[1em] text-center leading-[1em]", children: n }, n)) }) }, chars.length - i)) })
|
|
25
|
+
] });
|
|
26
|
+
}
|
|
27
|
+
function PlanRadio({ plans = PLANS, value, defaultValue = "team", onChange, seats = 5, currency = "$", title = "Choose a plan", name, onContinue, className }) {
|
|
28
|
+
const uid = useId();
|
|
29
|
+
const [inner, setInner] = useState(defaultValue);
|
|
30
|
+
const current = value ?? inner;
|
|
31
|
+
const index = Math.max(0, plans.findIndex((p) => p.value === current));
|
|
32
|
+
const plan = plans[index];
|
|
33
|
+
const rows = useRef([]);
|
|
34
|
+
const list = useRef(null);
|
|
35
|
+
const drop = useRef(null);
|
|
36
|
+
const prevIndex = useRef(index);
|
|
37
|
+
const [ring, setRing] = useState(null);
|
|
38
|
+
useLayoutEffect(() => {
|
|
39
|
+
const measure = () => {
|
|
40
|
+
const el = rows.current[index];
|
|
41
|
+
if (el) setRing({ y: el.offsetTop, h: el.offsetHeight });
|
|
42
|
+
};
|
|
43
|
+
measure();
|
|
44
|
+
if (prevIndex.current !== index && drop.current && !window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
45
|
+
drop.current.animate([{ transform: "scale(1, 1)" }, { transform: "scale(.97, 1.14)", offset: 0.35 }, { transform: "scale(1, 1)" }], { duration: 560, easing: EASE });
|
|
46
|
+
}
|
|
47
|
+
prevIndex.current = index;
|
|
48
|
+
const ro = new ResizeObserver(measure);
|
|
49
|
+
if (list.current) ro.observe(list.current);
|
|
50
|
+
return () => ro.disconnect();
|
|
51
|
+
}, [index]);
|
|
52
|
+
const pick = (v) => {
|
|
53
|
+
if (value === void 0) setInner(v);
|
|
54
|
+
onChange?.(v);
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ jsxs(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
className: cx(
|
|
60
|
+
"aui055 w-full max-w-[440px] rounded-[14px] bg-paper p-5 sm:p-6",
|
|
61
|
+
"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)]",
|
|
62
|
+
className
|
|
63
|
+
),
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ jsx("style", { href: "asta-aui055", precedence: "asta", children: CSS }),
|
|
66
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-end justify-between", style: rise(0), children: [
|
|
67
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
68
|
+
/* @__PURE__ */ jsx("p", { className: "font-mono text-[11px] uppercase tracking-[0.08em] text-mute", children: "Astabyte \xB7 Billing" }),
|
|
69
|
+
/* @__PURE__ */ jsx("h3", { id: `${uid}-t`, className: "mt-1.5 text-[20px] font-medium leading-tight tracking-[-0.02em] text-ink", children: title })
|
|
70
|
+
] }),
|
|
71
|
+
/* @__PURE__ */ jsxs("p", { className: "pb-0.5 text-[12.5px] text-mute", children: [
|
|
72
|
+
seats,
|
|
73
|
+
" seats"
|
|
74
|
+
] })
|
|
75
|
+
] }),
|
|
76
|
+
/* @__PURE__ */ jsxs("div", { ref: list, role: "radiogroup", "aria-labelledby": `${uid}-t`, className: "relative mt-4 flex flex-col gap-2", children: [
|
|
77
|
+
ring && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "pointer-events-none absolute inset-x-0 top-0 z-10 transition-transform duration-500", style: { height: ring.h, transform: `translateY(${ring.y}px)`, transitionTimingFunction: EASE }, children: /* @__PURE__ */ jsx(
|
|
78
|
+
"span",
|
|
79
|
+
{
|
|
80
|
+
ref: drop,
|
|
81
|
+
style: { animation: `aui055-fade .5s ${EASE} 420ms both` },
|
|
82
|
+
className: "block h-full w-full rounded-[12px] shadow-[inset_0_0_0_2px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_13%,transparent),0_14px_30px_-18px_var(--brand)]"
|
|
83
|
+
}
|
|
84
|
+
) }),
|
|
85
|
+
plans.map((p, i) => {
|
|
86
|
+
const on = i === index;
|
|
87
|
+
const id = `${uid}-${p.value}`;
|
|
88
|
+
return /* @__PURE__ */ jsxs(
|
|
89
|
+
"label",
|
|
90
|
+
{
|
|
91
|
+
ref: (el) => {
|
|
92
|
+
rows.current[i] = el;
|
|
93
|
+
},
|
|
94
|
+
htmlFor: id,
|
|
95
|
+
style: rise(i + 1),
|
|
96
|
+
className: "group/plan relative flex cursor-pointer select-none items-center gap-3.5 rounded-[12px] bg-paper px-4 py-3.5 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent)] transition-transform duration-200 active:scale-[0.99] has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-[3px] has-[:focus-visible]:outline-brand",
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ jsx("input", { id, type: "radio", name: name ?? uid, value: p.value, checked: on, onChange: () => pick(p.value), className: "sr-only" }),
|
|
99
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "pointer-events-none absolute inset-0 rounded-[12px] bg-paper-2 opacity-0 transition-opacity duration-300 group-hover/plan:opacity-60" }),
|
|
100
|
+
/* @__PURE__ */ jsxs("span", { "aria-hidden": true, className: "relative grid h-[18px] w-[18px] shrink-0 place-items-center rounded-full shadow-[inset_0_0_0_1.5px_color-mix(in_srgb,var(--ink)_24%,transparent)]", children: [
|
|
101
|
+
/* @__PURE__ */ jsx("span", { className: "absolute inset-0 rounded-full bg-brand transition-[transform,opacity] duration-300", style: { opacity: on ? 1 : 0, transform: on ? "scale(1)" : "scale(0.5)", transitionTimingFunction: SPRING } }),
|
|
102
|
+
/* @__PURE__ */ jsx("span", { className: "relative h-1.5 w-1.5 rounded-full bg-white transition-transform duration-300", style: { transform: on ? "scale(1)" : "scale(0)", transitionTimingFunction: SPRING, transitionDelay: on ? "80ms" : "0ms" } })
|
|
103
|
+
] }),
|
|
104
|
+
/* @__PURE__ */ jsxs("span", { className: "relative min-w-0 flex-1", children: [
|
|
105
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
106
|
+
/* @__PURE__ */ jsx("span", { className: "text-[15px] font-medium tracking-[-0.01em] text-ink", children: p.name }),
|
|
107
|
+
p.tag && /* @__PURE__ */ jsx("span", { className: "rounded-[5px] bg-[color-mix(in_srgb,var(--brand)_10%,transparent)] px-1.5 py-[1px] text-[10.5px] font-medium tracking-[0.02em] text-brand", children: p.tag })
|
|
108
|
+
] }),
|
|
109
|
+
/* @__PURE__ */ jsx("span", { className: "mt-0.5 block truncate text-[12.5px] text-mute", children: p.description })
|
|
110
|
+
] }),
|
|
111
|
+
/* @__PURE__ */ jsxs("span", { className: "relative shrink-0 text-right", children: [
|
|
112
|
+
/* @__PURE__ */ jsxs("span", { className: "text-[22px] font-medium leading-none tracking-[-0.04em] text-ink", children: [
|
|
113
|
+
/* @__PURE__ */ jsx("span", { className: "mr-px align-top text-[12px] tracking-normal text-mute", children: currency }),
|
|
114
|
+
p.price
|
|
115
|
+
] }),
|
|
116
|
+
/* @__PURE__ */ jsx("span", { className: "mt-1 block text-[11px] text-mute", children: p.price ? "per seat" : "free" })
|
|
117
|
+
] })
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
p.value
|
|
121
|
+
);
|
|
122
|
+
})
|
|
123
|
+
] }),
|
|
124
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-5 flex items-center justify-between gap-4", style: rise(plans.length + 1), children: [
|
|
125
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
126
|
+
/* @__PURE__ */ jsx("p", { className: "text-[12px] text-mute", children: "Due today" }),
|
|
127
|
+
/* @__PURE__ */ jsxs("p", { className: "mt-1 flex items-start text-[28px] font-medium leading-none tracking-[-0.04em] text-ink", children: [
|
|
128
|
+
/* @__PURE__ */ jsx("span", { className: "mr-0.5 mt-[3px] text-[13px] tracking-normal text-mute", children: currency }),
|
|
129
|
+
/* @__PURE__ */ jsx(Roll, { value: plan.price * seats })
|
|
130
|
+
] })
|
|
131
|
+
] }),
|
|
132
|
+
/* @__PURE__ */ jsxs(
|
|
133
|
+
"button",
|
|
134
|
+
{
|
|
135
|
+
type: "button",
|
|
136
|
+
onClick: () => onContinue?.(plan.value),
|
|
137
|
+
className: "group/cta relative inline-flex h-10 items-center gap-1.5 rounded-[8px] bg-brand pl-4 pr-3.5 text-[13.5px] font-medium text-white shadow-[inset_0_1px_0_rgb(255_255_255/0.2),0_6px_16px_-8px_var(--brand)] outline-none transition-transform duration-200 active:scale-[0.97] focus-visible:ring-2 focus-visible:ring-brand/50 focus-visible:ring-offset-2 focus-visible:ring-offset-paper",
|
|
138
|
+
children: [
|
|
139
|
+
/* @__PURE__ */ jsx("span", { children: "Continue with" }),
|
|
140
|
+
/* @__PURE__ */ jsxs("span", { className: "relative block h-5 overflow-hidden", "aria-live": "polite", children: [
|
|
141
|
+
/* @__PURE__ */ jsx("span", { className: "invisible block h-5 leading-5", children: plans.reduce((a, p) => p.name.length > a.length ? p.name : a, "") }),
|
|
142
|
+
/* @__PURE__ */ jsx("span", { className: "absolute inset-x-0 top-0 flex flex-col transition-transform duration-500", style: { transform: `translateY(${-index * 20}px)`, transitionTimingFunction: EASE }, children: plans.map((p, i) => /* @__PURE__ */ jsx("span", { "aria-hidden": i !== index, className: "block h-5 text-left leading-5", children: p.name }, p.value)) })
|
|
143
|
+
] }),
|
|
144
|
+
/* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "h-3.5 w-3.5 transition-transform duration-300 group-hover/cta:translate-x-0.5", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M3 8h9.5M8.5 4l4 4-4 4" }) })
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
] })
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
var radio_group_aui_055_default = PlanRadio;
|
|
154
|
+
|
|
155
|
+
export {
|
|
156
|
+
PlanRadio,
|
|
157
|
+
radio_group_aui_055_default
|
|
158
|
+
};
|