starwind 3.0.0-beta.1 → 3.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -23
- package/dist/index.js +1165 -269
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command, Option } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "starwind",
|
|
9
|
-
version: "3.0.0-beta.
|
|
9
|
+
version: "3.0.0-beta.2",
|
|
10
10
|
description: "Install and manage Starwind UI components in Astro and React applications",
|
|
11
11
|
license: "MIT",
|
|
12
12
|
homepage: "https://starwind.dev/",
|
|
@@ -2042,7 +2042,7 @@ export const badge = tv({
|
|
|
2042
2042
|
],
|
|
2043
2043
|
componentDependencies: [],
|
|
2044
2044
|
packageRequirements: [
|
|
2045
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
2045
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
2046
2046
|
{ name: "astro", range: ">=5" },
|
|
2047
2047
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
2048
2048
|
]
|
|
@@ -2576,7 +2576,7 @@ export const badge = tv({
|
|
|
2576
2576
|
],
|
|
2577
2577
|
componentDependencies: [],
|
|
2578
2578
|
packageRequirements: [
|
|
2579
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
2579
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
2580
2580
|
{ name: "react", range: ">=18" },
|
|
2581
2581
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
2582
2582
|
]
|
|
@@ -2606,7 +2606,7 @@ export const badge = tv({
|
|
|
2606
2606
|
],
|
|
2607
2607
|
componentDependencies: [],
|
|
2608
2608
|
packageRequirements: [
|
|
2609
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
2609
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
2610
2610
|
{ name: "astro", range: ">=5" },
|
|
2611
2611
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
2612
2612
|
]
|
|
@@ -2628,7 +2628,7 @@ export const badge = tv({
|
|
|
2628
2628
|
],
|
|
2629
2629
|
componentDependencies: [],
|
|
2630
2630
|
packageRequirements: [
|
|
2631
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
2631
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
2632
2632
|
{ name: "react", range: ">=18" },
|
|
2633
2633
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
2634
2634
|
]
|
|
@@ -2676,7 +2676,7 @@ export const kbdGroup = tv({
|
|
|
2676
2676
|
],
|
|
2677
2677
|
componentDependencies: [],
|
|
2678
2678
|
packageRequirements: [
|
|
2679
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
2679
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
2680
2680
|
{ name: "astro", range: ">=5" },
|
|
2681
2681
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
2682
2682
|
]
|
|
@@ -2716,7 +2716,7 @@ export const kbdGroup = tv({
|
|
|
2716
2716
|
],
|
|
2717
2717
|
componentDependencies: [],
|
|
2718
2718
|
packageRequirements: [
|
|
2719
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
2719
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
2720
2720
|
{ name: "react", range: ">=18" },
|
|
2721
2721
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
2722
2722
|
]
|
|
@@ -2746,7 +2746,7 @@ export const kbdGroup = tv({
|
|
|
2746
2746
|
],
|
|
2747
2747
|
componentDependencies: [],
|
|
2748
2748
|
packageRequirements: [
|
|
2749
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
2749
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
2750
2750
|
{ name: "astro", range: ">=5" },
|
|
2751
2751
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
2752
2752
|
]
|
|
@@ -2768,7 +2768,7 @@ export const kbdGroup = tv({
|
|
|
2768
2768
|
],
|
|
2769
2769
|
componentDependencies: [],
|
|
2770
2770
|
packageRequirements: [
|
|
2771
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
2771
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
2772
2772
|
{ name: "react", range: ">=18" },
|
|
2773
2773
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
2774
2774
|
]
|
|
@@ -2798,7 +2798,7 @@ export const kbdGroup = tv({
|
|
|
2798
2798
|
],
|
|
2799
2799
|
componentDependencies: [],
|
|
2800
2800
|
packageRequirements: [
|
|
2801
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
2801
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
2802
2802
|
{ name: "astro", range: ">=5" },
|
|
2803
2803
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
2804
2804
|
]
|
|
@@ -2820,7 +2820,7 @@ export const kbdGroup = tv({
|
|
|
2820
2820
|
],
|
|
2821
2821
|
componentDependencies: [],
|
|
2822
2822
|
packageRequirements: [
|
|
2823
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
2823
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
2824
2824
|
{ name: "react", range: ">=18" },
|
|
2825
2825
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
2826
2826
|
]
|
|
@@ -2850,7 +2850,7 @@ export const kbdGroup = tv({
|
|
|
2850
2850
|
],
|
|
2851
2851
|
componentDependencies: [],
|
|
2852
2852
|
packageRequirements: [
|
|
2853
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
2853
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
2854
2854
|
{ name: "astro", range: ">=5" },
|
|
2855
2855
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
2856
2856
|
]
|
|
@@ -2872,7 +2872,7 @@ export const kbdGroup = tv({
|
|
|
2872
2872
|
],
|
|
2873
2873
|
componentDependencies: [],
|
|
2874
2874
|
packageRequirements: [
|
|
2875
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
2875
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
2876
2876
|
{ name: "react", range: ">=18" },
|
|
2877
2877
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
2878
2878
|
]
|
|
@@ -2902,7 +2902,7 @@ export const kbdGroup = tv({
|
|
|
2902
2902
|
],
|
|
2903
2903
|
componentDependencies: [],
|
|
2904
2904
|
packageRequirements: [
|
|
2905
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
2905
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
2906
2906
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
2907
2907
|
{ name: "astro", range: ">=5" },
|
|
2908
2908
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -2925,7 +2925,7 @@ export const kbdGroup = tv({
|
|
|
2925
2925
|
],
|
|
2926
2926
|
componentDependencies: [],
|
|
2927
2927
|
packageRequirements: [
|
|
2928
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
2928
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
2929
2929
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
2930
2930
|
{ name: "react", range: ">=18" },
|
|
2931
2931
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -2980,7 +2980,7 @@ export const kbdGroup = tv({
|
|
|
2980
2980
|
],
|
|
2981
2981
|
componentDependencies: [],
|
|
2982
2982
|
packageRequirements: [
|
|
2983
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
2983
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
2984
2984
|
{ name: "astro", range: ">=5" },
|
|
2985
2985
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
2986
2986
|
]
|
|
@@ -3026,7 +3026,7 @@ export const kbdGroup = tv({
|
|
|
3026
3026
|
],
|
|
3027
3027
|
componentDependencies: [],
|
|
3028
3028
|
packageRequirements: [
|
|
3029
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
3029
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
3030
3030
|
{ name: "react", range: ">=18" },
|
|
3031
3031
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
3032
3032
|
]
|
|
@@ -3080,7 +3080,7 @@ export const kbdGroup = tv({
|
|
|
3080
3080
|
],
|
|
3081
3081
|
componentDependencies: [],
|
|
3082
3082
|
packageRequirements: [
|
|
3083
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
3083
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
3084
3084
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
3085
3085
|
{ name: "astro", range: ">=5" },
|
|
3086
3086
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -3127,7 +3127,7 @@ export const kbdGroup = tv({
|
|
|
3127
3127
|
],
|
|
3128
3128
|
componentDependencies: [],
|
|
3129
3129
|
packageRequirements: [
|
|
3130
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
3130
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
3131
3131
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
3132
3132
|
{ name: "react", range: ">=18" },
|
|
3133
3133
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -3166,7 +3166,7 @@ export const kbdGroup = tv({
|
|
|
3166
3166
|
],
|
|
3167
3167
|
componentDependencies: [],
|
|
3168
3168
|
packageRequirements: [
|
|
3169
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
3169
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
3170
3170
|
{ name: "astro", range: ">=5" },
|
|
3171
3171
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
3172
3172
|
]
|
|
@@ -3196,7 +3196,7 @@ export const kbdGroup = tv({
|
|
|
3196
3196
|
],
|
|
3197
3197
|
componentDependencies: [],
|
|
3198
3198
|
packageRequirements: [
|
|
3199
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
3199
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
3200
3200
|
{ name: "react", range: ">=18" },
|
|
3201
3201
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
3202
3202
|
]
|
|
@@ -3226,7 +3226,7 @@ export const kbdGroup = tv({
|
|
|
3226
3226
|
],
|
|
3227
3227
|
componentDependencies: [],
|
|
3228
3228
|
packageRequirements: [
|
|
3229
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
3229
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
3230
3230
|
{ name: "astro", range: ">=5" },
|
|
3231
3231
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
3232
3232
|
]
|
|
@@ -3248,7 +3248,7 @@ export const kbdGroup = tv({
|
|
|
3248
3248
|
],
|
|
3249
3249
|
componentDependencies: [],
|
|
3250
3250
|
packageRequirements: [
|
|
3251
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
3251
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
3252
3252
|
{ name: "react", range: ">=18" },
|
|
3253
3253
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
3254
3254
|
]
|
|
@@ -3286,7 +3286,7 @@ export const kbdGroup = tv({
|
|
|
3286
3286
|
],
|
|
3287
3287
|
componentDependencies: [],
|
|
3288
3288
|
packageRequirements: [
|
|
3289
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
3289
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
3290
3290
|
{ name: "astro", range: ">=5" },
|
|
3291
3291
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
3292
3292
|
]
|
|
@@ -3316,7 +3316,7 @@ export const kbdGroup = tv({
|
|
|
3316
3316
|
],
|
|
3317
3317
|
componentDependencies: [],
|
|
3318
3318
|
packageRequirements: [
|
|
3319
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
3319
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
3320
3320
|
{ name: "react", range: ">=18" },
|
|
3321
3321
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
3322
3322
|
]
|
|
@@ -3350,7 +3350,7 @@ export const kbdGroup = tv({
|
|
|
3350
3350
|
],
|
|
3351
3351
|
componentDependencies: [],
|
|
3352
3352
|
packageRequirements: [
|
|
3353
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
3353
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
3354
3354
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
3355
3355
|
{ name: "astro", range: ">=5" },
|
|
3356
3356
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -3377,7 +3377,7 @@ export const kbdGroup = tv({
|
|
|
3377
3377
|
],
|
|
3378
3378
|
componentDependencies: [],
|
|
3379
3379
|
packageRequirements: [
|
|
3380
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
3380
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
3381
3381
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
3382
3382
|
{ name: "react", range: ">=18" },
|
|
3383
3383
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -3408,7 +3408,7 @@ export const kbdGroup = tv({
|
|
|
3408
3408
|
],
|
|
3409
3409
|
componentDependencies: [],
|
|
3410
3410
|
packageRequirements: [
|
|
3411
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
3411
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
3412
3412
|
{ name: "astro", range: ">=5" },
|
|
3413
3413
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
3414
3414
|
]
|
|
@@ -3430,7 +3430,7 @@ export const kbdGroup = tv({
|
|
|
3430
3430
|
],
|
|
3431
3431
|
componentDependencies: [],
|
|
3432
3432
|
packageRequirements: [
|
|
3433
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
3433
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
3434
3434
|
{ name: "react", range: ">=18" },
|
|
3435
3435
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
3436
3436
|
]
|
|
@@ -3646,7 +3646,7 @@ export const comboboxValue = tv({
|
|
|
3646
3646
|
],
|
|
3647
3647
|
componentDependencies: ["input-group"],
|
|
3648
3648
|
packageRequirements: [
|
|
3649
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
3649
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
3650
3650
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
3651
3651
|
{ name: "astro", range: ">=5" },
|
|
3652
3652
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -3855,7 +3855,229 @@ export const comboboxValue = tv({
|
|
|
3855
3855
|
],
|
|
3856
3856
|
componentDependencies: ["input-group"],
|
|
3857
3857
|
packageRequirements: [
|
|
3858
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
3858
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
3859
|
+
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
3860
|
+
{ name: "react", range: ">=18" },
|
|
3861
|
+
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
3862
|
+
]
|
|
3863
|
+
}
|
|
3864
|
+
}
|
|
3865
|
+
},
|
|
3866
|
+
{
|
|
3867
|
+
name: "color-picker",
|
|
3868
|
+
version: "0.1.0",
|
|
3869
|
+
type: "component",
|
|
3870
|
+
dependencies: [],
|
|
3871
|
+
targets: {
|
|
3872
|
+
astro: {
|
|
3873
|
+
files: [
|
|
3874
|
+
{
|
|
3875
|
+
path: "src/components/starwind/color-picker/ColorPicker.astro",
|
|
3876
|
+
content: '---\nimport type { ComponentProps } from "astro/types";\n\nimport { Popover } from "../popover";\nimport ColorPickerRoot from "./ColorPickerRoot.astro";\n\ntype Props = ComponentProps<typeof ColorPickerRoot> & {\n defaultOpen?: boolean;\n closeOnEscape?: boolean;\n closeOnOutsideInteract?: boolean;\n modal?: boolean;\n openOnHover?: boolean;\n closeDelay?: number;\n};\n\nconst {\n defaultOpen = false,\n closeOnEscape = true,\n closeOnOutsideInteract = true,\n modal = false,\n openOnHover = false,\n closeDelay = 200,\n defaultValue = "#000000",\n format = "hex",\n alpha = true,\n allowEmpty = false,\n disabled = false,\n readOnly = false,\n name,\n form,\n required = false,\n locale,\n dir,\n class: className,\n size = "md",\n ...rest\n} = Astro.props;\n---\n\n<Popover\n defaultOpen={defaultOpen}\n closeOnEscape={closeOnEscape}\n closeOnOutsideInteract={closeOnOutsideInteract}\n modal={modal}\n openOnHover={openOnHover}\n closeDelay={closeDelay}\n>\n <ColorPickerRoot\n defaultValue={defaultValue}\n format={format}\n alpha={alpha}\n allowEmpty={allowEmpty}\n disabled={disabled}\n readOnly={readOnly}\n name={name}\n form={form}\n required={required}\n locale={locale}\n dir={dir}\n {...rest}\n data-floating-root={true}\n class={className}\n size={size}\n >\n {async (initial: import("@starwind-ui/astro/color-picker").ColorPickerRenderProjection) => (\n <Fragment set:html={await Astro.slots.render("default", [initial])} />\n )}\n </ColorPickerRoot>\n</Popover>\n'
|
|
3877
|
+
},
|
|
3878
|
+
{
|
|
3879
|
+
path: "src/components/starwind/color-picker/ColorPickerArea.astro",
|
|
3880
|
+
content: '---\nimport type { HTMLAttributes } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\n\nimport "./styles.css";\nimport ColorPickerPrimitive from "@starwind-ui/astro/color-picker";\nimport ColorPickerAreaThumb from "./ColorPickerAreaThumb.astro";\nimport { colorPickerArea } from "./variants";\n\ntype Props = HTMLAttributes<"div"> & VariantProps<typeof colorPickerArea> & {\n initial?: import("@starwind-ui/astro/color-picker").ColorPickerAreaProjection;\n};\n\nconst { initial, class: className, size = "md", ...rest } = Astro.props;\n---\n\n<ColorPickerPrimitive.Area\n initial={initial?.root.initial}\n class={colorPickerArea({ size, class: className })}\n {...rest}\n data-slot="color-picker-area"\n>\n <ColorPickerPrimitive.AreaBackground\n initial={initial?.background.initial}\n class="pointer-events-none absolute inset-0 size-full"\n data-slot="color-picker-area-background"\n />\n\n <ColorPickerAreaThumb initial={initial?.thumb.initial} size={size} />\n\n <ColorPickerPrimitive.AreaInput\n initial={initial?.input({ axis: "x" }).initial}\n axis="x"\n class="absolute inset-0 size-full cursor-crosshair opacity-0"\n data-slot="color-picker-area-input-x"\n />\n\n <ColorPickerPrimitive.AreaInput\n initial={initial?.input({ axis: "y" }).initial}\n axis="y"\n class="absolute inset-0 size-full cursor-crosshair opacity-0"\n data-slot="color-picker-area-input-y"\n />\n</ColorPickerPrimitive.Area>\n'
|
|
3881
|
+
},
|
|
3882
|
+
{
|
|
3883
|
+
path: "src/components/starwind/color-picker/ColorPickerAreaThumb.astro",
|
|
3884
|
+
content: '---\nimport ColorPickerPrimitive from "@starwind-ui/astro/color-picker";\nimport type { HTMLAttributes } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPickerAreaThumb } from "./variants";\n\ntype Props = HTMLAttributes<"span"> & VariantProps<typeof colorPickerAreaThumb> & {\n initial?: import("@starwind-ui/astro/color-picker").ColorPickerInitialPartProjection;\n};\n\nconst { initial, class: className, size = "md", ...rest } = Astro.props;\n---\n\n<ColorPickerPrimitive.AreaThumb\n initial={initial}\n class={colorPickerAreaThumb({ size, class: className })}\n {...rest}\n data-slot="color-picker-area-thumb"\n>\n <slot />\n</ColorPickerPrimitive.AreaThumb>\n'
|
|
3885
|
+
},
|
|
3886
|
+
{
|
|
3887
|
+
path: "src/components/starwind/color-picker/ColorPickerChannelInput.astro",
|
|
3888
|
+
content: '---\nimport ColorPickerPrimitive from "@starwind-ui/astro/color-picker";\nimport type { HTMLAttributes } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPickerChannelInput, colorPickerChannelInputLayout } from "./variants";\n\ntype Props = HTMLAttributes<"input"> & VariantProps<typeof colorPickerChannelInput> & {\n channel: import("@starwind-ui/astro/color-picker").ColorPickerChannel;\n initial?: import("@starwind-ui/astro/color-picker").ColorPickerInitialPartProjection;\n};\n\nconst { initial, channel, class: className, size = "md", ...rest } = Astro.props;\n---\n\n<ColorPickerPrimitive.ChannelInput\n initial={initial}\n class={[colorPickerChannelInput({ size }), colorPickerChannelInputLayout({ size }), className].filter(Boolean).join(" ")}\n channel={channel}\n {...rest}\n data-slot="color-picker-channel-input"\n/>\n'
|
|
3889
|
+
},
|
|
3890
|
+
{
|
|
3891
|
+
path: "src/components/starwind/color-picker/ColorPickerChannelSlider.astro",
|
|
3892
|
+
content: '---\nimport type { HTMLAttributes } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\n\nimport "./styles.css";\nimport ColorPickerPrimitive from "@starwind-ui/astro/color-picker";\nimport { colorPickerChannelSlider, colorPickerChannelSliderThumb } from "./variants";\n\ntype Props = HTMLAttributes<"div"> & VariantProps<typeof colorPickerChannelSlider> & {\n channel: import("@starwind-ui/astro/color-picker").ColorPickerChannel;\n orientation?: "horizontal" | "vertical";\n step?: number;\n initial?: import("@starwind-ui/astro/color-picker").ColorPickerRenderProjection;\n};\n\nconst {\n initial,\n step,\n channel,\n orientation = "horizontal",\n class: className,\n size = "md",\n ...rest\n} = Astro.props;\n---\n\n<ColorPickerPrimitive.ChannelSlider\n initial={initial?.channelSlider({ channel, orientation, step }).root.initial}\n channel={channel}\n orientation={orientation}\n class={colorPickerChannelSlider({ size, class: className })}\n {...rest}\n data-slot="color-picker-channel-slider"\n>\n <ColorPickerPrimitive.TransparencyGrid\n initial={initial?.transparencyGrid.initial}\n class="pointer-events-none absolute inset-0 size-full rounded-[inherit]"\n data-slot="color-picker-transparency-grid"\n />\n\n <ColorPickerPrimitive.ChannelSliderTrack\n initial={initial?.channelSlider({ channel, orientation, step }).track.initial}\n class="pointer-events-none absolute inset-0 size-full rounded-[inherit]"\n data-slot="color-picker-channel-slider-track"\n />\n\n <ColorPickerPrimitive.ChannelSliderThumb\n initial={initial?.channelSlider({ channel, orientation, step }).thumb.initial}\n class={colorPickerChannelSliderThumb({ size })}\n data-slot="color-picker-channel-slider-thumb"\n >\n <span\n class="pointer-events-none absolute inset-0 size-full"\n data-slot="color-picker-transparency-grid"\n />\n\n <span\n class="pointer-events-none absolute inset-0 size-full bg-[var(--sw-color-picker-channel-thumb-color)]"\n data-slot="color-picker-channel-thumb-color-layer"\n />\n </ColorPickerPrimitive.ChannelSliderThumb>\n\n <ColorPickerPrimitive.ChannelSliderInput\n initial={initial?.channelSlider({ channel, orientation, step }).input().initial}\n class="absolute inset-0 size-full cursor-pointer opacity-0"\n data-slot="color-picker-channel-slider-input"\n />\n</ColorPickerPrimitive.ChannelSlider>\n'
|
|
3893
|
+
},
|
|
3894
|
+
{
|
|
3895
|
+
path: "src/components/starwind/color-picker/ColorPickerClear.astro",
|
|
3896
|
+
content: '---\nimport ColorPickerPrimitive from "@starwind-ui/astro/color-picker";\nimport type { HTMLAttributes } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPickerAction } from "./variants";\n\ntype Props = HTMLAttributes<"button"> & VariantProps<typeof colorPickerAction> & {\n initial?: import("@starwind-ui/astro/color-picker").ColorPickerInitialPartProjection;\n};\n\nconst { initial, class: className, size = "md", ...rest } = Astro.props;\n---\n\n<ColorPickerPrimitive.Clear\n initial={initial}\n class={colorPickerAction({ size, class: className })}\n {...rest}\n data-slot="color-picker-clear"\n>\n <slot />\n</ColorPickerPrimitive.Clear>\n'
|
|
3897
|
+
},
|
|
3898
|
+
{
|
|
3899
|
+
path: "src/components/starwind/color-picker/ColorPickerContent.astro",
|
|
3900
|
+
content: '---\nimport ColorPicker from "@tabler/icons/outline/color-picker.svg";\nimport type { ComponentProps } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\n\nimport "./styles.css";\nimport { PopoverContent } from "../popover";\nimport ColorPickerArea from "./ColorPickerArea.astro";\nimport ColorPickerClear from "./ColorPickerClear.astro";\nimport ColorPickerEyeDropper from "./ColorPickerEyeDropper.astro";\nimport ColorPickerInput from "./ColorPickerInput.astro";\nimport ColorPickerSliders from "./ColorPickerSliders.astro";\nimport { colorPickerContent, colorPickerSeparator, colorPickerSliderActionRow, colorPickerValueFormatRow } from "./variants";\n\ntype Props = ComponentProps<typeof PopoverContent> & VariantProps<typeof colorPickerContent> & {\n alpha?: boolean;\n showEyeDropper?: boolean;\n showClear?: boolean;\n initial?: import("@starwind-ui/astro/color-picker").ColorPickerRenderProjection;\n};\n\nconst {\n initial,\n class: className,\n size = "md",\n alpha = true,\n showEyeDropper = true,\n showClear = false,\n side = "bottom",\n align = "start",\n exitMotion = "fade",\n ...rest\n} = Astro.props;\n\nconst inputSize = size === "lg" ? "md" : "sm";\nconst hasSwatches = Astro.slots.has("swatches");\nconst hasSwatchesAttribute = hasSwatches ? "true" : "false";\n---\n\n<PopoverContent\n class={colorPickerContent({ size, class: className })}\n side={side}\n align={align}\n exitMotion={exitMotion}\n {...rest}\n data-slot="color-picker-content"\n>\n <slot>\n <ColorPickerArea initial={initial?.area()} size={size} />\n\n <div class={colorPickerSliderActionRow({ size })} data-slot="color-picker-slider-action-row">\n <ColorPickerSliders initial={initial} alpha={alpha} size={size} class="min-w-0 flex-1" />\n\n {\n showEyeDropper && (\n <ColorPickerEyeDropper\n initial={initial?.eyeDropperTrigger.initial}\n size={size}\n aria-label="Pick a color from the screen"\n >\n <ColorPicker class="size-4" aria-hidden="true" />\n </ColorPickerEyeDropper>\n )\n }\n </div>\n\n <div class={colorPickerValueFormatRow({ size })} data-slot="color-picker-value-format-row">\n <ColorPickerInput initial={initial} size={inputSize} class="min-w-0 flex-1" />\n </div>\n\n <div class="contents" data-has-swatches={hasSwatchesAttribute} data-slot="color-picker-footer">\n {\n (hasSwatches || showClear) && (\n <div\n class={colorPickerSeparator({ size })}\n role="separator"\n aria-hidden="true"\n data-slot="color-picker-separator"\n />\n )\n }\n\n <slot name="swatches" />\n\n {\n showClear && (\n <ColorPickerClear\n initial={initial?.clear.initial}\n size={inputSize}\n aria-label="Clear color"\n >\n Clear\n </ColorPickerClear>\n )\n }\n </div>\n </slot>\n</PopoverContent>\n'
|
|
3901
|
+
},
|
|
3902
|
+
{
|
|
3903
|
+
path: "src/components/starwind/color-picker/ColorPickerControl.astro",
|
|
3904
|
+
content: '---\nimport ColorPickerPrimitive from "@starwind-ui/astro/color-picker";\nimport type { HTMLAttributes } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPickerControl } from "./variants";\n\ntype Props = HTMLAttributes<"div"> & VariantProps<typeof colorPickerControl> & {\n initial?: import("@starwind-ui/astro/color-picker").ColorPickerInitialPartProjection;\n};\n\nconst { initial, class: className, size = "md", ...rest } = Astro.props;\n---\n\n<ColorPickerPrimitive.Control\n initial={initial}\n class={colorPickerControl({ size, class: className })}\n {...rest}\n data-slot="color-picker-control"\n>\n <slot />\n</ColorPickerPrimitive.Control>\n'
|
|
3905
|
+
},
|
|
3906
|
+
{
|
|
3907
|
+
path: "src/components/starwind/color-picker/ColorPickerEyeDropper.astro",
|
|
3908
|
+
content: '---\nimport ColorPickerPrimitive from "@starwind-ui/astro/color-picker";\nimport type { HTMLAttributes } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPickerAction } from "./variants";\n\ntype Props = HTMLAttributes<"button"> & VariantProps<typeof colorPickerAction> & {\n initial?: import("@starwind-ui/astro/color-picker").ColorPickerInitialPartProjection;\n};\n\nconst { initial, class: className, size = "md", ...rest } = Astro.props;\n---\n\n<ColorPickerPrimitive.EyeDropperTrigger\n initial={initial}\n class={colorPickerAction({ size, class: className })}\n {...rest}\n data-slot="color-picker-eye-dropper"\n>\n <slot />\n</ColorPickerPrimitive.EyeDropperTrigger>\n'
|
|
3909
|
+
},
|
|
3910
|
+
{
|
|
3911
|
+
path: "src/components/starwind/color-picker/ColorPickerFormatSelect.astro",
|
|
3912
|
+
content: '---\nimport type { HTMLAttributes } from "astro/types";\n\nimport "./styles.css";\nimport ColorPickerPrimitive from "@starwind-ui/astro/color-picker";\nimport { Select, SelectContent, SelectItem, SelectTrigger } from "../select";\nimport { colorPickerFormatSelectTrigger } from "./variants";\n\ntype Props = HTMLAttributes<"div"> & {\n size?: "sm" | "md" | "lg";\n initial?: import("@starwind-ui/astro/color-picker").ColorPickerInitialPartProjection;\n};\n\nconst { initial, class: className, size = "md", ...rest } = Astro.props;\n---\n\n<ColorPickerPrimitive.FormatControl\n initial={initial}\n class={["shrink-0", className].filter(Boolean).join(" ")}\n {...rest}\n data-slot="color-picker-format-control"\n>\n <Select>\n <SelectTrigger\n size={size}\n aria-label="Color format"\n class={colorPickerFormatSelectTrigger({ size })}\n />\n\n <SelectContent size={size} data-sw-color-picker-format-options="">\n <SelectItem value="hex">HEX</SelectItem>\n\n <SelectItem value="rgb">RGB</SelectItem>\n\n <SelectItem value="hsl">HSL</SelectItem>\n\n <SelectItem value="hsb">HSB</SelectItem>\n </SelectContent>\n </Select>\n</ColorPickerPrimitive.FormatControl>\n'
|
|
3913
|
+
},
|
|
3914
|
+
{
|
|
3915
|
+
path: "src/components/starwind/color-picker/ColorPickerHiddenInput.astro",
|
|
3916
|
+
content: '---\nimport ColorPickerPrimitive from "@starwind-ui/astro/color-picker";\nimport type { HTMLAttributes } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPickerHiddenInput } from "./variants";\n\ntype Props = HTMLAttributes<"input"> & VariantProps<typeof colorPickerHiddenInput> & {\n initial?: import("@starwind-ui/astro/color-picker").ColorPickerInitialPartProjection;\n};\n\nconst { initial, class: className, size = "md", ...rest } = Astro.props;\n---\n\n<ColorPickerPrimitive.HiddenInput\n initial={initial}\n class={colorPickerHiddenInput({ size, class: className })}\n {...rest}\n data-slot="color-picker-hidden-input"\n/>\n'
|
|
3917
|
+
},
|
|
3918
|
+
{
|
|
3919
|
+
path: "src/components/starwind/color-picker/ColorPickerInput.astro",
|
|
3920
|
+
content: '---\nimport type { HTMLAttributes } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\n\nimport ColorPickerFormatSelect from "./ColorPickerFormatSelect.astro";\nimport ColorPickerNativeFormatSelect from "./ColorPickerNativeFormatSelect.astro";\nimport ColorPickerValueInput from "./ColorPickerValueInput.astro";\nimport { colorPickerInput } from "./variants";\n\ntype Props = HTMLAttributes<"div"> & VariantProps<typeof colorPickerInput> & {\n formatControl?: "select" | "native";\n initial?: import("@starwind-ui/astro/color-picker").ColorPickerRenderProjection;\n};\n\nconst { initial, formatControl = "select", class: className, size = "md", ...rest } = Astro.props;\n---\n\n<div class={colorPickerInput({ size, class: className })} {...rest} data-slot="color-picker-input">\n <ColorPickerValueInput initial={initial?.valueInput.initial} size={size} />\n\n {\n formatControl === "native" ? (\n <ColorPickerNativeFormatSelect initial={initial?.formatSelect.initial} size={size} />\n ) : (\n <ColorPickerFormatSelect initial={initial?.formatControl.initial} size={size} />\n )\n }\n</div>\n'
|
|
3921
|
+
},
|
|
3922
|
+
{
|
|
3923
|
+
path: "src/components/starwind/color-picker/ColorPickerLabel.astro",
|
|
3924
|
+
content: '---\nimport ColorPickerPrimitive from "@starwind-ui/astro/color-picker";\nimport type { HTMLAttributes } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPickerLabel } from "./variants";\n\ntype Props = HTMLAttributes<"label"> & VariantProps<typeof colorPickerLabel> & {\n initial?: import("@starwind-ui/astro/color-picker").ColorPickerInitialPartProjection;\n};\n\nconst { initial, class: className, size = "md", ...rest } = Astro.props;\n---\n\n<ColorPickerPrimitive.Label\n initial={initial}\n class={colorPickerLabel({ size, class: className })}\n {...rest}\n data-slot="color-picker-label"\n>\n <slot />\n</ColorPickerPrimitive.Label>\n'
|
|
3925
|
+
},
|
|
3926
|
+
{
|
|
3927
|
+
path: "src/components/starwind/color-picker/ColorPickerNativeFormatSelect.astro",
|
|
3928
|
+
content: '---\nimport ColorPickerPrimitive from "@starwind-ui/astro/color-picker";\nimport ChevronDown from "@tabler/icons/outline/chevron-down.svg";\nimport type { HTMLAttributes } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\nimport { NativeSelectOption } from "../native-select";\nimport { colorPickerNativeFormatSelect, colorPickerNativeFormatSelectIcon, colorPickerNativeFormatSelectWrapper } from "./variants";\n\ntype Props = Omit<HTMLAttributes<"select">, "size"> & VariantProps<typeof colorPickerNativeFormatSelect> & {\n initial?: import("@starwind-ui/astro/color-picker").ColorPickerInitialPartProjection;\n};\n\nconst { initial, class: className, size = "md", ...rest } = Astro.props;\n---\n\n<div\n class={colorPickerNativeFormatSelectWrapper()}\n data-slot="color-picker-native-format-select-wrapper"\n>\n <ColorPickerPrimitive.FormatSelect\n initial={initial}\n class={colorPickerNativeFormatSelect({ size, class: className })}\n aria-label="Color format"\n {...rest}\n data-slot="color-picker-native-format-select"\n >\n <NativeSelectOption value="hex" selected={(initial?.properties.value ?? rest.value) === "hex"}>\n HEX\n </NativeSelectOption>\n\n <NativeSelectOption value="rgb" selected={(initial?.properties.value ?? rest.value) === "rgb"}>\n RGB\n </NativeSelectOption>\n\n <NativeSelectOption value="hsl" selected={(initial?.properties.value ?? rest.value) === "hsl"}>\n HSL\n </NativeSelectOption>\n\n <NativeSelectOption value="hsb" selected={(initial?.properties.value ?? rest.value) === "hsb"}>\n HSB\n </NativeSelectOption>\n </ColorPickerPrimitive.FormatSelect>\n\n <ChevronDown\n class={colorPickerNativeFormatSelectIcon({ size })}\n aria-hidden="true"\n data-slot="color-picker-native-format-select-icon"\n />\n</div>\n'
|
|
3929
|
+
},
|
|
3930
|
+
{
|
|
3931
|
+
path: "src/components/starwind/color-picker/ColorPickerRoot.astro",
|
|
3932
|
+
content: '---\nimport ColorPickerPrimitive from "@starwind-ui/astro/color-picker";\nimport type { HTMLAttributes } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPicker } from "./variants";\n\ntype Props = Omit<HTMLAttributes<"div">, "value" | "defaultValue" | "onChange" | "dir"> & VariantProps<typeof colorPicker> & {\n defaultValue?: import("@starwind-ui/astro/color-picker").ColorPickerValue;\n format?: import("@starwind-ui/astro/color-picker").ColorPickerFormat;\n alpha?: boolean;\n allowEmpty?: boolean;\n disabled?: boolean;\n readOnly?: boolean;\n name?: string;\n form?: string;\n required?: boolean;\n locale?: string;\n dir?: import("@starwind-ui/astro/color-picker").ColorPickerDirection;\n};\n\nconst {\n defaultValue = "#000000",\n format = "hex",\n alpha = true,\n allowEmpty = false,\n disabled = false,\n readOnly = false,\n name,\n form,\n required = false,\n locale,\n dir,\n class: className,\n size = "md",\n ...rest\n} = Astro.props;\n---\n\n<ColorPickerPrimitive.Root\n class={colorPicker({ size, class: className })}\n defaultValue={defaultValue}\n format={format}\n alpha={alpha}\n allowEmpty={allowEmpty}\n disabled={disabled}\n readOnly={readOnly}\n name={name}\n form={form}\n required={required}\n locale={locale}\n dir={dir}\n {...rest}\n data-slot="color-picker"\n>\n {async (initial: import("@starwind-ui/astro/color-picker").ColorPickerRenderProjection) => (\n <Fragment set:html={await Astro.slots.render("default", [initial])} />\n )}\n</ColorPickerPrimitive.Root>\n'
|
|
3933
|
+
},
|
|
3934
|
+
{
|
|
3935
|
+
path: "src/components/starwind/color-picker/ColorPickerSliders.astro",
|
|
3936
|
+
content: '---\nimport type { HTMLAttributes } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\n\nimport ColorPickerChannelSlider from "./ColorPickerChannelSlider.astro";\nimport { colorPickerSliders } from "./variants";\n\ntype Props = HTMLAttributes<"div"> & VariantProps<typeof colorPickerSliders> & {\n alpha?: boolean;\n initial?: import("@starwind-ui/astro/color-picker").ColorPickerRenderProjection;\n};\n\nconst { initial, alpha = true, class: className, size = "md", ...rest } = Astro.props;\n---\n\n<div\n class={colorPickerSliders({ size, class: className })}\n {...rest}\n data-slot="color-picker-sliders"\n>\n <ColorPickerChannelSlider initial={initial} channel="hue" size={size} />\n\n {\n alpha && (\n <ColorPickerChannelSlider initial={initial} channel="alpha" size={size} />\n )\n }\n</div>\n'
|
|
3937
|
+
},
|
|
3938
|
+
{
|
|
3939
|
+
path: "src/components/starwind/color-picker/ColorPickerSwatch.astro",
|
|
3940
|
+
content: '---\nimport type { HTMLAttributes } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\n\nimport "./styles.css";\nimport ColorPickerPrimitive from "@starwind-ui/astro/color-picker";\nimport { colorPickerSwatch } from "./variants";\n\ntype Props = HTMLAttributes<"button"> & VariantProps<typeof colorPickerSwatch> & {\n value: import("@starwind-ui/astro/color-picker").ColorPickerValue;\n disabled?: boolean;\n initial?: import("@starwind-ui/astro/color-picker").ColorPickerRenderProjection;\n};\n\nconst { initial, value, disabled = false, class: className, size = "md", ...rest } = Astro.props;\n---\n\n<ColorPickerPrimitive.Swatch\n initial={initial?.swatch({ value, disabled }).initial}\n swatchValue={value}\n swatchDisabled={disabled}\n class={colorPickerSwatch({ size, class: className })}\n {...rest}\n data-slot="color-picker-swatch"\n>\n <ColorPickerPrimitive.TransparencyGrid\n initial={initial?.transparencyGrid.initial}\n class="pointer-events-none absolute inset-0 size-full"\n data-slot="color-picker-transparency-grid"\n />\n\n <span\n class="pointer-events-none absolute inset-0 size-full"\n data-slot="color-picker-swatch-color"\n />\n\n <slot />\n</ColorPickerPrimitive.Swatch>\n'
|
|
3941
|
+
},
|
|
3942
|
+
{
|
|
3943
|
+
path: "src/components/starwind/color-picker/ColorPickerSwatchGroup.astro",
|
|
3944
|
+
content: '---\nimport ColorPickerPrimitive from "@starwind-ui/astro/color-picker";\nimport type { HTMLAttributes } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPickerSwatchGroup } from "./variants";\n\ntype Props = HTMLAttributes<"div"> & VariantProps<typeof colorPickerSwatchGroup> & {\n initial?: import("@starwind-ui/astro/color-picker").ColorPickerInitialPartProjection;\n};\n\nconst { initial, class: className, size = "md", ...rest } = Astro.props;\n---\n\n<ColorPickerPrimitive.SwatchGroup\n initial={initial}\n class={colorPickerSwatchGroup({ size, class: className })}\n {...rest}\n data-slot="color-picker-swatch-group"\n>\n <slot />\n</ColorPickerPrimitive.SwatchGroup>\n'
|
|
3945
|
+
},
|
|
3946
|
+
{
|
|
3947
|
+
path: "src/components/starwind/color-picker/ColorPickerTrigger.astro",
|
|
3948
|
+
content: '---\nimport ColorPickerPrimitive from "@starwind-ui/astro/color-picker";\nimport type { ComponentProps } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\nimport { PopoverTrigger } from "../popover";\nimport { colorPickerTrigger, colorPickerValueSwatch } from "./variants";\n\ntype Props = ComponentProps<typeof PopoverTrigger> & VariantProps<typeof colorPickerTrigger> & {\n showValueText?: boolean;\n initial?: import("@starwind-ui/astro/color-picker").ColorPickerRenderProjection;\n};\n\nconst { initial, class: className, size = "md", showValueText = true, ...rest } = Astro.props;\n---\n\n<PopoverTrigger\n class={colorPickerTrigger({ size, class: className })}\n {...rest}\n data-slot="color-picker-trigger"\n>\n <slot />\n\n <ColorPickerPrimitive.ValueSwatch\n initial={initial?.valueSwatch.initial}\n class={colorPickerValueSwatch({ size })}\n data-slot="color-picker-value-swatch"\n >\n <ColorPickerPrimitive.TransparencyGrid\n initial={initial?.transparencyGrid.initial}\n class="pointer-events-none absolute inset-0 size-full"\n data-slot="color-picker-transparency-grid"\n />\n\n <span\n class="pointer-events-none absolute inset-0 size-full"\n data-slot="color-picker-value-swatch-color"\n />\n </ColorPickerPrimitive.ValueSwatch>\n\n {\n showValueText && (\n <ColorPickerPrimitive.ValueText\n initial={initial?.valueText.initial}\n data-slot="color-picker-value-text"\n />\n )\n }\n</PopoverTrigger>\n'
|
|
3949
|
+
},
|
|
3950
|
+
{
|
|
3951
|
+
path: "src/components/starwind/color-picker/ColorPickerValueInput.astro",
|
|
3952
|
+
content: '---\nimport ColorPickerPrimitive from "@starwind-ui/astro/color-picker";\nimport type { HTMLAttributes } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPickerValueInput, colorPickerValueInputLayout } from "./variants";\n\ntype Props = Omit<HTMLAttributes<"input">, "size"> & VariantProps<typeof colorPickerValueInput> & {\n initial?: import("@starwind-ui/astro/color-picker").ColorPickerInitialPartProjection;\n};\n\nconst { initial, class: className, size = "md", ...rest } = Astro.props;\n---\n\n<ColorPickerPrimitive.ValueInput\n initial={initial}\n class={[colorPickerValueInput({ size }), colorPickerValueInputLayout({ size }), className].filter(Boolean).join(" ")}\n {...rest}\n data-slot="color-picker-value-input"\n/>\n'
|
|
3953
|
+
},
|
|
3954
|
+
{
|
|
3955
|
+
path: "src/components/starwind/color-picker/ColorPickerValueSwatch.astro",
|
|
3956
|
+
content: '---\nimport type { HTMLAttributes } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\n\nimport "./styles.css";\nimport ColorPickerPrimitive from "@starwind-ui/astro/color-picker";\nimport { colorPickerValueSwatch } from "./variants";\n\ntype Props = HTMLAttributes<"span"> & VariantProps<typeof colorPickerValueSwatch> & {\n initial?: import("@starwind-ui/astro/color-picker").ColorPickerRenderProjection;\n};\n\nconst { initial, class: className, size = "md", ...rest } = Astro.props;\n---\n\n<ColorPickerPrimitive.ValueSwatch\n initial={initial?.valueSwatch.initial}\n class={colorPickerValueSwatch({ size, class: className })}\n {...rest}\n data-slot="color-picker-value-swatch"\n>\n <ColorPickerPrimitive.TransparencyGrid\n initial={initial?.transparencyGrid.initial}\n class="pointer-events-none absolute inset-0 size-full"\n data-slot="color-picker-transparency-grid"\n />\n\n <span\n class="pointer-events-none absolute inset-0 size-full"\n data-slot="color-picker-value-swatch-color"\n />\n</ColorPickerPrimitive.ValueSwatch>\n'
|
|
3957
|
+
},
|
|
3958
|
+
{
|
|
3959
|
+
path: "src/components/starwind/color-picker/index.ts",
|
|
3960
|
+
content: 'import ColorPicker from "./ColorPicker.astro";\nimport ColorPickerArea from "./ColorPickerArea.astro";\nimport ColorPickerAreaThumb from "./ColorPickerAreaThumb.astro";\nimport ColorPickerChannelInput from "./ColorPickerChannelInput.astro";\nimport ColorPickerChannelSlider from "./ColorPickerChannelSlider.astro";\nimport ColorPickerClear from "./ColorPickerClear.astro";\nimport ColorPickerContent from "./ColorPickerContent.astro";\nimport ColorPickerControl from "./ColorPickerControl.astro";\nimport ColorPickerEyeDropper from "./ColorPickerEyeDropper.astro";\nimport ColorPickerFormatSelect from "./ColorPickerFormatSelect.astro";\nimport ColorPickerHiddenInput from "./ColorPickerHiddenInput.astro";\nimport ColorPickerInput from "./ColorPickerInput.astro";\nimport ColorPickerLabel from "./ColorPickerLabel.astro";\nimport ColorPickerNativeFormatSelect from "./ColorPickerNativeFormatSelect.astro";\nimport ColorPickerRoot from "./ColorPickerRoot.astro";\nimport ColorPickerSliders from "./ColorPickerSliders.astro";\nimport ColorPickerSwatch from "./ColorPickerSwatch.astro";\nimport ColorPickerSwatchGroup from "./ColorPickerSwatchGroup.astro";\nimport ColorPickerTrigger from "./ColorPickerTrigger.astro";\nimport ColorPickerValueInput from "./ColorPickerValueInput.astro";\nimport ColorPickerValueSwatch from "./ColorPickerValueSwatch.astro";\nimport {\n colorPicker,\n colorPickerAction,\n colorPickerArea,\n colorPickerAreaThumb,\n colorPickerChannelInput,\n colorPickerChannelInputLayout,\n colorPickerChannelSlider,\n colorPickerChannelSliderThumb,\n colorPickerContent,\n colorPickerControl,\n colorPickerFormatSelectTrigger,\n colorPickerHiddenInput,\n colorPickerInput,\n colorPickerLabel,\n colorPickerNativeFormatSelect,\n colorPickerNativeFormatSelectIcon,\n colorPickerNativeFormatSelectWrapper,\n colorPickerSeparator,\n colorPickerSliderActionRow,\n colorPickerSliders,\n colorPickerSwatch,\n colorPickerSwatchGroup,\n colorPickerTrigger,\n colorPickerValueFormatRow,\n colorPickerValueInput,\n colorPickerValueInputLayout,\n colorPickerValueSwatch,\n} from "./variants";\n\nconst ColorPickerVariants = {\n colorPicker,\n colorPickerAction,\n colorPickerArea,\n colorPickerAreaThumb,\n colorPickerChannelInput,\n colorPickerChannelInputLayout,\n colorPickerChannelSlider,\n colorPickerChannelSliderThumb,\n colorPickerContent,\n colorPickerControl,\n colorPickerFormatSelectTrigger,\n colorPickerHiddenInput,\n colorPickerInput,\n colorPickerLabel,\n colorPickerNativeFormatSelect,\n colorPickerNativeFormatSelectIcon,\n colorPickerNativeFormatSelectWrapper,\n colorPickerSeparator,\n colorPickerSliderActionRow,\n colorPickerSliders,\n colorPickerSwatch,\n colorPickerSwatchGroup,\n colorPickerTrigger,\n colorPickerValueFormatRow,\n colorPickerValueInput,\n colorPickerValueInputLayout,\n colorPickerValueSwatch,\n};\n\nexport {\n ColorPicker,\n ColorPickerArea,\n ColorPickerAreaThumb,\n ColorPickerChannelInput,\n ColorPickerChannelSlider,\n ColorPickerClear,\n ColorPickerContent,\n ColorPickerControl,\n ColorPickerEyeDropper,\n ColorPickerFormatSelect,\n ColorPickerHiddenInput,\n ColorPickerInput,\n ColorPickerLabel,\n ColorPickerNativeFormatSelect,\n ColorPickerRoot,\n ColorPickerSliders,\n ColorPickerSwatch,\n ColorPickerSwatchGroup,\n ColorPickerTrigger,\n ColorPickerValueInput,\n ColorPickerValueSwatch,\n ColorPickerVariants,\n};\n\nexport default {\n Root: ColorPicker,\n InlineRoot: ColorPickerRoot,\n Label: ColorPickerLabel,\n Control: ColorPickerControl,\n Input: ColorPickerInput,\n Trigger: ColorPickerTrigger,\n Content: ColorPickerContent,\n Area: ColorPickerArea,\n AreaThumb: ColorPickerAreaThumb,\n Sliders: ColorPickerSliders,\n ChannelSlider: ColorPickerChannelSlider,\n ChannelInput: ColorPickerChannelInput,\n ValueInput: ColorPickerValueInput,\n NativeFormatSelect: ColorPickerNativeFormatSelect,\n FormatSelect: ColorPickerFormatSelect,\n ValueSwatch: ColorPickerValueSwatch,\n SwatchGroup: ColorPickerSwatchGroup,\n Swatch: ColorPickerSwatch,\n EyeDropper: ColorPickerEyeDropper,\n Clear: ColorPickerClear,\n HiddenInput: ColorPickerHiddenInput,\n};\n'
|
|
3961
|
+
},
|
|
3962
|
+
{
|
|
3963
|
+
path: "src/components/starwind/color-picker/styles.css",
|
|
3964
|
+
content: '[data-slot="color-picker-area-background"] { background: var(--sw-color-picker-area-background-overlay, linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent)), var(--sw-color-picker-area-background, hsl(var(--sw-color-picker-hue) 100% 50%)); }\n[data-slot="color-picker-channel-slider"] { --sw-color-picker-channel-gradient-direction: to right; --sw-color-picker-channel-gradient: linear-gradient(var(--sw-color-picker-channel-gradient-direction), transparent, var(--sw-color-picker-color, #000)); }\n[data-slot="color-picker-channel-slider"][data-orientation="vertical"] { --sw-color-picker-channel-gradient-direction: to top; }\n[data-slot="color-picker-channel-slider"][data-channel="hue"] { --sw-color-picker-channel-gradient: linear-gradient(var(--sw-color-picker-channel-gradient-direction), #f00 0%, #ff0 16.67%, #0f0 33.33%, #0ff 50%, #00f 66.67%, #f0f 83.33%, #f00 100%); }\n[data-slot="color-picker-channel-slider"][data-channel="alpha"] { --sw-color-picker-channel-gradient: linear-gradient(var(--sw-color-picker-channel-gradient-direction), rgb(from var(--sw-color-picker-color, #000) r g b / 0), rgb(from var(--sw-color-picker-color, #000) r g b / 1)); }\n[data-slot="color-picker-channel-slider"][data-channel="saturation"] { --sw-color-picker-channel-gradient: linear-gradient(var(--sw-color-picker-channel-gradient-direction), hsl(var(--sw-color-picker-hue, 0) 0% 50%), hsl(var(--sw-color-picker-hue, 0) 100% 50%)); }\n[data-slot="color-picker-channel-slider"][data-channel="brightness"] { --sw-color-picker-channel-gradient: linear-gradient(var(--sw-color-picker-channel-gradient-direction), #000, hsl(var(--sw-color-picker-hue, 0) 100% 50%)); }\n[data-slot="color-picker-channel-slider"][data-channel="lightness"] { --sw-color-picker-channel-gradient: linear-gradient(var(--sw-color-picker-channel-gradient-direction), #000, hsl(var(--sw-color-picker-hue, 0) 100% 50%), #fff); }\n[data-slot="color-picker-channel-slider"][data-channel="red"] { --sw-color-picker-channel-gradient: linear-gradient(var(--sw-color-picker-channel-gradient-direction), rgb(from var(--sw-color-picker-color, #000) 0 g b), rgb(from var(--sw-color-picker-color, #000) 255 g b)); }\n[data-slot="color-picker-channel-slider"][data-channel="green"] { --sw-color-picker-channel-gradient: linear-gradient(var(--sw-color-picker-channel-gradient-direction), rgb(from var(--sw-color-picker-color, #000) r 0 b), rgb(from var(--sw-color-picker-color, #000) r 255 b)); }\n[data-slot="color-picker-channel-slider"][data-channel="blue"] { --sw-color-picker-channel-gradient: linear-gradient(var(--sw-color-picker-channel-gradient-direction), rgb(from var(--sw-color-picker-color, #000) r g 0), rgb(from var(--sw-color-picker-color, #000) r g 255)); }\n[data-slot="color-picker-channel-slider-track"] { background: var(--sw-color-picker-channel-gradient); }\n[data-slot="color-picker-transparency-grid"] { background-color: #fff; background-image: linear-gradient(45deg, #d4d4d8 25%, transparent 25%), linear-gradient(-45deg, #d4d4d8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d4d4d8 75%), linear-gradient(-45deg, transparent 75%, #d4d4d8 75%); background-position: 0 0, 0 4px, 4px -4px, -4px 0; background-size: 8px 8px; }\n[data-slot="color-picker-value-swatch-color"], [data-slot="color-picker-swatch-color"] { background: var(--sw-color-picker-swatch-color); }\n[data-slot="color-picker-value-swatch"] { background-color: #fff; background-image: linear-gradient(var(--sw-color-picker-swatch-color, transparent), var(--sw-color-picker-swatch-color, transparent)), linear-gradient(45deg, #d4d4d8 25%, transparent 25%), linear-gradient(-45deg, #d4d4d8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d4d4d8 75%), linear-gradient(-45deg, transparent 75%, #d4d4d8 75%); background-position: 0 0, 0 0, 0 4px, 4px -4px, -4px 0; background-size: 100% 100%, 8px 8px, 8px 8px, 8px 8px, 8px 8px; }\n[data-slot="color-picker-value-swatch"] > [data-slot="color-picker-transparency-grid"], [data-slot="color-picker-value-swatch"] > [data-slot="color-picker-value-swatch-color"] { display: none; }\n[data-slot="color-picker-footer"][data-has-swatches="false"]:not(:has([data-slot="color-picker-clear"]:not([hidden]))) > [data-slot="color-picker-separator"] { display: none; }\n[data-sw-color-picker][data-floating-root] > [data-slot="select-positioner"]:has(> [data-sw-color-picker-format-options]) { z-index: 60; }\n'
|
|
3965
|
+
},
|
|
3966
|
+
{
|
|
3967
|
+
path: "src/components/starwind/color-picker/variants.ts",
|
|
3968
|
+
content: 'import { input as channelInputRecipe } from "../input/variants";\nimport { input as valueInputRecipe } from "../input/variants";\nimport { nativeSelectWrapper as nativeSelectWrapperRecipe } from "../native-select/variants";\nimport { nativeSelect as nativeSelectRecipe } from "../native-select/variants";\nimport { nativeSelectIcon as nativeSelectIconRecipe } from "../native-select/variants";\nimport { tv } from "tailwind-variants";\n\nexport const colorPickerChannelInput = channelInputRecipe;\n\nexport const colorPickerValueInput = valueInputRecipe;\n\nexport const colorPickerNativeFormatSelectWrapper = nativeSelectWrapperRecipe;\n\nexport const colorPickerNativeFormatSelect = nativeSelectRecipe;\n\nexport const colorPickerNativeFormatSelectIcon = nativeSelectIconRecipe;\n\nexport const colorPicker = tv({\n base: "relative flex flex-col gap-3",\n variants: {\n size: {\n sm: "text-sm",\n md: "text-base",\n lg: "text-lg",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerLabel = tv({\n base: "font-medium leading-none data-disabled:cursor-not-allowed data-disabled:opacity-50",\n variants: {\n size: {\n sm: "text-xs",\n md: "text-sm",\n lg: "text-base",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerControl = tv({\n base: "flex items-center gap-2",\n variants: {\n size: {\n sm: "gap-1.5",\n md: "gap-2",\n lg: "gap-2.5",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerTrigger = tv({\n base: "border-input bg-background focus-visible:ring-outline/50 inline-flex items-center rounded-md border shadow-xs outline-none focus-visible:ring-3 disabled:pointer-events-none disabled:opacity-50",\n variants: {\n size: {\n sm: "h-9 gap-2 px-2 text-sm",\n md: "h-11 gap-2.5 px-3",\n lg: "h-12 gap-3 px-4 text-lg",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerContent = tv({\n base: "flex max-h-[max(10rem,var(--sw-floating-available-height))] w-72 flex-col gap-3 p-3",\n variants: {\n size: {\n sm: "w-64 gap-2 p-2",\n md: "w-72 gap-3 p-3",\n lg: "w-80 gap-4 p-4",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerInput = tv({\n base: "flex items-center gap-2",\n variants: {\n size: {\n sm: "gap-1.5",\n md: "gap-2",\n lg: "gap-2.5",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerValueInputLayout = tv({\n base: "min-w-0 flex-1 data-invalid:border-error data-invalid:focus-visible:ring-error/40",\n variants: {\n size: {\n sm: "",\n md: "",\n lg: "",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerArea = tv({\n base: "group/color-picker-area border-outline relative w-full touch-none rounded-md border [&>[data-slot=color-picker-area-background]]:inset-0 [&>[data-slot=color-picker-area-background]]:size-full [&>[data-slot=color-picker-area-background]]:rounded-[7px]",\n variants: {\n size: {\n sm: "h-[150px]",\n md: "h-[175px]",\n lg: "h-[200px]",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerAreaThumb = tv({\n base: "group-has-[[data-slot=color-picker-area-input-x]:focus-visible]/color-picker-area:ring-outline/60 pointer-events-none absolute top-[clamp(1px,var(--sw-color-picker-area-y),calc(100%_-_1px))] left-[clamp(1px,var(--sw-color-picker-area-x),calc(100%_-_1px))] z-10 size-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white bg-[var(--sw-color-picker-area-thumb-color)] shadow-md ring-1 ring-black/30 outline-none group-has-[[data-slot=color-picker-area-input-x]:focus-visible]/color-picker-area:ring-3 focus-visible:ring-3 data-disabled:opacity-50 data-dragging:scale-110",\n variants: {\n size: {\n sm: "size-3.5",\n md: "size-4",\n lg: "size-5",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerSliders = tv({\n base: "flex flex-col gap-3 px-2",\n variants: {\n size: {\n sm: "gap-2",\n md: "gap-3",\n lg: "gap-4",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerSliderActionRow = tv({\n base: "flex items-center gap-2",\n variants: {\n size: {\n sm: "gap-1.5",\n md: "gap-2",\n lg: "gap-2.5",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerValueFormatRow = tv({\n base: "flex items-center gap-2",\n variants: {\n size: {\n sm: "gap-1.5",\n md: "gap-2",\n lg: "gap-2.5",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerSeparator = tv({\n base: "bg-border h-px w-full",\n variants: {\n size: {\n sm: "my-0.5",\n md: "my-1",\n lg: "my-1.5",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerChannelSlider = tv({\n base: "group/color-picker-channel-slider bg-border relative touch-none rounded-full [&>[data-slot=color-picker-channel-slider-track]]:inset-px [&>[data-slot=color-picker-channel-slider-track]]:size-auto [&>[data-slot=color-picker-transparency-grid]]:inset-px [&>[data-slot=color-picker-transparency-grid]]:size-auto",\n variants: {\n size: {\n sm: "h-2.5 data-[orientation=vertical]:h-40 data-[orientation=vertical]:w-2.5",\n md: "h-3 data-[orientation=vertical]:h-48 data-[orientation=vertical]:w-3",\n lg: "h-4 data-[orientation=vertical]:h-56 data-[orientation=vertical]:w-4",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerChannelSliderThumb = tv({\n base: "group-has-[[data-slot=color-picker-channel-slider-input]:focus-visible]/color-picker-channel-slider:ring-outline/60 pointer-events-none absolute top-1/2 left-[var(--sw-color-picker-channel-position)] z-10 -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-full border-2 border-white shadow-md ring-1 ring-black/30 outline-none group-has-[[data-slot=color-picker-channel-slider-input]:focus-visible]/color-picker-channel-slider:ring-3 group-data-[orientation=vertical]/color-picker-channel-slider:top-[calc(100%-var(--sw-color-picker-channel-position))] group-data-[orientation=vertical]/color-picker-channel-slider:left-1/2 data-disabled:opacity-50 data-dragging:scale-110",\n variants: {\n size: {\n sm: "size-3",\n md: "size-4",\n lg: "size-5",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerChannelInputLayout = tv({\n base: "text-center data-invalid:border-error data-invalid:focus-visible:ring-error/40",\n variants: {\n size: {\n sm: "h-9 w-16 text-sm",\n md: "h-11 w-20",\n lg: "h-12 w-24 text-lg",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerSwatch = tv({\n base: "relative overflow-hidden rounded-md border shadow-xs outline-none focus-visible:ring-3 data-selected:ring-2 data-disabled:opacity-50",\n variants: {\n size: {\n sm: "size-6",\n md: "size-7",\n lg: "size-8",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerSwatchGroup = tv({\n base: "flex flex-wrap gap-2",\n variants: {\n size: {\n sm: "gap-1.5",\n md: "gap-2",\n lg: "gap-2.5",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerValueSwatch = tv({\n base: "border-input relative shrink-0 overflow-hidden border",\n variants: {\n size: {\n sm: "size-4 rounded-[4.5px]",\n md: "size-5 rounded-[5.5px]",\n lg: "size-6 rounded-[6.5px]",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerFormatSelectTrigger = tv({\n base: "uppercase",\n variants: {\n size: {\n sm: "min-w-20",\n md: "min-w-24",\n lg: "min-w-24",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerAction = tv({\n base: "border-input bg-background inline-flex items-center justify-center rounded-md border outline-none focus-visible:ring-3 disabled:opacity-50",\n variants: {\n size: {\n sm: "h-9 px-2 text-sm",\n md: "h-11 px-3",\n lg: "h-12 px-4 text-lg",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerHiddenInput = tv({\n base: "sr-only",\n variants: {\n size: {\n sm: "",\n md: "",\n lg: "",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n'
|
|
3969
|
+
}
|
|
3970
|
+
],
|
|
3971
|
+
componentDependencies: ["input", "native-select", "popover", "select"],
|
|
3972
|
+
packageRequirements: [
|
|
3973
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
3974
|
+
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
3975
|
+
{ name: "astro", range: ">=5" },
|
|
3976
|
+
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
3977
|
+
]
|
|
3978
|
+
},
|
|
3979
|
+
react: {
|
|
3980
|
+
files: [
|
|
3981
|
+
{
|
|
3982
|
+
path: "src/components/starwind/color-picker/ColorPicker.tsx",
|
|
3983
|
+
content: 'import * as React from "react";\nimport { Popover } from "../popover";\nimport ColorPickerRoot from "./ColorPickerRoot";\n\nexport type ColorPickerProps = React.ComponentProps<typeof ColorPickerRoot> & {\n defaultOpen?: boolean;\n open?: boolean;\n closeOnEscape?: boolean;\n closeOnOutsideInteract?: boolean;\n modal?: boolean;\n openOnHover?: boolean;\n closeDelay?: number;\n onOpenChange?: React.ComponentProps<typeof Popover>["onOpenChange"];\n onCloseComplete?: React.ComponentProps<typeof Popover>["onCloseComplete"];\n};\n\nconst ColorPicker = React.forwardRef<HTMLDivElement, ColorPickerProps>(\n function ColorPicker(props, forwardedRef) {\n const {\n defaultOpen = false,\n open,\n closeOnEscape = true,\n closeOnOutsideInteract = true,\n modal = false,\n openOnHover = false,\n closeDelay = 200,\n onOpenChange,\n onCloseComplete,\n value,\n defaultValue = "#000000",\n format,\n alpha = true,\n allowEmpty = false,\n disabled = false,\n readOnly = false,\n name,\n form,\n required = false,\n locale,\n dir,\n onValueChange,\n onValueCommitted,\n onFormatChange,\n className,\n size = "md",\n children,\n ...rest\n } = props;\n\n return (\n <Popover\n defaultOpen={defaultOpen}\n open={open}\n closeOnEscape={closeOnEscape}\n closeOnOutsideInteract={closeOnOutsideInteract}\n modal={modal}\n openOnHover={openOnHover}\n closeDelay={closeDelay}\n onOpenChange={onOpenChange}\n onCloseComplete={onCloseComplete}\n >\n <ColorPickerRoot\n value={value}\n defaultValue={defaultValue}\n format={format}\n alpha={alpha}\n allowEmpty={allowEmpty}\n disabled={disabled}\n readOnly={readOnly}\n name={name}\n form={form}\n required={required}\n locale={locale}\n dir={dir}\n {...rest}\n data-floating-root={true}\n onValueChange={onValueChange}\n onValueCommitted={onValueCommitted}\n onFormatChange={onFormatChange}\n ref={forwardedRef}\n className={className}\n size={size}\n >\n {children}\n </ColorPickerRoot>\n </Popover>\n );\n },\n);\n\nColorPicker.displayName = "ColorPicker";\n\nexport default ColorPicker;\n'
|
|
3984
|
+
},
|
|
3985
|
+
{
|
|
3986
|
+
path: "src/components/starwind/color-picker/ColorPickerArea.tsx",
|
|
3987
|
+
content: 'import type * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport "./styles.css";\nimport ColorPickerPrimitive from "@starwind-ui/react/color-picker";\nimport ColorPickerAreaThumb from "./ColorPickerAreaThumb";\nimport { colorPickerArea } from "./variants";\n\nexport type ColorPickerAreaProps =\n React.ComponentPropsWithoutRef<"div"> &\n VariantProps<typeof colorPickerArea>;\n\nfunction ColorPickerArea(props: ColorPickerAreaProps) {\n const { className, size = "md", ...rest } = props;\n\n return (\n <ColorPickerPrimitive.Area\n className={colorPickerArea({ size, class: className })}\n {...rest}\n data-slot="color-picker-area"\n >\n <ColorPickerPrimitive.AreaBackground\n className="pointer-events-none absolute inset-0 size-full"\n data-slot="color-picker-area-background"\n />\n\n <ColorPickerAreaThumb\n size={size}\n />\n\n <ColorPickerPrimitive.AreaInput\n axis="x"\n className="absolute inset-0 size-full cursor-crosshair opacity-0"\n data-slot="color-picker-area-input-x"\n />\n\n <ColorPickerPrimitive.AreaInput\n axis="y"\n className="absolute inset-0 size-full cursor-crosshair opacity-0"\n data-slot="color-picker-area-input-y"\n />\n </ColorPickerPrimitive.Area>\n );\n}\n\nexport default ColorPickerArea;\n'
|
|
3988
|
+
},
|
|
3989
|
+
{
|
|
3990
|
+
path: "src/components/starwind/color-picker/ColorPickerAreaThumb.tsx",
|
|
3991
|
+
content: 'import ColorPickerPrimitive from "@starwind-ui/react/color-picker";\nimport type * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPickerAreaThumb } from "./variants";\n\nexport type ColorPickerAreaThumbProps =\n React.ComponentPropsWithoutRef<"span"> &\n VariantProps<typeof colorPickerAreaThumb>;\n\nfunction ColorPickerAreaThumb(props: ColorPickerAreaThumbProps) {\n const { className, size = "md", children, ...rest } = props;\n\n return (\n <ColorPickerPrimitive.AreaThumb\n className={colorPickerAreaThumb({ size, class: className })}\n {...rest}\n data-slot="color-picker-area-thumb"\n >\n {children}\n </ColorPickerPrimitive.AreaThumb>\n );\n}\n\nexport default ColorPickerAreaThumb;\n'
|
|
3992
|
+
},
|
|
3993
|
+
{
|
|
3994
|
+
path: "src/components/starwind/color-picker/ColorPickerChannelInput.tsx",
|
|
3995
|
+
content: 'import ColorPickerPrimitive from "@starwind-ui/react/color-picker";\nimport type * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPickerChannelInput, colorPickerChannelInputLayout } from "./variants";\n\nexport type ColorPickerChannelInputProps = React.ComponentPropsWithoutRef<"input"> &\n VariantProps<typeof colorPickerChannelInput> & {\n channel: import("@starwind-ui/react/color-picker").ColorPickerChannel;\n };\n\nfunction ColorPickerChannelInput(props: ColorPickerChannelInputProps) {\n const { channel, className, size = "md", ...rest } = props;\n\n return (\n <ColorPickerPrimitive.ChannelInput\n className={[colorPickerChannelInput({ size }), colorPickerChannelInputLayout({ size }), className].filter(Boolean).join(" ")}\n channel={channel}\n {...rest}\n data-slot="color-picker-channel-input"\n />\n );\n}\n\nexport default ColorPickerChannelInput;\n'
|
|
3996
|
+
},
|
|
3997
|
+
{
|
|
3998
|
+
path: "src/components/starwind/color-picker/ColorPickerChannelSlider.tsx",
|
|
3999
|
+
content: 'import type * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport "./styles.css";\nimport ColorPickerPrimitive from "@starwind-ui/react/color-picker";\nimport { colorPickerChannelSlider, colorPickerChannelSliderThumb } from "./variants";\n\nexport type ColorPickerChannelSliderProps = React.ComponentPropsWithoutRef<"div"> &\n VariantProps<typeof colorPickerChannelSlider> & {\n channel: import("@starwind-ui/react/color-picker").ColorPickerChannel;\n orientation?: "horizontal" | "vertical";\n };\n\nfunction ColorPickerChannelSlider(props: ColorPickerChannelSliderProps) {\n const { channel, orientation = "horizontal", className, size = "md", ...rest } = props;\n\n return (\n <ColorPickerPrimitive.ChannelSlider\n channel={channel}\n orientation={orientation}\n className={colorPickerChannelSlider({ size, class: className })}\n {...rest}\n data-slot="color-picker-channel-slider"\n >\n <ColorPickerPrimitive.TransparencyGrid\n className="pointer-events-none absolute inset-0 size-full rounded-[inherit]"\n data-slot="color-picker-transparency-grid"\n />\n\n <ColorPickerPrimitive.ChannelSliderTrack\n className="pointer-events-none absolute inset-0 size-full rounded-[inherit]"\n data-slot="color-picker-channel-slider-track"\n />\n\n <ColorPickerPrimitive.ChannelSliderThumb\n className={colorPickerChannelSliderThumb({ size })}\n data-slot="color-picker-channel-slider-thumb"\n >\n <span\n className="pointer-events-none absolute inset-0 size-full"\n data-slot="color-picker-transparency-grid"\n />\n\n <span\n className="pointer-events-none absolute inset-0 size-full bg-[var(--sw-color-picker-channel-thumb-color)]"\n data-slot="color-picker-channel-thumb-color-layer"\n />\n </ColorPickerPrimitive.ChannelSliderThumb>\n\n <ColorPickerPrimitive.ChannelSliderInput\n className="absolute inset-0 size-full cursor-pointer opacity-0"\n data-slot="color-picker-channel-slider-input"\n />\n </ColorPickerPrimitive.ChannelSlider>\n );\n}\n\nexport default ColorPickerChannelSlider;\n'
|
|
4000
|
+
},
|
|
4001
|
+
{
|
|
4002
|
+
path: "src/components/starwind/color-picker/ColorPickerClear.tsx",
|
|
4003
|
+
content: 'import ColorPickerPrimitive from "@starwind-ui/react/color-picker";\nimport type * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPickerAction } from "./variants";\n\nexport type ColorPickerClearProps =\n React.ComponentPropsWithoutRef<"button"> &\n VariantProps<typeof colorPickerAction>;\n\nfunction ColorPickerClear(props: ColorPickerClearProps) {\n const { className, size = "md", children, ...rest } = props;\n\n return (\n <ColorPickerPrimitive.Clear\n className={colorPickerAction({ size, class: className })}\n {...rest}\n data-slot="color-picker-clear"\n >\n {children}\n </ColorPickerPrimitive.Clear>\n );\n}\n\nexport default ColorPickerClear;\n'
|
|
4004
|
+
},
|
|
4005
|
+
{
|
|
4006
|
+
path: "src/components/starwind/color-picker/ColorPickerContent.tsx",
|
|
4007
|
+
content: 'import type * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport "./styles.css";\nimport { IconColorPicker as ColorPicker } from "@tabler/icons-react";\nimport { PopoverContent } from "../popover";\nimport ColorPickerArea from "./ColorPickerArea";\nimport ColorPickerClear from "./ColorPickerClear";\nimport ColorPickerEyeDropper from "./ColorPickerEyeDropper";\nimport ColorPickerInput from "./ColorPickerInput";\nimport ColorPickerSliders from "./ColorPickerSliders";\nimport { colorPickerContent, colorPickerSeparator, colorPickerSliderActionRow, colorPickerValueFormatRow } from "./variants";\n\nexport type ColorPickerContentProps = React.ComponentProps<typeof PopoverContent> &\n VariantProps<typeof colorPickerContent> & {\n alpha?: boolean;\n showEyeDropper?: boolean;\n showClear?: boolean;\n swatches?: React.ReactNode;\n };\n\nfunction ColorPickerContent(props: ColorPickerContentProps) {\n const {\n className,\n size = "md",\n alpha = true,\n showEyeDropper = true,\n showClear = false,\n side = "bottom",\n align = "start",\n exitMotion = "fade",\n children,\n swatches,\n ...rest\n } = props;\n\n const inputSize = size === "lg" ? "md" : "sm";\n const hasSwatches = swatches != null;\n const hasSwatchesAttribute = hasSwatches ? "true" : "false";\n\n return (\n <PopoverContent\n className={colorPickerContent({ size, class: className })}\n side={side}\n align={align}\n exitMotion={exitMotion}\n {...rest}\n data-slot="color-picker-content"\n >\n {children ?? (\n <>\n <ColorPickerArea\n size={size}\n />\n\n <div\n className={colorPickerSliderActionRow({ size })}\n data-slot="color-picker-slider-action-row"\n >\n <ColorPickerSliders\n alpha={alpha}\n size={size}\n className="min-w-0 flex-1"\n />\n\n {showEyeDropper && (\n <ColorPickerEyeDropper\n size={size}\n aria-label="Pick a color from the screen"\n >\n <ColorPicker\n className="size-4"\n aria-hidden="true"\n />\n </ColorPickerEyeDropper>\n )}\n </div>\n\n <div\n className={colorPickerValueFormatRow({ size })}\n data-slot="color-picker-value-format-row"\n >\n <ColorPickerInput\n size={inputSize}\n className="min-w-0 flex-1"\n />\n </div>\n\n <div\n className="contents"\n data-has-swatches={hasSwatchesAttribute}\n data-slot="color-picker-footer"\n >\n {(hasSwatches || showClear) && (\n <div\n className={colorPickerSeparator({ size })}\n role="separator"\n aria-hidden="true"\n data-slot="color-picker-separator"\n />\n )}\n\n {swatches}\n\n {showClear && (\n <ColorPickerClear\n size={inputSize}\n aria-label="Clear color"\n >\n Clear\n </ColorPickerClear>\n )}\n </div>\n </>\n )}\n </PopoverContent>\n );\n}\n\nexport default ColorPickerContent;\n'
|
|
4008
|
+
},
|
|
4009
|
+
{
|
|
4010
|
+
path: "src/components/starwind/color-picker/ColorPickerControl.tsx",
|
|
4011
|
+
content: 'import ColorPickerPrimitive from "@starwind-ui/react/color-picker";\nimport type * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPickerControl } from "./variants";\n\nexport type ColorPickerControlProps =\n React.ComponentPropsWithoutRef<"div"> &\n VariantProps<typeof colorPickerControl>;\n\nfunction ColorPickerControl(props: ColorPickerControlProps) {\n const { className, size = "md", children, ...rest } = props;\n\n return (\n <ColorPickerPrimitive.Control\n className={colorPickerControl({ size, class: className })}\n {...rest}\n data-slot="color-picker-control"\n >\n {children}\n </ColorPickerPrimitive.Control>\n );\n}\n\nexport default ColorPickerControl;\n'
|
|
4012
|
+
},
|
|
4013
|
+
{
|
|
4014
|
+
path: "src/components/starwind/color-picker/ColorPickerEyeDropper.tsx",
|
|
4015
|
+
content: 'import ColorPickerPrimitive from "@starwind-ui/react/color-picker";\nimport type * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPickerAction } from "./variants";\n\nexport type ColorPickerEyeDropperProps =\n React.ComponentPropsWithoutRef<"button"> &\n VariantProps<typeof colorPickerAction>;\n\nfunction ColorPickerEyeDropper(props: ColorPickerEyeDropperProps) {\n const { className, size = "md", children, ...rest } = props;\n\n return (\n <ColorPickerPrimitive.EyeDropperTrigger\n className={colorPickerAction({ size, class: className })}\n {...rest}\n data-slot="color-picker-eye-dropper"\n >\n {children}\n </ColorPickerPrimitive.EyeDropperTrigger>\n );\n}\n\nexport default ColorPickerEyeDropper;\n'
|
|
4016
|
+
},
|
|
4017
|
+
{
|
|
4018
|
+
path: "src/components/starwind/color-picker/ColorPickerFormatSelect.tsx",
|
|
4019
|
+
content: 'import type * as React from "react";\nimport "./styles.css";\nimport ColorPickerPrimitive from "@starwind-ui/react/color-picker";\nimport { Select, SelectContent, SelectItem, SelectTrigger } from "../select";\nimport { colorPickerFormatSelectTrigger } from "./variants";\n\nexport type ColorPickerFormatSelectProps = React.ComponentPropsWithoutRef<"div"> & {\n size?: "sm" | "md" | "lg";\n};\n\nfunction ColorPickerFormatSelect(props: ColorPickerFormatSelectProps) {\n const { className, size = "md", ...rest } = props;\n\n return (\n <ColorPickerPrimitive.FormatControl\n className={["shrink-0", className].filter(Boolean).join(" ")}\n {...rest}\n data-slot="color-picker-format-control"\n >\n <Select>\n <SelectTrigger\n size={size}\n aria-label="Color format"\n className={colorPickerFormatSelectTrigger({ size })}\n />\n\n <SelectContent\n size={size}\n data-sw-color-picker-format-options=""\n >\n <SelectItem value="hex">HEX</SelectItem>\n\n <SelectItem value="rgb">RGB</SelectItem>\n\n <SelectItem value="hsl">HSL</SelectItem>\n\n <SelectItem value="hsb">HSB</SelectItem>\n </SelectContent>\n </Select>\n </ColorPickerPrimitive.FormatControl>\n );\n}\n\nexport default ColorPickerFormatSelect;\n'
|
|
4020
|
+
},
|
|
4021
|
+
{
|
|
4022
|
+
path: "src/components/starwind/color-picker/ColorPickerHiddenInput.tsx",
|
|
4023
|
+
content: 'import ColorPickerPrimitive from "@starwind-ui/react/color-picker";\nimport type * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPickerHiddenInput } from "./variants";\n\nexport type ColorPickerHiddenInputProps =\n React.ComponentPropsWithoutRef<"input"> &\n VariantProps<typeof colorPickerHiddenInput>;\n\nfunction ColorPickerHiddenInput(props: ColorPickerHiddenInputProps) {\n const { className, size = "md", ...rest } = props;\n\n return (\n <ColorPickerPrimitive.HiddenInput\n className={colorPickerHiddenInput({ size, class: className })}\n {...rest}\n data-slot="color-picker-hidden-input"\n />\n );\n}\n\nexport default ColorPickerHiddenInput;\n'
|
|
4024
|
+
},
|
|
4025
|
+
{
|
|
4026
|
+
path: "src/components/starwind/color-picker/ColorPickerInput.tsx",
|
|
4027
|
+
content: 'import type * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport ColorPickerFormatSelect from "./ColorPickerFormatSelect";\nimport ColorPickerNativeFormatSelect from "./ColorPickerNativeFormatSelect";\nimport ColorPickerValueInput from "./ColorPickerValueInput";\nimport { colorPickerInput } from "./variants";\n\nexport type ColorPickerInputProps = React.ComponentPropsWithoutRef<"div"> &\n VariantProps<typeof colorPickerInput> & {\n formatControl?: "select" | "native";\n };\n\nfunction ColorPickerInput(props: ColorPickerInputProps) {\n const { formatControl = "select", className, size = "md", ...rest } = props;\n\n return (\n <div\n className={colorPickerInput({ size, class: className })}\n {...rest}\n data-slot="color-picker-input"\n >\n <ColorPickerValueInput\n size={size}\n />\n\n {formatControl === "native" ? (\n <ColorPickerNativeFormatSelect\n size={size}\n />\n ) : (\n <ColorPickerFormatSelect\n size={size}\n />\n )}\n </div>\n );\n}\n\nexport default ColorPickerInput;\n'
|
|
4028
|
+
},
|
|
4029
|
+
{
|
|
4030
|
+
path: "src/components/starwind/color-picker/ColorPickerLabel.tsx",
|
|
4031
|
+
content: 'import ColorPickerPrimitive from "@starwind-ui/react/color-picker";\nimport type * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPickerLabel } from "./variants";\n\nexport type ColorPickerLabelProps =\n React.ComponentPropsWithoutRef<"label"> &\n VariantProps<typeof colorPickerLabel>;\n\nfunction ColorPickerLabel(props: ColorPickerLabelProps) {\n const { className, size = "md", children, ...rest } = props;\n\n return (\n <ColorPickerPrimitive.Label\n className={colorPickerLabel({ size, class: className })}\n {...rest}\n data-slot="color-picker-label"\n >\n {children}\n </ColorPickerPrimitive.Label>\n );\n}\n\nexport default ColorPickerLabel;\n'
|
|
4032
|
+
},
|
|
4033
|
+
{
|
|
4034
|
+
path: "src/components/starwind/color-picker/ColorPickerNativeFormatSelect.tsx",
|
|
4035
|
+
content: 'import ColorPickerPrimitive from "@starwind-ui/react/color-picker";\nimport { IconChevronDown as ChevronDown } from "@tabler/icons-react";\nimport type * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport { NativeSelectOption } from "../native-select";\nimport { colorPickerNativeFormatSelect, colorPickerNativeFormatSelectIcon, colorPickerNativeFormatSelectWrapper } from "./variants";\n\nexport type ColorPickerNativeFormatSelectProps =\n Omit<React.ComponentPropsWithoutRef<"select">, "size"> &\n VariantProps<typeof colorPickerNativeFormatSelect>;\n\nfunction ColorPickerNativeFormatSelect(props: ColorPickerNativeFormatSelectProps) {\n const { className, size = "md", ...rest } = props;\n\n return (\n <div\n className={colorPickerNativeFormatSelectWrapper()}\n data-slot="color-picker-native-format-select-wrapper"\n >\n <ColorPickerPrimitive.FormatSelect\n className={colorPickerNativeFormatSelect({ size, class: className })}\n aria-label="Color format"\n {...rest}\n data-slot="color-picker-native-format-select"\n >\n <NativeSelectOption value="hex">HEX</NativeSelectOption>\n\n <NativeSelectOption value="rgb">RGB</NativeSelectOption>\n\n <NativeSelectOption value="hsl">HSL</NativeSelectOption>\n\n <NativeSelectOption value="hsb">HSB</NativeSelectOption>\n </ColorPickerPrimitive.FormatSelect>\n\n <ChevronDown\n className={colorPickerNativeFormatSelectIcon({ size })}\n aria-hidden="true"\n data-slot="color-picker-native-format-select-icon"\n />\n </div>\n );\n}\n\nexport default ColorPickerNativeFormatSelect;\n'
|
|
4036
|
+
},
|
|
4037
|
+
{
|
|
4038
|
+
path: "src/components/starwind/color-picker/ColorPickerRoot.tsx",
|
|
4039
|
+
content: 'import ColorPickerPrimitive from "@starwind-ui/react/color-picker";\nimport * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPicker } from "./variants";\n\nexport type ColorPickerRootProps = Omit<React.ComponentPropsWithoutRef<"div">, "value" | "defaultValue" | "onChange" | "dir"> &\n VariantProps<typeof colorPicker> & {\n value?: import("@starwind-ui/react/color-picker").ColorPickerValue;\n defaultValue?: import("@starwind-ui/react/color-picker").ColorPickerValue;\n format?: import("@starwind-ui/react/color-picker").ColorPickerFormat;\n alpha?: boolean;\n allowEmpty?: boolean;\n disabled?: boolean;\n readOnly?: boolean;\n name?: string;\n form?: string;\n required?: boolean;\n locale?: string;\n dir?: import("@starwind-ui/react/color-picker").ColorPickerDirection;\n onValueChange?: (value: import("@starwind-ui/react/color-picker").ColorPickerColor | null, details: import("@starwind-ui/react/color-picker").ColorPickerValueChangeDetails) => void;\n onValueCommitted?: (value: import("@starwind-ui/react/color-picker").ColorPickerColor | null, details: import("@starwind-ui/react/color-picker").ColorPickerValueCommitDetails) => void;\n onFormatChange?: (format: import("@starwind-ui/react/color-picker").ColorPickerFormat, details: import("@starwind-ui/react/color-picker").ColorPickerFormatChangeDetails) => void;\n ref?: React.Ref<HTMLDivElement>;\n };\n\nconst ColorPickerRoot = React.forwardRef<HTMLDivElement, ColorPickerRootProps>(\n function ColorPickerRoot(props, forwardedRef) {\n const {\n value,\n defaultValue = "#000000",\n format,\n alpha = true,\n allowEmpty = false,\n disabled = false,\n readOnly = false,\n name,\n form,\n required = false,\n locale,\n dir,\n onValueChange,\n onValueCommitted,\n onFormatChange,\n className,\n size = "md",\n children,\n ...rest\n } = props;\n\n return (\n <ColorPickerPrimitive.Root\n className={colorPicker({ size, class: className })}\n value={value}\n defaultValue={defaultValue}\n format={format}\n alpha={alpha}\n allowEmpty={allowEmpty}\n disabled={disabled}\n readOnly={readOnly}\n name={name}\n form={form}\n required={required}\n locale={locale}\n dir={dir}\n onValueChange={onValueChange}\n onValueCommitted={onValueCommitted}\n onFormatChange={onFormatChange}\n {...rest}\n ref={forwardedRef}\n data-slot="color-picker"\n >\n {children}\n </ColorPickerPrimitive.Root>\n );\n },\n);\n\nColorPickerRoot.displayName = "ColorPickerRoot";\n\nexport default ColorPickerRoot;\n'
|
|
4040
|
+
},
|
|
4041
|
+
{
|
|
4042
|
+
path: "src/components/starwind/color-picker/ColorPickerSliders.tsx",
|
|
4043
|
+
content: 'import type * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport ColorPickerChannelSlider from "./ColorPickerChannelSlider";\nimport { colorPickerSliders } from "./variants";\n\nexport type ColorPickerSlidersProps = React.ComponentPropsWithoutRef<"div"> &\n VariantProps<typeof colorPickerSliders> & {\n alpha?: boolean;\n };\n\nfunction ColorPickerSliders(props: ColorPickerSlidersProps) {\n const { alpha = true, className, size = "md", ...rest } = props;\n\n return (\n <div\n className={colorPickerSliders({ size, class: className })}\n {...rest}\n data-slot="color-picker-sliders"\n >\n <ColorPickerChannelSlider\n channel="hue"\n size={size}\n />\n\n {alpha && (\n <ColorPickerChannelSlider\n channel="alpha"\n size={size}\n />\n )}\n </div>\n );\n}\n\nexport default ColorPickerSliders;\n'
|
|
4044
|
+
},
|
|
4045
|
+
{
|
|
4046
|
+
path: "src/components/starwind/color-picker/ColorPickerSwatch.tsx",
|
|
4047
|
+
content: 'import type * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport "./styles.css";\nimport ColorPickerPrimitive from "@starwind-ui/react/color-picker";\nimport { colorPickerSwatch } from "./variants";\n\nexport type ColorPickerSwatchProps = React.ComponentPropsWithoutRef<"button"> &\n VariantProps<typeof colorPickerSwatch> & {\n value: import("@starwind-ui/react/color-picker").ColorPickerValue;\n disabled?: boolean;\n };\n\nfunction ColorPickerSwatch(props: ColorPickerSwatchProps) {\n const { value, disabled = false, className, size = "md", children, ...rest } = props;\n\n return (\n <ColorPickerPrimitive.Swatch\n swatchValue={value}\n swatchDisabled={disabled}\n className={colorPickerSwatch({ size, class: className })}\n {...rest}\n data-slot="color-picker-swatch"\n >\n <ColorPickerPrimitive.TransparencyGrid\n className="pointer-events-none absolute inset-0 size-full"\n data-slot="color-picker-transparency-grid"\n />\n\n <span\n className="pointer-events-none absolute inset-0 size-full"\n data-slot="color-picker-swatch-color"\n />\n\n {children}\n </ColorPickerPrimitive.Swatch>\n );\n}\n\nexport default ColorPickerSwatch;\n'
|
|
4048
|
+
},
|
|
4049
|
+
{
|
|
4050
|
+
path: "src/components/starwind/color-picker/ColorPickerSwatchGroup.tsx",
|
|
4051
|
+
content: 'import ColorPickerPrimitive from "@starwind-ui/react/color-picker";\nimport type * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPickerSwatchGroup } from "./variants";\n\nexport type ColorPickerSwatchGroupProps =\n React.ComponentPropsWithoutRef<"div"> &\n VariantProps<typeof colorPickerSwatchGroup>;\n\nfunction ColorPickerSwatchGroup(props: ColorPickerSwatchGroupProps) {\n const { className, size = "md", children, ...rest } = props;\n\n return (\n <ColorPickerPrimitive.SwatchGroup\n className={colorPickerSwatchGroup({ size, class: className })}\n {...rest}\n data-slot="color-picker-swatch-group"\n >\n {children}\n </ColorPickerPrimitive.SwatchGroup>\n );\n}\n\nexport default ColorPickerSwatchGroup;\n'
|
|
4052
|
+
},
|
|
4053
|
+
{
|
|
4054
|
+
path: "src/components/starwind/color-picker/ColorPickerTrigger.tsx",
|
|
4055
|
+
content: 'import ColorPickerPrimitive from "@starwind-ui/react/color-picker";\nimport type * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport { PopoverTrigger } from "../popover";\nimport { colorPickerTrigger, colorPickerValueSwatch } from "./variants";\n\nexport type ColorPickerTriggerProps = React.ComponentProps<typeof PopoverTrigger> &\n VariantProps<typeof colorPickerTrigger> & {\n showValueText?: boolean;\n };\n\nfunction ColorPickerTrigger(props: ColorPickerTriggerProps) {\n const { className, size = "md", showValueText = true, children, ...rest } = props;\n\n return (\n <PopoverTrigger\n className={colorPickerTrigger({ size, class: className })}\n {...rest}\n data-slot="color-picker-trigger"\n >\n {children}\n\n <ColorPickerPrimitive.ValueSwatch\n className={colorPickerValueSwatch({ size })}\n data-slot="color-picker-value-swatch"\n >\n <ColorPickerPrimitive.TransparencyGrid\n className="pointer-events-none absolute inset-0 size-full"\n data-slot="color-picker-transparency-grid"\n />\n\n <span\n className="pointer-events-none absolute inset-0 size-full"\n data-slot="color-picker-value-swatch-color"\n />\n </ColorPickerPrimitive.ValueSwatch>\n\n {showValueText && (\n <ColorPickerPrimitive.ValueText\n data-slot="color-picker-value-text"\n />\n )}\n </PopoverTrigger>\n );\n}\n\nexport default ColorPickerTrigger;\n'
|
|
4056
|
+
},
|
|
4057
|
+
{
|
|
4058
|
+
path: "src/components/starwind/color-picker/ColorPickerValueInput.tsx",
|
|
4059
|
+
content: 'import ColorPickerPrimitive from "@starwind-ui/react/color-picker";\nimport type * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport { colorPickerValueInput, colorPickerValueInputLayout } from "./variants";\n\nexport type ColorPickerValueInputProps =\n Omit<React.ComponentPropsWithoutRef<"input">, "size"> &\n VariantProps<typeof colorPickerValueInput>;\n\nfunction ColorPickerValueInput(props: ColorPickerValueInputProps) {\n const { className, size = "md", ...rest } = props;\n\n return (\n <ColorPickerPrimitive.ValueInput\n className={[colorPickerValueInput({ size }), colorPickerValueInputLayout({ size }), className].filter(Boolean).join(" ")}\n {...rest}\n data-slot="color-picker-value-input"\n />\n );\n}\n\nexport default ColorPickerValueInput;\n'
|
|
4060
|
+
},
|
|
4061
|
+
{
|
|
4062
|
+
path: "src/components/starwind/color-picker/ColorPickerValueSwatch.tsx",
|
|
4063
|
+
content: 'import type * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport "./styles.css";\nimport ColorPickerPrimitive from "@starwind-ui/react/color-picker";\nimport { colorPickerValueSwatch } from "./variants";\n\nexport type ColorPickerValueSwatchProps =\n React.ComponentPropsWithoutRef<"span"> &\n VariantProps<typeof colorPickerValueSwatch>;\n\nfunction ColorPickerValueSwatch(props: ColorPickerValueSwatchProps) {\n const { className, size = "md", ...rest } = props;\n\n return (\n <ColorPickerPrimitive.ValueSwatch\n className={colorPickerValueSwatch({ size, class: className })}\n {...rest}\n data-slot="color-picker-value-swatch"\n >\n <ColorPickerPrimitive.TransparencyGrid\n className="pointer-events-none absolute inset-0 size-full"\n data-slot="color-picker-transparency-grid"\n />\n\n <span\n className="pointer-events-none absolute inset-0 size-full"\n data-slot="color-picker-value-swatch-color"\n />\n </ColorPickerPrimitive.ValueSwatch>\n );\n}\n\nexport default ColorPickerValueSwatch;\n'
|
|
4064
|
+
},
|
|
4065
|
+
{
|
|
4066
|
+
path: "src/components/starwind/color-picker/index.ts",
|
|
4067
|
+
content: 'import ColorPicker from "./ColorPicker";\nimport ColorPickerArea from "./ColorPickerArea";\nimport ColorPickerAreaThumb from "./ColorPickerAreaThumb";\nimport ColorPickerChannelInput from "./ColorPickerChannelInput";\nimport ColorPickerChannelSlider from "./ColorPickerChannelSlider";\nimport ColorPickerClear from "./ColorPickerClear";\nimport ColorPickerContent from "./ColorPickerContent";\nimport ColorPickerControl from "./ColorPickerControl";\nimport ColorPickerEyeDropper from "./ColorPickerEyeDropper";\nimport ColorPickerFormatSelect from "./ColorPickerFormatSelect";\nimport ColorPickerHiddenInput from "./ColorPickerHiddenInput";\nimport ColorPickerInput from "./ColorPickerInput";\nimport ColorPickerLabel from "./ColorPickerLabel";\nimport ColorPickerNativeFormatSelect from "./ColorPickerNativeFormatSelect";\nimport ColorPickerRoot from "./ColorPickerRoot";\nimport ColorPickerSliders from "./ColorPickerSliders";\nimport ColorPickerSwatch from "./ColorPickerSwatch";\nimport ColorPickerSwatchGroup from "./ColorPickerSwatchGroup";\nimport ColorPickerTrigger from "./ColorPickerTrigger";\nimport ColorPickerValueInput from "./ColorPickerValueInput";\nimport ColorPickerValueSwatch from "./ColorPickerValueSwatch";\nimport {\n colorPicker,\n colorPickerAction,\n colorPickerArea,\n colorPickerAreaThumb,\n colorPickerChannelInput,\n colorPickerChannelInputLayout,\n colorPickerChannelSlider,\n colorPickerChannelSliderThumb,\n colorPickerContent,\n colorPickerControl,\n colorPickerFormatSelectTrigger,\n colorPickerHiddenInput,\n colorPickerInput,\n colorPickerLabel,\n colorPickerNativeFormatSelect,\n colorPickerNativeFormatSelectIcon,\n colorPickerNativeFormatSelectWrapper,\n colorPickerSeparator,\n colorPickerSliderActionRow,\n colorPickerSliders,\n colorPickerSwatch,\n colorPickerSwatchGroup,\n colorPickerTrigger,\n colorPickerValueFormatRow,\n colorPickerValueInput,\n colorPickerValueInputLayout,\n colorPickerValueSwatch,\n} from "./variants";\n\nconst ColorPickerVariants = {\n colorPicker,\n colorPickerAction,\n colorPickerArea,\n colorPickerAreaThumb,\n colorPickerChannelInput,\n colorPickerChannelInputLayout,\n colorPickerChannelSlider,\n colorPickerChannelSliderThumb,\n colorPickerContent,\n colorPickerControl,\n colorPickerFormatSelectTrigger,\n colorPickerHiddenInput,\n colorPickerInput,\n colorPickerLabel,\n colorPickerNativeFormatSelect,\n colorPickerNativeFormatSelectIcon,\n colorPickerNativeFormatSelectWrapper,\n colorPickerSeparator,\n colorPickerSliderActionRow,\n colorPickerSliders,\n colorPickerSwatch,\n colorPickerSwatchGroup,\n colorPickerTrigger,\n colorPickerValueFormatRow,\n colorPickerValueInput,\n colorPickerValueInputLayout,\n colorPickerValueSwatch,\n};\n\nexport {\n ColorPicker,\n ColorPickerArea,\n ColorPickerAreaThumb,\n ColorPickerChannelInput,\n ColorPickerChannelSlider,\n ColorPickerClear,\n ColorPickerContent,\n ColorPickerControl,\n ColorPickerEyeDropper,\n ColorPickerFormatSelect,\n ColorPickerHiddenInput,\n ColorPickerInput,\n ColorPickerLabel,\n ColorPickerNativeFormatSelect,\n ColorPickerRoot,\n ColorPickerSliders,\n ColorPickerSwatch,\n ColorPickerSwatchGroup,\n ColorPickerTrigger,\n ColorPickerValueInput,\n ColorPickerValueSwatch,\n ColorPickerVariants,\n};\n\nexport default {\n Root: ColorPicker,\n InlineRoot: ColorPickerRoot,\n Label: ColorPickerLabel,\n Control: ColorPickerControl,\n Input: ColorPickerInput,\n Trigger: ColorPickerTrigger,\n Content: ColorPickerContent,\n Area: ColorPickerArea,\n AreaThumb: ColorPickerAreaThumb,\n Sliders: ColorPickerSliders,\n ChannelSlider: ColorPickerChannelSlider,\n ChannelInput: ColorPickerChannelInput,\n ValueInput: ColorPickerValueInput,\n NativeFormatSelect: ColorPickerNativeFormatSelect,\n FormatSelect: ColorPickerFormatSelect,\n ValueSwatch: ColorPickerValueSwatch,\n SwatchGroup: ColorPickerSwatchGroup,\n Swatch: ColorPickerSwatch,\n EyeDropper: ColorPickerEyeDropper,\n Clear: ColorPickerClear,\n HiddenInput: ColorPickerHiddenInput,\n};\n'
|
|
4068
|
+
},
|
|
4069
|
+
{
|
|
4070
|
+
path: "src/components/starwind/color-picker/styles.css",
|
|
4071
|
+
content: '[data-slot="color-picker-area-background"] { background: var(--sw-color-picker-area-background-overlay, linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent)), var(--sw-color-picker-area-background, hsl(var(--sw-color-picker-hue) 100% 50%)); }\n[data-slot="color-picker-channel-slider"] { --sw-color-picker-channel-gradient-direction: to right; --sw-color-picker-channel-gradient: linear-gradient(var(--sw-color-picker-channel-gradient-direction), transparent, var(--sw-color-picker-color, #000)); }\n[data-slot="color-picker-channel-slider"][data-orientation="vertical"] { --sw-color-picker-channel-gradient-direction: to top; }\n[data-slot="color-picker-channel-slider"][data-channel="hue"] { --sw-color-picker-channel-gradient: linear-gradient(var(--sw-color-picker-channel-gradient-direction), #f00 0%, #ff0 16.67%, #0f0 33.33%, #0ff 50%, #00f 66.67%, #f0f 83.33%, #f00 100%); }\n[data-slot="color-picker-channel-slider"][data-channel="alpha"] { --sw-color-picker-channel-gradient: linear-gradient(var(--sw-color-picker-channel-gradient-direction), rgb(from var(--sw-color-picker-color, #000) r g b / 0), rgb(from var(--sw-color-picker-color, #000) r g b / 1)); }\n[data-slot="color-picker-channel-slider"][data-channel="saturation"] { --sw-color-picker-channel-gradient: linear-gradient(var(--sw-color-picker-channel-gradient-direction), hsl(var(--sw-color-picker-hue, 0) 0% 50%), hsl(var(--sw-color-picker-hue, 0) 100% 50%)); }\n[data-slot="color-picker-channel-slider"][data-channel="brightness"] { --sw-color-picker-channel-gradient: linear-gradient(var(--sw-color-picker-channel-gradient-direction), #000, hsl(var(--sw-color-picker-hue, 0) 100% 50%)); }\n[data-slot="color-picker-channel-slider"][data-channel="lightness"] { --sw-color-picker-channel-gradient: linear-gradient(var(--sw-color-picker-channel-gradient-direction), #000, hsl(var(--sw-color-picker-hue, 0) 100% 50%), #fff); }\n[data-slot="color-picker-channel-slider"][data-channel="red"] { --sw-color-picker-channel-gradient: linear-gradient(var(--sw-color-picker-channel-gradient-direction), rgb(from var(--sw-color-picker-color, #000) 0 g b), rgb(from var(--sw-color-picker-color, #000) 255 g b)); }\n[data-slot="color-picker-channel-slider"][data-channel="green"] { --sw-color-picker-channel-gradient: linear-gradient(var(--sw-color-picker-channel-gradient-direction), rgb(from var(--sw-color-picker-color, #000) r 0 b), rgb(from var(--sw-color-picker-color, #000) r 255 b)); }\n[data-slot="color-picker-channel-slider"][data-channel="blue"] { --sw-color-picker-channel-gradient: linear-gradient(var(--sw-color-picker-channel-gradient-direction), rgb(from var(--sw-color-picker-color, #000) r g 0), rgb(from var(--sw-color-picker-color, #000) r g 255)); }\n[data-slot="color-picker-channel-slider-track"] { background: var(--sw-color-picker-channel-gradient); }\n[data-slot="color-picker-transparency-grid"] { background-color: #fff; background-image: linear-gradient(45deg, #d4d4d8 25%, transparent 25%), linear-gradient(-45deg, #d4d4d8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d4d4d8 75%), linear-gradient(-45deg, transparent 75%, #d4d4d8 75%); background-position: 0 0, 0 4px, 4px -4px, -4px 0; background-size: 8px 8px; }\n[data-slot="color-picker-value-swatch-color"], [data-slot="color-picker-swatch-color"] { background: var(--sw-color-picker-swatch-color); }\n[data-slot="color-picker-value-swatch"] { background-color: #fff; background-image: linear-gradient(var(--sw-color-picker-swatch-color, transparent), var(--sw-color-picker-swatch-color, transparent)), linear-gradient(45deg, #d4d4d8 25%, transparent 25%), linear-gradient(-45deg, #d4d4d8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d4d4d8 75%), linear-gradient(-45deg, transparent 75%, #d4d4d8 75%); background-position: 0 0, 0 0, 0 4px, 4px -4px, -4px 0; background-size: 100% 100%, 8px 8px, 8px 8px, 8px 8px, 8px 8px; }\n[data-slot="color-picker-value-swatch"] > [data-slot="color-picker-transparency-grid"], [data-slot="color-picker-value-swatch"] > [data-slot="color-picker-value-swatch-color"] { display: none; }\n[data-slot="color-picker-footer"][data-has-swatches="false"]:not(:has([data-slot="color-picker-clear"]:not([hidden]))) > [data-slot="color-picker-separator"] { display: none; }\n[data-sw-color-picker][data-floating-root] > [data-slot="select-positioner"]:has(> [data-sw-color-picker-format-options]) { z-index: 60; }\n'
|
|
4072
|
+
},
|
|
4073
|
+
{
|
|
4074
|
+
path: "src/components/starwind/color-picker/variants.ts",
|
|
4075
|
+
content: 'import { tv } from "tailwind-variants";\nimport { input as channelInputRecipe, input as valueInputRecipe } from "../input/variants";\nimport {\n nativeSelectIcon as nativeSelectIconRecipe,\n nativeSelect as nativeSelectRecipe,\n nativeSelectWrapper as nativeSelectWrapperRecipe,\n} from "../native-select/variants";\n\nexport const colorPickerChannelInput = channelInputRecipe;\n\nexport const colorPickerValueInput = valueInputRecipe;\n\nexport const colorPickerNativeFormatSelectWrapper = nativeSelectWrapperRecipe;\n\nexport const colorPickerNativeFormatSelect = nativeSelectRecipe;\n\nexport const colorPickerNativeFormatSelectIcon = nativeSelectIconRecipe;\n\nexport const colorPicker = tv({\n base: "relative flex flex-col gap-3",\n variants: {\n size: {\n sm: "text-sm",\n md: "text-base",\n lg: "text-lg",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerLabel = tv({\n base: "font-medium leading-none data-disabled:cursor-not-allowed data-disabled:opacity-50",\n variants: {\n size: {\n sm: "text-xs",\n md: "text-sm",\n lg: "text-base",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerControl = tv({\n base: "flex items-center gap-2",\n variants: {\n size: {\n sm: "gap-1.5",\n md: "gap-2",\n lg: "gap-2.5",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerTrigger = tv({\n base: "border-input bg-background focus-visible:ring-outline/50 inline-flex items-center rounded-md border shadow-xs outline-none focus-visible:ring-3 disabled:pointer-events-none disabled:opacity-50",\n variants: {\n size: {\n sm: "h-9 gap-2 px-2 text-sm",\n md: "h-11 gap-2.5 px-3",\n lg: "h-12 gap-3 px-4 text-lg",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerContent = tv({\n base: "flex max-h-[max(10rem,var(--sw-floating-available-height))] w-72 flex-col gap-3 p-3",\n variants: {\n size: {\n sm: "w-64 gap-2 p-2",\n md: "w-72 gap-3 p-3",\n lg: "w-80 gap-4 p-4",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerInput = tv({\n base: "flex items-center gap-2",\n variants: {\n size: {\n sm: "gap-1.5",\n md: "gap-2",\n lg: "gap-2.5",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerValueInputLayout = tv({\n base: "min-w-0 flex-1 data-invalid:border-error data-invalid:focus-visible:ring-error/40",\n variants: {\n size: {\n sm: "",\n md: "",\n lg: "",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerArea = tv({\n base: "group/color-picker-area border-outline relative w-full touch-none rounded-md border [&>[data-slot=color-picker-area-background]]:inset-0 [&>[data-slot=color-picker-area-background]]:size-full [&>[data-slot=color-picker-area-background]]:rounded-[7px]",\n variants: {\n size: {\n sm: "h-[150px]",\n md: "h-[175px]",\n lg: "h-[200px]",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerAreaThumb = tv({\n base: "group-has-[[data-slot=color-picker-area-input-x]:focus-visible]/color-picker-area:ring-outline/60 pointer-events-none absolute top-[clamp(1px,var(--sw-color-picker-area-y),calc(100%_-_1px))] left-[clamp(1px,var(--sw-color-picker-area-x),calc(100%_-_1px))] z-10 size-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white bg-[var(--sw-color-picker-area-thumb-color)] shadow-md ring-1 ring-black/30 outline-none group-has-[[data-slot=color-picker-area-input-x]:focus-visible]/color-picker-area:ring-3 focus-visible:ring-3 data-disabled:opacity-50 data-dragging:scale-110",\n variants: {\n size: {\n sm: "size-3.5",\n md: "size-4",\n lg: "size-5",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerSliders = tv({\n base: "flex flex-col gap-3 px-2",\n variants: {\n size: {\n sm: "gap-2",\n md: "gap-3",\n lg: "gap-4",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerSliderActionRow = tv({\n base: "flex items-center gap-2",\n variants: {\n size: {\n sm: "gap-1.5",\n md: "gap-2",\n lg: "gap-2.5",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerValueFormatRow = tv({\n base: "flex items-center gap-2",\n variants: {\n size: {\n sm: "gap-1.5",\n md: "gap-2",\n lg: "gap-2.5",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerSeparator = tv({\n base: "bg-border h-px w-full",\n variants: {\n size: {\n sm: "my-0.5",\n md: "my-1",\n lg: "my-1.5",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerChannelSlider = tv({\n base: "group/color-picker-channel-slider bg-border relative touch-none rounded-full [&>[data-slot=color-picker-channel-slider-track]]:inset-px [&>[data-slot=color-picker-channel-slider-track]]:size-auto [&>[data-slot=color-picker-transparency-grid]]:inset-px [&>[data-slot=color-picker-transparency-grid]]:size-auto",\n variants: {\n size: {\n sm: "h-2.5 data-[orientation=vertical]:h-40 data-[orientation=vertical]:w-2.5",\n md: "h-3 data-[orientation=vertical]:h-48 data-[orientation=vertical]:w-3",\n lg: "h-4 data-[orientation=vertical]:h-56 data-[orientation=vertical]:w-4",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerChannelSliderThumb = tv({\n base: "group-has-[[data-slot=color-picker-channel-slider-input]:focus-visible]/color-picker-channel-slider:ring-outline/60 pointer-events-none absolute top-1/2 left-[var(--sw-color-picker-channel-position)] z-10 -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-full border-2 border-white shadow-md ring-1 ring-black/30 outline-none group-has-[[data-slot=color-picker-channel-slider-input]:focus-visible]/color-picker-channel-slider:ring-3 group-data-[orientation=vertical]/color-picker-channel-slider:top-[calc(100%-var(--sw-color-picker-channel-position))] group-data-[orientation=vertical]/color-picker-channel-slider:left-1/2 data-disabled:opacity-50 data-dragging:scale-110",\n variants: {\n size: {\n sm: "size-3",\n md: "size-4",\n lg: "size-5",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerChannelInputLayout = tv({\n base: "text-center data-invalid:border-error data-invalid:focus-visible:ring-error/40",\n variants: {\n size: {\n sm: "h-9 w-16 text-sm",\n md: "h-11 w-20",\n lg: "h-12 w-24 text-lg",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerSwatch = tv({\n base: "relative overflow-hidden rounded-md border shadow-xs outline-none focus-visible:ring-3 data-selected:ring-2 data-disabled:opacity-50",\n variants: {\n size: {\n sm: "size-6",\n md: "size-7",\n lg: "size-8",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerSwatchGroup = tv({\n base: "flex flex-wrap gap-2",\n variants: {\n size: {\n sm: "gap-1.5",\n md: "gap-2",\n lg: "gap-2.5",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerValueSwatch = tv({\n base: "border-input relative shrink-0 overflow-hidden border",\n variants: {\n size: {\n sm: "size-4 rounded-[4.5px]",\n md: "size-5 rounded-[5.5px]",\n lg: "size-6 rounded-[6.5px]",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerFormatSelectTrigger = tv({\n base: "uppercase",\n variants: {\n size: {\n sm: "min-w-20",\n md: "min-w-24",\n lg: "min-w-24",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerAction = tv({\n base: "border-input bg-background inline-flex items-center justify-center rounded-md border outline-none focus-visible:ring-3 disabled:opacity-50",\n variants: {\n size: {\n sm: "h-9 px-2 text-sm",\n md: "h-11 px-3",\n lg: "h-12 px-4 text-lg",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n\nexport const colorPickerHiddenInput = tv({\n base: "sr-only",\n variants: {\n size: {\n sm: "",\n md: "",\n lg: "",\n },\n },\n defaultVariants: {\n size: "md",\n },\n});\n'
|
|
4076
|
+
}
|
|
4077
|
+
],
|
|
4078
|
+
componentDependencies: ["input", "native-select", "popover", "select"],
|
|
4079
|
+
packageRequirements: [
|
|
4080
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
3859
4081
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
3860
4082
|
{ name: "react", range: ">=18" },
|
|
3861
4083
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -3886,7 +4108,7 @@ export const comboboxValue = tv({
|
|
|
3886
4108
|
],
|
|
3887
4109
|
componentDependencies: [],
|
|
3888
4110
|
packageRequirements: [
|
|
3889
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
4111
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
3890
4112
|
{ name: "astro", range: ">=5" },
|
|
3891
4113
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
3892
4114
|
]
|
|
@@ -3908,7 +4130,7 @@ export const comboboxValue = tv({
|
|
|
3908
4130
|
],
|
|
3909
4131
|
componentDependencies: [],
|
|
3910
4132
|
packageRequirements: [
|
|
3911
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
4133
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
3912
4134
|
{ name: "react", range: ">=18" },
|
|
3913
4135
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
3914
4136
|
]
|
|
@@ -4020,7 +4242,7 @@ export const inputGroupTextarea = tv({
|
|
|
4020
4242
|
],
|
|
4021
4243
|
componentDependencies: ["button", "input", "textarea"],
|
|
4022
4244
|
packageRequirements: [
|
|
4023
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
4245
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
4024
4246
|
{ name: "astro", range: ">=5" },
|
|
4025
4247
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
4026
4248
|
]
|
|
@@ -4124,7 +4346,7 @@ export const inputGroupTextarea = tv({
|
|
|
4124
4346
|
],
|
|
4125
4347
|
componentDependencies: ["button", "input", "textarea"],
|
|
4126
4348
|
packageRequirements: [
|
|
4127
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
4349
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
4128
4350
|
{ name: "react", range: ">=18" },
|
|
4129
4351
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
4130
4352
|
]
|
|
@@ -4166,7 +4388,7 @@ export const inputGroupTextarea = tv({
|
|
|
4166
4388
|
],
|
|
4167
4389
|
componentDependencies: [],
|
|
4168
4390
|
packageRequirements: [
|
|
4169
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
4391
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
4170
4392
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
4171
4393
|
{ name: "astro", range: ">=5" },
|
|
4172
4394
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -4201,7 +4423,7 @@ export const inputGroupTextarea = tv({
|
|
|
4201
4423
|
],
|
|
4202
4424
|
componentDependencies: [],
|
|
4203
4425
|
packageRequirements: [
|
|
4204
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
4426
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
4205
4427
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
4206
4428
|
{ name: "react", range: ">=18" },
|
|
4207
4429
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -4344,7 +4566,7 @@ export const itemTitle = tv({
|
|
|
4344
4566
|
],
|
|
4345
4567
|
componentDependencies: ["separator"],
|
|
4346
4568
|
packageRequirements: [
|
|
4347
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
4569
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
4348
4570
|
{ name: "astro", range: ">=5" },
|
|
4349
4571
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
4350
4572
|
]
|
|
@@ -4478,7 +4700,7 @@ export const itemTitle = tv({
|
|
|
4478
4700
|
],
|
|
4479
4701
|
componentDependencies: ["separator"],
|
|
4480
4702
|
packageRequirements: [
|
|
4481
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
4703
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
4482
4704
|
{ name: "react", range: ">=18" },
|
|
4483
4705
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
4484
4706
|
]
|
|
@@ -4516,7 +4738,7 @@ export const itemTitle = tv({
|
|
|
4516
4738
|
],
|
|
4517
4739
|
componentDependencies: [],
|
|
4518
4740
|
packageRequirements: [
|
|
4519
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
4741
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
4520
4742
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
4521
4743
|
{ name: "astro", range: ">=5" },
|
|
4522
4744
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -4547,7 +4769,7 @@ export const itemTitle = tv({
|
|
|
4547
4769
|
],
|
|
4548
4770
|
componentDependencies: [],
|
|
4549
4771
|
packageRequirements: [
|
|
4550
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
4772
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
4551
4773
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
4552
4774
|
{ name: "react", range: ">=18" },
|
|
4553
4775
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -4674,7 +4896,7 @@ export const navigationMenuViewport = tv({
|
|
|
4674
4896
|
],
|
|
4675
4897
|
componentDependencies: [],
|
|
4676
4898
|
packageRequirements: [
|
|
4677
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
4899
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
4678
4900
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
4679
4901
|
{ name: "astro", range: ">=5" },
|
|
4680
4902
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -4793,7 +5015,7 @@ export const navigationMenuViewport = tv({
|
|
|
4793
5015
|
],
|
|
4794
5016
|
componentDependencies: [],
|
|
4795
5017
|
packageRequirements: [
|
|
4796
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
5018
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
4797
5019
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
4798
5020
|
{ name: "react", range: ">=18" },
|
|
4799
5021
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -4848,7 +5070,7 @@ export const navigationMenuViewport = tv({
|
|
|
4848
5070
|
],
|
|
4849
5071
|
componentDependencies: ["button"],
|
|
4850
5072
|
packageRequirements: [
|
|
4851
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
5073
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
4852
5074
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
4853
5075
|
{ name: "astro", range: ">=5" },
|
|
4854
5076
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -4895,7 +5117,7 @@ export const navigationMenuViewport = tv({
|
|
|
4895
5117
|
],
|
|
4896
5118
|
componentDependencies: ["button"],
|
|
4897
5119
|
packageRequirements: [
|
|
4898
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
5120
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
4899
5121
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
4900
5122
|
{ name: "react", range: ">=18" },
|
|
4901
5123
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -4926,7 +5148,7 @@ export const navigationMenuViewport = tv({
|
|
|
4926
5148
|
],
|
|
4927
5149
|
componentDependencies: [],
|
|
4928
5150
|
packageRequirements: [
|
|
4929
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
5151
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
4930
5152
|
{ name: "astro", range: ">=5" },
|
|
4931
5153
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
4932
5154
|
]
|
|
@@ -4948,7 +5170,7 @@ export const navigationMenuViewport = tv({
|
|
|
4948
5170
|
],
|
|
4949
5171
|
componentDependencies: [],
|
|
4950
5172
|
packageRequirements: [
|
|
4951
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
5173
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
4952
5174
|
{ name: "react", range: ">=18" },
|
|
4953
5175
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
4954
5176
|
]
|
|
@@ -5582,7 +5804,7 @@ export const navigationMenuViewport = tv({
|
|
|
5582
5804
|
],
|
|
5583
5805
|
componentDependencies: [],
|
|
5584
5806
|
packageRequirements: [
|
|
5585
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
5807
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
5586
5808
|
{ name: "astro", range: ">=5" },
|
|
5587
5809
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
5588
5810
|
]
|
|
@@ -6208,7 +6430,7 @@ export const navigationMenuViewport = tv({
|
|
|
6208
6430
|
],
|
|
6209
6431
|
componentDependencies: [],
|
|
6210
6432
|
packageRequirements: [
|
|
6211
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
6433
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
6212
6434
|
{ name: "react", range: ">=18" },
|
|
6213
6435
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
6214
6436
|
]
|
|
@@ -6242,7 +6464,7 @@ export const navigationMenuViewport = tv({
|
|
|
6242
6464
|
],
|
|
6243
6465
|
componentDependencies: [],
|
|
6244
6466
|
packageRequirements: [
|
|
6245
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
6467
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
6246
6468
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
6247
6469
|
{ name: "astro", range: ">=5" },
|
|
6248
6470
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -6269,7 +6491,7 @@ export const navigationMenuViewport = tv({
|
|
|
6269
6491
|
],
|
|
6270
6492
|
componentDependencies: [],
|
|
6271
6493
|
packageRequirements: [
|
|
6272
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
6494
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
6273
6495
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
6274
6496
|
{ name: "react", range: ">=18" },
|
|
6275
6497
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -6324,7 +6546,7 @@ export const navigationMenuViewport = tv({
|
|
|
6324
6546
|
],
|
|
6325
6547
|
componentDependencies: [],
|
|
6326
6548
|
packageRequirements: [
|
|
6327
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
6549
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
6328
6550
|
{ name: "astro", range: ">=5" },
|
|
6329
6551
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
6330
6552
|
]
|
|
@@ -6370,7 +6592,7 @@ export const navigationMenuViewport = tv({
|
|
|
6370
6592
|
],
|
|
6371
6593
|
componentDependencies: [],
|
|
6372
6594
|
packageRequirements: [
|
|
6373
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
6595
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
6374
6596
|
{ name: "react", range: ">=18" },
|
|
6375
6597
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
6376
6598
|
]
|
|
@@ -6444,7 +6666,7 @@ export const navigationMenuViewport = tv({
|
|
|
6444
6666
|
],
|
|
6445
6667
|
componentDependencies: [],
|
|
6446
6668
|
packageRequirements: [
|
|
6447
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
6669
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
6448
6670
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
6449
6671
|
{ name: "astro", range: ">=5" },
|
|
6450
6672
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -6511,7 +6733,7 @@ export const navigationMenuViewport = tv({
|
|
|
6511
6733
|
],
|
|
6512
6734
|
componentDependencies: [],
|
|
6513
6735
|
packageRequirements: [
|
|
6514
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
6736
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
6515
6737
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
6516
6738
|
{ name: "react", range: ">=18" },
|
|
6517
6739
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -6542,7 +6764,7 @@ export const navigationMenuViewport = tv({
|
|
|
6542
6764
|
],
|
|
6543
6765
|
componentDependencies: [],
|
|
6544
6766
|
packageRequirements: [
|
|
6545
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
6767
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
6546
6768
|
{ name: "astro", range: ">=5" },
|
|
6547
6769
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
6548
6770
|
]
|
|
@@ -6564,7 +6786,7 @@ export const navigationMenuViewport = tv({
|
|
|
6564
6786
|
],
|
|
6565
6787
|
componentDependencies: [],
|
|
6566
6788
|
packageRequirements: [
|
|
6567
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
6789
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
6568
6790
|
{ name: "react", range: ">=18" },
|
|
6569
6791
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
6570
6792
|
]
|
|
@@ -6594,7 +6816,7 @@ export const navigationMenuViewport = tv({
|
|
|
6594
6816
|
],
|
|
6595
6817
|
componentDependencies: [],
|
|
6596
6818
|
packageRequirements: [
|
|
6597
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
6819
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
6598
6820
|
{ name: "astro", range: ">=5" },
|
|
6599
6821
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
6600
6822
|
]
|
|
@@ -6616,7 +6838,7 @@ export const navigationMenuViewport = tv({
|
|
|
6616
6838
|
],
|
|
6617
6839
|
componentDependencies: [],
|
|
6618
6840
|
packageRequirements: [
|
|
6619
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
6841
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
6620
6842
|
{ name: "react", range: ">=18" },
|
|
6621
6843
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
6622
6844
|
]
|
|
@@ -6682,7 +6904,7 @@ export const tabsTrigger = tv({
|
|
|
6682
6904
|
],
|
|
6683
6905
|
componentDependencies: [],
|
|
6684
6906
|
packageRequirements: [
|
|
6685
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
6907
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
6686
6908
|
{ name: "astro", range: ">=5" },
|
|
6687
6909
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
6688
6910
|
]
|
|
@@ -6740,7 +6962,7 @@ export const tabsTrigger = tv({
|
|
|
6740
6962
|
],
|
|
6741
6963
|
componentDependencies: [],
|
|
6742
6964
|
packageRequirements: [
|
|
6743
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
6965
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
6744
6966
|
{ name: "react", range: ">=18" },
|
|
6745
6967
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
6746
6968
|
]
|
|
@@ -6798,7 +7020,7 @@ export const tabsTrigger = tv({
|
|
|
6798
7020
|
],
|
|
6799
7021
|
componentDependencies: [],
|
|
6800
7022
|
packageRequirements: [
|
|
6801
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
7023
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
6802
7024
|
{ name: "astro", range: ">=5" },
|
|
6803
7025
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
6804
7026
|
]
|
|
@@ -6848,7 +7070,7 @@ export const tabsTrigger = tv({
|
|
|
6848
7070
|
],
|
|
6849
7071
|
componentDependencies: [],
|
|
6850
7072
|
packageRequirements: [
|
|
6851
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
7073
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
6852
7074
|
{ name: "react", range: ">=18" },
|
|
6853
7075
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
6854
7076
|
]
|
|
@@ -6910,7 +7132,7 @@ export const tabsTrigger = tv({
|
|
|
6910
7132
|
],
|
|
6911
7133
|
componentDependencies: [],
|
|
6912
7134
|
packageRequirements: [
|
|
6913
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
7135
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
6914
7136
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
6915
7137
|
{ name: "astro", range: ">=5" },
|
|
6916
7138
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -6965,7 +7187,7 @@ export const tabsTrigger = tv({
|
|
|
6965
7187
|
],
|
|
6966
7188
|
componentDependencies: [],
|
|
6967
7189
|
packageRequirements: [
|
|
6968
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
7190
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
6969
7191
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
6970
7192
|
{ name: "react", range: ">=18" },
|
|
6971
7193
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -7004,7 +7226,7 @@ export const tabsTrigger = tv({
|
|
|
7004
7226
|
],
|
|
7005
7227
|
componentDependencies: [],
|
|
7006
7228
|
packageRequirements: [
|
|
7007
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
7229
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
7008
7230
|
{ name: "astro", range: ">=5" },
|
|
7009
7231
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
7010
7232
|
]
|
|
@@ -7034,7 +7256,7 @@ export const tabsTrigger = tv({
|
|
|
7034
7256
|
],
|
|
7035
7257
|
componentDependencies: [],
|
|
7036
7258
|
packageRequirements: [
|
|
7037
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
7259
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
7038
7260
|
{ name: "react", range: ">=18" },
|
|
7039
7261
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
7040
7262
|
]
|
|
@@ -7072,7 +7294,7 @@ export const tabsTrigger = tv({
|
|
|
7072
7294
|
],
|
|
7073
7295
|
componentDependencies: [],
|
|
7074
7296
|
packageRequirements: [
|
|
7075
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
7297
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
7076
7298
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
7077
7299
|
{ name: "astro", range: ">=5" },
|
|
7078
7300
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -7103,7 +7325,7 @@ export const tabsTrigger = tv({
|
|
|
7103
7325
|
],
|
|
7104
7326
|
componentDependencies: [],
|
|
7105
7327
|
packageRequirements: [
|
|
7106
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
7328
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
7107
7329
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
7108
7330
|
{ name: "react", range: ">=18" },
|
|
7109
7331
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -7163,7 +7385,7 @@ export const themeToggle = tv({
|
|
|
7163
7385
|
],
|
|
7164
7386
|
componentDependencies: [],
|
|
7165
7387
|
packageRequirements: [
|
|
7166
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
7388
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
7167
7389
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
7168
7390
|
{ name: "astro", range: ">=5" },
|
|
7169
7391
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -7215,7 +7437,7 @@ export const themeToggle = tv({
|
|
|
7215
7437
|
],
|
|
7216
7438
|
componentDependencies: [],
|
|
7217
7439
|
packageRequirements: [
|
|
7218
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
7440
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
7219
7441
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
7220
7442
|
{ name: "react", range: ">=18" },
|
|
7221
7443
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -7274,7 +7496,7 @@ export const toggle = tv({
|
|
|
7274
7496
|
],
|
|
7275
7497
|
componentDependencies: [],
|
|
7276
7498
|
packageRequirements: [
|
|
7277
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
7499
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
7278
7500
|
{ name: "astro", range: ">=5" },
|
|
7279
7501
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
7280
7502
|
]
|
|
@@ -7324,7 +7546,7 @@ export const toggle = tv({
|
|
|
7324
7546
|
],
|
|
7325
7547
|
componentDependencies: [],
|
|
7326
7548
|
packageRequirements: [
|
|
7327
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
7549
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
7328
7550
|
{ name: "react", range: ">=18" },
|
|
7329
7551
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
7330
7552
|
]
|
|
@@ -7401,7 +7623,7 @@ export const toggleGroupItem = tv({
|
|
|
7401
7623
|
],
|
|
7402
7624
|
componentDependencies: [],
|
|
7403
7625
|
packageRequirements: [
|
|
7404
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
7626
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
7405
7627
|
{ name: "astro", range: ">=5" },
|
|
7406
7628
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
7407
7629
|
]
|
|
@@ -7470,7 +7692,7 @@ export const toggleGroupItem = tv({
|
|
|
7470
7692
|
],
|
|
7471
7693
|
componentDependencies: [],
|
|
7472
7694
|
packageRequirements: [
|
|
7473
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
7695
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
7474
7696
|
{ name: "react", range: ">=18" },
|
|
7475
7697
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
7476
7698
|
]
|
|
@@ -7500,7 +7722,7 @@ export const toggleGroupItem = tv({
|
|
|
7500
7722
|
],
|
|
7501
7723
|
componentDependencies: [],
|
|
7502
7724
|
packageRequirements: [
|
|
7503
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
7725
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
7504
7726
|
{ name: "astro", range: ">=5" },
|
|
7505
7727
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
7506
7728
|
]
|
|
@@ -7522,7 +7744,7 @@ export const toggleGroupItem = tv({
|
|
|
7522
7744
|
],
|
|
7523
7745
|
componentDependencies: [],
|
|
7524
7746
|
packageRequirements: [
|
|
7525
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
7747
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
7526
7748
|
{ name: "react", range: ">=18" },
|
|
7527
7749
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
7528
7750
|
]
|
|
@@ -7624,7 +7846,7 @@ export const buttonGroupText = tv({
|
|
|
7624
7846
|
],
|
|
7625
7847
|
componentDependencies: ["separator"],
|
|
7626
7848
|
packageRequirements: [
|
|
7627
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
7849
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
7628
7850
|
{ name: "astro", range: ">=5" },
|
|
7629
7851
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
7630
7852
|
]
|
|
@@ -7718,7 +7940,7 @@ export const buttonGroupText = tv({
|
|
|
7718
7940
|
],
|
|
7719
7941
|
componentDependencies: ["separator"],
|
|
7720
7942
|
packageRequirements: [
|
|
7721
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
7943
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
7722
7944
|
{ name: "react", range: ">=18" },
|
|
7723
7945
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
7724
7946
|
]
|
|
@@ -7764,7 +7986,7 @@ export const buttonGroupText = tv({
|
|
|
7764
7986
|
],
|
|
7765
7987
|
componentDependencies: ["button"],
|
|
7766
7988
|
packageRequirements: [
|
|
7767
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
7989
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
7768
7990
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
7769
7991
|
{ name: "astro", range: ">=5" },
|
|
7770
7992
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -7798,12 +8020,12 @@ export const buttonGroupText = tv({
|
|
|
7798
8020
|
},
|
|
7799
8021
|
{
|
|
7800
8022
|
path: "src/components/starwind/carousel/variants.ts",
|
|
7801
|
-
content: 'import {
|
|
8023
|
+
content: 'import { tv } from "tailwind-variants";\nimport { button as buttonVariants } from "../button/variants";\n\nexport const carouselControl = tv({\n extend: buttonVariants,\n defaultVariants: {\n variant: "outline",\n size: "icon",\n },\n});\n\nexport const carousel = tv({\n base: "group/carousel relative",\n});\n\nexport const carouselContent = tv({\n base: "overflow-hidden",\n});\n\nexport const carouselContainer = tv({\n base: [\n "flex group-data-[axis=y]/carousel:flex-col",\n "group-data-[axis=x]/carousel:-ml-4",\n "group-data-[axis=y]/carousel:-mt-4",\n ],\n});\n\nexport const carouselItem = tv({\n base: [\n "min-w-0 shrink-0 grow-0 basis-full",\n "group-data-[axis=x]/carousel:pl-4",\n "group-data-[axis=y]/carousel:pt-4",\n ],\n});\n\nexport const carouselNext = tv({\n base: [\n "absolute size-8 rounded-full",\n "group-data-[axis=x]/carousel:top-1/2 group-data-[axis=x]/carousel:-right-12 group-data-[axis=x]/carousel:-translate-y-1/2",\n "group-data-[axis=y]/carousel:-bottom-12 group-data-[axis=y]/carousel:left-1/2 group-data-[axis=y]/carousel:-translate-x-1/2 group-data-[axis=y]/carousel:rotate-90",\n ],\n});\n\nexport const carouselPrevious = tv({\n base: [\n "absolute size-8 rounded-full",\n "group-data-[axis=x]/carousel:top-1/2 group-data-[axis=x]/carousel:-left-12 group-data-[axis=x]/carousel:-translate-y-1/2",\n "group-data-[axis=y]/carousel:-top-12 group-data-[axis=y]/carousel:left-1/2 group-data-[axis=y]/carousel:-translate-x-1/2 group-data-[axis=y]/carousel:rotate-90",\n ],\n});\n'
|
|
7802
8024
|
}
|
|
7803
8025
|
],
|
|
7804
8026
|
componentDependencies: ["button"],
|
|
7805
8027
|
packageRequirements: [
|
|
7806
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
8028
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
7807
8029
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
7808
8030
|
{ name: "react", range: ">=18" },
|
|
7809
8031
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -7844,7 +8066,7 @@ export const button = tv({
|
|
|
7844
8066
|
variant: {
|
|
7845
8067
|
default: "bg-foreground text-background hover:bg-foreground/90 focus-visible:ring-outline/50",
|
|
7846
8068
|
primary: "bg-primary text-primary-foreground hover:bg-primary/90 focus-visible:ring-primary/50",
|
|
7847
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary
|
|
8069
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] focus-visible:ring-secondary/50",
|
|
7848
8070
|
outline: "dark:border-input focus-visible:ring-outline/50 bg-background dark:bg-input/30 focus-visible:border-outline hover:bg-muted dark:hover:bg-input/50 hover:text-foreground border shadow-xs",
|
|
7849
8071
|
ghost: "hover:bg-muted hover:text-foreground focus-visible:ring-outline/50",
|
|
7850
8072
|
info: "bg-info text-info-foreground hover:bg-info/90 focus-visible:ring-info/50",
|
|
@@ -7871,7 +8093,7 @@ export const button = tv({
|
|
|
7871
8093
|
],
|
|
7872
8094
|
componentDependencies: [],
|
|
7873
8095
|
packageRequirements: [
|
|
7874
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
8096
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
7875
8097
|
{ name: "astro", range: ">=5" },
|
|
7876
8098
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
7877
8099
|
]
|
|
@@ -7903,7 +8125,7 @@ export const button = tv({
|
|
|
7903
8125
|
variant: {
|
|
7904
8126
|
default: "bg-foreground text-background hover:bg-foreground/90 focus-visible:ring-outline/50",
|
|
7905
8127
|
primary: "bg-primary text-primary-foreground hover:bg-primary/90 focus-visible:ring-primary/50",
|
|
7906
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary
|
|
8128
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] focus-visible:ring-secondary/50",
|
|
7907
8129
|
outline: "dark:border-input focus-visible:ring-outline/50 bg-background dark:bg-input/30 focus-visible:border-outline hover:bg-muted dark:hover:bg-input/50 hover:text-foreground border shadow-xs",
|
|
7908
8130
|
ghost: "hover:bg-muted hover:text-foreground focus-visible:ring-outline/50",
|
|
7909
8131
|
info: "bg-info text-info-foreground hover:bg-info/90 focus-visible:ring-info/50",
|
|
@@ -7930,7 +8152,7 @@ export const button = tv({
|
|
|
7930
8152
|
],
|
|
7931
8153
|
componentDependencies: [],
|
|
7932
8154
|
packageRequirements: [
|
|
7933
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
8155
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
7934
8156
|
{ name: "react", range: ">=18" },
|
|
7935
8157
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
7936
8158
|
]
|
|
@@ -7968,7 +8190,7 @@ export const button = tv({
|
|
|
7968
8190
|
],
|
|
7969
8191
|
componentDependencies: [],
|
|
7970
8192
|
packageRequirements: [
|
|
7971
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
8193
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
7972
8194
|
{ name: "astro", range: ">=5" },
|
|
7973
8195
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
7974
8196
|
]
|
|
@@ -7998,7 +8220,7 @@ export const button = tv({
|
|
|
7998
8220
|
],
|
|
7999
8221
|
componentDependencies: [],
|
|
8000
8222
|
packageRequirements: [
|
|
8001
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
8223
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
8002
8224
|
{ name: "react", range: ">=18" },
|
|
8003
8225
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
8004
8226
|
]
|
|
@@ -8007,7 +8229,7 @@ export const button = tv({
|
|
|
8007
8229
|
},
|
|
8008
8230
|
{
|
|
8009
8231
|
name: "accordion",
|
|
8010
|
-
version: "2.0.
|
|
8232
|
+
version: "2.0.1",
|
|
8011
8233
|
type: "component",
|
|
8012
8234
|
dependencies: [],
|
|
8013
8235
|
targets: {
|
|
@@ -8015,7 +8237,7 @@ export const button = tv({
|
|
|
8015
8237
|
files: [
|
|
8016
8238
|
{
|
|
8017
8239
|
path: "src/components/starwind/accordion/Accordion.astro",
|
|
8018
|
-
content: '---\nimport AccordionPrimitive from "@starwind-ui/astro/accordion";\nimport type { HTMLAttributes } from "astro/types";\nimport { accordion } from "./variants";\n\ntype Props = HTMLAttributes<"div"> & {\n type?: "single" | "multiple";\n defaultValue?: string | string[];\n collapsible?: boolean;\n};\n\nconst {\n type = "single",\n defaultValue,\n collapsible =
|
|
8240
|
+
content: '---\nimport AccordionPrimitive from "@starwind-ui/astro/accordion";\nimport type { HTMLAttributes } from "astro/types";\nimport { accordion } from "./variants";\n\ntype Props = HTMLAttributes<"div"> & {\n type?: "single" | "multiple";\n defaultValue?: string | string[];\n collapsible?: boolean;\n};\n\nconst {\n type = "single",\n defaultValue,\n collapsible = true,\n class: className,\n ...rest\n} = Astro.props;\n---\n\n<AccordionPrimitive.Root\n class={accordion({ class: className })}\n type={type}\n defaultValue={defaultValue}\n collapsible={collapsible}\n {...rest}\n data-slot="accordion"\n>\n <slot />\n</AccordionPrimitive.Root>\n'
|
|
8019
8241
|
},
|
|
8020
8242
|
{
|
|
8021
8243
|
path: "src/components/starwind/accordion/AccordionContent.astro",
|
|
@@ -8040,7 +8262,7 @@ export const button = tv({
|
|
|
8040
8262
|
],
|
|
8041
8263
|
componentDependencies: [],
|
|
8042
8264
|
packageRequirements: [
|
|
8043
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
8265
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
8044
8266
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
8045
8267
|
{ name: "astro", range: ">=5" },
|
|
8046
8268
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -8050,7 +8272,7 @@ export const button = tv({
|
|
|
8050
8272
|
files: [
|
|
8051
8273
|
{
|
|
8052
8274
|
path: "src/components/starwind/accordion/Accordion.tsx",
|
|
8053
|
-
content: 'import AccordionPrimitive from "@starwind-ui/react/accordion";\nimport type * as React from "react";\nimport { accordion } from "./variants";\n\nexport type AccordionProps = React.ComponentPropsWithoutRef<"div"> & {\n type?: "single" | "multiple";\n defaultValue?: string | string[];\n value?: import("@starwind-ui/react/accordion").AccordionValue;\n collapsible?: boolean;\n onValueChange?: (details: import("@starwind-ui/react/accordion").AccordionValueChangeDetails) => void;\n};\n\nfunction Accordion(props: AccordionProps) {\n const {\n type = "single",\n defaultValue,\n value,\n collapsible =
|
|
8275
|
+
content: 'import AccordionPrimitive from "@starwind-ui/react/accordion";\nimport type * as React from "react";\nimport { accordion } from "./variants";\n\nexport type AccordionProps = React.ComponentPropsWithoutRef<"div"> & {\n type?: "single" | "multiple";\n defaultValue?: string | string[];\n value?: import("@starwind-ui/react/accordion").AccordionValue;\n collapsible?: boolean;\n onValueChange?: (details: import("@starwind-ui/react/accordion").AccordionValueChangeDetails) => void;\n};\n\nfunction Accordion(props: AccordionProps) {\n const {\n type = "single",\n defaultValue,\n value,\n collapsible = true,\n onValueChange,\n className,\n children,\n ...rest\n } = props;\n\n return (\n <AccordionPrimitive.Root\n className={accordion({ class: className })}\n type={type}\n defaultValue={defaultValue}\n value={value}\n collapsible={collapsible}\n onValueChange={onValueChange}\n {...rest}\n data-slot="accordion"\n >\n {children}\n </AccordionPrimitive.Root>\n );\n}\n\nexport default Accordion;\n'
|
|
8054
8276
|
},
|
|
8055
8277
|
{
|
|
8056
8278
|
path: "src/components/starwind/accordion/AccordionContent.tsx",
|
|
@@ -8075,7 +8297,7 @@ export const button = tv({
|
|
|
8075
8297
|
],
|
|
8076
8298
|
componentDependencies: [],
|
|
8077
8299
|
packageRequirements: [
|
|
8078
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
8300
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
8079
8301
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
8080
8302
|
{ name: "react", range: ">=18" },
|
|
8081
8303
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -8138,7 +8360,7 @@ export const button = tv({
|
|
|
8138
8360
|
],
|
|
8139
8361
|
componentDependencies: ["button"],
|
|
8140
8362
|
packageRequirements: [
|
|
8141
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
8363
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
8142
8364
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
8143
8365
|
{ name: "astro", range: ">=5" },
|
|
8144
8366
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -8193,7 +8415,7 @@ export const button = tv({
|
|
|
8193
8415
|
],
|
|
8194
8416
|
componentDependencies: ["button"],
|
|
8195
8417
|
packageRequirements: [
|
|
8196
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
8418
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
8197
8419
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
8198
8420
|
{ name: "react", range: ">=18" },
|
|
8199
8421
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -8284,7 +8506,7 @@ export const button = tv({
|
|
|
8284
8506
|
],
|
|
8285
8507
|
componentDependencies: [],
|
|
8286
8508
|
packageRequirements: [
|
|
8287
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
8509
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
8288
8510
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
8289
8511
|
{ name: "astro", range: ">=5" },
|
|
8290
8512
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -8367,7 +8589,7 @@ export const button = tv({
|
|
|
8367
8589
|
],
|
|
8368
8590
|
componentDependencies: [],
|
|
8369
8591
|
packageRequirements: [
|
|
8370
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
8592
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
8371
8593
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
8372
8594
|
{ name: "react", range: ">=18" },
|
|
8373
8595
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -8410,7 +8632,7 @@ export const button = tv({
|
|
|
8410
8632
|
],
|
|
8411
8633
|
componentDependencies: [],
|
|
8412
8634
|
packageRequirements: [
|
|
8413
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
8635
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
8414
8636
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
8415
8637
|
{ name: "astro", range: ">=5" },
|
|
8416
8638
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -8445,7 +8667,7 @@ export const button = tv({
|
|
|
8445
8667
|
],
|
|
8446
8668
|
componentDependencies: [],
|
|
8447
8669
|
packageRequirements: [
|
|
8448
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
8670
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
8449
8671
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
8450
8672
|
{ name: "react", range: ">=18" },
|
|
8451
8673
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -8536,7 +8758,7 @@ export const button = tv({
|
|
|
8536
8758
|
],
|
|
8537
8759
|
componentDependencies: [],
|
|
8538
8760
|
packageRequirements: [
|
|
8539
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
8761
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
8540
8762
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
8541
8763
|
{ name: "astro", range: ">=5" },
|
|
8542
8764
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -8619,7 +8841,7 @@ export const button = tv({
|
|
|
8619
8841
|
],
|
|
8620
8842
|
componentDependencies: [],
|
|
8621
8843
|
packageRequirements: [
|
|
8622
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
8844
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
8623
8845
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
8624
8846
|
{ name: "react", range: ">=18" },
|
|
8625
8847
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -8678,7 +8900,7 @@ export const button = tv({
|
|
|
8678
8900
|
],
|
|
8679
8901
|
componentDependencies: ["button"],
|
|
8680
8902
|
packageRequirements: [
|
|
8681
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
8903
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
8682
8904
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
8683
8905
|
{ name: "astro", range: ">=5" },
|
|
8684
8906
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -8729,7 +8951,7 @@ export const button = tv({
|
|
|
8729
8951
|
],
|
|
8730
8952
|
componentDependencies: ["button"],
|
|
8731
8953
|
packageRequirements: [
|
|
8732
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
8954
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
8733
8955
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
8734
8956
|
{ name: "react", range: ">=18" },
|
|
8735
8957
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -8852,7 +9074,7 @@ export const button = tv({
|
|
|
8852
9074
|
],
|
|
8853
9075
|
componentDependencies: ["button", "input", "separator", "sheet", "skeleton", "tooltip"],
|
|
8854
9076
|
packageRequirements: [
|
|
8855
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
9077
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
8856
9078
|
{ name: "@tabler/icons", range: "^3.37.1" },
|
|
8857
9079
|
{ name: "astro", range: ">=5" },
|
|
8858
9080
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -8967,7 +9189,7 @@ export const button = tv({
|
|
|
8967
9189
|
],
|
|
8968
9190
|
componentDependencies: ["button", "input", "separator", "sheet", "skeleton", "tooltip"],
|
|
8969
9191
|
packageRequirements: [
|
|
8970
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
9192
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
8971
9193
|
{ name: "@tabler/icons-react", range: "^3.37.1" },
|
|
8972
9194
|
{ name: "react", range: ">=18" },
|
|
8973
9195
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
@@ -8998,7 +9220,7 @@ export const button = tv({
|
|
|
8998
9220
|
],
|
|
8999
9221
|
componentDependencies: [],
|
|
9000
9222
|
packageRequirements: [
|
|
9001
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
9223
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
9002
9224
|
{ name: "astro", range: ">=5" },
|
|
9003
9225
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
9004
9226
|
]
|
|
@@ -9032,7 +9254,7 @@ export const button = tv({
|
|
|
9032
9254
|
],
|
|
9033
9255
|
componentDependencies: [],
|
|
9034
9256
|
packageRequirements: [
|
|
9035
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
9257
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
9036
9258
|
{ name: "astro", range: ">=5" },
|
|
9037
9259
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
9038
9260
|
]
|
|
@@ -9058,7 +9280,7 @@ export const button = tv({
|
|
|
9058
9280
|
],
|
|
9059
9281
|
componentDependencies: [],
|
|
9060
9282
|
packageRequirements: [
|
|
9061
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
9283
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
9062
9284
|
{ name: "react", range: ">=18" },
|
|
9063
9285
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
9064
9286
|
]
|
|
@@ -9136,7 +9358,7 @@ export const button = tv({
|
|
|
9136
9358
|
],
|
|
9137
9359
|
componentDependencies: ["separator"],
|
|
9138
9360
|
packageRequirements: [
|
|
9139
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
9361
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
9140
9362
|
{ name: "astro", range: ">=5" },
|
|
9141
9363
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
9142
9364
|
]
|
|
@@ -9206,7 +9428,7 @@ export const button = tv({
|
|
|
9206
9428
|
],
|
|
9207
9429
|
componentDependencies: ["separator"],
|
|
9208
9430
|
packageRequirements: [
|
|
9209
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
9431
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
9210
9432
|
{ name: "react", range: ">=18" },
|
|
9211
9433
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
9212
9434
|
]
|
|
@@ -9227,7 +9449,7 @@ export const button = tv({
|
|
|
9227
9449
|
},
|
|
9228
9450
|
{
|
|
9229
9451
|
path: "src/components/starwind/popover/PopoverContent.astro",
|
|
9230
|
-
content: '---\nimport PopoverPrimitive from "@starwind-ui/astro/popover";\nimport type { HTMLAttributes } from "astro/types";\nimport { popoverContent } from "./variants";\n\ntype Props = HTMLAttributes<"div"> & {\n side?: "top" | "right" | "bottom" | "left";\n align?: "start" | "center" | "end";\n sideOffset?: number;\n avoidCollisions?: boolean;\n};\n\nconst {\n class: className,\n side = "bottom",\n align = "center",\n sideOffset = 4,\n avoidCollisions = true,\n ...rest\n} = Astro.props;\n---\n\n<PopoverPrimitive.Portal data-slot="popover-portal">\n <PopoverPrimitive.Popup\n class={popoverContent({ class: className })}\n side={side}\n align={align}\n sideOffset={sideOffset}\n avoidCollisions={avoidCollisions}\n {...rest}\n data-slot="popover-content"\n >\n <slot />\n </PopoverPrimitive.Popup>\n</PopoverPrimitive.Portal>\n'
|
|
9452
|
+
content: '---\nimport PopoverPrimitive from "@starwind-ui/astro/popover";\nimport type { HTMLAttributes } from "astro/types";\nimport type { VariantProps } from "tailwind-variants";\nimport { popoverContent } from "./variants";\n\ntype Props = HTMLAttributes<"div"> & VariantProps<typeof popoverContent> & {\n side?: "top" | "right" | "bottom" | "left";\n align?: "start" | "center" | "end";\n sideOffset?: number;\n avoidCollisions?: boolean;\n};\n\nconst {\n class: className,\n side = "bottom",\n align = "center",\n sideOffset = 4,\n avoidCollisions = true,\n exitMotion = "popover",\n ...rest\n} = Astro.props;\n---\n\n<PopoverPrimitive.Portal data-slot="popover-portal">\n <PopoverPrimitive.Popup\n class={popoverContent({ exitMotion, class: className })}\n side={side}\n align={align}\n sideOffset={sideOffset}\n avoidCollisions={avoidCollisions}\n {...rest}\n data-slot="popover-content"\n >\n <slot />\n </PopoverPrimitive.Popup>\n</PopoverPrimitive.Portal>\n'
|
|
9231
9453
|
},
|
|
9232
9454
|
{
|
|
9233
9455
|
path: "src/components/starwind/popover/PopoverDescription.astro",
|
|
@@ -9251,12 +9473,12 @@ export const button = tv({
|
|
|
9251
9473
|
},
|
|
9252
9474
|
{
|
|
9253
9475
|
path: "src/components/starwind/popover/variants.ts",
|
|
9254
|
-
content: 'import { tv } from "tailwind-variants";\n\nexport const popover = tv({\n base: "",\n});\n\nexport const popoverContent = tv({\n base: [\n "bg-popover text-popover-foreground z-50 flex w-72 flex-col gap-2.5 overflow-x-hidden overflow-y-auto rounded-lg border p-2.5 shadow-md",\n "data-[state=open]:animate-in fade-in zoom-in-95 outline-none",\n "data-[state=closed]:animate-out data-[state=closed]:fill-mode-forwards fade-out
|
|
9476
|
+
content: 'import { tv } from "tailwind-variants";\n\nexport const popover = tv({\n base: "",\n});\n\nexport const popoverContent = tv({\n base: [\n "bg-popover text-popover-foreground z-50 flex w-72 flex-col gap-2.5 overflow-x-hidden overflow-y-auto rounded-lg border p-2.5 shadow-md",\n "data-[state=open]:animate-in fade-in zoom-in-95 outline-none",\n "data-[state=closed]:animate-out data-[state=closed]:fill-mode-forwards fade-out",\n "data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",\n "data-[side=right]:slide-in-from-left-2 data-[side=left]:slide-in-from-right-2",\n "origin-(--transform-origin) pointer-events-auto fixed isolate will-change-transform",\n ],\n variants: {\n exitMotion: {\n popover: [\n "zoom-out-95",\n "data-[side=bottom]:slide-out-to-top-2 data-[side=top]:slide-out-to-bottom-2",\n "data-[side=right]:slide-out-to-left-2 data-[side=left]:slide-out-to-right-2",\n ],\n fade: "",\n },\n },\n defaultVariants: {\n exitMotion: "popover",\n },\n});\n\nexport const popoverDescription = tv({\n base: "text-muted-foreground",\n});\n\nexport const popoverHeader = tv({\n base: "flex flex-col gap-1",\n});\n\nexport const popoverTitle = tv({\n base: "font-medium",\n});\n\nexport const popoverTrigger = tv({\n base: [\n "inline-flex items-center justify-center",\n "focus-visible:ring-outline/50 transition-[color,box-shadow] outline-none focus-visible:ring-3",\n "disabled:pointer-events-none",\n ],\n});\n'
|
|
9255
9477
|
}
|
|
9256
9478
|
],
|
|
9257
9479
|
componentDependencies: [],
|
|
9258
9480
|
packageRequirements: [
|
|
9259
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
9481
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
9260
9482
|
{ name: "astro", range: ">=5" },
|
|
9261
9483
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
9262
9484
|
]
|
|
@@ -9269,7 +9491,7 @@ export const button = tv({
|
|
|
9269
9491
|
},
|
|
9270
9492
|
{
|
|
9271
9493
|
path: "src/components/starwind/popover/PopoverContent.tsx",
|
|
9272
|
-
content: 'import PopoverPrimitive from "@starwind-ui/react/popover";\nimport type * as React from "react";\nimport { popoverContent } from "./variants";\n\nexport type PopoverContentProps = React.ComponentPropsWithoutRef<"div"> & {\n
|
|
9494
|
+
content: 'import PopoverPrimitive from "@starwind-ui/react/popover";\nimport type * as React from "react";\nimport type { VariantProps } from "tailwind-variants";\nimport { popoverContent } from "./variants";\n\nexport type PopoverContentProps = React.ComponentPropsWithoutRef<"div"> &\n VariantProps<typeof popoverContent> & {\n side?: "top" | "right" | "bottom" | "left";\n align?: "start" | "center" | "end";\n sideOffset?: number;\n avoidCollisions?: boolean;\n };\n\nfunction PopoverContent(props: PopoverContentProps) {\n const {\n className,\n side = "bottom",\n align = "center",\n sideOffset = 4,\n avoidCollisions = true,\n exitMotion = "popover",\n children,\n ...rest\n } = props;\n\n return (\n <PopoverPrimitive.Portal\n data-slot="popover-portal"\n >\n <PopoverPrimitive.Popup\n className={popoverContent({ exitMotion, class: className })}\n side={side}\n align={align}\n sideOffset={sideOffset}\n avoidCollisions={avoidCollisions}\n {...rest}\n data-slot="popover-content"\n >\n {children}\n </PopoverPrimitive.Popup>\n </PopoverPrimitive.Portal>\n );\n}\n\nexport default PopoverContent;\n'
|
|
9273
9495
|
},
|
|
9274
9496
|
{
|
|
9275
9497
|
path: "src/components/starwind/popover/PopoverDescription.tsx",
|
|
@@ -9293,12 +9515,12 @@ export const button = tv({
|
|
|
9293
9515
|
},
|
|
9294
9516
|
{
|
|
9295
9517
|
path: "src/components/starwind/popover/variants.ts",
|
|
9296
|
-
content: 'import { tv } from "tailwind-variants";\n\nexport const popover = tv({\n base: "",\n});\n\nexport const popoverContent = tv({\n base: [\n "bg-popover text-popover-foreground z-50 flex w-72 flex-col gap-2.5 overflow-x-hidden overflow-y-auto rounded-lg border p-2.5 shadow-md",\n "data-[state=open]:animate-in fade-in zoom-in-95 outline-none",\n "data-[state=closed]:animate-out data-[state=closed]:fill-mode-forwards fade-out
|
|
9518
|
+
content: 'import { tv } from "tailwind-variants";\n\nexport const popover = tv({\n base: "",\n});\n\nexport const popoverContent = tv({\n base: [\n "bg-popover text-popover-foreground z-50 flex w-72 flex-col gap-2.5 overflow-x-hidden overflow-y-auto rounded-lg border p-2.5 shadow-md",\n "data-[state=open]:animate-in fade-in zoom-in-95 outline-none",\n "data-[state=closed]:animate-out data-[state=closed]:fill-mode-forwards fade-out",\n "data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",\n "data-[side=right]:slide-in-from-left-2 data-[side=left]:slide-in-from-right-2",\n "origin-(--transform-origin) pointer-events-auto fixed isolate will-change-transform",\n ],\n variants: {\n exitMotion: {\n popover: [\n "zoom-out-95",\n "data-[side=bottom]:slide-out-to-top-2 data-[side=top]:slide-out-to-bottom-2",\n "data-[side=right]:slide-out-to-left-2 data-[side=left]:slide-out-to-right-2",\n ],\n fade: "",\n },\n },\n defaultVariants: {\n exitMotion: "popover",\n },\n});\n\nexport const popoverDescription = tv({\n base: "text-muted-foreground",\n});\n\nexport const popoverHeader = tv({\n base: "flex flex-col gap-1",\n});\n\nexport const popoverTitle = tv({\n base: "font-medium",\n});\n\nexport const popoverTrigger = tv({\n base: [\n "inline-flex items-center justify-center",\n "focus-visible:ring-outline/50 transition-[color,box-shadow] outline-none focus-visible:ring-3",\n "disabled:pointer-events-none",\n ],\n});\n'
|
|
9297
9519
|
}
|
|
9298
9520
|
],
|
|
9299
9521
|
componentDependencies: [],
|
|
9300
9522
|
packageRequirements: [
|
|
9301
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
9523
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
9302
9524
|
{ name: "react", range: ">=18" },
|
|
9303
9525
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
9304
9526
|
]
|
|
@@ -9407,7 +9629,7 @@ export const alertDialogActionAsChild = tv({
|
|
|
9407
9629
|
variant: {
|
|
9408
9630
|
default: "bg-foreground text-background hover:bg-foreground/90 focus-visible:ring-outline/50",
|
|
9409
9631
|
primary: "bg-primary text-primary-foreground hover:bg-primary/90 focus-visible:ring-primary/50",
|
|
9410
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary
|
|
9632
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] focus-visible:ring-secondary/50",
|
|
9411
9633
|
outline: "dark:border-input focus-visible:ring-outline/50 bg-background dark:bg-input/30 focus-visible:border-outline hover:bg-muted dark:hover:bg-input/50 hover:text-foreground border shadow-xs",
|
|
9412
9634
|
ghost: "hover:bg-muted hover:text-foreground focus-visible:ring-outline/50",
|
|
9413
9635
|
info: "bg-info text-info-foreground hover:bg-info/90 focus-visible:ring-info/50",
|
|
@@ -9447,7 +9669,7 @@ export const alertDialogCancelAsChild = tv({
|
|
|
9447
9669
|
variant: {
|
|
9448
9670
|
default: "bg-foreground text-background hover:bg-foreground/90 focus-visible:ring-outline/50",
|
|
9449
9671
|
primary: "bg-primary text-primary-foreground hover:bg-primary/90 focus-visible:ring-primary/50",
|
|
9450
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary
|
|
9672
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] focus-visible:ring-secondary/50",
|
|
9451
9673
|
outline: "dark:border-input focus-visible:ring-outline/50 bg-background dark:bg-input/30 focus-visible:border-outline hover:bg-muted dark:hover:bg-input/50 hover:text-foreground border shadow-xs",
|
|
9452
9674
|
ghost: "hover:bg-muted hover:text-foreground focus-visible:ring-outline/50",
|
|
9453
9675
|
info: "bg-info text-info-foreground hover:bg-info/90 focus-visible:ring-info/50",
|
|
@@ -9474,7 +9696,7 @@ export const alertDialogCancelAsChild = tv({
|
|
|
9474
9696
|
],
|
|
9475
9697
|
componentDependencies: ["button"],
|
|
9476
9698
|
packageRequirements: [
|
|
9477
|
-
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.
|
|
9699
|
+
{ name: "@starwind-ui/astro", range: "^0.1.0-beta.2" },
|
|
9478
9700
|
{ name: "astro", range: ">=5" },
|
|
9479
9701
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
9480
9702
|
]
|
|
@@ -9575,7 +9797,7 @@ export const alertDialogActionAsChild = tv({
|
|
|
9575
9797
|
variant: {
|
|
9576
9798
|
default: "bg-foreground text-background hover:bg-foreground/90 focus-visible:ring-outline/50",
|
|
9577
9799
|
primary: "bg-primary text-primary-foreground hover:bg-primary/90 focus-visible:ring-primary/50",
|
|
9578
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary
|
|
9800
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] focus-visible:ring-secondary/50",
|
|
9579
9801
|
outline: "dark:border-input focus-visible:ring-outline/50 bg-background dark:bg-input/30 focus-visible:border-outline hover:bg-muted dark:hover:bg-input/50 hover:text-foreground border shadow-xs",
|
|
9580
9802
|
ghost: "hover:bg-muted hover:text-foreground focus-visible:ring-outline/50",
|
|
9581
9803
|
info: "bg-info text-info-foreground hover:bg-info/90 focus-visible:ring-info/50",
|
|
@@ -9615,7 +9837,7 @@ export const alertDialogCancelAsChild = tv({
|
|
|
9615
9837
|
variant: {
|
|
9616
9838
|
default: "bg-foreground text-background hover:bg-foreground/90 focus-visible:ring-outline/50",
|
|
9617
9839
|
primary: "bg-primary text-primary-foreground hover:bg-primary/90 focus-visible:ring-primary/50",
|
|
9618
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary
|
|
9840
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] focus-visible:ring-secondary/50",
|
|
9619
9841
|
outline: "dark:border-input focus-visible:ring-outline/50 bg-background dark:bg-input/30 focus-visible:border-outline hover:bg-muted dark:hover:bg-input/50 hover:text-foreground border shadow-xs",
|
|
9620
9842
|
ghost: "hover:bg-muted hover:text-foreground focus-visible:ring-outline/50",
|
|
9621
9843
|
info: "bg-info text-info-foreground hover:bg-info/90 focus-visible:ring-info/50",
|
|
@@ -9642,7 +9864,7 @@ export const alertDialogCancelAsChild = tv({
|
|
|
9642
9864
|
],
|
|
9643
9865
|
componentDependencies: ["button"],
|
|
9644
9866
|
packageRequirements: [
|
|
9645
|
-
{ name: "@starwind-ui/react", range: "^0.1.0-beta.
|
|
9867
|
+
{ name: "@starwind-ui/react", range: "^0.1.0-beta.2" },
|
|
9646
9868
|
{ name: "react", range: ">=18" },
|
|
9647
9869
|
{ name: "tailwind-variants", range: "^3.2.2" }
|
|
9648
9870
|
]
|
|
@@ -11784,8 +12006,7 @@ async function migrate(options) {
|
|
|
11784
12006
|
applied: [],
|
|
11785
12007
|
skipped: [],
|
|
11786
12008
|
unavailable: []
|
|
11787
|
-
}
|
|
11788
|
-
compatibility: []
|
|
12009
|
+
}
|
|
11789
12010
|
};
|
|
11790
12011
|
const existingFolders = await listDirectories(componentDir);
|
|
11791
12012
|
const legacyComponentNames = new Set(
|
|
@@ -11834,28 +12055,9 @@ async function migrate(options) {
|
|
|
11834
12055
|
legacyComponents.set(component.name, toLegacyComponent(component));
|
|
11835
12056
|
}
|
|
11836
12057
|
}
|
|
11837
|
-
const hasLegacyColorPicker = legacyConfig.components.some(
|
|
11838
|
-
(component) => component.name === "color-picker"
|
|
11839
|
-
);
|
|
11840
|
-
const canBridgeLegacyColorPicker = hasLegacyColorPicker ? await canApplyLegacyColorPickerSelectBridge(componentDir) : false;
|
|
11841
|
-
const keepLegacySelect = hasLegacyColorPicker && !canBridgeLegacyColorPicker;
|
|
11842
|
-
if (keepLegacySelect) {
|
|
11843
|
-
report.compatibility.push(
|
|
11844
|
-
"Color Picker is customized, so Select remains legacy to preserve compatibility; unrelated components will continue migrating."
|
|
11845
|
-
);
|
|
11846
|
-
}
|
|
11847
12058
|
const componentsToMigrate = [];
|
|
11848
12059
|
const conflicts = [];
|
|
11849
12060
|
for (const item of migrationPlan.values()) {
|
|
11850
|
-
if (item.component.name === "select" && keepLegacySelect) {
|
|
11851
|
-
const legacySelect = item.legacyComponent ?? legacyConfig.components.find((component) => component.name === "select") ?? {
|
|
11852
|
-
name: "select",
|
|
11853
|
-
version: "0.0.0"
|
|
11854
|
-
};
|
|
11855
|
-
report.legacy.push("select");
|
|
11856
|
-
legacyComponents.set("select", toLegacyComponent(legacySelect));
|
|
11857
|
-
continue;
|
|
11858
|
-
}
|
|
11859
12061
|
const componentPath = path6.join(componentDir, item.component.name);
|
|
11860
12062
|
const hasExistingFolder = await fs8.pathExists(componentPath);
|
|
11861
12063
|
if (!hasExistingFolder) {
|
|
@@ -11962,12 +12164,6 @@ async function migrate(options) {
|
|
|
11962
12164
|
});
|
|
11963
12165
|
report.codemods[codemodResult].push(formatRenameCodemodLabel(item.rename));
|
|
11964
12166
|
}
|
|
11965
|
-
if (hasLegacyColorPicker && installedNames.has("select")) {
|
|
11966
|
-
const bridgeResult = await applyLegacyColorPickerSelectBridge(componentDir);
|
|
11967
|
-
report.compatibility.push(
|
|
11968
|
-
bridgeResult === "applied" ? "Color Picker remains legacy Astro-only; added its Runtime Select event bridge." : bridgeResult === "already-applied" ? "Color Picker remains legacy Astro-only; its Runtime Select event bridge was already present." : "Color Picker remains legacy Astro-only and customized; verify its Select integration manually."
|
|
11969
|
-
);
|
|
11970
|
-
}
|
|
11971
12167
|
}
|
|
11972
12168
|
await p8.tasks([
|
|
11973
12169
|
{
|
|
@@ -12187,44 +12383,6 @@ ${formatIndentedList(report.codemods.unavailable)}`
|
|
|
12187
12383
|
${formatIndentedList(report.custom)}`
|
|
12188
12384
|
);
|
|
12189
12385
|
}
|
|
12190
|
-
report.compatibility.forEach((message) => p8.log.warn(highlighter.warn(message)));
|
|
12191
|
-
}
|
|
12192
|
-
async function canApplyLegacyColorPickerSelectBridge(componentDir) {
|
|
12193
|
-
const relativePath = path6.posix.join(
|
|
12194
|
-
componentDir.replace(/\\/g, "/"),
|
|
12195
|
-
"color-picker/ColorPicker.astro"
|
|
12196
|
-
);
|
|
12197
|
-
if (!await fs8.pathExists(relativePath)) return false;
|
|
12198
|
-
const content = await fs8.readFile(relativePath, "utf8");
|
|
12199
|
-
return content.includes('"starwind:value-change", handleColorFormatChange') || /colorFormatSelect\.addEventListener\(\s*"starwind-select:change",\s*\(event: Event\) => \{([\s\S]*?)\},\s*\{ signal: abortController\.signal \},\s*\);/.test(
|
|
12200
|
-
content
|
|
12201
|
-
);
|
|
12202
|
-
}
|
|
12203
|
-
async function applyLegacyColorPickerSelectBridge(componentDir) {
|
|
12204
|
-
const relativePath = path6.posix.join(
|
|
12205
|
-
componentDir.replace(/\\/g, "/"),
|
|
12206
|
-
"color-picker/ColorPicker.astro"
|
|
12207
|
-
);
|
|
12208
|
-
if (!await fs8.pathExists(relativePath)) return "unavailable";
|
|
12209
|
-
const content = await fs8.readFile(relativePath, "utf8");
|
|
12210
|
-
if (content.includes('"starwind:value-change", handleColorFormatChange')) {
|
|
12211
|
-
return "already-applied";
|
|
12212
|
-
}
|
|
12213
|
-
const listenerPattern = /colorFormatSelect\.addEventListener\(\s*"starwind-select:change",\s*\(event: Event\) => \{([\s\S]*?)\},\s*\{ signal: abortController\.signal \},\s*\);/;
|
|
12214
|
-
const match = content.match(listenerPattern);
|
|
12215
|
-
if (!match) return "unavailable";
|
|
12216
|
-
const body = match[1];
|
|
12217
|
-
const replacement = `const handleColorFormatChange = (event: Event) => {${body}};
|
|
12218
|
-
|
|
12219
|
-
colorFormatSelect.addEventListener("starwind-select:change", handleColorFormatChange, {
|
|
12220
|
-
signal: abortController.signal,
|
|
12221
|
-
});
|
|
12222
|
-
colorFormatSelect.addEventListener("starwind:value-change", handleColorFormatChange, {
|
|
12223
|
-
signal: abortController.signal,
|
|
12224
|
-
});`;
|
|
12225
|
-
const destination = await resolveProjectMutationPath(relativePath);
|
|
12226
|
-
await fs8.writeFile(destination, content.replace(listenerPattern, replacement), "utf8");
|
|
12227
|
-
return "applied";
|
|
12228
12386
|
}
|
|
12229
12387
|
function formatIndentedList(items) {
|
|
12230
12388
|
return items.map((item) => ` ${item}`).join("\n");
|
|
@@ -13265,12 +13423,76 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13265
13423
|
{
|
|
13266
13424
|
component: "button",
|
|
13267
13425
|
framework: "astro",
|
|
13268
|
-
version: "0.1.
|
|
13426
|
+
version: "0.1.1",
|
|
13269
13427
|
files: [
|
|
13270
13428
|
{
|
|
13271
13429
|
path: "src/components/starwind-primitives/button/ButtonRoot.astro",
|
|
13272
|
-
content:
|
|
13273
|
-
|
|
13430
|
+
content: `---
|
|
13431
|
+
/**
|
|
13432
|
+
* Vendored by the Starwind CLI.
|
|
13433
|
+
* You own this file in your project.
|
|
13434
|
+
*/
|
|
13435
|
+
import type { HTMLAttributes } from "astro/types";
|
|
13436
|
+
|
|
13437
|
+
interface Props extends HTMLAttributes<"button"> {
|
|
13438
|
+
focusableWhenDisabled?: boolean;
|
|
13439
|
+
}
|
|
13440
|
+
|
|
13441
|
+
const { type = "button", disabled = false, focusableWhenDisabled = false, ...rest } = Astro.props;
|
|
13442
|
+
---
|
|
13443
|
+
|
|
13444
|
+
<button
|
|
13445
|
+
data-focusable-when-disabled={focusableWhenDisabled ? "true" : undefined}
|
|
13446
|
+
data-disabled={disabled ? "" : undefined}
|
|
13447
|
+
aria-disabled={disabled && focusableWhenDisabled ? "true" : undefined}
|
|
13448
|
+
disabled={disabled && !focusableWhenDisabled}
|
|
13449
|
+
type={type}
|
|
13450
|
+
{...rest}
|
|
13451
|
+
data-sw-button
|
|
13452
|
+
>
|
|
13453
|
+
<slot />
|
|
13454
|
+
</button>
|
|
13455
|
+
|
|
13456
|
+
<script>
|
|
13457
|
+
import { createButton } from "@starwind-ui/runtime/button";
|
|
13458
|
+
import {
|
|
13459
|
+
registerAstroControllerLifecycle,
|
|
13460
|
+
trackAstroController,
|
|
13461
|
+
} from "../internal/controller-lifecycle";
|
|
13462
|
+
|
|
13463
|
+
const getInitCandidates = (event: Event | undefined, selector: string): HTMLButtonElement[] => {
|
|
13464
|
+
const initRoot =
|
|
13465
|
+
event?.type === "starwind:init" && event instanceof CustomEvent
|
|
13466
|
+
? event.detail?.root
|
|
13467
|
+
: undefined;
|
|
13468
|
+
const scopedRoot: Document | DocumentFragment | Element = isQueryableRoot(initRoot)
|
|
13469
|
+
? initRoot
|
|
13470
|
+
: document;
|
|
13471
|
+
const candidates = Array.from(scopedRoot.querySelectorAll<HTMLButtonElement>(selector));
|
|
13472
|
+
|
|
13473
|
+
if (scopedRoot instanceof HTMLButtonElement && scopedRoot.matches(selector)) {
|
|
13474
|
+
candidates.unshift(scopedRoot);
|
|
13475
|
+
}
|
|
13476
|
+
|
|
13477
|
+
return candidates;
|
|
13478
|
+
};
|
|
13479
|
+
|
|
13480
|
+
const isQueryableRoot = (value: unknown): value is Document | DocumentFragment | Element =>
|
|
13481
|
+
value instanceof Document || value instanceof DocumentFragment || value instanceof Element;
|
|
13482
|
+
|
|
13483
|
+
const setupButtons = (event?: Event) => {
|
|
13484
|
+
getInitCandidates(event, '[data-sw-button][data-focusable-when-disabled="true"]').forEach(
|
|
13485
|
+
(button) =>
|
|
13486
|
+
trackAstroController("ButtonRoot", button, createButton(button)).setDisabled(
|
|
13487
|
+
button.hasAttribute("data-disabled"),
|
|
13488
|
+
),
|
|
13489
|
+
);
|
|
13490
|
+
};
|
|
13491
|
+
|
|
13492
|
+
registerAstroControllerLifecycle("ButtonRoot", setupButtons);
|
|
13493
|
+
</script>
|
|
13494
|
+
`,
|
|
13495
|
+
sourceHash: "sha256:f3cc206f66110e8ff7f02953684ff83143a5bf5f9a34ab89c569048390f6b53f",
|
|
13274
13496
|
sourcePath: "packages/astro/src/button/ButtonRoot.astro"
|
|
13275
13497
|
},
|
|
13276
13498
|
{
|
|
@@ -13278,12 +13500,18 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13278
13500
|
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport ButtonRoot from "./ButtonRoot.astro";\n\nconst Button = {\n Root: ButtonRoot,\n};\n\nexport { Button, ButtonRoot };\n\nexport default Button;\n',
|
|
13279
13501
|
sourceHash: "sha256:bc7160d21174ec75768e367d49b12c166a1f02b78a7b703db252bf7c9cbcdb0e",
|
|
13280
13502
|
sourcePath: "packages/astro/src/button/index.ts"
|
|
13503
|
+
},
|
|
13504
|
+
{
|
|
13505
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
13506
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
13507
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
13508
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
13281
13509
|
}
|
|
13282
13510
|
],
|
|
13283
13511
|
packageRequirements: [
|
|
13284
13512
|
{
|
|
13285
13513
|
name: "@starwind-ui/runtime",
|
|
13286
|
-
range: "^0.1.0-beta.
|
|
13514
|
+
range: "^0.1.0-beta.2"
|
|
13287
13515
|
},
|
|
13288
13516
|
{
|
|
13289
13517
|
name: "astro",
|
|
@@ -13337,12 +13565,18 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13337
13565
|
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport CarouselContainer from "./CarouselContainer.astro";\nimport CarouselItem from "./CarouselItem.astro";\nimport CarouselNext from "./CarouselNext.astro";\nimport CarouselPrevious from "./CarouselPrevious.astro";\nimport CarouselRoot from "./CarouselRoot.astro";\nimport CarouselViewport from "./CarouselViewport.astro";\n\nconst Carousel = {\n Root: CarouselRoot,\n Viewport: CarouselViewport,\n Container: CarouselContainer,\n Item: CarouselItem,\n Previous: CarouselPrevious,\n Next: CarouselNext,\n};\n\nexport {\n Carousel,\n CarouselContainer,\n CarouselItem,\n CarouselNext,\n CarouselPrevious,\n CarouselRoot,\n CarouselViewport,\n};\n\nexport default Carousel;\n\nexport type { CarouselInstance, CarouselOptions } from "@starwind-ui/runtime";\nexport { createCarousel } from "@starwind-ui/runtime/carousel";\n',
|
|
13338
13566
|
sourceHash: "sha256:afaa6695bd5fde0254c8a31b32a9c35575dce09dfc8aea7f0b6a56c2c20ac2d4",
|
|
13339
13567
|
sourcePath: "packages/astro/src/carousel/index.ts"
|
|
13568
|
+
},
|
|
13569
|
+
{
|
|
13570
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
13571
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
13572
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
13573
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
13340
13574
|
}
|
|
13341
13575
|
],
|
|
13342
13576
|
packageRequirements: [
|
|
13343
13577
|
{
|
|
13344
13578
|
name: "@starwind-ui/runtime",
|
|
13345
|
-
range: "^0.1.0-beta.
|
|
13579
|
+
range: "^0.1.0-beta.2"
|
|
13346
13580
|
},
|
|
13347
13581
|
{
|
|
13348
13582
|
name: "astro",
|
|
@@ -13355,6 +13589,12 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13355
13589
|
framework: "astro",
|
|
13356
13590
|
version: "0.1.1",
|
|
13357
13591
|
files: [
|
|
13592
|
+
{
|
|
13593
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
13594
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
13595
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
13596
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
13597
|
+
},
|
|
13358
13598
|
{
|
|
13359
13599
|
path: "src/components/starwind-primitives/toggle/ToggleRoot.astro",
|
|
13360
13600
|
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ninterface Props extends Omit<\n HTMLAttributes<"button">,\n "aria-pressed" | "defaultPressed" | "disabled" | "onChange" | "type" | "value"\n> {\n defaultPressed?: boolean;\n disabled?: boolean;\n nativeButton?: boolean;\n pressed?: boolean;\n syncGroup?: string;\n value?: string;\n}\n\nconst {\n defaultPressed = false,\n disabled = false,\n nativeButton = true,\n pressed,\n syncGroup,\n value,\n ...rest\n} = Astro.props;\n\nconst Tag = nativeButton ? "button" : "span";\nconst initialPressed = pressed ?? defaultPressed;\nconst defaultPressedAttribute = pressed === undefined && defaultPressed ? "true" : undefined;\n---\n\n<Tag\n {...rest}\n data-sw-toggle\n data-default-pressed={defaultPressedAttribute}\n data-native={!nativeButton ? "false" : undefined}\n data-sync-group={syncGroup}\n data-value={value}\n aria-disabled={!nativeButton && disabled ? "true" : undefined}\n aria-pressed={initialPressed ? "true" : "false"}\n data-disabled={disabled ? "" : undefined}\n data-pressed={initialPressed ? "" : undefined}\n data-state={initialPressed ? "on" : "off"}\n data-unpressed={!initialPressed ? "" : undefined}\n disabled={nativeButton && disabled ? true : undefined}\n role={!nativeButton ? "button" : undefined}\n tabindex={!nativeButton ? (disabled ? -1 : 0) : undefined}\n type={nativeButton ? "button" : undefined}\n value={nativeButton ? value : undefined}\n>\n <slot />\n</Tag>\n\n<script>\n import { createToggle } from "@starwind-ui/runtime/toggle";\n import { registerAstroControllerLifecycle } from "../internal/controller-lifecycle";\n\n const toggleInstances = new Set<ReturnType<typeof createToggle>>();\n\n const getInitCandidates = (event: Event | undefined, selector: string): HTMLElement[] => {\n const initRoot =\n event?.type === "starwind:init" && event instanceof CustomEvent\n ? event.detail?.root\n : undefined;\n const scopedRoot: Document | DocumentFragment | Element = isQueryableRoot(initRoot)\n ? initRoot\n : document;\n const candidates = Array.from(scopedRoot.querySelectorAll<HTMLElement>(selector));\n\n if (scopedRoot instanceof Element && scopedRoot.matches(selector)) {\n candidates.unshift(scopedRoot as HTMLElement);\n }\n\n return candidates;\n };\n\n const isQueryableRoot = (value: unknown): value is Document | DocumentFragment | Element =>\n value instanceof Document || value instanceof DocumentFragment || value instanceof Element;\n\n const setupToggles = (event?: Event) => {\n getInitCandidates(event, "[data-sw-toggle]").forEach((root) => {\n if (root.hasAttribute("data-sw-theme-toggle")) return;\n\n toggleInstances.add(createToggle(root));\n });\n };\n\n const destroyToggles = () => {\n toggleInstances.forEach((instance) => instance.destroy());\n toggleInstances.clear();\n };\n\n registerAstroControllerLifecycle("ToggleRoot", setupToggles, destroyToggles);\n</script>\n',
|
|
@@ -13371,7 +13611,7 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13371
13611
|
packageRequirements: [
|
|
13372
13612
|
{
|
|
13373
13613
|
name: "@starwind-ui/runtime",
|
|
13374
|
-
range: "^0.1.0-beta.
|
|
13614
|
+
range: "^0.1.0-beta.2"
|
|
13375
13615
|
},
|
|
13376
13616
|
{
|
|
13377
13617
|
name: "astro",
|
|
@@ -13431,12 +13671,18 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13431
13671
|
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport FieldControl from "./FieldControl.astro";\nimport FieldDescription from "./FieldDescription.astro";\nimport FieldError from "./FieldError.astro";\nimport FieldItem from "./FieldItem.astro";\nimport FieldLabel from "./FieldLabel.astro";\nimport FieldRoot from "./FieldRoot.astro";\nimport FieldValidity from "./FieldValidity.astro";\n\nconst Field = {\n Control: FieldControl,\n Description: FieldDescription,\n Error: FieldError,\n Item: FieldItem,\n Label: FieldLabel,\n Root: FieldRoot,\n Validity: FieldValidity,\n};\n\nexport {\n Field,\n FieldControl,\n FieldDescription,\n FieldError,\n FieldItem,\n FieldLabel,\n FieldRoot,\n FieldValidity,\n};\n\nexport default Field;\n\nexport type { InputValue, InputValueChangeDetails } from "@starwind-ui/runtime";\n',
|
|
13432
13672
|
sourceHash: "sha256:2526f8a5d6301a727d46b6babf9b38cab3469c005156aab70ff28a78a2b3dc08",
|
|
13433
13673
|
sourcePath: "packages/astro/src/field/index.ts"
|
|
13674
|
+
},
|
|
13675
|
+
{
|
|
13676
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
13677
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
13678
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
13679
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
13434
13680
|
}
|
|
13435
13681
|
],
|
|
13436
13682
|
packageRequirements: [
|
|
13437
13683
|
{
|
|
13438
13684
|
name: "@starwind-ui/runtime",
|
|
13439
|
-
range: "^0.1.0-beta.
|
|
13685
|
+
range: "^0.1.0-beta.2"
|
|
13440
13686
|
},
|
|
13441
13687
|
{
|
|
13442
13688
|
name: "astro",
|
|
@@ -13466,12 +13712,18 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13466
13712
|
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport FieldsetLegend from "./FieldsetLegend.astro";\nimport FieldsetRoot from "./FieldsetRoot.astro";\n\nconst Fieldset = {\n Legend: FieldsetLegend,\n Root: FieldsetRoot,\n};\n\nexport { Fieldset, FieldsetLegend, FieldsetRoot };\n\nexport default Fieldset;\n',
|
|
13467
13713
|
sourceHash: "sha256:2e73a115dd3e3bd7a607c72c227b313ca1629ed6c0122cd1a85118aa5d3f538a",
|
|
13468
13714
|
sourcePath: "packages/astro/src/fieldset/index.ts"
|
|
13715
|
+
},
|
|
13716
|
+
{
|
|
13717
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
13718
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
13719
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
13720
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
13469
13721
|
}
|
|
13470
13722
|
],
|
|
13471
13723
|
packageRequirements: [
|
|
13472
13724
|
{
|
|
13473
13725
|
name: "@starwind-ui/runtime",
|
|
13474
|
-
range: "^0.1.0-beta.
|
|
13726
|
+
range: "^0.1.0-beta.2"
|
|
13475
13727
|
},
|
|
13476
13728
|
{
|
|
13477
13729
|
name: "astro",
|
|
@@ -13501,12 +13753,18 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13501
13753
|
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport FormErrorSummary from "./FormErrorSummary.astro";\nimport FormRoot from "./FormRoot.astro";\n\nconst Form = {\n ErrorSummary: FormErrorSummary,\n Root: FormRoot,\n};\n\nexport { Form, FormErrorSummary, FormRoot };\n\nexport default Form;\n\nexport type {\n FormExternalErrors,\n FormSchemaResult,\n FormValidationTiming,\n FormValues,\n} from "@starwind-ui/runtime";\nexport {\n createForm,\n createFormSchemaValidator,\n validateFormSchema,\n} from "@starwind-ui/runtime/form";\n',
|
|
13502
13754
|
sourceHash: "sha256:8d7051bc5a476e4fcb26fae9a61290f2c06fec40e344bd7bcd3c17755e10717e",
|
|
13503
13755
|
sourcePath: "packages/astro/src/form/index.ts"
|
|
13756
|
+
},
|
|
13757
|
+
{
|
|
13758
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
13759
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
13760
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
13761
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
13504
13762
|
}
|
|
13505
13763
|
],
|
|
13506
13764
|
packageRequirements: [
|
|
13507
13765
|
{
|
|
13508
13766
|
name: "@starwind-ui/runtime",
|
|
13509
|
-
range: "^0.1.0-beta.
|
|
13767
|
+
range: "^0.1.0-beta.2"
|
|
13510
13768
|
},
|
|
13511
13769
|
{
|
|
13512
13770
|
name: "astro",
|
|
@@ -13530,12 +13788,18 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13530
13788
|
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport InputRoot from "./InputRoot.astro";\n\nconst Input = {\n Root: InputRoot,\n};\n\nexport { Input, InputRoot };\n\nexport default Input;\n\nexport type { InputValue, InputValueChangeDetails } from "@starwind-ui/runtime";\n',
|
|
13531
13789
|
sourceHash: "sha256:88484b8c131f4138737eef5081ac9dcfe532860ef9f8a584147c6ecdc1d36c48",
|
|
13532
13790
|
sourcePath: "packages/astro/src/input/index.ts"
|
|
13791
|
+
},
|
|
13792
|
+
{
|
|
13793
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
13794
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
13795
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
13796
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
13533
13797
|
}
|
|
13534
13798
|
],
|
|
13535
13799
|
packageRequirements: [
|
|
13536
13800
|
{
|
|
13537
13801
|
name: "@starwind-ui/runtime",
|
|
13538
|
-
range: "^0.1.0-beta.
|
|
13802
|
+
range: "^0.1.0-beta.2"
|
|
13539
13803
|
},
|
|
13540
13804
|
{
|
|
13541
13805
|
name: "astro",
|
|
@@ -13548,6 +13812,12 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13548
13812
|
framework: "astro",
|
|
13549
13813
|
version: "0.1.0",
|
|
13550
13814
|
files: [
|
|
13815
|
+
{
|
|
13816
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
13817
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
13818
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
13819
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
13820
|
+
},
|
|
13551
13821
|
{
|
|
13552
13822
|
path: "src/components/starwind-primitives/switch/SwitchRoot.astro",
|
|
13553
13823
|
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ninterface Props extends Omit<HTMLAttributes<"span">, "aria-checked" | "onChange"> {\n checked?: boolean;\n defaultChecked?: boolean;\n disabled?: boolean;\n form?: string;\n id?: string;\n name?: string;\n nativeButton?: boolean;\n readOnly?: boolean;\n required?: boolean;\n uncheckedValue?: string;\n value?: string;\n}\n\nconst {\n checked,\n defaultChecked = false,\n disabled = false,\n form,\n id,\n name,\n nativeButton = false,\n readOnly = false,\n required = false,\n uncheckedValue,\n value,\n ...rest\n} = Astro.props;\n\nconst Tag = nativeButton ? "button" : "span";\nconst initialChecked = checked ?? defaultChecked;\nconst inputId = id && nativeButton ? `${id}-input` : id;\nconst rootId = nativeButton ? id : undefined;\n---\n\n<Tag\n {...rest}\n data-sw-switch\n data-default-checked={initialChecked ? "true" : undefined}\n data-form={form}\n data-id={id}\n data-name={name}\n data-unchecked-value={uncheckedValue}\n data-value={value}\n aria-checked={initialChecked ? "true" : "false"}\n aria-readonly={readOnly ? "true" : undefined}\n aria-required={required ? "true" : undefined}\n data-checked={initialChecked ? "" : undefined}\n data-disabled={disabled ? "" : undefined}\n data-filled={initialChecked ? "" : undefined}\n data-readonly={readOnly ? "" : undefined}\n data-required={required ? "" : undefined}\n data-unchecked={!initialChecked ? "" : undefined}\n disabled={nativeButton && disabled ? true : undefined}\n id={rootId}\n role="switch"\n tabindex={disabled ? -1 : 0}\n type={nativeButton ? "button" : undefined}\n>\n <slot />\n</Tag>\n<input data-sw-switch-input id={inputId} hidden />\n\n<script>\n import { createSwitch } from "@starwind-ui/runtime/switch";\n import {\n registerAstroControllerLifecycle,\n trackAstroController,\n } from "../internal/controller-lifecycle";\n\n const getInitCandidates = (event: Event | undefined, selector: string): HTMLElement[] => {\n const initRoot =\n event?.type === "starwind:init" && event instanceof CustomEvent\n ? event.detail?.root\n : undefined;\n const scopedRoot: Document | DocumentFragment | Element = isQueryableRoot(initRoot)\n ? initRoot\n : document;\n const candidates = Array.from(scopedRoot.querySelectorAll<HTMLElement>(selector));\n\n if (scopedRoot instanceof Element && scopedRoot.matches(selector)) {\n candidates.unshift(scopedRoot as HTMLElement);\n }\n\n return candidates;\n };\n\n const isQueryableRoot = (value: unknown): value is Document | DocumentFragment | Element =>\n value instanceof Document || value instanceof DocumentFragment || value instanceof Element;\n\n const setupSwitches = (event?: Event) => {\n getInitCandidates(event, "[data-sw-switch]").forEach((root) =>\n trackAstroController("SwitchRoot", root, createSwitch(root)),\n );\n };\n\n registerAstroControllerLifecycle("SwitchRoot", setupSwitches);\n</script>\n',
|
|
@@ -13570,7 +13840,7 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13570
13840
|
packageRequirements: [
|
|
13571
13841
|
{
|
|
13572
13842
|
name: "@starwind-ui/runtime",
|
|
13573
|
-
range: "^0.1.0-beta.
|
|
13843
|
+
range: "^0.1.0-beta.2"
|
|
13574
13844
|
},
|
|
13575
13845
|
{
|
|
13576
13846
|
name: "astro",
|
|
@@ -13600,12 +13870,18 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13600
13870
|
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport CheckboxIndicator from "./CheckboxIndicator.astro";\nimport CheckboxRoot from "./CheckboxRoot.astro";\n\nconst Checkbox = {\n Root: CheckboxRoot,\n Indicator: CheckboxIndicator,\n};\n\nexport { Checkbox, CheckboxIndicator, CheckboxRoot };\n\nexport default Checkbox;\n\nexport type { CheckboxCheckedChangeDetails } from "@starwind-ui/runtime";\n',
|
|
13601
13871
|
sourceHash: "sha256:1d0d754e19e791004aeb9530d7af51444b818313b80c71c8ef4da8144b06e50f",
|
|
13602
13872
|
sourcePath: "packages/astro/src/checkbox/index.ts"
|
|
13873
|
+
},
|
|
13874
|
+
{
|
|
13875
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
13876
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
13877
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
13878
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
13603
13879
|
}
|
|
13604
13880
|
],
|
|
13605
13881
|
packageRequirements: [
|
|
13606
13882
|
{
|
|
13607
13883
|
name: "@starwind-ui/runtime",
|
|
13608
|
-
range: "^0.1.0-beta.
|
|
13884
|
+
range: "^0.1.0-beta.2"
|
|
13609
13885
|
},
|
|
13610
13886
|
{
|
|
13611
13887
|
name: "astro",
|
|
@@ -13618,6 +13894,12 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13618
13894
|
framework: "astro",
|
|
13619
13895
|
version: "0.1.0",
|
|
13620
13896
|
files: [
|
|
13897
|
+
{
|
|
13898
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
13899
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
13900
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
13901
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
13902
|
+
},
|
|
13621
13903
|
{
|
|
13622
13904
|
path: "src/components/starwind-primitives/radio/RadioIndicator.astro",
|
|
13623
13905
|
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"span"> & {\n keepMounted?: boolean;\n};\n\nconst { keepMounted = false, ...rest } = Astro.props;\n---\n\n<span\n data-sw-radio-indicator\n data-keep-mounted={keepMounted ? "true" : undefined}\n data-unchecked\n hidden={!keepMounted}\n {...rest}\n>\n <slot />\n</span>\n',
|
|
@@ -13640,7 +13922,7 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13640
13922
|
packageRequirements: [
|
|
13641
13923
|
{
|
|
13642
13924
|
name: "@starwind-ui/runtime",
|
|
13643
|
-
range: "^0.1.0-beta.
|
|
13925
|
+
range: "^0.1.0-beta.2"
|
|
13644
13926
|
},
|
|
13645
13927
|
{
|
|
13646
13928
|
name: "astro",
|
|
@@ -13653,6 +13935,12 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13653
13935
|
framework: "astro",
|
|
13654
13936
|
version: "0.1.0",
|
|
13655
13937
|
files: [
|
|
13938
|
+
{
|
|
13939
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
13940
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
13941
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
13942
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
13943
|
+
},
|
|
13656
13944
|
{
|
|
13657
13945
|
path: "src/components/starwind-primitives/slider/SliderControl.astro",
|
|
13658
13946
|
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div">;\n\nconst { ...rest } = Astro.props;\n---\n\n<div data-sw-slider-control {...rest}>\n <slot />\n</div>\n',
|
|
@@ -13699,7 +13987,7 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13699
13987
|
packageRequirements: [
|
|
13700
13988
|
{
|
|
13701
13989
|
name: "@starwind-ui/runtime",
|
|
13702
|
-
range: "^0.1.0-beta.
|
|
13990
|
+
range: "^0.1.0-beta.2"
|
|
13703
13991
|
},
|
|
13704
13992
|
{
|
|
13705
13993
|
name: "astro",
|
|
@@ -13735,12 +14023,18 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13735
14023
|
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport CollapsiblePanel from "./CollapsiblePanel.astro";\nimport CollapsibleRoot from "./CollapsibleRoot.astro";\nimport CollapsibleTrigger from "./CollapsibleTrigger.astro";\n\nconst Collapsible = {\n Root: CollapsibleRoot,\n Trigger: CollapsibleTrigger,\n Panel: CollapsiblePanel,\n};\n\nexport { Collapsible, CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger };\n\nexport default Collapsible;\n\nexport type { CollapsibleOpenChangeDetails } from "@starwind-ui/runtime";\n',
|
|
13736
14024
|
sourceHash: "sha256:8337084a35e7a4a5b7c8d8bae8eaf0f68b1ce1547a15700a0c51ea2c904aff55",
|
|
13737
14025
|
sourcePath: "packages/astro/src/collapsible/index.ts"
|
|
14026
|
+
},
|
|
14027
|
+
{
|
|
14028
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
14029
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
14030
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
14031
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
13738
14032
|
}
|
|
13739
14033
|
],
|
|
13740
14034
|
packageRequirements: [
|
|
13741
14035
|
{
|
|
13742
14036
|
name: "@starwind-ui/runtime",
|
|
13743
|
-
range: "^0.1.0-beta.
|
|
14037
|
+
range: "^0.1.0-beta.2"
|
|
13744
14038
|
},
|
|
13745
14039
|
{
|
|
13746
14040
|
name: "astro",
|
|
@@ -13753,6 +14047,12 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13753
14047
|
framework: "astro",
|
|
13754
14048
|
version: "0.1.0",
|
|
13755
14049
|
files: [
|
|
14050
|
+
{
|
|
14051
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
14052
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
14053
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
14054
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
14055
|
+
},
|
|
13756
14056
|
{
|
|
13757
14057
|
path: "src/components/starwind-primitives/toggle-group/ToggleGroupRoot.astro",
|
|
13758
14058
|
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = Omit<HTMLAttributes<"div">, "defaultValue" | "onChange"> & {\n defaultValue?: string[];\n disabled?: boolean;\n loopFocus?: boolean;\n multiple?: boolean;\n orientation?: "horizontal" | "vertical";\n};\n\nconst {\n defaultValue,\n disabled = false,\n loopFocus = true,\n multiple = false,\n orientation = "horizontal",\n ...rest\n} = Astro.props;\nconst defaultValueAttribute = defaultValue ? JSON.stringify(defaultValue) : undefined;\nconst valueAttribute = JSON.stringify(defaultValue ?? []);\n---\n\n<div\n data-sw-toggle-group\n data-default-value={defaultValueAttribute}\n data-disabled={disabled ? "" : undefined}\n data-loop-focus={!loopFocus ? "false" : undefined}\n data-multiple={multiple ? "" : undefined}\n data-orientation={orientation}\n data-value={valueAttribute}\n role="group"\n {...rest}\n>\n <slot />\n</div>\n\n<script>\n import { createToggleGroup } from "@starwind-ui/runtime/toggle-group";\n import {\n registerAstroControllerLifecycle,\n trackAstroController,\n } from "../internal/controller-lifecycle";\n\n const getInitCandidates = (event: Event | undefined, selector: string): HTMLElement[] => {\n const initRoot =\n event?.type === "starwind:init" && event instanceof CustomEvent\n ? event.detail?.root\n : undefined;\n const scopedRoot: Document | DocumentFragment | Element = isQueryableRoot(initRoot)\n ? initRoot\n : document;\n const candidates = Array.from(scopedRoot.querySelectorAll<HTMLElement>(selector));\n\n if (scopedRoot instanceof Element && scopedRoot.matches(selector)) {\n candidates.unshift(scopedRoot as HTMLElement);\n }\n\n return candidates;\n };\n\n const isQueryableRoot = (value: unknown): value is Document | DocumentFragment | Element =>\n value instanceof Document || value instanceof DocumentFragment || value instanceof Element;\n\n const setupToggleGroups = (event?: Event) => {\n getInitCandidates(event, "[data-sw-toggle-group]").forEach((root) =>\n trackAstroController("ToggleGroupRoot", root, createToggleGroup(root)),\n );\n };\n\n registerAstroControllerLifecycle("ToggleGroupRoot", setupToggleGroups);\n</script>\n',
|
|
@@ -13769,7 +14069,7 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13769
14069
|
packageRequirements: [
|
|
13770
14070
|
{
|
|
13771
14071
|
name: "@starwind-ui/runtime",
|
|
13772
|
-
range: "^0.1.0-beta.
|
|
14072
|
+
range: "^0.1.0-beta.2"
|
|
13773
14073
|
},
|
|
13774
14074
|
{
|
|
13775
14075
|
name: "astro",
|
|
@@ -13782,6 +14082,12 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13782
14082
|
framework: "astro",
|
|
13783
14083
|
version: "0.1.0",
|
|
13784
14084
|
files: [
|
|
14085
|
+
{
|
|
14086
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
14087
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
14088
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
14089
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
14090
|
+
},
|
|
13785
14091
|
{
|
|
13786
14092
|
path: "src/components/starwind-primitives/radio-group/RadioGroupRoot.astro",
|
|
13787
14093
|
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = Omit<HTMLAttributes<"div">, "defaultValue"> & {\n defaultValue?: string;\n disabled?: boolean;\n form?: string;\n name?: string;\n orientation?: "horizontal" | "vertical";\n readOnly?: boolean;\n required?: boolean;\n value?: string;\n};\n\nconst {\n defaultValue,\n disabled = false,\n form,\n name,\n orientation = "vertical",\n readOnly = false,\n required = false,\n value,\n ...rest\n} = Astro.props;\n\nconst renderedValue = value ?? defaultValue;\n---\n\n<div\n data-sw-radio-group\n data-default-value={defaultValue}\n data-form={form}\n data-name={name}\n data-orientation={orientation}\n data-value={renderedValue}\n aria-disabled={disabled ? "true" : undefined}\n aria-orientation={orientation}\n aria-readonly={readOnly ? "true" : undefined}\n aria-required={required ? "true" : undefined}\n data-disabled={disabled ? "" : undefined}\n data-readonly={readOnly ? "" : undefined}\n data-required={required ? "" : undefined}\n role="radiogroup"\n {...rest}\n>\n <slot />\n</div>\n\n<script>\n import { createRadioGroup } from "@starwind-ui/runtime/radio-group";\n import {\n registerAstroControllerLifecycle,\n trackAstroController,\n } from "../internal/controller-lifecycle";\n\n const getInitCandidates = (event: Event | undefined, selector: string): HTMLElement[] => {\n const initRoot =\n event?.type === "starwind:init" && event instanceof CustomEvent\n ? event.detail?.root\n : undefined;\n const scopedRoot: Document | DocumentFragment | Element = isQueryableRoot(initRoot)\n ? initRoot\n : document;\n const candidates = Array.from(scopedRoot.querySelectorAll<HTMLElement>(selector));\n\n if (scopedRoot instanceof Element && scopedRoot.matches(selector)) {\n candidates.unshift(scopedRoot as HTMLElement);\n }\n\n return candidates;\n };\n\n const isQueryableRoot = (value: unknown): value is Document | DocumentFragment | Element =>\n value instanceof Document || value instanceof DocumentFragment || value instanceof Element;\n\n const setupRadioGroups = (event?: Event) => {\n getInitCandidates(event, "[data-sw-radio-group]").forEach((root) =>\n trackAstroController("RadioGroupRoot", root, createRadioGroup(root)),\n );\n };\n\n registerAstroControllerLifecycle("RadioGroupRoot", setupRadioGroups);\n</script>\n',
|
|
@@ -13798,7 +14104,7 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13798
14104
|
packageRequirements: [
|
|
13799
14105
|
{
|
|
13800
14106
|
name: "@starwind-ui/runtime",
|
|
13801
|
-
range: "^0.1.0-beta.
|
|
14107
|
+
range: "^0.1.0-beta.2"
|
|
13802
14108
|
},
|
|
13803
14109
|
{
|
|
13804
14110
|
name: "astro",
|
|
@@ -13822,12 +14128,18 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13822
14128
|
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport CheckboxGroupRoot from "./CheckboxGroupRoot.astro";\n\nconst CheckboxGroup = {\n Root: CheckboxGroupRoot,\n};\n\nexport { CheckboxGroup, CheckboxGroupRoot };\n\nexport default CheckboxGroup;\n\nexport type { CheckboxGroupValue, CheckboxGroupValueChangeDetails } from "@starwind-ui/runtime";\n',
|
|
13823
14129
|
sourceHash: "sha256:6bcc86c29237de480a87ddca3931e21dd70fb544e2a3748a7fa513f812d5b9fc",
|
|
13824
14130
|
sourcePath: "packages/astro/src/checkbox-group/index.ts"
|
|
14131
|
+
},
|
|
14132
|
+
{
|
|
14133
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
14134
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
14135
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
14136
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
13825
14137
|
}
|
|
13826
14138
|
],
|
|
13827
14139
|
packageRequirements: [
|
|
13828
14140
|
{
|
|
13829
14141
|
name: "@starwind-ui/runtime",
|
|
13830
|
-
range: "^0.1.0-beta.
|
|
14142
|
+
range: "^0.1.0-beta.2"
|
|
13831
14143
|
},
|
|
13832
14144
|
{
|
|
13833
14145
|
name: "astro",
|
|
@@ -13840,6 +14152,12 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13840
14152
|
framework: "astro",
|
|
13841
14153
|
version: "0.1.0",
|
|
13842
14154
|
files: [
|
|
14155
|
+
{
|
|
14156
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
14157
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
14158
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
14159
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
14160
|
+
},
|
|
13843
14161
|
{
|
|
13844
14162
|
path: "src/components/starwind-primitives/tabs/TabsIndicator.astro",
|
|
13845
14163
|
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"span">;\n\nconst { ...rest } = Astro.props;\n---\n\n<span data-sw-tabs-indicator {...rest}>\n <slot />\n</span>\n',
|
|
@@ -13880,7 +14198,7 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13880
14198
|
packageRequirements: [
|
|
13881
14199
|
{
|
|
13882
14200
|
name: "@starwind-ui/runtime",
|
|
13883
|
-
range: "^0.1.0-beta.
|
|
14201
|
+
range: "^0.1.0-beta.2"
|
|
13884
14202
|
},
|
|
13885
14203
|
{
|
|
13886
14204
|
name: "astro",
|
|
@@ -13891,7 +14209,7 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13891
14209
|
{
|
|
13892
14210
|
component: "accordion",
|
|
13893
14211
|
framework: "astro",
|
|
13894
|
-
version: "0.1.
|
|
14212
|
+
version: "0.1.1",
|
|
13895
14213
|
files: [
|
|
13896
14214
|
{
|
|
13897
14215
|
path: "src/components/starwind-primitives/accordion/AccordionHeader.astro",
|
|
@@ -13913,8 +14231,8 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13913
14231
|
},
|
|
13914
14232
|
{
|
|
13915
14233
|
path: "src/components/starwind-primitives/accordion/AccordionRoot.astro",
|
|
13916
|
-
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div"> & {\n type?: "single" | "multiple";\n defaultValue?: string | string[];\n collapsible?: boolean;\n};\n\nconst { type = "single", defaultValue, collapsible =
|
|
13917
|
-
sourceHash: "sha256:
|
|
14234
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div"> & {\n type?: "single" | "multiple";\n defaultValue?: string | string[];\n collapsible?: boolean;\n};\n\nconst { type = "single", defaultValue, collapsible = true, ...rest } = Astro.props;\n\nconst defaultValueAttribute = Array.isArray(defaultValue)\n ? JSON.stringify(defaultValue)\n : defaultValue;\n---\n\n<div\n data-sw-accordion\n data-type={type}\n data-default-value={defaultValueAttribute}\n data-collapsible={String(collapsible)}\n data-state="closed"\n {...rest}\n>\n <slot />\n</div>\n\n<script>\n import { createAccordion } from "@starwind-ui/runtime/accordion";\n import {\n registerAstroControllerLifecycle,\n trackAstroController,\n } from "../internal/controller-lifecycle";\n\n const getInitCandidates = (event: Event | undefined, selector: string): HTMLElement[] => {\n const initRoot =\n event?.type === "starwind:init" && event instanceof CustomEvent\n ? event.detail?.root\n : undefined;\n const scopedRoot: Document | DocumentFragment | Element = isQueryableRoot(initRoot)\n ? initRoot\n : document;\n const candidates = Array.from(scopedRoot.querySelectorAll<HTMLElement>(selector));\n\n if (scopedRoot instanceof Element && scopedRoot.matches(selector)) {\n candidates.unshift(scopedRoot as HTMLElement);\n }\n\n return candidates;\n };\n\n const isQueryableRoot = (value: unknown): value is Document | DocumentFragment | Element =>\n value instanceof Document || value instanceof DocumentFragment || value instanceof Element;\n\n const setupAccordions = (event?: Event) => {\n getInitCandidates(event, "[data-sw-accordion]").forEach((root) =>\n trackAstroController("AccordionRoot", root, createAccordion(root)),\n );\n };\n\n registerAstroControllerLifecycle("AccordionRoot", setupAccordions);\n</script>\n',
|
|
14235
|
+
sourceHash: "sha256:614dacad3ff8e0463511e08a29e91593232f319741481c3cea2e43b5fd8e0c7f",
|
|
13918
14236
|
sourcePath: "packages/astro/src/accordion/AccordionRoot.astro"
|
|
13919
14237
|
},
|
|
13920
14238
|
{
|
|
@@ -13928,12 +14246,18 @@ var primitive_vendoring_artifacts_default = {
|
|
|
13928
14246
|
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport AccordionHeader from "./AccordionHeader.astro";\nimport AccordionItem from "./AccordionItem.astro";\nimport AccordionPanel from "./AccordionPanel.astro";\nimport AccordionRoot from "./AccordionRoot.astro";\nimport AccordionTrigger from "./AccordionTrigger.astro";\n\nconst Accordion = {\n Root: AccordionRoot,\n Item: AccordionItem,\n Header: AccordionHeader,\n Trigger: AccordionTrigger,\n Panel: AccordionPanel,\n};\n\nexport {\n Accordion,\n AccordionHeader,\n AccordionItem,\n AccordionPanel,\n AccordionRoot,\n AccordionTrigger,\n};\n\nexport default Accordion;\n\nexport type { AccordionValue, AccordionValueChangeDetails } from "@starwind-ui/runtime";\n',
|
|
13929
14247
|
sourceHash: "sha256:67db87ed4f9d962b4e872e159591905770066932f0d3e0c11c17ca17cc9a7aa1",
|
|
13930
14248
|
sourcePath: "packages/astro/src/accordion/index.ts"
|
|
14249
|
+
},
|
|
14250
|
+
{
|
|
14251
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
14252
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
14253
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
14254
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
13931
14255
|
}
|
|
13932
14256
|
],
|
|
13933
14257
|
packageRequirements: [
|
|
13934
14258
|
{
|
|
13935
14259
|
name: "@starwind-ui/runtime",
|
|
13936
|
-
range: "^0.1.0-beta.
|
|
14260
|
+
range: "^0.1.0-beta.2"
|
|
13937
14261
|
},
|
|
13938
14262
|
{
|
|
13939
14263
|
name: "astro",
|
|
@@ -14017,12 +14341,18 @@ if (!src && !image) {
|
|
|
14017
14341
|
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport AvatarFallback from "./AvatarFallback.astro";\nimport AvatarImage from "./AvatarImage.astro";\nimport AvatarRoot from "./AvatarRoot.astro";\n\nconst Avatar = {\n Root: AvatarRoot,\n Image: AvatarImage,\n Fallback: AvatarFallback,\n};\n\nexport { Avatar, AvatarFallback, AvatarImage, AvatarRoot };\n\nexport default Avatar;\n\nexport type {\n AvatarImageLoadingStatus,\n AvatarLoadingStatusChangeDetails,\n} from "@starwind-ui/runtime";\n',
|
|
14018
14342
|
sourceHash: "sha256:8dcb08224b0de18309d76b157c1bcba8ce21d61284400cbcbc43289938646bbb",
|
|
14019
14343
|
sourcePath: "packages/astro/src/avatar/index.ts"
|
|
14344
|
+
},
|
|
14345
|
+
{
|
|
14346
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
14347
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
14348
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
14349
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
14020
14350
|
}
|
|
14021
14351
|
],
|
|
14022
14352
|
packageRequirements: [
|
|
14023
14353
|
{
|
|
14024
14354
|
name: "@starwind-ui/runtime",
|
|
14025
|
-
range: "^0.1.0-beta.
|
|
14355
|
+
range: "^0.1.0-beta.2"
|
|
14026
14356
|
},
|
|
14027
14357
|
{
|
|
14028
14358
|
name: "astro",
|
|
@@ -14035,6 +14365,12 @@ if (!src && !image) {
|
|
|
14035
14365
|
framework: "astro",
|
|
14036
14366
|
version: "0.1.0",
|
|
14037
14367
|
files: [
|
|
14368
|
+
{
|
|
14369
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
14370
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
14371
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
14372
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
14373
|
+
},
|
|
14038
14374
|
{
|
|
14039
14375
|
path: "src/components/starwind-primitives/progress/ProgressIndicator.astro",
|
|
14040
14376
|
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div">;\n\nconst { ...rest } = Astro.props;\n---\n\n<div data-sw-progress-indicator {...rest}>\n <slot />\n</div>\n',
|
|
@@ -14075,7 +14411,7 @@ if (!src && !image) {
|
|
|
14075
14411
|
packageRequirements: [
|
|
14076
14412
|
{
|
|
14077
14413
|
name: "@starwind-ui/runtime",
|
|
14078
|
-
range: "^0.1.0-beta.
|
|
14414
|
+
range: "^0.1.0-beta.2"
|
|
14079
14415
|
},
|
|
14080
14416
|
{
|
|
14081
14417
|
name: "astro",
|
|
@@ -14088,6 +14424,12 @@ if (!src && !image) {
|
|
|
14088
14424
|
framework: "astro",
|
|
14089
14425
|
version: "0.1.0",
|
|
14090
14426
|
files: [
|
|
14427
|
+
{
|
|
14428
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
14429
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
14430
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
14431
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
14432
|
+
},
|
|
14091
14433
|
{
|
|
14092
14434
|
path: "src/components/starwind-primitives/scroll-area/ScrollAreaContent.astro",
|
|
14093
14435
|
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div">;\n\nconst { ...rest } = Astro.props;\n---\n\n<div data-sw-scroll-area-content role="presentation" {...rest}>\n <slot />\n</div>\n',
|
|
@@ -14134,7 +14476,7 @@ if (!src && !image) {
|
|
|
14134
14476
|
packageRequirements: [
|
|
14135
14477
|
{
|
|
14136
14478
|
name: "@starwind-ui/runtime",
|
|
14137
|
-
range: "^0.1.0-beta.
|
|
14479
|
+
range: "^0.1.0-beta.2"
|
|
14138
14480
|
},
|
|
14139
14481
|
{
|
|
14140
14482
|
name: "astro",
|
|
@@ -14176,12 +14518,18 @@ if (!src && !image) {
|
|
|
14176
14518
|
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport InputOtpGroup from "./InputOtpGroup.astro";\nimport InputOtpRoot from "./InputOtpRoot.astro";\nimport InputOtpSeparator from "./InputOtpSeparator.astro";\nimport InputOtpSlot from "./InputOtpSlot.astro";\n\nconst InputOtp = {\n Root: InputOtpRoot,\n Group: InputOtpGroup,\n Separator: InputOtpSeparator,\n Slot: InputOtpSlot,\n};\n\nexport { InputOtp, InputOtpGroup, InputOtpRoot, InputOtpSeparator, InputOtpSlot };\n\nexport default InputOtp;\n\nexport type { InputOtpValueChangeDetails } from "@starwind-ui/runtime";\n',
|
|
14177
14519
|
sourceHash: "sha256:c9f96f451bfb14ccbd2ac3dfeb050185a43eaf0d7cef5717e12a87feb5a9d719",
|
|
14178
14520
|
sourcePath: "packages/astro/src/input-otp/index.ts"
|
|
14521
|
+
},
|
|
14522
|
+
{
|
|
14523
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
14524
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
14525
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
14526
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
14179
14527
|
}
|
|
14180
14528
|
],
|
|
14181
14529
|
packageRequirements: [
|
|
14182
14530
|
{
|
|
14183
14531
|
name: "@starwind-ui/runtime",
|
|
14184
|
-
range: "^0.1.0-beta.
|
|
14532
|
+
range: "^0.1.0-beta.2"
|
|
14185
14533
|
},
|
|
14186
14534
|
{
|
|
14187
14535
|
name: "astro",
|
|
@@ -14194,6 +14542,12 @@ if (!src && !image) {
|
|
|
14194
14542
|
framework: "astro",
|
|
14195
14543
|
version: "0.1.0",
|
|
14196
14544
|
files: [
|
|
14545
|
+
{
|
|
14546
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
14547
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
14548
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
14549
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
14550
|
+
},
|
|
14197
14551
|
{
|
|
14198
14552
|
path: "src/components/starwind-primitives/tooltip/TooltipArrow.astro",
|
|
14199
14553
|
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div">;\n\nconst { ...rest } = Astro.props;\n---\n\n<div data-sw-tooltip-arrow data-state="closed" {...rest}>\n <slot />\n</div>\n',
|
|
@@ -14240,7 +14594,7 @@ if (!src && !image) {
|
|
|
14240
14594
|
packageRequirements: [
|
|
14241
14595
|
{
|
|
14242
14596
|
name: "@starwind-ui/runtime",
|
|
14243
|
-
range: "^0.1.0-beta.
|
|
14597
|
+
range: "^0.1.0-beta.2"
|
|
14244
14598
|
},
|
|
14245
14599
|
{
|
|
14246
14600
|
name: "astro",
|
|
@@ -14253,6 +14607,12 @@ if (!src && !image) {
|
|
|
14253
14607
|
framework: "astro",
|
|
14254
14608
|
version: "0.1.1",
|
|
14255
14609
|
files: [
|
|
14610
|
+
{
|
|
14611
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
14612
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
14613
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
14614
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
14615
|
+
},
|
|
14256
14616
|
{
|
|
14257
14617
|
path: "src/components/starwind-primitives/popover/PopoverArrow.astro",
|
|
14258
14618
|
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div">;\n\nconst { ...rest } = Astro.props;\n---\n\n<div data-sw-popover-arrow {...rest}>\n <slot />\n</div>\n',
|
|
@@ -14329,7 +14689,7 @@ if (!src && !image) {
|
|
|
14329
14689
|
packageRequirements: [
|
|
14330
14690
|
{
|
|
14331
14691
|
name: "@starwind-ui/runtime",
|
|
14332
|
-
range: "^0.1.0-beta.
|
|
14692
|
+
range: "^0.1.0-beta.2"
|
|
14333
14693
|
},
|
|
14334
14694
|
{
|
|
14335
14695
|
name: "astro",
|
|
@@ -14342,6 +14702,12 @@ if (!src && !image) {
|
|
|
14342
14702
|
framework: "astro",
|
|
14343
14703
|
version: "0.1.0",
|
|
14344
14704
|
files: [
|
|
14705
|
+
{
|
|
14706
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
14707
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
14708
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
14709
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
14710
|
+
},
|
|
14345
14711
|
{
|
|
14346
14712
|
path: "src/components/starwind-primitives/preview-card/PreviewCardArrow.astro",
|
|
14347
14713
|
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div">;\n\nconst { ...rest } = Astro.props;\n---\n\n<div data-sw-preview-card-arrow data-state="closed" {...rest}>\n <slot />\n</div>\n',
|
|
@@ -14400,7 +14766,7 @@ if (!src && !image) {
|
|
|
14400
14766
|
packageRequirements: [
|
|
14401
14767
|
{
|
|
14402
14768
|
name: "@starwind-ui/runtime",
|
|
14403
|
-
range: "^0.1.0-beta.
|
|
14769
|
+
range: "^0.1.0-beta.2"
|
|
14404
14770
|
},
|
|
14405
14771
|
{
|
|
14406
14772
|
name: "astro",
|
|
@@ -14460,12 +14826,18 @@ if (!src && !image) {
|
|
|
14460
14826
|
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport DialogBackdrop from "./DialogBackdrop.astro";\nimport DialogClose from "./DialogClose.astro";\nimport DialogDescription from "./DialogDescription.astro";\nimport DialogPopup from "./DialogPopup.astro";\nimport DialogRoot from "./DialogRoot.astro";\nimport DialogTitle from "./DialogTitle.astro";\nimport DialogTrigger from "./DialogTrigger.astro";\n\nconst Dialog = {\n Root: DialogRoot,\n Trigger: DialogTrigger,\n Backdrop: DialogBackdrop,\n Popup: DialogPopup,\n Title: DialogTitle,\n Description: DialogDescription,\n Close: DialogClose,\n};\n\nexport {\n Dialog,\n DialogBackdrop,\n DialogClose,\n DialogDescription,\n DialogPopup,\n DialogRoot,\n DialogTitle,\n DialogTrigger,\n};\n\nexport default Dialog;\n\nexport type { DialogCloseCompleteDetails, DialogOpenChangeDetails } from "@starwind-ui/runtime";\n',
|
|
14461
14827
|
sourceHash: "sha256:5a60646e7a79c48f9f3202a637a5f1acd04e69246575529ce47afeef2e38b674",
|
|
14462
14828
|
sourcePath: "packages/astro/src/dialog/index.ts"
|
|
14829
|
+
},
|
|
14830
|
+
{
|
|
14831
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
14832
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
14833
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
14834
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
14463
14835
|
}
|
|
14464
14836
|
],
|
|
14465
14837
|
packageRequirements: [
|
|
14466
14838
|
{
|
|
14467
14839
|
name: "@starwind-ui/runtime",
|
|
14468
|
-
range: "^0.1.0-beta.
|
|
14840
|
+
range: "^0.1.0-beta.2"
|
|
14469
14841
|
},
|
|
14470
14842
|
{
|
|
14471
14843
|
name: "astro",
|
|
@@ -14537,12 +14909,18 @@ if (!src && !image) {
|
|
|
14537
14909
|
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport AlertDialogBackdrop from "./AlertDialogBackdrop.astro";\nimport AlertDialogClose from "./AlertDialogClose.astro";\nimport AlertDialogDescription from "./AlertDialogDescription.astro";\nimport AlertDialogPopup from "./AlertDialogPopup.astro";\nimport AlertDialogPortal from "./AlertDialogPortal.astro";\nimport AlertDialogRoot from "./AlertDialogRoot.astro";\nimport AlertDialogTitle from "./AlertDialogTitle.astro";\nimport AlertDialogTrigger from "./AlertDialogTrigger.astro";\nimport AlertDialogViewport from "./AlertDialogViewport.astro";\n\nconst AlertDialog = {\n Root: AlertDialogRoot,\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Backdrop: AlertDialogBackdrop,\n Viewport: AlertDialogViewport,\n Popup: AlertDialogPopup,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription,\n Close: AlertDialogClose,\n};\n\nexport {\n AlertDialog,\n AlertDialogBackdrop,\n AlertDialogClose,\n AlertDialogDescription,\n AlertDialogPopup,\n AlertDialogPortal,\n AlertDialogRoot,\n AlertDialogTitle,\n AlertDialogTrigger,\n AlertDialogViewport,\n};\n\nexport default AlertDialog;\n\nexport type {\n AlertDialogCloseCompleteDetails,\n AlertDialogOpenChangeDetails,\n} from "@starwind-ui/runtime";\n',
|
|
14538
14910
|
sourceHash: "sha256:101b8d725dc28883ea06f4668b81cbffa11ee7c2edba98ea9c3002b70461aa0c",
|
|
14539
14911
|
sourcePath: "packages/astro/src/alert-dialog/index.ts"
|
|
14912
|
+
},
|
|
14913
|
+
{
|
|
14914
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
14915
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
14916
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
14917
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
14540
14918
|
}
|
|
14541
14919
|
],
|
|
14542
14920
|
packageRequirements: [
|
|
14543
14921
|
{
|
|
14544
14922
|
name: "@starwind-ui/runtime",
|
|
14545
|
-
range: "^0.1.0-beta.
|
|
14923
|
+
range: "^0.1.0-beta.2"
|
|
14546
14924
|
},
|
|
14547
14925
|
{
|
|
14548
14926
|
name: "astro",
|
|
@@ -14614,12 +14992,18 @@ if (!src && !image) {
|
|
|
14614
14992
|
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport DrawerBackdrop from "./DrawerBackdrop.astro";\nimport DrawerClose from "./DrawerClose.astro";\nimport DrawerDescription from "./DrawerDescription.astro";\nimport DrawerPopup from "./DrawerPopup.astro";\nimport DrawerPortal from "./DrawerPortal.astro";\nimport DrawerRoot from "./DrawerRoot.astro";\nimport DrawerTitle from "./DrawerTitle.astro";\nimport DrawerTrigger from "./DrawerTrigger.astro";\nimport DrawerViewport from "./DrawerViewport.astro";\n\nconst Drawer = {\n Root: DrawerRoot,\n Trigger: DrawerTrigger,\n Portal: DrawerPortal,\n Backdrop: DrawerBackdrop,\n Viewport: DrawerViewport,\n Popup: DrawerPopup,\n Title: DrawerTitle,\n Description: DrawerDescription,\n Close: DrawerClose,\n};\n\nexport {\n Drawer,\n DrawerBackdrop,\n DrawerClose,\n DrawerDescription,\n DrawerPopup,\n DrawerPortal,\n DrawerRoot,\n DrawerTitle,\n DrawerTrigger,\n DrawerViewport,\n};\n\nexport default Drawer;\n\nexport type { DrawerCloseCompleteDetails, DrawerOpenChangeDetails } from "@starwind-ui/runtime";\n',
|
|
14615
14993
|
sourceHash: "sha256:64ca75adbaf283938be9ed5ebd472e4919f66ce0a6e5c9e5f0436ca633b18536",
|
|
14616
14994
|
sourcePath: "packages/astro/src/drawer/index.ts"
|
|
14995
|
+
},
|
|
14996
|
+
{
|
|
14997
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
14998
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
14999
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
15000
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
14617
15001
|
}
|
|
14618
15002
|
],
|
|
14619
15003
|
packageRequirements: [
|
|
14620
15004
|
{
|
|
14621
15005
|
name: "@starwind-ui/runtime",
|
|
14622
|
-
range: "^0.1.0-beta.
|
|
15006
|
+
range: "^0.1.0-beta.2"
|
|
14623
15007
|
},
|
|
14624
15008
|
{
|
|
14625
15009
|
name: "astro",
|
|
@@ -14667,12 +15051,18 @@ if (!src && !image) {
|
|
|
14667
15051
|
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport DropzoneFilesList from "./DropzoneFilesList.astro";\nimport DropzoneInput from "./DropzoneInput.astro";\nimport DropzoneLoadingIndicator from "./DropzoneLoadingIndicator.astro";\nimport DropzoneRoot from "./DropzoneRoot.astro";\nimport DropzoneUploadIndicator from "./DropzoneUploadIndicator.astro";\n\nconst Dropzone = {\n Root: DropzoneRoot,\n Input: DropzoneInput,\n UploadIndicator: DropzoneUploadIndicator,\n LoadingIndicator: DropzoneLoadingIndicator,\n FilesList: DropzoneFilesList,\n};\n\nexport {\n Dropzone,\n DropzoneFilesList,\n DropzoneInput,\n DropzoneLoadingIndicator,\n DropzoneRoot,\n DropzoneUploadIndicator,\n};\n\nexport default Dropzone;\n\nexport type { DropzoneFilesChangeDetails } from "@starwind-ui/runtime";\n',
|
|
14668
15052
|
sourceHash: "sha256:4b71b12551996c34612324b85deb989dd30e1d3278e9c6acef8e7e0fa78dbe39",
|
|
14669
15053
|
sourcePath: "packages/astro/src/dropzone/index.ts"
|
|
15054
|
+
},
|
|
15055
|
+
{
|
|
15056
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
15057
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
15058
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
15059
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
14670
15060
|
}
|
|
14671
15061
|
],
|
|
14672
15062
|
packageRequirements: [
|
|
14673
15063
|
{
|
|
14674
15064
|
name: "@starwind-ui/runtime",
|
|
14675
|
-
range: "^0.1.0-beta.
|
|
15065
|
+
range: "^0.1.0-beta.2"
|
|
14676
15066
|
},
|
|
14677
15067
|
{
|
|
14678
15068
|
name: "astro",
|
|
@@ -14685,6 +15075,12 @@ if (!src && !image) {
|
|
|
14685
15075
|
framework: "astro",
|
|
14686
15076
|
version: "0.1.1",
|
|
14687
15077
|
files: [
|
|
15078
|
+
{
|
|
15079
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
15080
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
15081
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
15082
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
15083
|
+
},
|
|
14688
15084
|
{
|
|
14689
15085
|
path: "src/components/starwind-primitives/menu/MenuCheckboxItem.astro",
|
|
14690
15086
|
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = Omit<HTMLAttributes<"div">, "aria-checked" | "role"> & {\n checked?: boolean;\n defaultChecked?: boolean;\n closeOnClick?: boolean;\n disabled?: boolean;\n};\n\nconst {\n checked,\n defaultChecked = false,\n closeOnClick = false,\n disabled = false,\n ...rest\n} = Astro.props;\n\nconst initialChecked = checked ?? defaultChecked;\n---\n\n<div\n data-sw-menu-checkbox-item\n data-default-checked={initialChecked ? "true" : undefined}\n data-close-on-click={closeOnClick ? "true" : undefined}\n role="menuitemcheckbox"\n aria-checked={initialChecked ? "true" : "false"}\n aria-disabled={disabled ? "true" : undefined}\n data-checked={initialChecked ? "" : undefined}\n data-disabled={disabled ? "" : undefined}\n data-unchecked={!initialChecked ? "" : undefined}\n tabindex="0"\n {...rest}\n>\n <slot />\n</div>\n',
|
|
@@ -14803,7 +15199,7 @@ if (!src && !image) {
|
|
|
14803
15199
|
packageRequirements: [
|
|
14804
15200
|
{
|
|
14805
15201
|
name: "@starwind-ui/runtime",
|
|
14806
|
-
range: "^0.1.0-beta.
|
|
15202
|
+
range: "^0.1.0-beta.2"
|
|
14807
15203
|
},
|
|
14808
15204
|
{
|
|
14809
15205
|
name: "astro",
|
|
@@ -14816,6 +15212,12 @@ if (!src && !image) {
|
|
|
14816
15212
|
framework: "astro",
|
|
14817
15213
|
version: "0.1.0",
|
|
14818
15214
|
files: [
|
|
15215
|
+
{
|
|
15216
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
15217
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
15218
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
15219
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
15220
|
+
},
|
|
14819
15221
|
{
|
|
14820
15222
|
path: "src/components/starwind-primitives/navigation-menu/NavigationMenuArrow.astro",
|
|
14821
15223
|
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div">;\n\nconst { ...rest } = Astro.props;\n---\n\n<div data-sw-nav-menu-arrow aria-hidden="true" {...rest}>\n <slot />\n</div>\n',
|
|
@@ -14898,7 +15300,7 @@ if (!src && !image) {
|
|
|
14898
15300
|
packageRequirements: [
|
|
14899
15301
|
{
|
|
14900
15302
|
name: "@starwind-ui/runtime",
|
|
14901
|
-
range: "^0.1.0-beta.
|
|
15303
|
+
range: "^0.1.0-beta.2"
|
|
14902
15304
|
},
|
|
14903
15305
|
{
|
|
14904
15306
|
name: "astro",
|
|
@@ -14928,12 +15330,132 @@ if (!src && !image) {
|
|
|
14928
15330
|
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport {\n MenuCheckboxItem as ContextMenuCheckboxItem,\n MenuCheckboxItemIndicator as ContextMenuCheckboxItemIndicator,\n MenuGroup as ContextMenuGroup,\n MenuItem as ContextMenuItem,\n MenuLabel as ContextMenuLabel,\n MenuLinkItem as ContextMenuLinkItem,\n MenuPopup as ContextMenuPopup,\n MenuPortal as ContextMenuPortal,\n MenuPositioner as ContextMenuPositioner,\n MenuRadioGroup as ContextMenuRadioGroup,\n MenuRadioItem as ContextMenuRadioItem,\n MenuRadioItemIndicator as ContextMenuRadioItemIndicator,\n MenuSeparator as ContextMenuSeparator,\n MenuShortcut as ContextMenuShortcut,\n MenuSubmenuRoot as ContextMenuSubmenuRoot,\n MenuSubmenuTrigger as ContextMenuSubmenuTrigger,\n} from "../menu";\nimport ContextMenuRoot from "./ContextMenuRoot.astro";\nimport ContextMenuTrigger from "./ContextMenuTrigger.astro";\n\nconst ContextMenu = {\n Root: ContextMenuRoot,\n Trigger: ContextMenuTrigger,\n Portal: ContextMenuPortal,\n Positioner: ContextMenuPositioner,\n Popup: ContextMenuPopup,\n Item: ContextMenuItem,\n LinkItem: ContextMenuLinkItem,\n CheckboxItem: ContextMenuCheckboxItem,\n CheckboxItemIndicator: ContextMenuCheckboxItemIndicator,\n RadioGroup: ContextMenuRadioGroup,\n RadioItem: ContextMenuRadioItem,\n RadioItemIndicator: ContextMenuRadioItemIndicator,\n Group: ContextMenuGroup,\n Label: ContextMenuLabel,\n Separator: ContextMenuSeparator,\n Shortcut: ContextMenuShortcut,\n SubmenuRoot: ContextMenuSubmenuRoot,\n SubmenuTrigger: ContextMenuSubmenuTrigger,\n};\n\nexport {\n ContextMenu,\n ContextMenuCheckboxItem,\n ContextMenuCheckboxItemIndicator,\n ContextMenuGroup,\n ContextMenuItem,\n ContextMenuLabel,\n ContextMenuLinkItem,\n ContextMenuPopup,\n ContextMenuPortal,\n ContextMenuPositioner,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuRadioItemIndicator,\n ContextMenuRoot,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuSubmenuRoot,\n ContextMenuSubmenuTrigger,\n ContextMenuTrigger,\n};\n\nexport default ContextMenu;\n\nexport type {\n ContextMenuCloseCompleteDetails,\n ContextMenuOpenChangeDetails,\n MenuCheckedChangeDetails,\n MenuValueChangeDetails,\n} from "@starwind-ui/runtime";\n',
|
|
14929
15331
|
sourceHash: "sha256:7c52c85ac79ef648e1c48d2f8def0a266175a1deff39e09fadfc429dd043d475",
|
|
14930
15332
|
sourcePath: "packages/astro/src/context-menu/index.ts"
|
|
15333
|
+
},
|
|
15334
|
+
{
|
|
15335
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
15336
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
15337
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
15338
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
15339
|
+
},
|
|
15340
|
+
{
|
|
15341
|
+
path: "src/components/starwind-primitives/menu/MenuCheckboxItem.astro",
|
|
15342
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = Omit<HTMLAttributes<"div">, "aria-checked" | "role"> & {\n checked?: boolean;\n defaultChecked?: boolean;\n closeOnClick?: boolean;\n disabled?: boolean;\n};\n\nconst {\n checked,\n defaultChecked = false,\n closeOnClick = false,\n disabled = false,\n ...rest\n} = Astro.props;\n\nconst initialChecked = checked ?? defaultChecked;\n---\n\n<div\n data-sw-menu-checkbox-item\n data-default-checked={initialChecked ? "true" : undefined}\n data-close-on-click={closeOnClick ? "true" : undefined}\n role="menuitemcheckbox"\n aria-checked={initialChecked ? "true" : "false"}\n aria-disabled={disabled ? "true" : undefined}\n data-checked={initialChecked ? "" : undefined}\n data-disabled={disabled ? "" : undefined}\n data-unchecked={!initialChecked ? "" : undefined}\n tabindex="0"\n {...rest}\n>\n <slot />\n</div>\n',
|
|
15343
|
+
sourceHash: "sha256:30ca05dd5a90dadeb2d685d9fc335a169279e1f328498c61eb4c1f61dcd76b93",
|
|
15344
|
+
sourcePath: "packages/astro/src/menu/MenuCheckboxItem.astro"
|
|
15345
|
+
},
|
|
15346
|
+
{
|
|
15347
|
+
path: "src/components/starwind-primitives/menu/MenuCheckboxItemIndicator.astro",
|
|
15348
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"span">;\n\nconst { ...rest } = Astro.props;\n---\n\n<span data-sw-menu-checkbox-item-indicator aria-hidden="true" data-state="unchecked" {...rest}>\n <slot />\n</span>\n',
|
|
15349
|
+
sourceHash: "sha256:5e0b73cf71ae58dbc7022557eab93783b84cde4b7d33a30a9ab0550332b25a08",
|
|
15350
|
+
sourcePath: "packages/astro/src/menu/MenuCheckboxItemIndicator.astro"
|
|
15351
|
+
},
|
|
15352
|
+
{
|
|
15353
|
+
path: "src/components/starwind-primitives/menu/MenuGroup.astro",
|
|
15354
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div">;\n\nconst { ...rest } = Astro.props;\n---\n\n<div data-sw-menu-group role="group" {...rest}>\n <slot />\n</div>\n',
|
|
15355
|
+
sourceHash: "sha256:a270601b56cb066189bb20c903c7b22e0412864d9bb5d5e20ac4e6bf817a04dd",
|
|
15356
|
+
sourcePath: "packages/astro/src/menu/MenuGroup.astro"
|
|
15357
|
+
},
|
|
15358
|
+
{
|
|
15359
|
+
path: "src/components/starwind-primitives/menu/MenuItem.astro",
|
|
15360
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div"> & {\n disabled?: boolean;\n closeOnClick?: boolean;\n};\n\nconst { disabled = false, closeOnClick = true, ...rest } = Astro.props;\n---\n\n<div\n data-sw-menu-item\n role="menuitem"\n tabindex="0"\n data-close-on-click={closeOnClick ? undefined : "false"}\n aria-disabled={disabled ? "true" : undefined}\n data-disabled={disabled ? "" : undefined}\n {...rest}\n>\n <slot />\n</div>\n',
|
|
15361
|
+
sourceHash: "sha256:33c160ce05e58e0a57af1a0121dd2ac4fc966fbccbed5090eb8e1b1459931b8e",
|
|
15362
|
+
sourcePath: "packages/astro/src/menu/MenuItem.astro"
|
|
15363
|
+
},
|
|
15364
|
+
{
|
|
15365
|
+
path: "src/components/starwind-primitives/menu/MenuLabel.astro",
|
|
15366
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div">;\n\nconst { ...rest } = Astro.props;\n---\n\n<div data-sw-menu-label {...rest}>\n <slot />\n</div>\n',
|
|
15367
|
+
sourceHash: "sha256:25b00d1bcf98a79790b4828b22233377bcae69ca8ebb8ba4475cea5be109adbe",
|
|
15368
|
+
sourcePath: "packages/astro/src/menu/MenuLabel.astro"
|
|
15369
|
+
},
|
|
15370
|
+
{
|
|
15371
|
+
path: "src/components/starwind-primitives/menu/MenuLinkItem.astro",
|
|
15372
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"a"> & {\n disabled?: boolean;\n closeOnClick?: boolean;\n};\n\nconst { disabled = false, href, closeOnClick = false, ...rest } = Astro.props;\n---\n\n<a\n data-sw-menu-link-item\n href={disabled ? undefined : href}\n role="menuitem"\n tabindex="0"\n data-close-on-click={closeOnClick ? "true" : undefined}\n aria-disabled={disabled ? "true" : undefined}\n data-disabled={disabled ? "" : undefined}\n {...rest}\n>\n <slot />\n</a>\n',
|
|
15373
|
+
sourceHash: "sha256:3e4fafccc2403ca58e90da059c2351ee6863c6b11d37d3ad32220b9564ef9ab7",
|
|
15374
|
+
sourcePath: "packages/astro/src/menu/MenuLinkItem.astro"
|
|
15375
|
+
},
|
|
15376
|
+
{
|
|
15377
|
+
path: "src/components/starwind-primitives/menu/MenuPopup.astro",
|
|
15378
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div"> & {\n side?: "top" | "right" | "bottom" | "left";\n align?: "start" | "center" | "end";\n sideOffset?: number;\n avoidCollisions?: boolean;\n};\n\nconst {\n side = "bottom",\n align = "start",\n sideOffset = 4,\n avoidCollisions = true,\n ...rest\n} = Astro.props;\n---\n\n<div\n data-sw-menu-popup\n role="menu"\n tabindex="-1"\n data-state="closed"\n data-side={side}\n data-align={align}\n data-side-offset={sideOffset}\n data-avoid-collisions={avoidCollisions ? "true" : "false"}\n hidden\n {...rest}\n>\n <slot />\n</div>\n',
|
|
15379
|
+
sourceHash: "sha256:a9bc1f222c8d75b76e565038ea8d1128a03fbee99c829da27afa14a7a9ed63b8",
|
|
15380
|
+
sourcePath: "packages/astro/src/menu/MenuPopup.astro"
|
|
15381
|
+
},
|
|
15382
|
+
{
|
|
15383
|
+
path: "src/components/starwind-primitives/menu/MenuPortal.astro",
|
|
15384
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div">;\n\nconst { ...rest } = Astro.props;\n---\n\n<div data-sw-menu-portal {...rest}>\n <slot />\n</div>\n',
|
|
15385
|
+
sourceHash: "sha256:a1cc6da5aa2d9111610ef0537ccc860928dc3c214f78e4a961b5356469dab6ff",
|
|
15386
|
+
sourcePath: "packages/astro/src/menu/MenuPortal.astro"
|
|
15387
|
+
},
|
|
15388
|
+
{
|
|
15389
|
+
path: "src/components/starwind-primitives/menu/MenuPositioner.astro",
|
|
15390
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div"> & {\n side?: "top" | "right" | "bottom" | "left";\n align?: "start" | "center" | "end";\n sideOffset?: number;\n avoidCollisions?: boolean;\n};\n\nconst {\n side = "bottom",\n align = "start",\n sideOffset = 4,\n avoidCollisions = true,\n ...rest\n} = Astro.props;\n---\n\n<div\n data-sw-menu-positioner\n data-state="closed"\n data-side={side}\n data-align={align}\n data-side-offset={sideOffset}\n data-avoid-collisions={avoidCollisions ? "true" : "false"}\n {...rest}\n>\n <slot />\n</div>\n',
|
|
15391
|
+
sourceHash: "sha256:d2493a65d790abf56257b042a51be22945379731d9be9572b9e0cc8a6e96f4ca",
|
|
15392
|
+
sourcePath: "packages/astro/src/menu/MenuPositioner.astro"
|
|
15393
|
+
},
|
|
15394
|
+
{
|
|
15395
|
+
path: "src/components/starwind-primitives/menu/MenuRadioGroup.astro",
|
|
15396
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div"> & {\n value?: string;\n defaultValue?: string;\n};\n\nconst { value, defaultValue, ...rest } = Astro.props;\n\nconst initialValue = value ?? defaultValue;\n---\n\n<div data-sw-menu-radio-group role="group" data-value={initialValue} {...rest}>\n <slot />\n</div>\n',
|
|
15397
|
+
sourceHash: "sha256:e5e250c32af68a5953253dc6aaebb5891d2596e560e80d1d1c298933fbb878d7",
|
|
15398
|
+
sourcePath: "packages/astro/src/menu/MenuRadioGroup.astro"
|
|
15399
|
+
},
|
|
15400
|
+
{
|
|
15401
|
+
path: "src/components/starwind-primitives/menu/MenuRadioItem.astro",
|
|
15402
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = Omit<HTMLAttributes<"div">, "aria-checked" | "role"> & {\n value: string;\n checked?: boolean;\n defaultChecked?: boolean;\n closeOnClick?: boolean;\n disabled?: boolean;\n};\n\nconst {\n value,\n checked,\n defaultChecked = false,\n closeOnClick = false,\n disabled = false,\n ...rest\n} = Astro.props;\n\nconst initialChecked = checked ?? defaultChecked;\n---\n\n<div\n data-sw-menu-radio-item\n data-value={value}\n data-default-checked={initialChecked ? "true" : undefined}\n data-close-on-click={closeOnClick ? "true" : undefined}\n role="menuitemradio"\n aria-checked={initialChecked ? "true" : "false"}\n aria-disabled={disabled ? "true" : undefined}\n data-checked={initialChecked ? "" : undefined}\n data-disabled={disabled ? "" : undefined}\n data-unchecked={!initialChecked ? "" : undefined}\n tabindex="0"\n {...rest}\n>\n <slot />\n</div>\n',
|
|
15403
|
+
sourceHash: "sha256:aaccb5255f05622b7704d6b43aa8eb3e384a62e9db599c7afc3ecc6d28916338",
|
|
15404
|
+
sourcePath: "packages/astro/src/menu/MenuRadioItem.astro"
|
|
15405
|
+
},
|
|
15406
|
+
{
|
|
15407
|
+
path: "src/components/starwind-primitives/menu/MenuRadioItemIndicator.astro",
|
|
15408
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"span">;\n\nconst { ...rest } = Astro.props;\n---\n\n<span data-sw-menu-radio-item-indicator aria-hidden="true" data-state="unchecked" {...rest}>\n <slot />\n</span>\n',
|
|
15409
|
+
sourceHash: "sha256:cde94696f33cb86eb78bec8ea34519c134eb32a054b7bcac4432dc23f4fc6808",
|
|
15410
|
+
sourcePath: "packages/astro/src/menu/MenuRadioItemIndicator.astro"
|
|
15411
|
+
},
|
|
15412
|
+
{
|
|
15413
|
+
path: "src/components/starwind-primitives/menu/MenuRoot.astro",
|
|
15414
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div"> & {\n defaultOpen?: boolean;\n disabled?: boolean;\n modal?: boolean;\n openOnHover?: boolean;\n closeDelay?: number;\n};\n\nconst {\n defaultOpen = false,\n disabled = false,\n modal = false,\n openOnHover = false,\n closeDelay = 200,\n ...rest\n} = Astro.props;\n---\n\n<div\n data-sw-menu\n data-default-open={defaultOpen ? "true" : undefined}\n data-disabled={disabled ? "" : undefined}\n data-modal={modal ? "true" : "false"}\n data-open-on-hover={openOnHover ? "true" : undefined}\n data-close-delay={closeDelay}\n data-state={defaultOpen ? "open" : "closed"}\n {...rest}\n>\n <slot />\n</div>\n\n<script>\n import { createMenu } from "@starwind-ui/runtime/menu";\n import { registerAstroControllerLifecycle } from "../internal/controller-lifecycle";\n\n const menuInstances = new Set<ReturnType<typeof createMenu>>();\n\n const getInitCandidates = (event: Event | undefined, selector: string): HTMLElement[] => {\n const initRoot =\n event?.type === "starwind:init" && event instanceof CustomEvent\n ? event.detail?.root\n : undefined;\n const scopedRoot: Document | DocumentFragment | Element = isQueryableRoot(initRoot)\n ? initRoot\n : document;\n const candidates = Array.from(scopedRoot.querySelectorAll<HTMLElement>(selector));\n\n if (scopedRoot instanceof Element && scopedRoot.matches(selector)) {\n candidates.unshift(scopedRoot as HTMLElement);\n }\n\n return candidates;\n };\n\n const isQueryableRoot = (value: unknown): value is Document | DocumentFragment | Element =>\n value instanceof Document || value instanceof DocumentFragment || value instanceof Element;\n\n const setupMenus = (event?: Event) => {\n getInitCandidates(event, "[data-sw-menu]").forEach((root) => {\n if (root.hasAttribute("data-sw-context-menu")) return;\n menuInstances.add(createMenu(root));\n });\n };\n\n const destroyMenus = () => {\n menuInstances.forEach((instance) => instance.destroy());\n menuInstances.clear();\n };\n\n registerAstroControllerLifecycle("MenuRoot", setupMenus, destroyMenus);\n</script>\n',
|
|
15415
|
+
sourceHash: "sha256:b1ec247194d07ec7f6641a35c0b8a9c743bad56f35302fba83b1d2e228df4f18",
|
|
15416
|
+
sourcePath: "packages/astro/src/menu/MenuRoot.astro"
|
|
15417
|
+
},
|
|
15418
|
+
{
|
|
15419
|
+
path: "src/components/starwind-primitives/menu/MenuSeparator.astro",
|
|
15420
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div">;\n\nconst { ...rest } = Astro.props;\n---\n\n<div data-sw-menu-separator role="separator" aria-orientation="horizontal" {...rest}></div>\n',
|
|
15421
|
+
sourceHash: "sha256:18944c79760d054e696447845984a8be7c17ba03ac12ed932e60ea857e549421",
|
|
15422
|
+
sourcePath: "packages/astro/src/menu/MenuSeparator.astro"
|
|
15423
|
+
},
|
|
15424
|
+
{
|
|
15425
|
+
path: "src/components/starwind-primitives/menu/MenuShortcut.astro",
|
|
15426
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"span">;\n\nconst { ...rest } = Astro.props;\n---\n\n<span data-sw-menu-shortcut {...rest}>\n <slot />\n</span>\n',
|
|
15427
|
+
sourceHash: "sha256:001f18975506096dbd6e228bf08e327c4bd67b8f1d6bec41b0bc7e397cdf67c4",
|
|
15428
|
+
sourcePath: "packages/astro/src/menu/MenuShortcut.astro"
|
|
15429
|
+
},
|
|
15430
|
+
{
|
|
15431
|
+
path: "src/components/starwind-primitives/menu/MenuSubmenuRoot.astro",
|
|
15432
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div"> & {\n closeDelay?: number;\n};\n\nconst { closeDelay = 200, ...rest } = Astro.props;\n---\n\n<div data-sw-menu-submenu-root data-close-delay={closeDelay} data-state="closed" {...rest}>\n <slot />\n</div>\n',
|
|
15433
|
+
sourceHash: "sha256:86c1c6d3b86372ea4af059960d1348c8cd75ac972dbb2e7d0c31eb3c322006b3",
|
|
15434
|
+
sourcePath: "packages/astro/src/menu/MenuSubmenuRoot.astro"
|
|
15435
|
+
},
|
|
15436
|
+
{
|
|
15437
|
+
path: "src/components/starwind-primitives/menu/MenuSubmenuTrigger.astro",
|
|
15438
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div"> & {\n disabled?: boolean;\n};\n\nconst { disabled = false, ...rest } = Astro.props;\n---\n\n<div\n data-sw-menu-submenu-trigger\n role="menuitem"\n aria-haspopup="menu"\n aria-expanded="false"\n aria-disabled={disabled ? "true" : undefined}\n data-disabled={disabled ? "" : undefined}\n data-state="closed"\n tabindex="0"\n {...rest}\n>\n <slot />\n</div>\n',
|
|
15439
|
+
sourceHash: "sha256:180bfca69a1e4c1f886630f43c0b4fc8a2e31c7137843a0490f07ce87b02a224",
|
|
15440
|
+
sourcePath: "packages/astro/src/menu/MenuSubmenuTrigger.astro"
|
|
15441
|
+
},
|
|
15442
|
+
{
|
|
15443
|
+
path: "src/components/starwind-primitives/menu/MenuTrigger.astro",
|
|
15444
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"button"> & {\n asChild?: boolean;\n};\n\nconst { asChild = false, ...rest } = Astro.props;\n---\n\n{\n asChild ? (\n <div\n data-sw-menu-trigger\n data-as-child\n aria-haspopup="menu"\n aria-expanded="false"\n data-state="closed"\n {...rest}\n >\n <slot />\n </div>\n ) : (\n <button\n type="button"\n data-sw-menu-trigger\n aria-haspopup="menu"\n aria-expanded="false"\n data-state="closed"\n {...rest}\n >\n <slot />\n </button>\n )\n}\n',
|
|
15445
|
+
sourceHash: "sha256:99a66fd89b74a56107096bd920bb7d3033ea5970726d09d72011a7124da54a8d",
|
|
15446
|
+
sourcePath: "packages/astro/src/menu/MenuTrigger.astro"
|
|
15447
|
+
},
|
|
15448
|
+
{
|
|
15449
|
+
path: "src/components/starwind-primitives/menu/index.ts",
|
|
15450
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport MenuCheckboxItem from "./MenuCheckboxItem.astro";\nimport MenuCheckboxItemIndicator from "./MenuCheckboxItemIndicator.astro";\nimport MenuGroup from "./MenuGroup.astro";\nimport MenuItem from "./MenuItem.astro";\nimport MenuLabel from "./MenuLabel.astro";\nimport MenuLinkItem from "./MenuLinkItem.astro";\nimport MenuPopup from "./MenuPopup.astro";\nimport MenuPortal from "./MenuPortal.astro";\nimport MenuPositioner from "./MenuPositioner.astro";\nimport MenuRadioGroup from "./MenuRadioGroup.astro";\nimport MenuRadioItem from "./MenuRadioItem.astro";\nimport MenuRadioItemIndicator from "./MenuRadioItemIndicator.astro";\nimport MenuRoot from "./MenuRoot.astro";\nimport MenuSeparator from "./MenuSeparator.astro";\nimport MenuShortcut from "./MenuShortcut.astro";\nimport MenuSubmenuRoot from "./MenuSubmenuRoot.astro";\nimport MenuSubmenuTrigger from "./MenuSubmenuTrigger.astro";\nimport MenuTrigger from "./MenuTrigger.astro";\n\nconst Menu = {\n Root: MenuRoot,\n Trigger: MenuTrigger,\n Portal: MenuPortal,\n Positioner: MenuPositioner,\n Popup: MenuPopup,\n Item: MenuItem,\n LinkItem: MenuLinkItem,\n CheckboxItem: MenuCheckboxItem,\n CheckboxItemIndicator: MenuCheckboxItemIndicator,\n RadioGroup: MenuRadioGroup,\n RadioItem: MenuRadioItem,\n RadioItemIndicator: MenuRadioItemIndicator,\n Group: MenuGroup,\n Label: MenuLabel,\n Separator: MenuSeparator,\n Shortcut: MenuShortcut,\n SubmenuRoot: MenuSubmenuRoot,\n SubmenuTrigger: MenuSubmenuTrigger,\n};\n\nexport {\n Menu,\n MenuCheckboxItem,\n MenuCheckboxItemIndicator,\n MenuGroup,\n MenuItem,\n MenuLabel,\n MenuLinkItem,\n MenuPopup,\n MenuPortal,\n MenuPositioner,\n MenuRadioGroup,\n MenuRadioItem,\n MenuRadioItemIndicator,\n MenuRoot,\n MenuSeparator,\n MenuShortcut,\n MenuSubmenuRoot,\n MenuSubmenuTrigger,\n MenuTrigger,\n};\n\nexport default Menu;\n\nexport type {\n MenuCheckedChangeDetails,\n MenuCloseCompleteDetails,\n MenuOpenChangeDetails,\n MenuValueChangeDetails,\n} from "@starwind-ui/runtime";\n',
|
|
15451
|
+
sourceHash: "sha256:29ca5909db26a42783ba3ae919b41b623561a49ebf0c967c0aee75f4627e23bb",
|
|
15452
|
+
sourcePath: "packages/astro/src/menu/index.ts"
|
|
14931
15453
|
}
|
|
14932
15454
|
],
|
|
14933
15455
|
packageRequirements: [
|
|
14934
15456
|
{
|
|
14935
15457
|
name: "@starwind-ui/runtime",
|
|
14936
|
-
range: "^0.1.0-beta.
|
|
15458
|
+
range: "^0.1.0-beta.2"
|
|
14937
15459
|
},
|
|
14938
15460
|
{
|
|
14939
15461
|
name: "astro",
|
|
@@ -14946,6 +15468,12 @@ if (!src && !image) {
|
|
|
14946
15468
|
framework: "astro",
|
|
14947
15469
|
version: "0.1.2",
|
|
14948
15470
|
files: [
|
|
15471
|
+
{
|
|
15472
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
15473
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
15474
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
15475
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
15476
|
+
},
|
|
14949
15477
|
{
|
|
14950
15478
|
path: "src/components/starwind-primitives/select/SelectGroup.astro",
|
|
14951
15479
|
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div">;\n\nconst { ...rest } = Astro.props;\n---\n\n<div data-sw-select-group role="group" {...rest}>\n <slot />\n</div>\n',
|
|
@@ -15058,7 +15586,7 @@ if (!src && !image) {
|
|
|
15058
15586
|
packageRequirements: [
|
|
15059
15587
|
{
|
|
15060
15588
|
name: "@starwind-ui/runtime",
|
|
15061
|
-
range: "^0.1.0-beta.
|
|
15589
|
+
range: "^0.1.0-beta.2"
|
|
15062
15590
|
},
|
|
15063
15591
|
{
|
|
15064
15592
|
name: "astro",
|
|
@@ -15071,6 +15599,12 @@ if (!src && !image) {
|
|
|
15071
15599
|
framework: "astro",
|
|
15072
15600
|
version: "0.1.0",
|
|
15073
15601
|
files: [
|
|
15602
|
+
{
|
|
15603
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
15604
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
15605
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
15606
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
15607
|
+
},
|
|
15074
15608
|
{
|
|
15075
15609
|
path: "src/components/starwind-primitives/sidebar/Sidebar.astro",
|
|
15076
15610
|
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"div"> & {\n side?: "left" | "right";\n variant?: "sidebar" | "floating" | "inset";\n collapsible?: "offcanvas" | "icon";\n};\n\nconst { side = "left", variant = "sidebar", collapsible = "offcanvas", ...rest } = Astro.props;\n---\n\n<div\n data-sw-sidebar\n data-state="expanded"\n data-collapsible=""\n data-collapsible-mode={collapsible}\n data-variant={variant}\n data-side={side}\n {...rest}\n>\n <slot />\n</div>\n',
|
|
@@ -15111,7 +15645,7 @@ if (!src && !image) {
|
|
|
15111
15645
|
packageRequirements: [
|
|
15112
15646
|
{
|
|
15113
15647
|
name: "@starwind-ui/runtime",
|
|
15114
|
-
range: "^0.1.0-beta.
|
|
15648
|
+
range: "^0.1.0-beta.2"
|
|
15115
15649
|
},
|
|
15116
15650
|
{
|
|
15117
15651
|
name: "astro",
|
|
@@ -15243,12 +15777,191 @@ if (!src && !image) {
|
|
|
15243
15777
|
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport ComboboxClear from "./ComboboxClear.astro";\nimport ComboboxEmpty from "./ComboboxEmpty.astro";\nimport ComboboxGroup from "./ComboboxGroup.astro";\nimport ComboboxGroupLabel from "./ComboboxGroupLabel.astro";\nimport ComboboxIcon from "./ComboboxIcon.astro";\nimport ComboboxInput from "./ComboboxInput.astro";\nimport ComboboxInputGroup from "./ComboboxInputGroup.astro";\nimport ComboboxItem from "./ComboboxItem.astro";\nimport ComboboxItemIndicator from "./ComboboxItemIndicator.astro";\nimport ComboboxItemText from "./ComboboxItemText.astro";\nimport ComboboxLabel from "./ComboboxLabel.astro";\nimport ComboboxList from "./ComboboxList.astro";\nimport ComboboxPopup from "./ComboboxPopup.astro";\nimport ComboboxPortal from "./ComboboxPortal.astro";\nimport ComboboxPositioner from "./ComboboxPositioner.astro";\nimport ComboboxRoot from "./ComboboxRoot.astro";\nimport ComboboxSeparator from "./ComboboxSeparator.astro";\nimport ComboboxTrigger from "./ComboboxTrigger.astro";\nimport ComboboxValue from "./ComboboxValue.astro";\n\nconst Combobox = {\n Root: ComboboxRoot,\n Label: ComboboxLabel,\n InputGroup: ComboboxInputGroup,\n Input: ComboboxInput,\n Trigger: ComboboxTrigger,\n Icon: ComboboxIcon,\n Clear: ComboboxClear,\n Value: ComboboxValue,\n Portal: ComboboxPortal,\n Positioner: ComboboxPositioner,\n Popup: ComboboxPopup,\n Empty: ComboboxEmpty,\n List: ComboboxList,\n Group: ComboboxGroup,\n GroupLabel: ComboboxGroupLabel,\n Item: ComboboxItem,\n ItemText: ComboboxItemText,\n ItemIndicator: ComboboxItemIndicator,\n Separator: ComboboxSeparator,\n};\n\nexport {\n Combobox,\n ComboboxClear,\n ComboboxEmpty,\n ComboboxGroup,\n ComboboxGroupLabel,\n ComboboxIcon,\n ComboboxInput,\n ComboboxInputGroup,\n ComboboxItem,\n ComboboxItemIndicator,\n ComboboxItemText,\n ComboboxLabel,\n ComboboxList,\n ComboboxPopup,\n ComboboxPortal,\n ComboboxPositioner,\n ComboboxRoot,\n ComboboxSeparator,\n ComboboxTrigger,\n ComboboxValue,\n};\n\nexport default Combobox;\n\nexport type {\n ComboboxInputValueChangeDetails,\n ComboboxOpenChangeDetails,\n ComboboxValueChangeDetails,\n} from "@starwind-ui/runtime";\n',
|
|
15244
15778
|
sourceHash: "sha256:9f9ec2714d78f1b53774bf33cd41b7b917c4492d9eae76669a430e49e88587ad",
|
|
15245
15779
|
sourcePath: "packages/astro/src/combobox/index.ts"
|
|
15780
|
+
},
|
|
15781
|
+
{
|
|
15782
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
15783
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
15784
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
15785
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
15246
15786
|
}
|
|
15247
15787
|
],
|
|
15248
15788
|
packageRequirements: [
|
|
15249
15789
|
{
|
|
15250
15790
|
name: "@starwind-ui/runtime",
|
|
15251
|
-
range: "^0.1.0-beta.
|
|
15791
|
+
range: "^0.1.0-beta.2"
|
|
15792
|
+
},
|
|
15793
|
+
{
|
|
15794
|
+
name: "astro",
|
|
15795
|
+
range: ">=5"
|
|
15796
|
+
}
|
|
15797
|
+
]
|
|
15798
|
+
},
|
|
15799
|
+
{
|
|
15800
|
+
component: "color-picker",
|
|
15801
|
+
framework: "astro",
|
|
15802
|
+
version: "0.1.0",
|
|
15803
|
+
files: [
|
|
15804
|
+
{
|
|
15805
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerArea.astro",
|
|
15806
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type {\n ColorPickerChannel,\n ColorPickerInitialPartProjection,\n} from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"div"> {\n initial?: ColorPickerInitialPartProjection;\n xChannel?: ColorPickerChannel;\n yChannel?: ColorPickerChannel;\n}\nconst {\n initial: suppliedInitial,\n xChannel = "saturation",\n yChannel = "brightness",\n style,\n ...rest\n} = Astro.props;\nconst initial = assertColorPickerInitialPart("area", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<div\n {...rest}\n data-x-channel={initial ? undefined : xChannel}\n data-y-channel={initial ? undefined : yChannel}\n {...initial?.attributes}\n style={mergedStyle}\n data-sw-color-picker-area\n>\n <slot />\n</div>\n',
|
|
15807
|
+
sourceHash: "sha256:94ce56fea56c0e1b4a4e8fba210498d6feb976992529285973a05a2f57c25dab",
|
|
15808
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerArea.astro"
|
|
15809
|
+
},
|
|
15810
|
+
{
|
|
15811
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerAreaBackground.astro",
|
|
15812
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type { ColorPickerInitialPartProjection } from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"div"> {\n initial?: ColorPickerInitialPartProjection;\n}\nconst { initial: suppliedInitial, style, ...rest } = Astro.props;\nconst initial = assertColorPickerInitialPart("areaBackground", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<div {...rest} {...initial?.attributes} style={mergedStyle} data-sw-color-picker-area-background>\n <slot />\n</div>\n',
|
|
15813
|
+
sourceHash: "sha256:17962d959c43c547aa0e900847ff7cb1acf169e2ac397cc43d5e543f5a225af2",
|
|
15814
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerAreaBackground.astro"
|
|
15815
|
+
},
|
|
15816
|
+
{
|
|
15817
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerAreaInput.astro",
|
|
15818
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type { ColorPickerInitialPartProjection } from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"input"> {\n initial?: ColorPickerInitialPartProjection;\n axis?: "x" | "y";\n step?: number;\n readOnly?: boolean;\n}\nconst {\n initial: suppliedInitial,\n axis = "x",\n step,\n style,\n value,\n disabled,\n readOnly,\n hidden,\n ...rest\n} = Astro.props;\nconst initial = assertColorPickerInitialPart("areaInput", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<input\n {...rest}\n type={initial ? undefined : "range"}\n data-axis={initial ? undefined : axis}\n data-step={initial ? undefined : step}\n {...initial?.attributes}\n value={initial?.properties.value ?? value}\n disabled={initial?.properties.disabled ?? disabled}\n readonly={initial?.properties.readOnly ?? readOnly}\n hidden={initial?.properties.hidden ?? hidden ?? false}\n style={mergedStyle}\n data-sw-color-picker-area-input\n/>\n',
|
|
15819
|
+
sourceHash: "sha256:780da163c54de72760458b13732c70149191bfdacaea4409750be11ff5b8cffe",
|
|
15820
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerAreaInput.astro"
|
|
15821
|
+
},
|
|
15822
|
+
{
|
|
15823
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerAreaThumb.astro",
|
|
15824
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type { ColorPickerInitialPartProjection } from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"span"> {\n initial?: ColorPickerInitialPartProjection;\n}\nconst { initial: suppliedInitial, style, ...rest } = Astro.props;\nconst initial = assertColorPickerInitialPart("areaThumb", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<span {...rest} {...initial?.attributes} style={mergedStyle} data-sw-color-picker-area-thumb>\n <slot />\n</span>\n',
|
|
15825
|
+
sourceHash: "sha256:1a581203b8c08499cd3b833b26e542002333af9c5176aea846412046238dcac0",
|
|
15826
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerAreaThumb.astro"
|
|
15827
|
+
},
|
|
15828
|
+
{
|
|
15829
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerChannelInput.astro",
|
|
15830
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type {\n ColorPickerInitialPartProjection,\n ColorPickerChannel,\n} from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"input"> {\n initial?: ColorPickerInitialPartProjection;\n channel: ColorPickerChannel;\n readOnly?: boolean;\n}\nconst {\n initial: suppliedInitial,\n channel,\n style,\n value,\n disabled,\n readOnly,\n hidden,\n ...rest\n} = Astro.props;\nconst initial = assertColorPickerInitialPart("channelInput", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<input\n {...rest}\n data-channel={initial ? undefined : channel}\n {...initial?.attributes}\n value={initial?.properties.value ?? value}\n disabled={initial?.properties.disabled ?? disabled}\n readonly={initial?.properties.readOnly ?? readOnly}\n hidden={initial?.properties.hidden ?? hidden ?? false}\n style={mergedStyle}\n data-sw-color-picker-channel-field\n/>\n',
|
|
15831
|
+
sourceHash: "sha256:1244793a021d22325de8a52df5ea5c67fa2321a2bfb5626cc227fefb3f62b309",
|
|
15832
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerChannelInput.astro"
|
|
15833
|
+
},
|
|
15834
|
+
{
|
|
15835
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerChannelSlider.astro",
|
|
15836
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type {\n ColorPickerChannel,\n ColorPickerInitialPartProjection,\n} from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"div"> {\n initial?: ColorPickerInitialPartProjection;\n channel: ColorPickerChannel;\n orientation?: "horizontal" | "vertical";\n}\nconst {\n initial: suppliedInitial,\n channel,\n orientation = "horizontal",\n style,\n hidden,\n ...rest\n} = Astro.props;\nconst initial = assertColorPickerInitialPart("channelSlider", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<div\n {...rest}\n data-channel={initial ? undefined : channel}\n data-orientation={initial ? undefined : orientation}\n {...initial?.attributes}\n hidden={initial?.properties.hidden ?? hidden}\n style={mergedStyle}\n data-sw-color-picker-channel-slider\n>\n <slot />\n</div>\n',
|
|
15837
|
+
sourceHash: "sha256:0cf7c0b5d7bdc34c609f2afcd9166fdae15e4181f8782a824abd5e3de07257d0",
|
|
15838
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerChannelSlider.astro"
|
|
15839
|
+
},
|
|
15840
|
+
{
|
|
15841
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerChannelSliderInput.astro",
|
|
15842
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type { ColorPickerInitialPartProjection } from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"input"> {\n initial?: ColorPickerInitialPartProjection;\n step?: number;\n readOnly?: boolean;\n}\nconst {\n initial: suppliedInitial,\n step,\n style,\n value,\n disabled,\n readOnly,\n hidden,\n ...rest\n} = Astro.props;\nconst initial = assertColorPickerInitialPart("channelSliderInput", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<input\n {...rest}\n type={initial ? undefined : "range"}\n data-step={initial ? undefined : step}\n {...initial?.attributes}\n value={initial?.properties.value ?? value}\n disabled={initial?.properties.disabled ?? disabled}\n readonly={initial?.properties.readOnly ?? readOnly}\n hidden={initial?.properties.hidden ?? hidden ?? false}\n style={mergedStyle}\n data-sw-color-picker-channel-input\n/>\n',
|
|
15843
|
+
sourceHash: "sha256:b9339c1f8ea06a66a01c58f720f8221e99b94d2cfdaf025c65cf0c0fab6bcb78",
|
|
15844
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerChannelSliderInput.astro"
|
|
15845
|
+
},
|
|
15846
|
+
{
|
|
15847
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerChannelSliderThumb.astro",
|
|
15848
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type { ColorPickerInitialPartProjection } from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"span"> {\n initial?: ColorPickerInitialPartProjection;\n}\nconst { initial: suppliedInitial, style, ...rest } = Astro.props;\nconst initial = assertColorPickerInitialPart("channelSliderThumb", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<span\n {...rest}\n {...initial?.attributes}\n style={mergedStyle}\n data-sw-color-picker-channel-slider-thumb\n>\n <slot />\n</span>\n',
|
|
15849
|
+
sourceHash: "sha256:e6f3dc49bcb882e3ca7758d4a121c47391f22bf55ae4a81752cf73359c1bdf24",
|
|
15850
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerChannelSliderThumb.astro"
|
|
15851
|
+
},
|
|
15852
|
+
{
|
|
15853
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerChannelSliderTrack.astro",
|
|
15854
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type { ColorPickerInitialPartProjection } from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"div"> {\n initial?: ColorPickerInitialPartProjection;\n}\nconst { initial: suppliedInitial, style, ...rest } = Astro.props;\nconst initial = assertColorPickerInitialPart("channelSliderTrack", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<div\n {...rest}\n {...initial?.attributes}\n style={mergedStyle}\n data-sw-color-picker-channel-slider-track\n>\n <slot />\n</div>\n',
|
|
15855
|
+
sourceHash: "sha256:58530cbf82d7ab5d8f55baf55c3b23344a46501d43c5910212e8878d4147d746",
|
|
15856
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerChannelSliderTrack.astro"
|
|
15857
|
+
},
|
|
15858
|
+
{
|
|
15859
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerClear.astro",
|
|
15860
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type { ColorPickerInitialPartProjection } from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"button"> {\n initial?: ColorPickerInitialPartProjection;\n}\nconst { initial: suppliedInitial, style, disabled, hidden, ...rest } = Astro.props;\nconst initial = assertColorPickerInitialPart("clear", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<button\n {...rest}\n type={initial ? undefined : "button"}\n {...initial?.attributes}\n disabled={initial?.properties.disabled ?? disabled}\n hidden={initial?.properties.hidden ?? hidden}\n style={mergedStyle}\n data-sw-color-picker-clear\n>\n <slot />\n</button>\n',
|
|
15861
|
+
sourceHash: "sha256:4ca62fe300ea02c7c82b8e61bbc861f70a9f08c85163c14ae262c9d00db708f3",
|
|
15862
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerClear.astro"
|
|
15863
|
+
},
|
|
15864
|
+
{
|
|
15865
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerControl.astro",
|
|
15866
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type { ColorPickerInitialPartProjection } from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"div"> {\n initial?: ColorPickerInitialPartProjection;\n}\nconst { initial: suppliedInitial, style, ...rest } = Astro.props;\nconst initial = assertColorPickerInitialPart("control", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<div {...rest} {...initial?.attributes} style={mergedStyle} data-sw-color-picker-control>\n <slot />\n</div>\n',
|
|
15867
|
+
sourceHash: "sha256:7e524a03d24a6f1ee7b43f9dad74cc7bbda87b48a97eb2cebe567062bd6a9261",
|
|
15868
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerControl.astro"
|
|
15869
|
+
},
|
|
15870
|
+
{
|
|
15871
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerEyeDropperTrigger.astro",
|
|
15872
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type { ColorPickerInitialPartProjection } from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"button"> {\n initial?: ColorPickerInitialPartProjection;\n}\nconst { initial: suppliedInitial, style, disabled, hidden, ...rest } = Astro.props;\nconst initial = assertColorPickerInitialPart("eyeDropperTrigger", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<button\n {...rest}\n type={initial ? undefined : "button"}\n {...initial?.attributes}\n disabled={initial?.properties.disabled ?? disabled}\n hidden={initial?.properties.hidden ?? hidden}\n style={mergedStyle}\n data-sw-color-picker-eye-dropper\n>\n <slot />\n</button>\n',
|
|
15873
|
+
sourceHash: "sha256:30b9dda00db500079458036945f069400b8e3e7b6058627cf170c1573e0c1099",
|
|
15874
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerEyeDropperTrigger.astro"
|
|
15875
|
+
},
|
|
15876
|
+
{
|
|
15877
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerFormatControl.astro",
|
|
15878
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type { ColorPickerInitialPartProjection } from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"div"> {\n initial?: ColorPickerInitialPartProjection;\n}\nconst { initial: suppliedInitial, style, ...rest } = Astro.props;\nconst initial = assertColorPickerInitialPart("formatControl", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<div {...rest} {...initial?.attributes} style={mergedStyle} data-sw-color-picker-format-control>\n <slot />\n</div>\n',
|
|
15879
|
+
sourceHash: "sha256:c3e4a4be9b66611502e8cd8160ee4136f9f6f357f5739401c3f37f6535057c0f",
|
|
15880
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerFormatControl.astro"
|
|
15881
|
+
},
|
|
15882
|
+
{
|
|
15883
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerFormatSelect.astro",
|
|
15884
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type { ColorPickerInitialPartProjection } from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"select"> {\n initial?: ColorPickerInitialPartProjection;\n}\nconst { initial: suppliedInitial, style, value, disabled, ...rest } = Astro.props;\nconst initial = assertColorPickerInitialPart("formatSelect", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<select\n {...rest}\n {...initial?.attributes}\n value={initial?.properties.value ?? value}\n disabled={initial?.properties.disabled ?? disabled}\n style={mergedStyle}\n data-sw-color-picker-format-select\n>\n <slot>\n <option value="hex" selected={(initial?.properties.value ?? value) === "hex"}>HEX</option>\n <option value="rgb" selected={(initial?.properties.value ?? value) === "rgb"}>RGB</option>\n <option value="hsl" selected={(initial?.properties.value ?? value) === "hsl"}>HSL</option>\n <option value="hsb" selected={(initial?.properties.value ?? value) === "hsb"}>HSB</option>\n </slot>\n</select>\n',
|
|
15885
|
+
sourceHash: "sha256:6e3f100f98e32ddd71587f145807332b2a96998480d5f97407e7a326852ea715",
|
|
15886
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerFormatSelect.astro"
|
|
15887
|
+
},
|
|
15888
|
+
{
|
|
15889
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerHiddenInput.astro",
|
|
15890
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type { ColorPickerInitialPartProjection } from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"input"> {\n initial?: ColorPickerInitialPartProjection;\n\n readOnly?: boolean;\n}\nconst { initial: suppliedInitial, style, value, disabled, readOnly, hidden, ...rest } = Astro.props;\nconst initial = assertColorPickerInitialPart("hiddenInput", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<input\n {...rest}\n type={initial ? undefined : "text"}\n {...initial?.attributes}\n value={initial?.properties.value ?? value}\n disabled={initial?.properties.disabled ?? disabled}\n readonly={initial?.properties.readOnly ?? readOnly}\n hidden={initial?.properties.hidden ?? hidden ?? false}\n style={mergedStyle}\n data-sw-color-picker-hidden-input\n/>\n',
|
|
15891
|
+
sourceHash: "sha256:0a4958d74feea4bdf30d92f45adae6682ba29798265b2ea9ea3b9dce27c0b893",
|
|
15892
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerHiddenInput.astro"
|
|
15893
|
+
},
|
|
15894
|
+
{
|
|
15895
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerLabel.astro",
|
|
15896
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type { ColorPickerInitialPartProjection } from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"span"> {\n initial?: ColorPickerInitialPartProjection;\n}\nconst { initial: suppliedInitial, style, ...rest } = Astro.props;\nconst initial = assertColorPickerInitialPart("label", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<span {...rest} {...initial?.attributes} style={mergedStyle} data-sw-color-picker-label>\n <slot />\n</span>\n',
|
|
15897
|
+
sourceHash: "sha256:b3db102151f79cb734cc52cbfe8a3f346db9f7c9c41a78907da1fa8b7e2eadcb",
|
|
15898
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerLabel.astro"
|
|
15899
|
+
},
|
|
15900
|
+
{
|
|
15901
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerRenderProjection.ts",
|
|
15902
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport type { HTMLAttributes } from "astro/types";\nimport {\n projectColorPickerInitialPart,\n type ColorPickerInitialAxis,\n type ColorPickerInitialChannel,\n type ColorPickerInitialOrientation,\n type ColorPickerInitialPartName,\n type ColorPickerInitialPartProjection,\n type ColorPickerInitialState,\n type ColorPickerInitialValue,\n} from "@starwind-ui/runtime/color-picker";\n\nexport type ColorPickerInitialProps = Readonly<{\n initial: ColorPickerInitialPartProjection;\n}>;\n\nexport type ColorPickerAreaProjection = Readonly<{\n root: ColorPickerInitialProps;\n background: ColorPickerInitialProps;\n thumb: ColorPickerInitialProps;\n input(options: {\n axis: ColorPickerInitialAxis;\n ariaLabel?: string;\n ariaLabelledBy?: string;\n ariaRoleDescription?: string;\n }): ColorPickerInitialProps;\n}>;\n\nexport type ColorPickerChannelSliderProjection = Readonly<{\n root: ColorPickerInitialProps;\n track: ColorPickerInitialProps;\n thumb: ColorPickerInitialProps;\n input(options?: { ariaLabel?: string }): ColorPickerInitialProps;\n}>;\n\nexport type ColorPickerRenderProjection = Readonly<{\n root: ColorPickerInitialProps;\n label: ColorPickerInitialProps;\n control: ColorPickerInitialProps;\n valueInput: ColorPickerInitialProps;\n valueSwatch: ColorPickerInitialProps;\n valueText: ColorPickerInitialProps;\n area(options?: {\n xChannel?: ColorPickerInitialChannel;\n yChannel?: ColorPickerInitialChannel;\n xStep?: number;\n yStep?: number;\n }): ColorPickerAreaProjection;\n channelSlider(options: {\n channel: ColorPickerInitialChannel;\n orientation?: ColorPickerInitialOrientation;\n step?: number;\n }): ColorPickerChannelSliderProjection;\n channelInput(options: { channel: ColorPickerInitialChannel }): ColorPickerInitialProps;\n formatSelect: ColorPickerInitialProps;\n formatControl: ColorPickerInitialProps;\n transparencyGrid: ColorPickerInitialProps;\n swatchGroup: ColorPickerInitialProps;\n swatch(options: { value: ColorPickerInitialValue; disabled?: boolean }): ColorPickerInitialProps;\n eyeDropperTrigger: ColorPickerInitialProps;\n clear: ColorPickerInitialProps;\n hiddenInput: ColorPickerInitialProps;\n}>;\n\nexport function createColorPickerRenderProjection(\n state: ColorPickerInitialState,\n): ColorPickerRenderProjection {\n const part = (\n request: Parameters<typeof projectColorPickerInitialPart>[1],\n ): ColorPickerInitialProps =>\n Object.freeze({ initial: projectColorPickerInitialPart(state, request) });\n const simple = (name: ColorPickerInitialPartName) => part({ part: name } as never);\n\n return Object.freeze({\n root: simple("root"),\n label: simple("label"),\n control: simple("control"),\n valueInput: simple("valueInput"),\n valueSwatch: simple("valueSwatch"),\n valueText: simple("valueText"),\n area(options = {}) {\n const context = Object.freeze({ ...options });\n return Object.freeze({\n root: part({ part: "area", ...context }),\n background: part({ part: "areaBackground", ...context }),\n thumb: part({ part: "areaThumb", ...context }),\n input(inputOptions) {\n return part({ part: "areaInput", ...context, ...inputOptions });\n },\n });\n },\n channelSlider(options) {\n const context = Object.freeze({ ...options });\n return Object.freeze({\n root: part({ part: "channelSlider", ...context }),\n track: part({ part: "channelSliderTrack", ...context }),\n thumb: part({ part: "channelSliderThumb", ...context }),\n input(inputOptions = {}) {\n return part({ part: "channelSliderInput", ...context, ...inputOptions });\n },\n });\n },\n channelInput: (options) => part({ part: "channelInput", ...options }),\n formatSelect: simple("formatSelect"),\n formatControl: simple("formatControl"),\n transparencyGrid: simple("transparencyGrid"),\n swatchGroup: simple("swatchGroup"),\n swatch: (options) => part({ part: "swatch", ...options }),\n eyeDropperTrigger: simple("eyeDropperTrigger"),\n clear: simple("clear"),\n hiddenInput: simple("hiddenInput"),\n });\n}\n\nexport function assertColorPickerInitialPart(\n expected: ColorPickerInitialPartName,\n initial: ColorPickerInitialPartProjection | undefined,\n): ColorPickerInitialPartProjection | undefined {\n if (initial && initial.part !== expected) {\n throw new Error(\n `Color Picker ${expected} received the initial projection for ${initial.part}.`,\n );\n }\n return initial;\n}\n\nexport function mergeColorPickerInitialStyles(\n style: HTMLAttributes<"div">["style"],\n initial: ColorPickerInitialPartProjection | undefined,\n): HTMLAttributes<"div">["style"] {\n const projected = Object.fromEntries(\n Object.entries(initial?.styles ?? {}).filter(\n (entry): entry is [string, string] => entry[1] !== undefined,\n ),\n );\n if (Object.keys(projected).length === 0) return style;\n if (typeof style === "string") {\n const suffix = Object.entries(projected)\n .map(([name, value]) => `${name}: ${value}`)\n .join("; ");\n return style.length > 0 ? `${style}; ${suffix}` : suffix;\n }\n return { ...(typeof style === "object" && style !== null ? style : {}), ...projected };\n}\n',
|
|
15903
|
+
sourceHash: "sha256:cac62787f69847cda171861e603c15fda0e9c8c1b49a4da32bf4db6b5a7c6ea5",
|
|
15904
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerRenderProjection.ts"
|
|
15905
|
+
},
|
|
15906
|
+
{
|
|
15907
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerRoot.astro",
|
|
15908
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport {\n createColorPickerInitialState,\n projectColorPickerInitialPart,\n} from "@starwind-ui/runtime/color-picker";\nimport type {\n ColorPickerDirection,\n ColorPickerFormat,\n ColorPickerOptions,\n ColorPickerValue,\n} from "@starwind-ui/runtime/color-picker";\nimport {\n createColorPickerRenderProjection,\n mergeColorPickerInitialStyles,\n type ColorPickerRenderProjection,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends Omit<HTMLAttributes<"div">, "defaultValue" | "dir"> {\n value?: ColorPickerValue;\n defaultValue?: ColorPickerValue;\n format?: ColorPickerFormat;\n alpha?: boolean;\n allowEmpty?: boolean;\n disabled?: boolean;\n readOnly?: boolean;\n required?: boolean;\n name?: string;\n form?: string;\n locale?: string;\n dir?: ColorPickerDirection;\n getAriaValueText?: ColorPickerOptions["getAriaValueText"];\n getAreaRoleDescription?: ColorPickerOptions["getAreaRoleDescription"];\n getColorDescription?: ColorPickerOptions["getColorDescription"];\n children?: (initial: ColorPickerRenderProjection) => unknown;\n}\n\nconst {\n value,\n defaultValue = "#000000",\n format = "hex",\n alpha = true,\n allowEmpty = false,\n disabled = false,\n readOnly = false,\n required = false,\n name,\n form,\n locale,\n dir,\n getAriaValueText,\n getAreaRoleDescription,\n getColorDescription,\n style,\n ...rest\n} = Astro.props;\nconst initialState = createColorPickerInitialState({\n ...(value === undefined ? {} : { value }),\n defaultValue,\n format,\n alpha,\n allowEmpty,\n disabled,\n readOnly,\n required,\n name,\n form,\n locale,\n dir,\n getAriaValueText,\n getAreaRoleDescription,\n getColorDescription,\n});\nconst rootInitial = projectColorPickerInitialPart(initialState, { part: "root" });\nconst initial = createColorPickerRenderProjection(initialState);\nconst content = Astro.slots.has("default") ? await Astro.slots.render("default", [initial]) : "";\nconst mergedStyle = mergeColorPickerInitialStyles(style, rootInitial);\n---\n\n<div {...rest} {...rootInitial.attributes} style={mergedStyle} data-sw-color-picker>\n <Fragment set:html={content} />\n</div>\n\n<script>\n import { createColorPicker } from "@starwind-ui/runtime/color-picker";\n import {\n registerAstroControllerLifecycle,\n trackAstroController,\n } from "../internal/controller-lifecycle";\n\n const getInitCandidates = (event: Event | undefined, selector: string): HTMLElement[] => {\n const initRoot =\n event?.type === "starwind:init" && event instanceof CustomEvent\n ? event.detail?.root\n : undefined;\n const scopedRoot: Document | DocumentFragment | Element = isQueryableRoot(initRoot)\n ? initRoot\n : document;\n const candidates = Array.from(scopedRoot.querySelectorAll<HTMLElement>(selector));\n\n if (scopedRoot instanceof Element && scopedRoot.matches(selector)) {\n candidates.unshift(scopedRoot as HTMLElement);\n }\n\n return candidates;\n };\n\n const isQueryableRoot = (value: unknown): value is Document | DocumentFragment | Element =>\n value instanceof Document || value instanceof DocumentFragment || value instanceof Element;\n\n const setupColorPickers = (event?: Event) => {\n getInitCandidates(event, "[data-sw-color-picker]").forEach((root) =>\n trackAstroController("ColorPickerRoot", root, createColorPicker(root)),\n );\n };\n\n registerAstroControllerLifecycle("ColorPickerRoot", setupColorPickers);\n</script>\n',
|
|
15909
|
+
sourceHash: "sha256:96107e83f5d82695413028f1a403fb3325ff91f87e2bdda272c6a2fb56a8aba7",
|
|
15910
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerRoot.astro"
|
|
15911
|
+
},
|
|
15912
|
+
{
|
|
15913
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerSwatch.astro",
|
|
15914
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type {\n ColorPickerInitialPartProjection,\n ColorPickerValue,\n} from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"button"> {\n initial?: ColorPickerInitialPartProjection;\n swatchValue: ColorPickerValue;\n swatchDisabled?: boolean;\n}\nconst {\n initial: suppliedInitial,\n swatchValue,\n swatchDisabled = false,\n style,\n disabled,\n ...rest\n} = Astro.props;\nconst initial = assertColorPickerInitialPart("swatch", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<button\n {...rest}\n type={initial ? undefined : "button"}\n data-value={initial ? undefined : swatchValue === null ? undefined : String(swatchValue)}\n data-disabled={initial ? undefined : swatchDisabled ? "" : undefined}\n {...initial?.attributes}\n disabled={initial?.properties.disabled ?? disabled ?? swatchDisabled}\n style={mergedStyle}\n data-sw-color-picker-swatch\n>\n <slot />\n</button>\n',
|
|
15915
|
+
sourceHash: "sha256:cb59f549a12f0bda237d267a84d578e21364daef519b68f44f260fef1f8d6efb",
|
|
15916
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerSwatch.astro"
|
|
15917
|
+
},
|
|
15918
|
+
{
|
|
15919
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerSwatchGroup.astro",
|
|
15920
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type { ColorPickerInitialPartProjection } from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"div"> {\n initial?: ColorPickerInitialPartProjection;\n}\nconst { initial: suppliedInitial, style, ...rest } = Astro.props;\nconst initial = assertColorPickerInitialPart("swatchGroup", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<div {...rest} {...initial?.attributes} style={mergedStyle} data-sw-color-picker-swatch-group>\n <slot />\n</div>\n',
|
|
15921
|
+
sourceHash: "sha256:5e4361fbf4bd5101d1980bf4d1f256eb2698c0cb00259dfc6f3d03241c3ecbbd",
|
|
15922
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerSwatchGroup.astro"
|
|
15923
|
+
},
|
|
15924
|
+
{
|
|
15925
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerTransparencyGrid.astro",
|
|
15926
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type { ColorPickerInitialPartProjection } from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"span"> {\n initial?: ColorPickerInitialPartProjection;\n}\nconst { initial: suppliedInitial, style, ...rest } = Astro.props;\nconst initial = assertColorPickerInitialPart("transparencyGrid", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<span {...rest} {...initial?.attributes} style={mergedStyle} data-sw-color-picker-transparency-grid>\n <slot />\n</span>\n',
|
|
15927
|
+
sourceHash: "sha256:728ed52e2856935c9237ecf49ea6d25ac08b487478f71580b0fbb60972b16e1c",
|
|
15928
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerTransparencyGrid.astro"
|
|
15929
|
+
},
|
|
15930
|
+
{
|
|
15931
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerValueInput.astro",
|
|
15932
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type { ColorPickerInitialPartProjection } from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"input"> {\n initial?: ColorPickerInitialPartProjection;\n\n readOnly?: boolean;\n}\nconst { initial: suppliedInitial, style, value, disabled, readOnly, hidden, ...rest } = Astro.props;\nconst initial = assertColorPickerInitialPart("valueInput", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<input\n {...rest}\n {...initial?.attributes}\n value={initial?.properties.value ?? value}\n disabled={initial?.properties.disabled ?? disabled}\n readonly={initial?.properties.readOnly ?? readOnly}\n hidden={initial?.properties.hidden ?? hidden ?? false}\n style={mergedStyle}\n data-sw-color-picker-value-input\n/>\n',
|
|
15933
|
+
sourceHash: "sha256:15c6a27d4cedcb4575764b93c2be10d3c5748d22a6359efff0b11d8b164cfec7",
|
|
15934
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerValueInput.astro"
|
|
15935
|
+
},
|
|
15936
|
+
{
|
|
15937
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerValueSwatch.astro",
|
|
15938
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type { ColorPickerInitialPartProjection } from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"span"> {\n initial?: ColorPickerInitialPartProjection;\n}\nconst { initial: suppliedInitial, style, ...rest } = Astro.props;\nconst initial = assertColorPickerInitialPart("valueSwatch", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<span {...rest} {...initial?.attributes} style={mergedStyle} data-sw-color-picker-value-swatch>\n <slot />\n</span>\n',
|
|
15939
|
+
sourceHash: "sha256:5b662c0aa87703f6ce2adb97e363b7d8a990ef0830f80d896944eb75d750fe64",
|
|
15940
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerValueSwatch.astro"
|
|
15941
|
+
},
|
|
15942
|
+
{
|
|
15943
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerValueText.astro",
|
|
15944
|
+
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\nimport type { ColorPickerInitialPartProjection } from "@starwind-ui/runtime/color-picker";\nimport {\n assertColorPickerInitialPart,\n mergeColorPickerInitialStyles,\n} from "./ColorPickerRenderProjection";\n\ninterface Props extends HTMLAttributes<"span"> {\n initial?: ColorPickerInitialPartProjection;\n}\nconst { initial: suppliedInitial, style, ...rest } = Astro.props;\nconst initial = assertColorPickerInitialPart("valueText", suppliedInitial);\nconst mergedStyle = mergeColorPickerInitialStyles(style, initial);\n---\n\n<span {...rest} {...initial?.attributes} style={mergedStyle} data-sw-color-picker-value-text>\n <slot>{initial?.text}</slot>\n</span>\n',
|
|
15945
|
+
sourceHash: "sha256:7ad0e80be15f1041071d4b827ef694e72333f9ba09a292c2bd54d1d9482c8ac5",
|
|
15946
|
+
sourcePath: "packages/astro/src/color-picker/ColorPickerValueText.astro"
|
|
15947
|
+
},
|
|
15948
|
+
{
|
|
15949
|
+
path: "src/components/starwind-primitives/color-picker/index.ts",
|
|
15950
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport ColorPickerRoot from "./ColorPickerRoot.astro";\nimport ColorPickerLabel from "./ColorPickerLabel.astro";\nimport ColorPickerControl from "./ColorPickerControl.astro";\nimport ColorPickerValueInput from "./ColorPickerValueInput.astro";\nimport ColorPickerValueSwatch from "./ColorPickerValueSwatch.astro";\nimport ColorPickerValueText from "./ColorPickerValueText.astro";\nimport ColorPickerArea from "./ColorPickerArea.astro";\nimport ColorPickerAreaBackground from "./ColorPickerAreaBackground.astro";\nimport ColorPickerAreaThumb from "./ColorPickerAreaThumb.astro";\nimport ColorPickerAreaInput from "./ColorPickerAreaInput.astro";\nimport ColorPickerChannelSlider from "./ColorPickerChannelSlider.astro";\nimport ColorPickerChannelSliderTrack from "./ColorPickerChannelSliderTrack.astro";\nimport ColorPickerChannelSliderThumb from "./ColorPickerChannelSliderThumb.astro";\nimport ColorPickerChannelSliderInput from "./ColorPickerChannelSliderInput.astro";\nimport ColorPickerChannelInput from "./ColorPickerChannelInput.astro";\nimport ColorPickerFormatSelect from "./ColorPickerFormatSelect.astro";\nimport ColorPickerFormatControl from "./ColorPickerFormatControl.astro";\nimport ColorPickerTransparencyGrid from "./ColorPickerTransparencyGrid.astro";\nimport ColorPickerSwatchGroup from "./ColorPickerSwatchGroup.astro";\nimport ColorPickerSwatch from "./ColorPickerSwatch.astro";\nimport ColorPickerEyeDropperTrigger from "./ColorPickerEyeDropperTrigger.astro";\nimport ColorPickerClear from "./ColorPickerClear.astro";\nimport ColorPickerHiddenInput from "./ColorPickerHiddenInput.astro";\n\nconst ColorPicker = {\n Root: ColorPickerRoot,\n Label: ColorPickerLabel,\n Control: ColorPickerControl,\n ValueInput: ColorPickerValueInput,\n ValueSwatch: ColorPickerValueSwatch,\n ValueText: ColorPickerValueText,\n Area: ColorPickerArea,\n AreaBackground: ColorPickerAreaBackground,\n AreaThumb: ColorPickerAreaThumb,\n AreaInput: ColorPickerAreaInput,\n ChannelSlider: ColorPickerChannelSlider,\n ChannelSliderTrack: ColorPickerChannelSliderTrack,\n ChannelSliderThumb: ColorPickerChannelSliderThumb,\n ChannelSliderInput: ColorPickerChannelSliderInput,\n ChannelInput: ColorPickerChannelInput,\n FormatSelect: ColorPickerFormatSelect,\n FormatControl: ColorPickerFormatControl,\n TransparencyGrid: ColorPickerTransparencyGrid,\n SwatchGroup: ColorPickerSwatchGroup,\n Swatch: ColorPickerSwatch,\n EyeDropperTrigger: ColorPickerEyeDropperTrigger,\n Clear: ColorPickerClear,\n HiddenInput: ColorPickerHiddenInput,\n};\n\nexport {\n ColorPicker,\n ColorPickerRoot,\n ColorPickerLabel,\n ColorPickerControl,\n ColorPickerValueInput,\n ColorPickerValueSwatch,\n ColorPickerValueText,\n ColorPickerArea,\n ColorPickerAreaBackground,\n ColorPickerAreaThumb,\n ColorPickerAreaInput,\n ColorPickerChannelSlider,\n ColorPickerChannelSliderTrack,\n ColorPickerChannelSliderThumb,\n ColorPickerChannelSliderInput,\n ColorPickerChannelInput,\n ColorPickerFormatSelect,\n ColorPickerFormatControl,\n ColorPickerTransparencyGrid,\n ColorPickerSwatchGroup,\n ColorPickerSwatch,\n ColorPickerEyeDropperTrigger,\n ColorPickerClear,\n ColorPickerHiddenInput,\n};\n\nexport default ColorPicker;\n\nexport type {\n ColorPickerAreaProjection,\n ColorPickerChannelSliderProjection,\n ColorPickerInitialProps,\n ColorPickerRenderProjection,\n} from "./ColorPickerRenderProjection";\nexport {\n createColorPickerInitialState,\n parseColor,\n projectColorPickerInitialPart,\n} from "@starwind-ui/runtime/color-picker";\nexport type {\n ColorPickerChannel,\n ColorPickerColor,\n ColorPickerDirection,\n ColorPickerFormat,\n ColorPickerFormatChangeDetails,\n ColorPickerHsbChannelUpdates,\n ColorPickerHsbChannels,\n ColorPickerHslChannelUpdates,\n ColorPickerHslChannels,\n ColorPickerInstance,\n ColorPickerInitialAxis,\n ColorPickerInitialChannel,\n ColorPickerInitialDirection,\n ColorPickerInitialOrientation,\n ColorPickerInitialPartName,\n ColorPickerInitialPartProjection,\n ColorPickerInitialPartRequest,\n ColorPickerInitialState,\n ColorPickerInitialStateOptions,\n ColorPickerInitialValue,\n ColorPickerOptions,\n ColorPickerRgbChannelUpdates,\n ColorPickerRgbChannels,\n ColorPickerSetOptions,\n ColorPickerSetValueOptions,\n ColorPickerStringFormat,\n ColorPickerValue,\n ColorPickerValueChangeDetails,\n ColorPickerValueChangeReason,\n ColorPickerValueCommitDetails,\n} from "@starwind-ui/runtime/color-picker";\n',
|
|
15951
|
+
sourceHash: "sha256:76e9681916afa443711e9e42c685658a483816d11dd205c80a550781cce1b8c8",
|
|
15952
|
+
sourcePath: "packages/astro/src/color-picker/index.ts"
|
|
15953
|
+
},
|
|
15954
|
+
{
|
|
15955
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
15956
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
15957
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
15958
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
15959
|
+
}
|
|
15960
|
+
],
|
|
15961
|
+
packageRequirements: [
|
|
15962
|
+
{
|
|
15963
|
+
name: "@starwind-ui/runtime",
|
|
15964
|
+
range: "^0.1.0-beta.2"
|
|
15252
15965
|
},
|
|
15253
15966
|
{
|
|
15254
15967
|
name: "astro",
|
|
@@ -15261,6 +15974,12 @@ if (!src && !image) {
|
|
|
15261
15974
|
framework: "astro",
|
|
15262
15975
|
version: "0.1.0",
|
|
15263
15976
|
files: [
|
|
15977
|
+
{
|
|
15978
|
+
path: "src/components/starwind-primitives/internal/controller-lifecycle.ts",
|
|
15979
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\ntype AstroController = {\n destroy(): void;\n};\n\ntype AstroControllerSetup = (event?: Event) => void;\n\ntype AstroControllerLifecycle = {\n controllers: WeakMap<HTMLElement, AstroController>;\n destroy?: () => void;\n registered: boolean;\n roots: Set<HTMLElement>;\n setup: AstroControllerSetup;\n};\n\nconst lifecycles = new Map<string, AstroControllerLifecycle>();\n\nexport function registerAstroControllerLifecycle(\n key: string,\n setup: AstroControllerSetup,\n destroy?: () => void,\n): void {\n const lifecycle = getLifecycle(key);\n lifecycle.setup = setup;\n lifecycle.destroy = destroy;\n\n if (!lifecycle.registered) {\n lifecycle.registered = true;\n document.addEventListener("astro:after-swap", () => lifecycle.setup());\n document.addEventListener("starwind:init", (event) => lifecycle.setup(event));\n document.addEventListener("astro:before-swap", () => destroyLifecycle(lifecycle));\n }\n\n lifecycle.setup();\n}\n\nexport function trackAstroController<T extends AstroController>(\n key: string,\n root: HTMLElement,\n controller: T,\n): T {\n const lifecycle = getLifecycle(key);\n const previous = lifecycle.controllers.get(root);\n\n if (previous && previous !== controller) {\n previous.destroy();\n }\n\n lifecycle.controllers.set(root, controller);\n lifecycle.roots.add(root);\n return controller;\n}\n\nfunction getLifecycle(key: string): AstroControllerLifecycle {\n const existing = lifecycles.get(key);\n if (existing) return existing;\n\n const lifecycle: AstroControllerLifecycle = {\n controllers: new WeakMap(),\n registered: false,\n roots: new Set(),\n setup: () => {},\n };\n lifecycles.set(key, lifecycle);\n return lifecycle;\n}\n\nfunction destroyLifecycle(lifecycle: AstroControllerLifecycle): void {\n if (lifecycle.destroy) {\n lifecycle.destroy();\n }\n\n lifecycle.roots.forEach((root) => {\n lifecycle.controllers.get(root)?.destroy();\n lifecycle.controllers.delete(root);\n });\n lifecycle.roots.clear();\n}\n',
|
|
15980
|
+
sourceHash: "sha256:690d4aa4512228d3d6bb9a0a5357a90c63e6fe9471849494335d45b6236f9f1b",
|
|
15981
|
+
sourcePath: "packages/astro/src/internal/controller-lifecycle.ts"
|
|
15982
|
+
},
|
|
15264
15983
|
{
|
|
15265
15984
|
path: "src/components/starwind-primitives/toast/ToastAction.astro",
|
|
15266
15985
|
content: '---\n/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\nimport type { HTMLAttributes } from "astro/types";\n\ntype Props = HTMLAttributes<"button">;\n\nconst { ...rest } = Astro.props;\n---\n\n<button type="button" data-sw-toast-action {...rest}>\n <slot />\n</button>\n',
|
|
@@ -15325,7 +16044,7 @@ if (!src && !image) {
|
|
|
15325
16044
|
packageRequirements: [
|
|
15326
16045
|
{
|
|
15327
16046
|
name: "@starwind-ui/runtime",
|
|
15328
|
-
range: "^0.1.0-beta.
|
|
16047
|
+
range: "^0.1.0-beta.2"
|
|
15329
16048
|
},
|
|
15330
16049
|
{
|
|
15331
16050
|
name: "astro",
|
|
@@ -15336,12 +16055,12 @@ if (!src && !image) {
|
|
|
15336
16055
|
{
|
|
15337
16056
|
component: "button",
|
|
15338
16057
|
framework: "react",
|
|
15339
|
-
version: "0.1.
|
|
16058
|
+
version: "0.1.1",
|
|
15340
16059
|
files: [
|
|
15341
16060
|
{
|
|
15342
16061
|
path: "src/components/starwind-primitives/button/ButtonRoot.tsx",
|
|
15343
|
-
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport { createButton } from "@starwind-ui/runtime/button";\nimport * as React from "react";\nimport { setRef } from "../internal/compose-refs";\nimport { useIsomorphicLayoutEffect } from "../internal/use-isomorphic-layout-effect";\n\nexport type ButtonRootProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {\n disabled?: boolean;\n focusableWhenDisabled?: boolean;\n type?: React.ButtonHTMLAttributes<HTMLButtonElement>["type"];\n};\n\nconst ButtonRoot = React.forwardRef<HTMLButtonElement, ButtonRootProps>(function ButtonRoot(\n { disabled = false, focusableWhenDisabled = false, type, ...props },\n forwardedRef,\n) {\n const rootRef = React.useRef<HTMLButtonElement>(null);\n\n const composedRef = React.useCallback(\n (node: HTMLButtonElement | null) => {\n rootRef.current = node;\n return setRef(forwardedRef, node);\n },\n [forwardedRef],\n );\n\n useIsomorphicLayoutEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n\n const instance = createButton(root, {\n disabled,\n
|
|
15344
|
-
sourceHash: "sha256:
|
|
16062
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport { createButton } from "@starwind-ui/runtime/button";\nimport * as React from "react";\nimport { setRef } from "../internal/compose-refs";\nimport { useIsomorphicLayoutEffect } from "../internal/use-isomorphic-layout-effect";\n\nexport type ButtonRootProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {\n disabled?: boolean;\n focusableWhenDisabled?: boolean;\n type?: React.ButtonHTMLAttributes<HTMLButtonElement>["type"];\n};\n\nconst ButtonRoot = React.forwardRef<HTMLButtonElement, ButtonRootProps>(function ButtonRoot(\n { disabled = false, focusableWhenDisabled = false, type, ...props },\n forwardedRef,\n) {\n const rootRef = React.useRef<HTMLButtonElement>(null);\n const instanceRef = React.useRef<ReturnType<typeof createButton> | null>(null);\n const disabledRef = React.useRef(disabled);\n disabledRef.current = disabled;\n\n const composedRef = React.useCallback(\n (node: HTMLButtonElement | null) => {\n rootRef.current = node;\n return setRef(forwardedRef, node);\n },\n [forwardedRef],\n );\n\n useIsomorphicLayoutEffect(() => {\n if (!focusableWhenDisabled) {\n instanceRef.current?.destroy();\n instanceRef.current = null;\n return;\n }\n\n const root = rootRef.current;\n if (!root) return;\n\n const instance = createButton(root, {\n disabled: disabledRef.current,\n });\n instanceRef.current = instance;\n\n return () => {\n if (instanceRef.current === instance) {\n instanceRef.current = null;\n }\n instance.destroy();\n };\n }, [focusableWhenDisabled]);\n\n useIsomorphicLayoutEffect(() => {\n instanceRef.current?.setDisabled(disabled);\n }, [disabled]);\n\n return (\n <button\n data-focusable-when-disabled={focusableWhenDisabled ? "true" : undefined}\n aria-disabled={disabled && focusableWhenDisabled ? "true" : undefined}\n data-disabled={disabled ? "" : undefined}\n disabled={disabled && !focusableWhenDisabled}\n ref={composedRef}\n type={type ?? "button"}\n {...props}\n data-sw-button\n />\n );\n});\n\nButtonRoot.displayName = "Button.Root";\n\nexport default ButtonRoot;\n',
|
|
16063
|
+
sourceHash: "sha256:59d410043fac11cbdacbd52b844bb4bd5bbaf5bfc9174b21c9ff67fa6daa14da",
|
|
15345
16064
|
sourcePath: "packages/react/src/button/ButtonRoot.tsx"
|
|
15346
16065
|
},
|
|
15347
16066
|
{
|
|
@@ -15366,7 +16085,7 @@ if (!src && !image) {
|
|
|
15366
16085
|
packageRequirements: [
|
|
15367
16086
|
{
|
|
15368
16087
|
name: "@starwind-ui/runtime",
|
|
15369
|
-
range: "^0.1.0-beta.
|
|
16088
|
+
range: "^0.1.0-beta.2"
|
|
15370
16089
|
},
|
|
15371
16090
|
{
|
|
15372
16091
|
name: "react",
|
|
@@ -15441,7 +16160,7 @@ if (!src && !image) {
|
|
|
15441
16160
|
packageRequirements: [
|
|
15442
16161
|
{
|
|
15443
16162
|
name: "@starwind-ui/runtime",
|
|
15444
|
-
range: "^0.1.0-beta.
|
|
16163
|
+
range: "^0.1.0-beta.2"
|
|
15445
16164
|
},
|
|
15446
16165
|
{
|
|
15447
16166
|
name: "react",
|
|
@@ -15486,7 +16205,7 @@ if (!src && !image) {
|
|
|
15486
16205
|
packageRequirements: [
|
|
15487
16206
|
{
|
|
15488
16207
|
name: "@starwind-ui/runtime",
|
|
15489
|
-
range: "^0.1.0-beta.
|
|
16208
|
+
range: "^0.1.0-beta.2"
|
|
15490
16209
|
},
|
|
15491
16210
|
{
|
|
15492
16211
|
name: "react",
|
|
@@ -15573,7 +16292,7 @@ if (!src && !image) {
|
|
|
15573
16292
|
packageRequirements: [
|
|
15574
16293
|
{
|
|
15575
16294
|
name: "@starwind-ui/runtime",
|
|
15576
|
-
range: "^0.1.0-beta.
|
|
16295
|
+
range: "^0.1.0-beta.2"
|
|
15577
16296
|
},
|
|
15578
16297
|
{
|
|
15579
16298
|
name: "react",
|
|
@@ -15624,7 +16343,7 @@ if (!src && !image) {
|
|
|
15624
16343
|
packageRequirements: [
|
|
15625
16344
|
{
|
|
15626
16345
|
name: "@starwind-ui/runtime",
|
|
15627
|
-
range: "^0.1.0-beta.
|
|
16346
|
+
range: "^0.1.0-beta.2"
|
|
15628
16347
|
},
|
|
15629
16348
|
{
|
|
15630
16349
|
name: "react",
|
|
@@ -15675,7 +16394,7 @@ if (!src && !image) {
|
|
|
15675
16394
|
packageRequirements: [
|
|
15676
16395
|
{
|
|
15677
16396
|
name: "@starwind-ui/runtime",
|
|
15678
|
-
range: "^0.1.0-beta.
|
|
16397
|
+
range: "^0.1.0-beta.2"
|
|
15679
16398
|
},
|
|
15680
16399
|
{
|
|
15681
16400
|
name: "react",
|
|
@@ -15720,7 +16439,7 @@ if (!src && !image) {
|
|
|
15720
16439
|
packageRequirements: [
|
|
15721
16440
|
{
|
|
15722
16441
|
name: "@starwind-ui/runtime",
|
|
15723
|
-
range: "^0.1.0-beta.
|
|
16442
|
+
range: "^0.1.0-beta.2"
|
|
15724
16443
|
},
|
|
15725
16444
|
{
|
|
15726
16445
|
name: "react",
|
|
@@ -15771,7 +16490,7 @@ if (!src && !image) {
|
|
|
15771
16490
|
packageRequirements: [
|
|
15772
16491
|
{
|
|
15773
16492
|
name: "@starwind-ui/runtime",
|
|
15774
|
-
range: "^0.1.0-beta.
|
|
16493
|
+
range: "^0.1.0-beta.2"
|
|
15775
16494
|
},
|
|
15776
16495
|
{
|
|
15777
16496
|
name: "react",
|
|
@@ -15828,7 +16547,7 @@ if (!src && !image) {
|
|
|
15828
16547
|
packageRequirements: [
|
|
15829
16548
|
{
|
|
15830
16549
|
name: "@starwind-ui/runtime",
|
|
15831
|
-
range: "^0.1.0-beta.
|
|
16550
|
+
range: "^0.1.0-beta.2"
|
|
15832
16551
|
},
|
|
15833
16552
|
{
|
|
15834
16553
|
name: "react",
|
|
@@ -15885,7 +16604,7 @@ if (!src && !image) {
|
|
|
15885
16604
|
packageRequirements: [
|
|
15886
16605
|
{
|
|
15887
16606
|
name: "@starwind-ui/runtime",
|
|
15888
|
-
range: "^0.1.0-beta.
|
|
16607
|
+
range: "^0.1.0-beta.2"
|
|
15889
16608
|
},
|
|
15890
16609
|
{
|
|
15891
16610
|
name: "react",
|
|
@@ -15960,7 +16679,7 @@ if (!src && !image) {
|
|
|
15960
16679
|
packageRequirements: [
|
|
15961
16680
|
{
|
|
15962
16681
|
name: "@starwind-ui/runtime",
|
|
15963
|
-
range: "^0.1.0-beta.
|
|
16682
|
+
range: "^0.1.0-beta.2"
|
|
15964
16683
|
},
|
|
15965
16684
|
{
|
|
15966
16685
|
name: "react",
|
|
@@ -16017,7 +16736,7 @@ if (!src && !image) {
|
|
|
16017
16736
|
packageRequirements: [
|
|
16018
16737
|
{
|
|
16019
16738
|
name: "@starwind-ui/runtime",
|
|
16020
|
-
range: "^0.1.0-beta.
|
|
16739
|
+
range: "^0.1.0-beta.2"
|
|
16021
16740
|
},
|
|
16022
16741
|
{
|
|
16023
16742
|
name: "react",
|
|
@@ -16062,7 +16781,7 @@ if (!src && !image) {
|
|
|
16062
16781
|
packageRequirements: [
|
|
16063
16782
|
{
|
|
16064
16783
|
name: "@starwind-ui/runtime",
|
|
16065
|
-
range: "^0.1.0-beta.
|
|
16784
|
+
range: "^0.1.0-beta.2"
|
|
16066
16785
|
},
|
|
16067
16786
|
{
|
|
16068
16787
|
name: "react",
|
|
@@ -16113,7 +16832,7 @@ if (!src && !image) {
|
|
|
16113
16832
|
packageRequirements: [
|
|
16114
16833
|
{
|
|
16115
16834
|
name: "@starwind-ui/runtime",
|
|
16116
|
-
range: "^0.1.0-beta.
|
|
16835
|
+
range: "^0.1.0-beta.2"
|
|
16117
16836
|
},
|
|
16118
16837
|
{
|
|
16119
16838
|
name: "react",
|
|
@@ -16164,7 +16883,7 @@ if (!src && !image) {
|
|
|
16164
16883
|
packageRequirements: [
|
|
16165
16884
|
{
|
|
16166
16885
|
name: "@starwind-ui/runtime",
|
|
16167
|
-
range: "^0.1.0-beta.
|
|
16886
|
+
range: "^0.1.0-beta.2"
|
|
16168
16887
|
},
|
|
16169
16888
|
{
|
|
16170
16889
|
name: "react",
|
|
@@ -16239,7 +16958,7 @@ if (!src && !image) {
|
|
|
16239
16958
|
packageRequirements: [
|
|
16240
16959
|
{
|
|
16241
16960
|
name: "@starwind-ui/runtime",
|
|
16242
|
-
range: "^0.1.0-beta.
|
|
16961
|
+
range: "^0.1.0-beta.2"
|
|
16243
16962
|
},
|
|
16244
16963
|
{
|
|
16245
16964
|
name: "react",
|
|
@@ -16254,7 +16973,7 @@ if (!src && !image) {
|
|
|
16254
16973
|
{
|
|
16255
16974
|
component: "accordion",
|
|
16256
16975
|
framework: "react",
|
|
16257
|
-
version: "0.1.
|
|
16976
|
+
version: "0.1.1",
|
|
16258
16977
|
files: [
|
|
16259
16978
|
{
|
|
16260
16979
|
path: "src/components/starwind-primitives/accordion/AccordionHeader.tsx",
|
|
@@ -16276,8 +16995,8 @@ if (!src && !image) {
|
|
|
16276
16995
|
},
|
|
16277
16996
|
{
|
|
16278
16997
|
path: "src/components/starwind-primitives/accordion/AccordionRoot.tsx",
|
|
16279
|
-
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport {\n type AccordionValue,\n type AccordionValueChangeDetails,\n createAccordion,\n} from "@starwind-ui/runtime/accordion";\nimport * as React from "react";\nimport { setRef } from "../internal/compose-refs";\nimport { useIsomorphicLayoutEffect } from "../internal/use-isomorphic-layout-effect";\n\nexport type AccordionRootProps = Omit<\n React.HTMLAttributes<HTMLDivElement>,\n "defaultValue" | "onChange"\n> & {\n type?: "single" | "multiple";\n defaultValue?: AccordionValue;\n value?: AccordionValue;\n collapsible?: boolean;\n onValueChange?: (details: AccordionValueChangeDetails) => void;\n};\n\nconst AccordionRoot = React.forwardRef<HTMLDivElement, AccordionRootProps>(function AccordionRoot(\n { type = "single", defaultValue, value, collapsible =
|
|
16280
|
-
sourceHash: "sha256:
|
|
16998
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport {\n type AccordionValue,\n type AccordionValueChangeDetails,\n createAccordion,\n} from "@starwind-ui/runtime/accordion";\nimport * as React from "react";\nimport { setRef } from "../internal/compose-refs";\nimport { useIsomorphicLayoutEffect } from "../internal/use-isomorphic-layout-effect";\n\nexport type AccordionRootProps = Omit<\n React.HTMLAttributes<HTMLDivElement>,\n "defaultValue" | "onChange"\n> & {\n type?: "single" | "multiple";\n defaultValue?: AccordionValue;\n value?: AccordionValue;\n collapsible?: boolean;\n onValueChange?: (details: AccordionValueChangeDetails) => void;\n};\n\nconst AccordionRoot = React.forwardRef<HTMLDivElement, AccordionRootProps>(function AccordionRoot(\n { type = "single", defaultValue, value, collapsible = true, onValueChange, ...props },\n forwardedRef,\n) {\n const rootRef = React.useRef<HTMLDivElement>(null);\n const instanceRef = React.useRef<ReturnType<typeof createAccordion> | undefined>(undefined);\n const onValueChangeRef = React.useRef(onValueChange);\n const valueRef = React.useRef(value);\n const defaultValueRef = React.useRef(defaultValue);\n const uncontrolledValueRef = React.useRef<AccordionValue | undefined>(defaultValueRef.current);\n\n useIsomorphicLayoutEffect(() => {\n onValueChangeRef.current = onValueChange;\n }, [onValueChange]);\n\n useIsomorphicLayoutEffect(() => {\n valueRef.current = value;\n }, [value]);\n\n const composedRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node;\n return setRef(forwardedRef, node);\n },\n [forwardedRef],\n );\n\n useIsomorphicLayoutEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n\n const instance = createAccordion(root, {\n type,\n defaultValue: uncontrolledValueRef.current,\n collapsible,\n ...(valueRef.current !== undefined ? { value: valueRef.current } : {}),\n });\n instanceRef.current = instance;\n const unsubscribe = instance.subscribe("valueChange", (details) => {\n onValueChangeRef.current?.(details);\n if (valueRef.current === undefined) {\n uncontrolledValueRef.current = details.value;\n }\n });\n\n return () => {\n unsubscribe();\n instance.destroy();\n if (instanceRef.current === instance) {\n instanceRef.current = undefined;\n }\n };\n }, [type, collapsible]);\n\n useIsomorphicLayoutEffect(() => {\n if (value === undefined) return;\n const instance = instanceRef.current;\n if (!instance) return;\n if (isAccordionValueEqual(instance.getValue(), value)) return;\n\n instance.setValue(value, { emit: false });\n }, [value]);\n\n const defaultValueAttribute = Array.isArray(defaultValueRef.current)\n ? JSON.stringify(defaultValueRef.current)\n : defaultValueRef.current;\n\n return (\n <div\n data-sw-accordion\n data-type={type}\n data-default-value={defaultValueAttribute}\n data-collapsible={String(collapsible)}\n data-state="closed"\n ref={composedRef}\n {...props}\n />\n );\n});\n\nAccordionRoot.displayName = "Accordion.Root";\n\nexport default AccordionRoot;\n\nfunction isAccordionValueEqual(left: AccordionValue, right: AccordionValue): boolean {\n if (Array.isArray(left) || Array.isArray(right)) {\n return JSON.stringify(left) === JSON.stringify(right);\n }\n\n return left === right;\n}\n',
|
|
16999
|
+
sourceHash: "sha256:17a4321eac074ca45aa0de4b98439ba1080634fe9623bad7032c52d540ffcadf",
|
|
16281
17000
|
sourcePath: "packages/react/src/accordion/AccordionRoot.tsx"
|
|
16282
17001
|
},
|
|
16283
17002
|
{
|
|
@@ -16308,7 +17027,7 @@ if (!src && !image) {
|
|
|
16308
17027
|
packageRequirements: [
|
|
16309
17028
|
{
|
|
16310
17029
|
name: "@starwind-ui/runtime",
|
|
16311
|
-
range: "^0.1.0-beta.
|
|
17030
|
+
range: "^0.1.0-beta.2"
|
|
16312
17031
|
},
|
|
16313
17032
|
{
|
|
16314
17033
|
name: "react",
|
|
@@ -16365,7 +17084,7 @@ if (!src && !image) {
|
|
|
16365
17084
|
packageRequirements: [
|
|
16366
17085
|
{
|
|
16367
17086
|
name: "@starwind-ui/runtime",
|
|
16368
|
-
range: "^0.1.0-beta.
|
|
17087
|
+
range: "^0.1.0-beta.2"
|
|
16369
17088
|
},
|
|
16370
17089
|
{
|
|
16371
17090
|
name: "react",
|
|
@@ -16434,7 +17153,7 @@ if (!src && !image) {
|
|
|
16434
17153
|
packageRequirements: [
|
|
16435
17154
|
{
|
|
16436
17155
|
name: "@starwind-ui/runtime",
|
|
16437
|
-
range: "^0.1.0-beta.
|
|
17156
|
+
range: "^0.1.0-beta.2"
|
|
16438
17157
|
},
|
|
16439
17158
|
{
|
|
16440
17159
|
name: "react",
|
|
@@ -16509,7 +17228,7 @@ if (!src && !image) {
|
|
|
16509
17228
|
packageRequirements: [
|
|
16510
17229
|
{
|
|
16511
17230
|
name: "@starwind-ui/runtime",
|
|
16512
|
-
range: "^0.1.0-beta.
|
|
17231
|
+
range: "^0.1.0-beta.2"
|
|
16513
17232
|
},
|
|
16514
17233
|
{
|
|
16515
17234
|
name: "react",
|
|
@@ -16572,7 +17291,7 @@ if (!src && !image) {
|
|
|
16572
17291
|
packageRequirements: [
|
|
16573
17292
|
{
|
|
16574
17293
|
name: "@starwind-ui/runtime",
|
|
16575
|
-
range: "^0.1.0-beta.
|
|
17294
|
+
range: "^0.1.0-beta.2"
|
|
16576
17295
|
},
|
|
16577
17296
|
{
|
|
16578
17297
|
name: "react",
|
|
@@ -16647,7 +17366,7 @@ if (!src && !image) {
|
|
|
16647
17366
|
packageRequirements: [
|
|
16648
17367
|
{
|
|
16649
17368
|
name: "@starwind-ui/runtime",
|
|
16650
|
-
range: "^0.1.0-beta.
|
|
17369
|
+
range: "^0.1.0-beta.2"
|
|
16651
17370
|
},
|
|
16652
17371
|
{
|
|
16653
17372
|
name: "react",
|
|
@@ -16752,7 +17471,7 @@ if (!src && !image) {
|
|
|
16752
17471
|
packageRequirements: [
|
|
16753
17472
|
{
|
|
16754
17473
|
name: "@starwind-ui/runtime",
|
|
16755
|
-
range: "^0.1.0-beta.
|
|
17474
|
+
range: "^0.1.0-beta.2"
|
|
16756
17475
|
},
|
|
16757
17476
|
{
|
|
16758
17477
|
name: "react",
|
|
@@ -16839,7 +17558,7 @@ if (!src && !image) {
|
|
|
16839
17558
|
packageRequirements: [
|
|
16840
17559
|
{
|
|
16841
17560
|
name: "@starwind-ui/runtime",
|
|
16842
|
-
range: "^0.1.0-beta.
|
|
17561
|
+
range: "^0.1.0-beta.2"
|
|
16843
17562
|
},
|
|
16844
17563
|
{
|
|
16845
17564
|
name: "react",
|
|
@@ -16920,7 +17639,7 @@ if (!src && !image) {
|
|
|
16920
17639
|
packageRequirements: [
|
|
16921
17640
|
{
|
|
16922
17641
|
name: "@starwind-ui/runtime",
|
|
16923
|
-
range: "^0.1.0-beta.
|
|
17642
|
+
range: "^0.1.0-beta.2"
|
|
16924
17643
|
},
|
|
16925
17644
|
{
|
|
16926
17645
|
name: "react",
|
|
@@ -17013,7 +17732,7 @@ if (!src && !image) {
|
|
|
17013
17732
|
packageRequirements: [
|
|
17014
17733
|
{
|
|
17015
17734
|
name: "@starwind-ui/runtime",
|
|
17016
|
-
range: "^0.1.0-beta.
|
|
17735
|
+
range: "^0.1.0-beta.2"
|
|
17017
17736
|
},
|
|
17018
17737
|
{
|
|
17019
17738
|
name: "react",
|
|
@@ -17106,7 +17825,7 @@ if (!src && !image) {
|
|
|
17106
17825
|
packageRequirements: [
|
|
17107
17826
|
{
|
|
17108
17827
|
name: "@starwind-ui/runtime",
|
|
17109
|
-
range: "^0.1.0-beta.
|
|
17828
|
+
range: "^0.1.0-beta.2"
|
|
17110
17829
|
},
|
|
17111
17830
|
{
|
|
17112
17831
|
name: "react",
|
|
@@ -17175,7 +17894,7 @@ if (!src && !image) {
|
|
|
17175
17894
|
packageRequirements: [
|
|
17176
17895
|
{
|
|
17177
17896
|
name: "@starwind-ui/runtime",
|
|
17178
|
-
range: "^0.1.0-beta.
|
|
17897
|
+
range: "^0.1.0-beta.2"
|
|
17179
17898
|
},
|
|
17180
17899
|
{
|
|
17181
17900
|
name: "react",
|
|
@@ -17328,7 +18047,7 @@ if (!src && !image) {
|
|
|
17328
18047
|
packageRequirements: [
|
|
17329
18048
|
{
|
|
17330
18049
|
name: "@starwind-ui/runtime",
|
|
17331
|
-
range: "^0.1.0-beta.
|
|
18050
|
+
range: "^0.1.0-beta.2"
|
|
17332
18051
|
},
|
|
17333
18052
|
{
|
|
17334
18053
|
name: "react",
|
|
@@ -17439,7 +18158,7 @@ if (!src && !image) {
|
|
|
17439
18158
|
packageRequirements: [
|
|
17440
18159
|
{
|
|
17441
18160
|
name: "@starwind-ui/runtime",
|
|
17442
|
-
range: "^0.1.0-beta.
|
|
18161
|
+
range: "^0.1.0-beta.2"
|
|
17443
18162
|
},
|
|
17444
18163
|
{
|
|
17445
18164
|
name: "react",
|
|
@@ -17592,7 +18311,7 @@ if (!src && !image) {
|
|
|
17592
18311
|
packageRequirements: [
|
|
17593
18312
|
{
|
|
17594
18313
|
name: "@starwind-ui/runtime",
|
|
17595
|
-
range: "^0.1.0-beta.
|
|
18314
|
+
range: "^0.1.0-beta.2"
|
|
17596
18315
|
},
|
|
17597
18316
|
{
|
|
17598
18317
|
name: "react",
|
|
@@ -17745,7 +18464,7 @@ if (!src && !image) {
|
|
|
17745
18464
|
packageRequirements: [
|
|
17746
18465
|
{
|
|
17747
18466
|
name: "@starwind-ui/runtime",
|
|
17748
|
-
range: "^0.1.0-beta.
|
|
18467
|
+
range: "^0.1.0-beta.2"
|
|
17749
18468
|
},
|
|
17750
18469
|
{
|
|
17751
18470
|
name: "react",
|
|
@@ -17820,7 +18539,7 @@ if (!src && !image) {
|
|
|
17820
18539
|
packageRequirements: [
|
|
17821
18540
|
{
|
|
17822
18541
|
name: "@starwind-ui/runtime",
|
|
17823
|
-
range: "^0.1.0-beta.
|
|
18542
|
+
range: "^0.1.0-beta.2"
|
|
17824
18543
|
},
|
|
17825
18544
|
{
|
|
17826
18545
|
name: "react",
|
|
@@ -17985,7 +18704,184 @@ if (!src && !image) {
|
|
|
17985
18704
|
packageRequirements: [
|
|
17986
18705
|
{
|
|
17987
18706
|
name: "@starwind-ui/runtime",
|
|
17988
|
-
range: "^0.1.0-beta.
|
|
18707
|
+
range: "^0.1.0-beta.2"
|
|
18708
|
+
},
|
|
18709
|
+
{
|
|
18710
|
+
name: "react",
|
|
18711
|
+
range: ">=18"
|
|
18712
|
+
},
|
|
18713
|
+
{
|
|
18714
|
+
name: "react-dom",
|
|
18715
|
+
range: ">=18"
|
|
18716
|
+
}
|
|
18717
|
+
]
|
|
18718
|
+
},
|
|
18719
|
+
{
|
|
18720
|
+
component: "color-picker",
|
|
18721
|
+
framework: "react",
|
|
18722
|
+
version: "0.1.0",
|
|
18723
|
+
files: [
|
|
18724
|
+
{
|
|
18725
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerArea.tsx",
|
|
18726
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport { useColorPickerPartProjection, ColorPickerAreaContext } from "./ColorPickerRoot";\nimport type { ColorPickerInitialChannel } from "@starwind-ui/runtime/color-picker";\n\nexport type ColorPickerAreaProps = React.ComponentPropsWithoutRef<"div"> & {\n children?: React.ReactNode;\n xChannel?: ColorPickerInitialChannel;\n yChannel?: ColorPickerInitialChannel;\n xStep?: number;\n yStep?: number;\n};\n\nconst ColorPickerArea = React.forwardRef<HTMLDivElement, ColorPickerAreaProps>(\n function ColorPickerArea(\n { children, xChannel = "saturation", yChannel = "brightness", xStep, yStep, ...props },\n forwardedRef,\n ) {\n const areaContextValue = React.useMemo(\n () => ({ xChannel, yChannel, xStep, yStep }),\n [xChannel, yChannel, xStep, yStep],\n );\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "area", ...areaContextValue },\n {\n ...props,\n "data-sw-color-picker-area": "",\n "data-x-channel": xChannel,\n "data-y-channel": yChannel,\n },\n );\n return (\n <ColorPickerAreaContext.Provider value={areaContextValue}>\n <div {...projectedProps} ref={forwardedRef}>\n {children}\n </div>\n </ColorPickerAreaContext.Provider>\n );\n },\n);\n\nColorPickerArea.displayName = "ColorPicker.Area";\n\nexport default ColorPickerArea;\n',
|
|
18727
|
+
sourceHash: "sha256:280923c4f3381ddc20aa1683220f06c234dd2c350b89b82f98e335bdd172c896",
|
|
18728
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerArea.tsx"
|
|
18729
|
+
},
|
|
18730
|
+
{
|
|
18731
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerAreaBackground.tsx",
|
|
18732
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport { useColorPickerPartProjection, useColorPickerAreaContext } from "./ColorPickerRoot";\n\nexport type ColorPickerAreaBackgroundProps = React.ComponentPropsWithoutRef<"div"> & {\n children?: React.ReactNode;\n};\n\nconst ColorPickerAreaBackground = React.forwardRef<HTMLDivElement, ColorPickerAreaBackgroundProps>(\n function ColorPickerAreaBackground({ children, ...props }, forwardedRef) {\n const areaContext = useColorPickerAreaContext();\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "areaBackground", ...areaContext },\n { ...props, "data-sw-color-picker-area-background": "" },\n );\n return (\n <div {...projectedProps} ref={forwardedRef}>\n {children}\n </div>\n );\n },\n);\n\nColorPickerAreaBackground.displayName = "ColorPicker.AreaBackground";\n\nexport default ColorPickerAreaBackground;\n',
|
|
18733
|
+
sourceHash: "sha256:4d181ea31cffeacd9964355859bf949ed54aaea6f51cfc4dd1f011e5e77b886c",
|
|
18734
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerAreaBackground.tsx"
|
|
18735
|
+
},
|
|
18736
|
+
{
|
|
18737
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerAreaInput.tsx",
|
|
18738
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport { useColorPickerPartProjection, useColorPickerAreaContext } from "./ColorPickerRoot";\n\nexport type ColorPickerAreaInputProps = React.ComponentPropsWithoutRef<"input"> & {\n axis?: "x" | "y";\n step?: number;\n};\n\nconst ColorPickerAreaInput = React.forwardRef<HTMLInputElement, ColorPickerAreaInputProps>(\n function ColorPickerAreaInput({ axis = "x", step, ...props }, forwardedRef) {\n const areaContext = useColorPickerAreaContext();\n const { props: projectedProps } = useColorPickerPartProjection(\n {\n part: "areaInput",\n ...areaContext,\n axis,\n ...(axis === "x"\n ? { xStep: step ?? areaContext.xStep }\n : { yStep: step ?? areaContext.yStep }),\n },\n {\n ...props,\n "data-sw-color-picker-area-input": "",\n "data-axis": axis,\n "data-step": step ?? (axis === "x" ? areaContext.xStep : areaContext.yStep),\n },\n );\n return <input {...projectedProps} ref={forwardedRef} />;\n },\n);\n\nColorPickerAreaInput.displayName = "ColorPicker.AreaInput";\n\nexport default ColorPickerAreaInput;\n',
|
|
18739
|
+
sourceHash: "sha256:73a6f6a4def2a4b7156edec1a37b1b33d0ccd9bceff98ee7d9e803990cd5ba79",
|
|
18740
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerAreaInput.tsx"
|
|
18741
|
+
},
|
|
18742
|
+
{
|
|
18743
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerAreaThumb.tsx",
|
|
18744
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport { useColorPickerPartProjection, useColorPickerAreaContext } from "./ColorPickerRoot";\n\nexport type ColorPickerAreaThumbProps = React.ComponentPropsWithoutRef<"span"> & {\n children?: React.ReactNode;\n};\n\nconst ColorPickerAreaThumb = React.forwardRef<HTMLSpanElement, ColorPickerAreaThumbProps>(\n function ColorPickerAreaThumb({ children, ...props }, forwardedRef) {\n const areaContext = useColorPickerAreaContext();\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "areaThumb", ...areaContext },\n { ...props, "data-sw-color-picker-area-thumb": "" },\n );\n return (\n <span {...projectedProps} ref={forwardedRef}>\n {children}\n </span>\n );\n },\n);\n\nColorPickerAreaThumb.displayName = "ColorPicker.AreaThumb";\n\nexport default ColorPickerAreaThumb;\n',
|
|
18745
|
+
sourceHash: "sha256:d6577229f89a7ae04df9d5d7cac40cc40c594871de12edba882219f59e853f4b",
|
|
18746
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerAreaThumb.tsx"
|
|
18747
|
+
},
|
|
18748
|
+
{
|
|
18749
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerChannelInput.tsx",
|
|
18750
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport { useColorPickerPartProjection } from "./ColorPickerRoot";\nimport type { ColorPickerInitialChannel } from "@starwind-ui/runtime/color-picker";\n\nexport type ColorPickerChannelInputProps = React.ComponentPropsWithoutRef<"input"> & {\n channel?: ColorPickerInitialChannel;\n};\n\nconst ColorPickerChannelInput = React.forwardRef<HTMLInputElement, ColorPickerChannelInputProps>(\n function ColorPickerChannelInput({ channel = "hue", ...props }, forwardedRef) {\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "channelInput", channel },\n { ...props, "data-sw-color-picker-channel-field": "", "data-channel": channel },\n );\n return <input {...projectedProps} ref={forwardedRef} />;\n },\n);\n\nColorPickerChannelInput.displayName = "ColorPicker.ChannelInput";\n\nexport default ColorPickerChannelInput;\n',
|
|
18751
|
+
sourceHash: "sha256:c94a3d1ee2499a09f282493370b5a12df8c86fbba8a35390b0a36aa0b55e50b6",
|
|
18752
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerChannelInput.tsx"
|
|
18753
|
+
},
|
|
18754
|
+
{
|
|
18755
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerChannelSlider.tsx",
|
|
18756
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport { useColorPickerPartProjection, ColorPickerChannelSliderContext } from "./ColorPickerRoot";\nimport type { ColorPickerInitialChannel } from "@starwind-ui/runtime/color-picker";\n\nexport type ColorPickerChannelSliderProps = React.ComponentPropsWithoutRef<"div"> & {\n children?: React.ReactNode;\n channel?: ColorPickerInitialChannel;\n orientation?: "horizontal" | "vertical";\n step?: number;\n};\n\nconst ColorPickerChannelSlider = React.forwardRef<HTMLDivElement, ColorPickerChannelSliderProps>(\n function ColorPickerChannelSlider(\n { children, channel = "hue", orientation = "horizontal", step, ...props },\n forwardedRef,\n ) {\n const sliderContextValue = React.useMemo(\n () => ({ channel, orientation, step }),\n [channel, orientation, step],\n );\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "channelSlider", ...sliderContextValue },\n {\n ...props,\n "data-sw-color-picker-channel-slider": "",\n "data-channel": channel,\n "data-orientation": orientation,\n },\n );\n return (\n <ColorPickerChannelSliderContext.Provider value={sliderContextValue}>\n <div {...projectedProps} ref={forwardedRef}>\n {children}\n </div>\n </ColorPickerChannelSliderContext.Provider>\n );\n },\n);\n\nColorPickerChannelSlider.displayName = "ColorPicker.ChannelSlider";\n\nexport default ColorPickerChannelSlider;\n',
|
|
18757
|
+
sourceHash: "sha256:ed42cb23f5d23e5a82c45681348acd0387308f7b84302dcd11958e465188f744",
|
|
18758
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerChannelSlider.tsx"
|
|
18759
|
+
},
|
|
18760
|
+
{
|
|
18761
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerChannelSliderInput.tsx",
|
|
18762
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport {\n useColorPickerPartProjection,\n useColorPickerChannelSliderContext,\n} from "./ColorPickerRoot";\n\nexport type ColorPickerChannelSliderInputProps = React.ComponentPropsWithoutRef<"input"> & {\n step?: number;\n};\n\nconst ColorPickerChannelSliderInput = React.forwardRef<\n HTMLInputElement,\n ColorPickerChannelSliderInputProps\n>(function ColorPickerChannelSliderInput({ step, ...props }, forwardedRef) {\n const sliderContext = useColorPickerChannelSliderContext();\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "channelSliderInput", ...sliderContext, step: step ?? sliderContext.step },\n { ...props, "data-sw-color-picker-channel-input": "", "data-step": step ?? sliderContext.step },\n );\n return <input {...projectedProps} ref={forwardedRef} />;\n});\n\nColorPickerChannelSliderInput.displayName = "ColorPicker.ChannelSliderInput";\n\nexport default ColorPickerChannelSliderInput;\n',
|
|
18763
|
+
sourceHash: "sha256:ee381ccff2019aa383a1cdc373cb7a3609d02e2a3023642f2a08f4f2f1ce7e3a",
|
|
18764
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerChannelSliderInput.tsx"
|
|
18765
|
+
},
|
|
18766
|
+
{
|
|
18767
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerChannelSliderThumb.tsx",
|
|
18768
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport {\n useColorPickerPartProjection,\n useColorPickerChannelSliderContext,\n} from "./ColorPickerRoot";\n\nexport type ColorPickerChannelSliderThumbProps = React.ComponentPropsWithoutRef<"span"> & {\n children?: React.ReactNode;\n};\n\nconst ColorPickerChannelSliderThumb = React.forwardRef<\n HTMLSpanElement,\n ColorPickerChannelSliderThumbProps\n>(function ColorPickerChannelSliderThumb({ children, ...props }, forwardedRef) {\n const sliderContext = useColorPickerChannelSliderContext();\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "channelSliderThumb", ...sliderContext },\n { ...props, "data-sw-color-picker-channel-slider-thumb": "" },\n );\n return (\n <span {...projectedProps} ref={forwardedRef}>\n {children}\n </span>\n );\n});\n\nColorPickerChannelSliderThumb.displayName = "ColorPicker.ChannelSliderThumb";\n\nexport default ColorPickerChannelSliderThumb;\n',
|
|
18769
|
+
sourceHash: "sha256:b06c1e7ba62188190be023e1fc9784376ceec17a8a13d6edbd037e96362ce52c",
|
|
18770
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerChannelSliderThumb.tsx"
|
|
18771
|
+
},
|
|
18772
|
+
{
|
|
18773
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerChannelSliderTrack.tsx",
|
|
18774
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport {\n useColorPickerPartProjection,\n useColorPickerChannelSliderContext,\n} from "./ColorPickerRoot";\n\nexport type ColorPickerChannelSliderTrackProps = React.ComponentPropsWithoutRef<"div"> & {\n children?: React.ReactNode;\n};\n\nconst ColorPickerChannelSliderTrack = React.forwardRef<\n HTMLDivElement,\n ColorPickerChannelSliderTrackProps\n>(function ColorPickerChannelSliderTrack({ children, ...props }, forwardedRef) {\n const sliderContext = useColorPickerChannelSliderContext();\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "channelSliderTrack", ...sliderContext },\n { ...props, "data-sw-color-picker-channel-slider-track": "" },\n );\n return (\n <div {...projectedProps} ref={forwardedRef}>\n {children}\n </div>\n );\n});\n\nColorPickerChannelSliderTrack.displayName = "ColorPicker.ChannelSliderTrack";\n\nexport default ColorPickerChannelSliderTrack;\n',
|
|
18775
|
+
sourceHash: "sha256:8d7d2c7f1f10726df06315a1cc2b28e0bf3c6566da8b950ad9be7f725fe80de4",
|
|
18776
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerChannelSliderTrack.tsx"
|
|
18777
|
+
},
|
|
18778
|
+
{
|
|
18779
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerClear.tsx",
|
|
18780
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport { useColorPickerPartProjection } from "./ColorPickerRoot";\n\nexport type ColorPickerClearProps = React.ComponentPropsWithoutRef<"button"> & {\n children?: React.ReactNode;\n};\n\nconst ColorPickerClear = React.forwardRef<HTMLButtonElement, ColorPickerClearProps>(\n function ColorPickerClear({ children, ...props }, forwardedRef) {\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "clear" },\n { ...props, "data-sw-color-picker-clear": "" },\n );\n return (\n <button {...projectedProps} ref={forwardedRef}>\n {children}\n </button>\n );\n },\n);\n\nColorPickerClear.displayName = "ColorPicker.Clear";\n\nexport default ColorPickerClear;\n',
|
|
18781
|
+
sourceHash: "sha256:73b8ad9d0ecb6a6bd291984d64e2d4c14987337ccfb9a13c16ffbb1d163fcedb",
|
|
18782
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerClear.tsx"
|
|
18783
|
+
},
|
|
18784
|
+
{
|
|
18785
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerControl.tsx",
|
|
18786
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport { useColorPickerPartProjection } from "./ColorPickerRoot";\n\nexport type ColorPickerControlProps = React.ComponentPropsWithoutRef<"div"> & {\n children?: React.ReactNode;\n};\n\nconst ColorPickerControl = React.forwardRef<HTMLDivElement, ColorPickerControlProps>(\n function ColorPickerControl({ children, ...props }, forwardedRef) {\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "control" },\n { ...props, "data-sw-color-picker-control": "" },\n );\n return (\n <div {...projectedProps} ref={forwardedRef}>\n {children}\n </div>\n );\n },\n);\n\nColorPickerControl.displayName = "ColorPicker.Control";\n\nexport default ColorPickerControl;\n',
|
|
18787
|
+
sourceHash: "sha256:4b32b16fedd23716cb348f1eb495aebec6755e730e99b0effd0a2b1778e05cc4",
|
|
18788
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerControl.tsx"
|
|
18789
|
+
},
|
|
18790
|
+
{
|
|
18791
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerEyeDropperTrigger.tsx",
|
|
18792
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport { useColorPickerPartProjection } from "./ColorPickerRoot";\n\nexport type ColorPickerEyeDropperTriggerProps = React.ComponentPropsWithoutRef<"button"> & {\n children?: React.ReactNode;\n};\n\nconst ColorPickerEyeDropperTrigger = React.forwardRef<\n HTMLButtonElement,\n ColorPickerEyeDropperTriggerProps\n>(function ColorPickerEyeDropperTrigger({ children, ...props }, forwardedRef) {\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "eyeDropperTrigger" },\n { ...props, "data-sw-color-picker-eye-dropper": "" },\n );\n return (\n <button {...projectedProps} ref={forwardedRef}>\n {children}\n </button>\n );\n});\n\nColorPickerEyeDropperTrigger.displayName = "ColorPicker.EyeDropperTrigger";\n\nexport default ColorPickerEyeDropperTrigger;\n',
|
|
18793
|
+
sourceHash: "sha256:bd480e33d628676cb465026dd951a87df0b03dd9562cab40f2eef0f264505182",
|
|
18794
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerEyeDropperTrigger.tsx"
|
|
18795
|
+
},
|
|
18796
|
+
{
|
|
18797
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerFormatControl.tsx",
|
|
18798
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport { useColorPickerPartProjection } from "./ColorPickerRoot";\n\nexport type ColorPickerFormatControlProps = React.ComponentPropsWithoutRef<"div"> & {\n children?: React.ReactNode;\n};\n\nconst ColorPickerFormatControl = React.forwardRef<HTMLDivElement, ColorPickerFormatControlProps>(\n function ColorPickerFormatControl({ children, ...props }, forwardedRef) {\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "formatControl" },\n { ...props, "data-sw-color-picker-format-control": "" },\n );\n return (\n <div {...projectedProps} ref={forwardedRef}>\n {children}\n </div>\n );\n },\n);\n\nColorPickerFormatControl.displayName = "ColorPicker.FormatControl";\n\nexport default ColorPickerFormatControl;\n',
|
|
18799
|
+
sourceHash: "sha256:bac4d5effcfa6386e160f008abec383dc9e6e90542c50cd68c71a9e5f18d07b1",
|
|
18800
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerFormatControl.tsx"
|
|
18801
|
+
},
|
|
18802
|
+
{
|
|
18803
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerFormatSelect.tsx",
|
|
18804
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport { useColorPickerPartProjection } from "./ColorPickerRoot";\n\nexport type ColorPickerFormatSelectProps = React.ComponentPropsWithoutRef<"select"> & {\n children?: React.ReactNode;\n};\n\nconst ColorPickerFormatSelect = React.forwardRef<HTMLSelectElement, ColorPickerFormatSelectProps>(\n function ColorPickerFormatSelect({ children, ...props }, forwardedRef) {\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "formatSelect" },\n { ...props, "data-sw-color-picker-format-select": "" },\n );\n return (\n <select {...projectedProps} ref={forwardedRef}>\n {children}\n </select>\n );\n },\n);\n\nColorPickerFormatSelect.displayName = "ColorPicker.FormatSelect";\n\nexport default ColorPickerFormatSelect;\n',
|
|
18805
|
+
sourceHash: "sha256:50f73ee0ff7c0f2621d603880c9f3bb32cbd8b66a97fa85a2c97085acc84e342",
|
|
18806
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerFormatSelect.tsx"
|
|
18807
|
+
},
|
|
18808
|
+
{
|
|
18809
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerHiddenInput.tsx",
|
|
18810
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport { useColorPickerPartProjection } from "./ColorPickerRoot";\n\nexport type ColorPickerHiddenInputProps = React.ComponentPropsWithoutRef<"input"> & {};\n\nconst ColorPickerHiddenInput = React.forwardRef<HTMLInputElement, ColorPickerHiddenInputProps>(\n function ColorPickerHiddenInput({ ...props }, forwardedRef) {\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "hiddenInput" },\n { ...props, "data-sw-color-picker-hidden-input": "" },\n );\n return <input {...projectedProps} ref={forwardedRef} />;\n },\n);\n\nColorPickerHiddenInput.displayName = "ColorPicker.HiddenInput";\n\nexport default ColorPickerHiddenInput;\n',
|
|
18811
|
+
sourceHash: "sha256:8ec4ca5ea3b1a160270fbd20678ec4938695d913552df7125c303a3370b254db",
|
|
18812
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerHiddenInput.tsx"
|
|
18813
|
+
},
|
|
18814
|
+
{
|
|
18815
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerLabel.tsx",
|
|
18816
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport { useColorPickerPartProjection } from "./ColorPickerRoot";\n\nexport type ColorPickerLabelProps = React.ComponentPropsWithoutRef<"span"> & {\n children?: React.ReactNode;\n};\n\nconst ColorPickerLabel = React.forwardRef<HTMLSpanElement, ColorPickerLabelProps>(\n function ColorPickerLabel({ children, ...props }, forwardedRef) {\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "label" },\n { ...props, "data-sw-color-picker-label": "" },\n );\n return (\n <span {...projectedProps} ref={forwardedRef}>\n {children}\n </span>\n );\n },\n);\n\nColorPickerLabel.displayName = "ColorPicker.Label";\n\nexport default ColorPickerLabel;\n',
|
|
18817
|
+
sourceHash: "sha256:cea7f36e0fd53809ba3ef1453a99c33ff6407a93cae2baa76ff62cb0b71def2c",
|
|
18818
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerLabel.tsx"
|
|
18819
|
+
},
|
|
18820
|
+
{
|
|
18821
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerRoot.tsx",
|
|
18822
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport {\n createColorPicker,\n createColorPickerInitialState,\n projectColorPickerInitialPart,\n type ColorPickerColor,\n type ColorPickerDirection,\n type ColorPickerFormat,\n type ColorPickerFormatChangeDetails,\n type ColorPickerInitialChannel,\n type ColorPickerInitialPartProjection,\n type ColorPickerInitialPartRequest,\n type ColorPickerInitialState,\n type ColorPickerOptions,\n type ColorPickerValue,\n type ColorPickerValueChangeDetails,\n type ColorPickerValueCommitDetails,\n} from "@starwind-ui/runtime/color-picker";\nimport { setRef } from "../internal/compose-refs";\nimport { useIsomorphicLayoutEffect } from "../internal/use-isomorphic-layout-effect";\n\ntype ColorPickerRootContextValue = {\n initialState: ColorPickerInitialState;\n};\n\nexport type ColorPickerAreaContextValue = {\n xChannel: ColorPickerInitialChannel;\n yChannel: ColorPickerInitialChannel;\n xStep?: number;\n yStep?: number;\n};\n\nexport type ColorPickerChannelSliderContextValue = {\n channel: ColorPickerInitialChannel;\n orientation: "horizontal" | "vertical";\n step?: number;\n};\n\nconst ColorPickerRootContext = React.createContext<ColorPickerRootContextValue | null>(null);\nexport const ColorPickerAreaContext = React.createContext<ColorPickerAreaContextValue | null>(null);\nexport const ColorPickerChannelSliderContext =\n React.createContext<ColorPickerChannelSliderContextValue | null>(null);\n\nconst COLOR_PICKER_PART_SELECTOR =\n "[data-sw-color-picker], [data-sw-color-picker-label], [data-sw-color-picker-control], [data-sw-color-picker-value-input], [data-sw-color-picker-value-swatch], [data-sw-color-picker-value-text], [data-sw-color-picker-area], [data-sw-color-picker-area-background], [data-sw-color-picker-area-thumb], [data-sw-color-picker-area-input], [data-sw-color-picker-channel-slider], [data-sw-color-picker-channel-slider-track], [data-sw-color-picker-channel-slider-thumb], [data-sw-color-picker-channel-input], [data-sw-color-picker-channel-field], [data-sw-color-picker-format-select], [data-sw-color-picker-format-control], [data-sw-color-picker-transparency-grid], [data-sw-color-picker-swatch-group], [data-sw-color-picker-swatch], [data-sw-color-picker-eye-dropper], [data-sw-color-picker-clear], [data-sw-color-picker-hidden-input]";\nconst COLOR_PICKER_CONFIGURATION_ATTRIBUTES = [\n "data-axis",\n "data-channel",\n "data-disabled",\n "data-orientation",\n "data-step",\n "data-value",\n "data-x-channel",\n "data-y-channel",\n "aria-label",\n "aria-labelledby",\n "aria-roledescription",\n] as const;\nconst COLOR_PICKER_AUTHORED_ARIA_ATTRIBUTES = [\n "aria-label",\n "aria-labelledby",\n "aria-roledescription",\n] as const;\n\nexport type ColorPickerProjectedProps = Record<string, unknown> & {\n children?: React.ReactNode;\n style?: React.CSSProperties;\n};\n\nexport function useColorPickerPartProjection(\n request: ColorPickerInitialPartRequest,\n authoredProps: ColorPickerProjectedProps,\n): { props: ColorPickerProjectedProps; text?: string } {\n const context = React.useContext(ColorPickerRootContext);\n if (!context) {\n throw new Error("Color Picker parts must be rendered inside ColorPicker.Root.");\n }\n const initialProjectionRef = React.useRef<ColorPickerInitialPartProjection | undefined>(\n undefined,\n );\n initialProjectionRef.current ??= projectColorPickerInitialPart(context.initialState, request);\n const ownershipPendingRef = React.useRef(true);\n const authoredAriaHistoryRef = React.useRef(new Set<string>());\n const projection = initialProjectionRef.current;\n const initialValueRef = React.useRef(projection.properties.value);\n const dynamicAuthoredProps = { ...authoredProps };\n for (const name of COLOR_PICKER_AUTHORED_ARIA_ATTRIBUTES) {\n if (authoredProps[name] === undefined) {\n delete dynamicAuthoredProps[name];\n if (authoredAriaHistoryRef.current.has(name)) dynamicAuthoredProps[name] = undefined;\n }\n }\n useIsomorphicLayoutEffect(() => {\n ownershipPendingRef.current = false;\n for (const name of COLOR_PICKER_AUTHORED_ARIA_ATTRIBUTES) {\n if (authoredProps[name] !== undefined) authoredAriaHistoryRef.current.add(name);\n }\n });\n const stableProjection =\n projection.properties.value === undefined\n ? projection\n : {\n ...projection,\n properties: { ...projection.properties, value: initialValueRef.current },\n };\n return {\n props: translateColorPickerProjection(\n stableProjection,\n dynamicAuthoredProps,\n ownershipPendingRef.current,\n ),\n ...(projection.text === undefined ? {} : { text: projection.text }),\n };\n}\n\nexport function useColorPickerAreaContext(): ColorPickerAreaContextValue {\n return (\n React.useContext(ColorPickerAreaContext) ?? {\n xChannel: "saturation",\n yChannel: "brightness",\n }\n );\n}\n\nexport function useColorPickerChannelSliderContext(): ColorPickerChannelSliderContextValue {\n return (\n React.useContext(ColorPickerChannelSliderContext) ?? {\n channel: "hue",\n orientation: "horizontal",\n }\n );\n}\n\nexport type ColorPickerRootProps = Omit<\n React.ComponentPropsWithoutRef<"div">,\n "value" | "defaultValue" | "dir"\n> & {\n value?: ColorPickerValue;\n defaultValue?: ColorPickerValue;\n format?: ColorPickerFormat;\n alpha?: boolean;\n allowEmpty?: boolean;\n disabled?: boolean;\n readOnly?: boolean;\n name?: string;\n form?: string;\n required?: boolean;\n locale?: string;\n dir?: ColorPickerDirection;\n getAriaValueText?: ColorPickerOptions["getAriaValueText"];\n getAreaRoleDescription?: ColorPickerOptions["getAreaRoleDescription"];\n getColorDescription?: ColorPickerOptions["getColorDescription"];\n onValueChange?: (value: ColorPickerColor | null, details: ColorPickerValueChangeDetails) => void;\n onValueCommitted?: (\n value: ColorPickerColor | null,\n details: ColorPickerValueCommitDetails,\n ) => void;\n onFormatChange?: (format: ColorPickerFormat, details: ColorPickerFormatChangeDetails) => void;\n};\n\nconst ColorPickerRoot = React.forwardRef<React.ElementRef<"div">, ColorPickerRootProps>(\n function ColorPickerRoot(\n {\n value,\n defaultValue = "#000000",\n format,\n alpha = true,\n allowEmpty = false,\n disabled = false,\n readOnly = false,\n name,\n form,\n required = false,\n locale,\n dir,\n getAriaValueText,\n getAreaRoleDescription,\n getColorDescription,\n onValueChange,\n onValueCommitted,\n onFormatChange,\n children,\n ...props\n },\n forwardedRef,\n ) {\n const rootRef = React.useRef<HTMLDivElement>(null);\n const instanceRef = React.useRef<ReturnType<typeof createColorPicker> | undefined>(undefined);\n const ownershipSeedsRef = React.useRef(new Map<Element, string>());\n const structuralFingerprintRef = React.useRef("");\n const structuralElementIdsRef = React.useRef(new WeakMap<Element, number>());\n const nextStructuralElementIdRef = React.useRef(1);\n const rootOwnershipPendingRef = React.useRef(true);\n const isValueControlledRef = React.useRef(value !== undefined);\n const isFormatControlledRef = React.useRef(format !== undefined);\n const valueRef = React.useRef(value);\n const formatRef = React.useRef(format);\n const defaultValueRef = React.useRef(defaultValue);\n const onValueChangeRef = React.useRef(onValueChange);\n const onValueCommittedRef = React.useRef(onValueCommitted);\n const onFormatChangeRef = React.useRef(onFormatChange);\n const initialUncontrolledStateRef = React.useRef(\n createColorPickerInitialState({\n defaultValue: defaultValueRef.current,\n format: formatRef.current,\n alpha,\n allowEmpty,\n }),\n );\n const [uncontrolledValue, setUncontrolledValue] = React.useState<ColorPickerColor | null>(\n initialUncontrolledStateRef.current.value,\n );\n const [uncontrolledFormat, setUncontrolledFormat] = React.useState<ColorPickerFormat>(\n initialUncontrolledStateRef.current.format,\n );\n\n if (isValueControlledRef.current && value !== undefined) valueRef.current = value;\n if (isFormatControlledRef.current && format !== undefined) formatRef.current = format;\n onValueChangeRef.current = onValueChange;\n onValueCommittedRef.current = onValueCommitted;\n onFormatChangeRef.current = onFormatChange;\n\n const renderedValue = isValueControlledRef.current ? valueRef.current : uncontrolledValue;\n const renderedFormat = isFormatControlledRef.current\n ? (formatRef.current ?? uncontrolledFormat)\n : uncontrolledFormat;\n const initialState = React.useMemo(\n () =>\n createColorPickerInitialState({\n value: renderedValue,\n format: renderedFormat,\n alpha,\n allowEmpty,\n disabled,\n readOnly,\n required,\n name,\n form,\n locale,\n dir,\n getAriaValueText,\n getAreaRoleDescription,\n getColorDescription,\n }),\n [\n renderedValue,\n renderedFormat,\n alpha,\n allowEmpty,\n disabled,\n readOnly,\n required,\n name,\n form,\n locale,\n dir,\n getAriaValueText,\n getAreaRoleDescription,\n getColorDescription,\n ],\n );\n const contextValue = React.useMemo(() => ({ initialState }), [initialState]);\n\n const composedRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node;\n return setRef(forwardedRef, node);\n },\n [forwardedRef],\n );\n\n useIsomorphicLayoutEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n\n replayColorPickerOwnership(root, ownershipSeedsRef.current);\n captureColorPickerOwnership(root, ownershipSeedsRef.current);\n const instance = createColorPicker(root, {\n ...(isValueControlledRef.current\n ? { value: valueRef.current }\n : { defaultValue: defaultValueRef.current }),\n format: formatRef.current ?? uncontrolledFormat,\n alpha,\n allowEmpty,\n disabled,\n readOnly,\n name,\n form,\n required,\n locale,\n dir,\n getAriaValueText,\n getAreaRoleDescription,\n getColorDescription,\n onValueChange: (nextValue, details) => {\n onValueChangeRef.current?.(nextValue, details);\n if (!details.isCanceled && !isValueControlledRef.current) {\n setUncontrolledValue(() => nextValue);\n }\n },\n onValueCommitted: (nextValue, details) => {\n onValueCommittedRef.current?.(nextValue, details);\n },\n onFormatChange: (nextFormat, details) => {\n onFormatChangeRef.current?.(nextFormat, details);\n if (isFormatControlledRef.current) {\n const controlledFormat = formatRef.current;\n if (controlledFormat !== undefined && controlledFormat !== nextFormat) {\n instanceRef.current?.setFormat(controlledFormat, { emit: false });\n }\n return;\n }\n setUncontrolledFormat(() => nextFormat);\n },\n });\n instanceRef.current = instance;\n rootOwnershipPendingRef.current = false;\n instance.refresh();\n structuralFingerprintRef.current = colorPickerStructuralFingerprint(\n root,\n structuralElementIdsRef.current,\n nextStructuralElementIdRef,\n );\n\n return () => {\n instance.destroy();\n if (instanceRef.current === instance) instanceRef.current = undefined;\n };\n }, []);\n\n useIsomorphicLayoutEffect(() => {\n const root = rootRef.current;\n if (!root || typeof MutationObserver === "undefined") return;\n let refreshScheduled = false;\n let disposed = false;\n const refreshStructure = () => {\n refreshScheduled = false;\n if (disposed) return;\n const nextFingerprint = colorPickerStructuralFingerprint(\n root,\n structuralElementIdsRef.current,\n nextStructuralElementIdRef,\n );\n if (nextFingerprint === structuralFingerprintRef.current) return;\n structuralFingerprintRef.current = nextFingerprint;\n captureColorPickerOwnership(root, ownershipSeedsRef.current);\n instanceRef.current?.refresh({ preserveState: true });\n structuralFingerprintRef.current = colorPickerStructuralFingerprint(\n root,\n structuralElementIdsRef.current,\n nextStructuralElementIdRef,\n );\n };\n const observer = new MutationObserver((records) => {\n if (!records.some((record) => isColorPickerConfigurationMutation(root, record))) return;\n if (refreshScheduled) return;\n refreshScheduled = true;\n Promise.resolve().then(refreshStructure);\n });\n observer.observe(root, {\n attributes: true,\n attributeFilter: [...COLOR_PICKER_CONFIGURATION_ATTRIBUTES],\n childList: true,\n subtree: true,\n });\n return () => {\n disposed = true;\n observer.disconnect();\n };\n }, []);\n\n useIsomorphicLayoutEffect(() => {\n if (!isValueControlledRef.current || value === undefined) return;\n instanceRef.current?.setValue(value, { emit: false });\n }, [value]);\n\n useIsomorphicLayoutEffect(() => {\n if (!isFormatControlledRef.current || format === undefined) return;\n instanceRef.current?.setFormat(format, { emit: false });\n }, [format]);\n\n useIsomorphicLayoutEffect(() => {\n const instance = instanceRef.current;\n if (!instance) return;\n instance.setDisabled(disabled);\n instance.setReadOnly(readOnly);\n instance.setName(name ?? null);\n instance.setOptions({\n alpha,\n allowEmpty,\n dir: dir ?? null,\n form: form ?? null,\n getAreaRoleDescription,\n getAriaValueText,\n getColorDescription,\n locale: locale ?? null,\n required,\n });\n }, [\n alpha,\n allowEmpty,\n dir,\n disabled,\n form,\n getAreaRoleDescription,\n getAriaValueText,\n getColorDescription,\n locale,\n name,\n readOnly,\n required,\n ]);\n\n const initialRootProjectionRef = React.useRef<ColorPickerInitialPartProjection | undefined>(\n undefined,\n );\n initialRootProjectionRef.current ??= projectColorPickerInitialPart(initialState, {\n part: "root",\n });\n const rootProps = translateColorPickerProjection(\n initialRootProjectionRef.current,\n { ...props, "data-sw-color-picker": "" },\n rootOwnershipPendingRef.current,\n );\n\n return (\n <ColorPickerRootContext.Provider value={contextValue}>\n <div {...rootProps} ref={composedRef}>\n {children}\n </div>\n </ColorPickerRootContext.Provider>\n );\n },\n);\n\nColorPickerRoot.displayName = "ColorPicker.Root";\n\nexport default ColorPickerRoot;\n\nfunction translateColorPickerProjection(\n projection: ColorPickerInitialPartProjection,\n authoredProps: ColorPickerProjectedProps,\n includeOwnership: boolean,\n): ColorPickerProjectedProps {\n const projected: ColorPickerProjectedProps = {};\n for (const [name, value] of Object.entries(projection.attributes)) {\n if (name === "data-sw-color-picker-initial-owned" || value === undefined || value === false)\n continue;\n projected[toReactPropName(name)] = name.startsWith("data-") && value === true ? "" : value;\n }\n for (const [name, value] of Object.entries(projection.properties)) {\n if (value === undefined || name === "defaultValue") continue;\n projected[name === "value" ? "defaultValue" : name] = value;\n }\n if (Object.keys(projection.styles).length > 0) {\n projected.style = Object.fromEntries(\n Object.entries(projection.styles).map(([name, value]) => [toReactStyleName(name), value]),\n ) as React.CSSProperties;\n }\n\n const result = { ...projected, ...authoredProps };\n if (projected.style || authoredProps.style) {\n result.style = { ...projected.style, ...authoredProps.style };\n }\n if (includeOwnership) {\n const tokens = [\n ...projection.ownership.attributes\n .filter((name) => !Object.hasOwn(authoredProps, toReactPropName(name)))\n .map((name) => `a:${name}`),\n ...projection.ownership.properties\n .filter(\n (name) =>\n !Object.hasOwn(authoredProps, name) &&\n !(name === "value" && Object.hasOwn(authoredProps, "defaultValue")),\n )\n .map((name) => `p:${name}`),\n ];\n if (tokens.length > 0) result["data-sw-color-picker-initial-owned"] = tokens.join(",");\n }\n return result;\n}\n\nfunction toReactPropName(name: string): string {\n if (name === "class") return "className";\n if (name === "for") return "htmlFor";\n if (name === "readonly") return "readOnly";\n if (name === "tabindex") return "tabIndex";\n return name;\n}\n\nfunction toReactStyleName(name: string): string {\n return name.startsWith("--")\n ? name\n : name.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());\n}\n\nfunction ownedColorPickerParts(root: HTMLElement): Element[] {\n return [root, ...root.querySelectorAll(COLOR_PICKER_PART_SELECTOR)].filter(\n (element) => element.closest("[data-sw-color-picker]") === root,\n );\n}\n\nfunction captureColorPickerOwnership(root: HTMLElement, seeds: Map<Element, string>): void {\n for (const element of ownedColorPickerParts(root)) {\n const marker = element.getAttribute("data-sw-color-picker-initial-owned");\n if (marker) seeds.set(element, marker);\n }\n}\n\nfunction replayColorPickerOwnership(root: HTMLElement, seeds: Map<Element, string>): void {\n for (const [element, marker] of seeds) {\n if (!element.isConnected || element.closest("[data-sw-color-picker]") !== root) {\n seeds.delete(element);\n continue;\n }\n element.setAttribute("data-sw-color-picker-initial-owned", marker);\n }\n}\n\nfunction isColorPickerConfigurationMutation(root: HTMLElement, record: MutationRecord): boolean {\n const target = record.target instanceof Element ? record.target : null;\n if (!target || target.closest("[data-sw-color-picker]") !== root) return false;\n if (record.type === "childList") return true;\n if (record.type !== "attributes" || !record.attributeName) return false;\n if (record.attributeName === "data-value" || record.attributeName === "data-disabled") {\n return target.hasAttribute("data-sw-color-picker-swatch");\n }\n return true;\n}\n\nfunction colorPickerStructuralFingerprint(\n root: HTMLElement,\n ids: WeakMap<Element, number>,\n nextIdRef: React.MutableRefObject<number>,\n): string {\n return ownedColorPickerParts(root)\n .map((element) => {\n let id = ids.get(element);\n if (id === undefined) {\n id = nextIdRef.current;\n nextIdRef.current += 1;\n ids.set(element, id);\n }\n const attributes = colorPickerConfigurationAttributes(element)\n .map((name) => `${name}=${element.getAttribute(name) ?? ""}`)\n .join(";");\n return `${id}:${element.tagName}:${attributes}`;\n })\n .join("|");\n}\n\nfunction colorPickerConfigurationAttributes(element: Element): readonly string[] {\n if (element.hasAttribute("data-sw-color-picker-area")) {\n return ["data-x-channel", "data-y-channel"];\n }\n if (element.hasAttribute("data-sw-color-picker-area-input")) {\n return ["data-axis", "data-step", "aria-label", "aria-labelledby", "aria-roledescription"];\n }\n if (element.hasAttribute("data-sw-color-picker-channel-slider")) {\n return ["data-channel", "data-orientation"];\n }\n if (element.hasAttribute("data-sw-color-picker-channel-input")) return ["data-step"];\n if (element.hasAttribute("data-sw-color-picker-channel-field")) return ["data-channel"];\n if (element.hasAttribute("data-sw-color-picker-swatch")) {\n return ["data-value", "data-disabled"];\n }\n return [];\n}\n',
|
|
18823
|
+
sourceHash: "sha256:480ff7c550bead133ba08b1fd49cb465dc8583fe3d0531a59bd481d19b6088b1",
|
|
18824
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerRoot.tsx"
|
|
18825
|
+
},
|
|
18826
|
+
{
|
|
18827
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerSwatch.tsx",
|
|
18828
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport { useColorPickerPartProjection } from "./ColorPickerRoot";\nimport type { ColorPickerValue } from "@starwind-ui/runtime/color-picker";\n\nexport type ColorPickerSwatchProps = React.ComponentPropsWithoutRef<"button"> & {\n children?: React.ReactNode;\n swatchValue: ColorPickerValue;\n swatchDisabled?: boolean;\n};\n\nconst ColorPickerSwatch = React.forwardRef<HTMLButtonElement, ColorPickerSwatchProps>(\n function ColorPickerSwatch(\n { children, swatchValue, swatchDisabled = false, ...props },\n forwardedRef,\n ) {\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "swatch", value: swatchValue, disabled: swatchDisabled },\n {\n ...props,\n "data-sw-color-picker-swatch": "",\n "data-value":\n typeof swatchValue === "string" ? swatchValue : (swatchValue?.toString() ?? undefined),\n "data-disabled": swatchDisabled ? "" : undefined,\n },\n );\n return (\n <button {...projectedProps} ref={forwardedRef}>\n {children}\n </button>\n );\n },\n);\n\nColorPickerSwatch.displayName = "ColorPicker.Swatch";\n\nexport default ColorPickerSwatch;\n',
|
|
18829
|
+
sourceHash: "sha256:c37d425d00ff5092dedd1bc21e73ebbd0547d3c46d51ea6b7bf94e83613d0e79",
|
|
18830
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerSwatch.tsx"
|
|
18831
|
+
},
|
|
18832
|
+
{
|
|
18833
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerSwatchGroup.tsx",
|
|
18834
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport { useColorPickerPartProjection } from "./ColorPickerRoot";\n\nexport type ColorPickerSwatchGroupProps = React.ComponentPropsWithoutRef<"div"> & {\n children?: React.ReactNode;\n};\n\nconst ColorPickerSwatchGroup = React.forwardRef<HTMLDivElement, ColorPickerSwatchGroupProps>(\n function ColorPickerSwatchGroup({ children, ...props }, forwardedRef) {\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "swatchGroup" },\n { ...props, "data-sw-color-picker-swatch-group": "" },\n );\n return (\n <div {...projectedProps} ref={forwardedRef}>\n {children}\n </div>\n );\n },\n);\n\nColorPickerSwatchGroup.displayName = "ColorPicker.SwatchGroup";\n\nexport default ColorPickerSwatchGroup;\n',
|
|
18835
|
+
sourceHash: "sha256:807e23e652288da912158ef42305a4b5ba836e70e584a5cc2772b1bae377a83a",
|
|
18836
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerSwatchGroup.tsx"
|
|
18837
|
+
},
|
|
18838
|
+
{
|
|
18839
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerTransparencyGrid.tsx",
|
|
18840
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport { useColorPickerPartProjection } from "./ColorPickerRoot";\n\nexport type ColorPickerTransparencyGridProps = React.ComponentPropsWithoutRef<"span"> & {\n children?: React.ReactNode;\n};\n\nconst ColorPickerTransparencyGrid = React.forwardRef<\n HTMLSpanElement,\n ColorPickerTransparencyGridProps\n>(function ColorPickerTransparencyGrid({ children, ...props }, forwardedRef) {\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "transparencyGrid" },\n { ...props, "data-sw-color-picker-transparency-grid": "" },\n );\n return (\n <span {...projectedProps} ref={forwardedRef}>\n {children}\n </span>\n );\n});\n\nColorPickerTransparencyGrid.displayName = "ColorPicker.TransparencyGrid";\n\nexport default ColorPickerTransparencyGrid;\n',
|
|
18841
|
+
sourceHash: "sha256:2766d826fc8ad9ef2ec9873b037e8d0893c2a768768824dc297a1e70cf7091ce",
|
|
18842
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerTransparencyGrid.tsx"
|
|
18843
|
+
},
|
|
18844
|
+
{
|
|
18845
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerValueInput.tsx",
|
|
18846
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport { useColorPickerPartProjection } from "./ColorPickerRoot";\n\nexport type ColorPickerValueInputProps = React.ComponentPropsWithoutRef<"input"> & {};\n\nconst ColorPickerValueInput = React.forwardRef<HTMLInputElement, ColorPickerValueInputProps>(\n function ColorPickerValueInput({ ...props }, forwardedRef) {\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "valueInput" },\n { ...props, "data-sw-color-picker-value-input": "" },\n );\n return <input {...projectedProps} ref={forwardedRef} />;\n },\n);\n\nColorPickerValueInput.displayName = "ColorPicker.ValueInput";\n\nexport default ColorPickerValueInput;\n',
|
|
18847
|
+
sourceHash: "sha256:94d572adaa1a5798bd3affa6a7906aa4ddb6c34a13ae97b4f50dc718cf263d7b",
|
|
18848
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerValueInput.tsx"
|
|
18849
|
+
},
|
|
18850
|
+
{
|
|
18851
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerValueSwatch.tsx",
|
|
18852
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport { useColorPickerPartProjection } from "./ColorPickerRoot";\n\nexport type ColorPickerValueSwatchProps = React.ComponentPropsWithoutRef<"span"> & {\n children?: React.ReactNode;\n};\n\nconst ColorPickerValueSwatch = React.forwardRef<HTMLSpanElement, ColorPickerValueSwatchProps>(\n function ColorPickerValueSwatch({ children, ...props }, forwardedRef) {\n const { props: projectedProps } = useColorPickerPartProjection(\n { part: "valueSwatch" },\n { ...props, "data-sw-color-picker-value-swatch": "" },\n );\n return (\n <span {...projectedProps} ref={forwardedRef}>\n {children}\n </span>\n );\n },\n);\n\nColorPickerValueSwatch.displayName = "ColorPicker.ValueSwatch";\n\nexport default ColorPickerValueSwatch;\n',
|
|
18853
|
+
sourceHash: "sha256:575d0c6327853fa9c5c307d2af2e19cb3decc5da4e8454e097e42d15b449ff3e",
|
|
18854
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerValueSwatch.tsx"
|
|
18855
|
+
},
|
|
18856
|
+
{
|
|
18857
|
+
path: "src/components/starwind-primitives/color-picker/ColorPickerValueText.tsx",
|
|
18858
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\nimport { useColorPickerPartProjection } from "./ColorPickerRoot";\n\nexport type ColorPickerValueTextProps = React.ComponentPropsWithoutRef<"span"> & {\n children?: React.ReactNode;\n};\n\nconst ColorPickerValueText = React.forwardRef<HTMLSpanElement, ColorPickerValueTextProps>(\n function ColorPickerValueText({ children, ...props }, forwardedRef) {\n const { props: projectedProps, text } = useColorPickerPartProjection(\n { part: "valueText" },\n { ...props, "data-sw-color-picker-value-text": "" },\n );\n return (\n <span {...projectedProps} ref={forwardedRef}>\n {children ?? text}\n </span>\n );\n },\n);\n\nColorPickerValueText.displayName = "ColorPicker.ValueText";\n\nexport default ColorPickerValueText;\n',
|
|
18859
|
+
sourceHash: "sha256:9d679c36de91b1b24003f6ab368ae1f134a8d5cae8edc49c81c33166a8838271",
|
|
18860
|
+
sourcePath: "packages/react/src/color-picker/ColorPickerValueText.tsx"
|
|
18861
|
+
},
|
|
18862
|
+
{
|
|
18863
|
+
path: "src/components/starwind-primitives/color-picker/index.ts",
|
|
18864
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport ColorPickerRoot from "./ColorPickerRoot";\nimport ColorPickerLabel from "./ColorPickerLabel";\nimport ColorPickerControl from "./ColorPickerControl";\nimport ColorPickerValueInput from "./ColorPickerValueInput";\nimport ColorPickerValueSwatch from "./ColorPickerValueSwatch";\nimport ColorPickerValueText from "./ColorPickerValueText";\nimport ColorPickerArea from "./ColorPickerArea";\nimport ColorPickerAreaBackground from "./ColorPickerAreaBackground";\nimport ColorPickerAreaThumb from "./ColorPickerAreaThumb";\nimport ColorPickerAreaInput from "./ColorPickerAreaInput";\nimport ColorPickerChannelSlider from "./ColorPickerChannelSlider";\nimport ColorPickerChannelSliderTrack from "./ColorPickerChannelSliderTrack";\nimport ColorPickerChannelSliderThumb from "./ColorPickerChannelSliderThumb";\nimport ColorPickerChannelSliderInput from "./ColorPickerChannelSliderInput";\nimport ColorPickerChannelInput from "./ColorPickerChannelInput";\nimport ColorPickerFormatSelect from "./ColorPickerFormatSelect";\nimport ColorPickerFormatControl from "./ColorPickerFormatControl";\nimport ColorPickerTransparencyGrid from "./ColorPickerTransparencyGrid";\nimport ColorPickerSwatchGroup from "./ColorPickerSwatchGroup";\nimport ColorPickerSwatch from "./ColorPickerSwatch";\nimport ColorPickerEyeDropperTrigger from "./ColorPickerEyeDropperTrigger";\nimport ColorPickerClear from "./ColorPickerClear";\nimport ColorPickerHiddenInput from "./ColorPickerHiddenInput";\n\nconst ColorPicker = {\n Root: ColorPickerRoot,\n Label: ColorPickerLabel,\n Control: ColorPickerControl,\n ValueInput: ColorPickerValueInput,\n ValueSwatch: ColorPickerValueSwatch,\n ValueText: ColorPickerValueText,\n Area: ColorPickerArea,\n AreaBackground: ColorPickerAreaBackground,\n AreaThumb: ColorPickerAreaThumb,\n AreaInput: ColorPickerAreaInput,\n ChannelSlider: ColorPickerChannelSlider,\n ChannelSliderTrack: ColorPickerChannelSliderTrack,\n ChannelSliderThumb: ColorPickerChannelSliderThumb,\n ChannelSliderInput: ColorPickerChannelSliderInput,\n ChannelInput: ColorPickerChannelInput,\n FormatSelect: ColorPickerFormatSelect,\n FormatControl: ColorPickerFormatControl,\n TransparencyGrid: ColorPickerTransparencyGrid,\n SwatchGroup: ColorPickerSwatchGroup,\n Swatch: ColorPickerSwatch,\n EyeDropperTrigger: ColorPickerEyeDropperTrigger,\n Clear: ColorPickerClear,\n HiddenInput: ColorPickerHiddenInput,\n};\n\nexport {\n ColorPicker,\n ColorPickerRoot,\n ColorPickerLabel,\n ColorPickerControl,\n ColorPickerValueInput,\n ColorPickerValueSwatch,\n ColorPickerValueText,\n ColorPickerArea,\n ColorPickerAreaBackground,\n ColorPickerAreaThumb,\n ColorPickerAreaInput,\n ColorPickerChannelSlider,\n ColorPickerChannelSliderTrack,\n ColorPickerChannelSliderThumb,\n ColorPickerChannelSliderInput,\n ColorPickerChannelInput,\n ColorPickerFormatSelect,\n ColorPickerFormatControl,\n ColorPickerTransparencyGrid,\n ColorPickerSwatchGroup,\n ColorPickerSwatch,\n ColorPickerEyeDropperTrigger,\n ColorPickerClear,\n ColorPickerHiddenInput,\n};\n\nexport default ColorPicker;\n\nexport type {\n ColorPickerChannel,\n ColorPickerColor,\n ColorPickerDirection,\n ColorPickerFormat,\n ColorPickerFormatChangeDetails,\n ColorPickerHsbChannelUpdates,\n ColorPickerHsbChannels,\n ColorPickerHslChannelUpdates,\n ColorPickerHslChannels,\n ColorPickerInstance,\n ColorPickerInitialAxis,\n ColorPickerInitialChannel,\n ColorPickerInitialDirection,\n ColorPickerInitialOrientation,\n ColorPickerInitialPartName,\n ColorPickerInitialPartProjection,\n ColorPickerInitialPartRequest,\n ColorPickerInitialState,\n ColorPickerInitialStateOptions,\n ColorPickerInitialValue,\n ColorPickerOptions,\n ColorPickerRgbChannelUpdates,\n ColorPickerRgbChannels,\n ColorPickerSetOptions,\n ColorPickerSetValueOptions,\n ColorPickerStringFormat,\n ColorPickerValue,\n ColorPickerValueChangeDetails,\n ColorPickerValueChangeReason,\n ColorPickerValueCommitDetails,\n} from "@starwind-ui/runtime/color-picker";\nexport {\n createColorPickerInitialState,\n parseColor,\n projectColorPickerInitialPart,\n} from "@starwind-ui/runtime/color-picker";\n',
|
|
18865
|
+
sourceHash: "sha256:58de9d7ceefb8eafc92e5fb3a2fae300af3eced02affd58602a9daa90d9258b0",
|
|
18866
|
+
sourcePath: "packages/react/src/color-picker/index.ts"
|
|
18867
|
+
},
|
|
18868
|
+
{
|
|
18869
|
+
path: "src/components/starwind-primitives/internal/compose-refs.ts",
|
|
18870
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\n\nexport type AsChildProps = React.HTMLAttributes<HTMLElement> &\n React.RefAttributes<HTMLElement> &\n Record<string, unknown>;\n\nexport type RefCapableElementProps = AsChildProps & {\n href?: string;\n};\n\nexport type AsChildMergeOptions = {\n eventOrder?: "child-first" | "parent-first";\n protectedProps?: AsChildProps;\n};\n\nexport function getElementRef(\n element: React.ReactElement<RefCapableElementProps>,\n): React.Ref<HTMLElement> | undefined {\n if (Number.parseInt(React.version, 10) >= 19) {\n return element.props.ref;\n }\n\n return (element as React.ReactElement<RefCapableElementProps> & { ref?: React.Ref<HTMLElement> })\n .ref;\n}\n\nexport function getAsChildElement(\n children: React.ReactNode,\n): React.ReactElement<RefCapableElementProps> | null {\n const childArray = React.Children.toArray(children);\n if (childArray.length !== 1) return null;\n\n const child = childArray[0];\n return React.isValidElement<RefCapableElementProps>(child) ? child : null;\n}\n\nexport function mergeAsChildProps(\n parentProps: AsChildProps,\n childProps: AsChildProps,\n options: AsChildMergeOptions = {},\n): AsChildProps {\n const { eventOrder = "child-first", protectedProps } = options;\n const mergedProps: AsChildProps = { ...parentProps, ...childProps };\n const className = mergeAsChildClassName(parentProps.className, childProps.className);\n const style = mergeAsChildStyle(parentProps.style, childProps.style);\n\n if (className) {\n mergedProps.className = className;\n } else {\n delete mergedProps.className;\n }\n\n if (style) {\n mergedProps.style = style;\n } else {\n delete mergedProps.style;\n }\n\n Object.keys(parentProps).forEach((propName) => {\n if (!isAsChildEventHandler(propName)) return;\n\n const parentHandler = getAsChildEventHandler(parentProps[propName]);\n const childHandler = getAsChildEventHandler(childProps[propName]);\n if (!parentHandler || !childHandler) return;\n\n mergedProps[propName] = composeAsChildEventHandlers(parentHandler, childHandler, eventOrder);\n });\n\n if (protectedProps) {\n Object.assign(mergedProps, protectedProps);\n }\n\n return mergedProps;\n}\n\nexport function useComposedRefs<T>(\n outerRef: React.Ref<T> | undefined,\n innerRef: React.Ref<T> | undefined,\n): React.RefCallback<T> {\n return React.useCallback(\n (value) => {\n const cleanups = [setRef(outerRef, value), setRef(innerRef, value)].filter(\n (cleanup): cleanup is RefCleanup => typeof cleanup === "function",\n );\n\n return () => {\n cleanups.reverse().forEach((cleanup) => cleanup());\n };\n },\n [outerRef, innerRef],\n );\n}\n\nfunction mergeAsChildClassName(\n parentClassName: string | undefined,\n childClassName: string | undefined,\n): string | undefined {\n return [parentClassName, childClassName].filter(Boolean).join(" ") || undefined;\n}\n\nfunction mergeAsChildStyle(\n parentStyle: React.CSSProperties | undefined,\n childStyle: React.CSSProperties | undefined,\n): React.CSSProperties | undefined {\n if (parentStyle && childStyle) return { ...parentStyle, ...childStyle };\n return childStyle ?? parentStyle;\n}\n\nfunction isAsChildEventHandler(propName: string): boolean {\n return /^on[A-Z]/.test(propName);\n}\n\nfunction getAsChildEventHandler(value: unknown): ((...args: unknown[]) => unknown) | undefined {\n return typeof value === "function" ? (value as (...args: unknown[]) => unknown) : undefined;\n}\n\nfunction composeAsChildEventHandlers(\n parentHandler: (...args: unknown[]) => unknown,\n childHandler: (...args: unknown[]) => unknown,\n eventOrder: NonNullable<AsChildMergeOptions["eventOrder"]>,\n): (...args: unknown[]) => void {\n return (...args) => {\n if (eventOrder === "parent-first") {\n parentHandler(...args);\n if (!isDefaultPrevented(args[0])) {\n childHandler(...args);\n }\n return;\n }\n\n childHandler(...args);\n if (!isDefaultPrevented(args[0])) {\n parentHandler(...args);\n }\n };\n}\n\nfunction isDefaultPrevented(value: unknown): boolean {\n if (typeof value !== "object" || value === null) return false;\n const event = value as { defaultPrevented?: boolean };\n return event.defaultPrevented === true;\n}\n\ntype RefCleanup = () => void;\n\nexport function setRef<T>(ref: React.Ref<T> | undefined, value: T | null): RefCleanup | undefined {\n if (!ref) return undefined;\n\n if (typeof ref === "function") {\n const cleanup = ref(value);\n return typeof cleanup === "function" ? cleanup : () => ref(null);\n }\n\n ref.current = value;\n return () => {\n ref.current = null;\n };\n}\n',
|
|
18871
|
+
sourceHash: "sha256:599814a3efff84ec03259a7fc7817f919aed593b5446c572ac0f7a7f4b9334d1",
|
|
18872
|
+
sourcePath: "packages/react/src/internal/compose-refs.ts"
|
|
18873
|
+
},
|
|
18874
|
+
{
|
|
18875
|
+
path: "src/components/starwind-primitives/internal/use-isomorphic-layout-effect.ts",
|
|
18876
|
+
content: '/**\n * Vendored by the Starwind CLI.\n * You own this file in your project.\n */\n\nimport * as React from "react";\n\nexport const useIsomorphicLayoutEffect =\n typeof window === "undefined" ? React.useEffect : React.useLayoutEffect;\n',
|
|
18877
|
+
sourceHash: "sha256:277183522889c375f2fd0e140ae643bec81b941da1d9f31fa49bd291a2ee84d9",
|
|
18878
|
+
sourcePath: "packages/react/src/internal/use-isomorphic-layout-effect.ts"
|
|
18879
|
+
}
|
|
18880
|
+
],
|
|
18881
|
+
packageRequirements: [
|
|
18882
|
+
{
|
|
18883
|
+
name: "@starwind-ui/runtime",
|
|
18884
|
+
range: "^0.1.0-beta.2"
|
|
17989
18885
|
},
|
|
17990
18886
|
{
|
|
17991
18887
|
name: "react",
|
|
@@ -18078,7 +18974,7 @@ if (!src && !image) {
|
|
|
18078
18974
|
packageRequirements: [
|
|
18079
18975
|
{
|
|
18080
18976
|
name: "@starwind-ui/runtime",
|
|
18081
|
-
range: "^0.1.0-beta.
|
|
18977
|
+
range: "^0.1.0-beta.2"
|
|
18082
18978
|
},
|
|
18083
18979
|
{
|
|
18084
18980
|
name: "react",
|