@sikka/hawa 0.26.22 → 0.26.23
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 +1 -1
- package/dist/alert/index.d.mts +1 -0
- package/dist/alert/index.d.ts +1 -0
- package/dist/blocks/index.mjs +1 -0
- package/dist/carousel/index.d.mts +2 -0
- package/dist/carousel/index.d.ts +2 -0
- package/dist/carousel/index.js +31 -16
- package/dist/carousel/index.mjs +30 -15
- package/dist/checkbox/index.d.mts +1 -1
- package/dist/checkbox/index.d.ts +1 -1
- package/dist/chip/index.d.mts +1 -1
- package/dist/chip/index.d.ts +1 -1
- package/dist/chunk-ZFXKCRJC.mjs +11 -0
- package/dist/codeBlock/index.d.mts +2 -1
- package/dist/codeBlock/index.d.ts +2 -1
- package/dist/codeBlock/index.js +21 -17
- package/dist/codeBlock/index.mjs +20 -11
- package/dist/collapsible/index.mjs +2 -0
- package/dist/colorPicker/index.mjs +1 -0
- package/dist/commonTypes-2k6FnHw5.d.mts +4 -0
- package/dist/commonTypes-2k6FnHw5.d.ts +4 -0
- package/dist/elements/index.d.mts +4 -1
- package/dist/elements/index.d.ts +4 -1
- package/dist/elements/index.js +42 -25
- package/dist/elements/index.mjs +50 -26
- package/dist/hooks/index.mjs +1 -0
- package/dist/index.css +366 -199
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +42 -25
- package/dist/index.mjs +55 -26
- package/dist/layout/index.mjs +1 -0
- package/package.json +11 -10
package/dist/elements/index.js
CHANGED
@@ -6938,6 +6938,8 @@ function useClipboard({ timeout = 2e3 } = {}) {
|
|
6938
6938
|
}
|
6939
6939
|
|
6940
6940
|
// elements/codeBlock/CodeBlock.tsx
|
6941
|
+
(typeof global !== "undefined" ? global : window).Prism = import_prism_react_renderer.Prism;
|
6942
|
+
require("prismjs/components/prism-bash");
|
6941
6943
|
var CodeBlock = ({
|
6942
6944
|
tabs,
|
6943
6945
|
code,
|
@@ -6950,8 +6952,7 @@ var CodeBlock = ({
|
|
6950
6952
|
}) => {
|
6951
6953
|
const clipboard = useClipboard();
|
6952
6954
|
const [selectedTab, setSelectedTab] = (0, import_react30.useState)(0);
|
6953
|
-
const
|
6954
|
-
const theme = isDarkMode ? import_prism_react_renderer.themes.vsDark : import_prism_react_renderer.themes.vsLight;
|
6955
|
+
const theme = import_prism_react_renderer.themes.oceanicNext;
|
6955
6956
|
let widthStyles = {
|
6956
6957
|
full: "hawa-w-full",
|
6957
6958
|
md: "hawa-w-full hawa-max-w-md",
|
@@ -6971,15 +6972,15 @@ var CodeBlock = ({
|
|
6971
6972
|
"div",
|
6972
6973
|
{
|
6973
6974
|
className: cn(
|
6974
|
-
"hawa-flex hawa-flex-row hawa-gap-2 hawa-rounded-t
|
6975
|
-
fileName && tabs ? "hawa-bg-
|
6975
|
+
"hawa-flex hawa-flex-row hawa-gap-2 hawa-rounded-t hawa-p-2 hawa-py-0.5 hawa-pb-0 hawa-font-mono hawa-text-foreground",
|
6976
|
+
fileName && tabs ? "hawa-bg-primary/10" : "hawa-bg-primary/15"
|
6976
6977
|
)
|
6977
6978
|
},
|
6978
6979
|
/* @__PURE__ */ import_react30.default.createElement(
|
6979
6980
|
"div",
|
6980
6981
|
{
|
6981
6982
|
className: cn(
|
6982
|
-
"mono hawa-w-full hawa-max-w-[52px] hawa-rounded-inner hawa-p-1 hawa-py-0.5 hawa-text-center hawa-text-[0.75rem]"
|
6983
|
+
"hawa-font-mono hawa-w-full hawa-max-w-[52px] hawa-rounded-inner hawa-p-1 hawa-py-0.5 hawa-text-center hawa-text-[0.75rem]"
|
6983
6984
|
)
|
6984
6985
|
},
|
6985
6986
|
fileName
|
@@ -6989,7 +6990,8 @@ var CodeBlock = ({
|
|
6989
6990
|
"div",
|
6990
6991
|
{
|
6991
6992
|
className: cn(
|
6992
|
-
|
6993
|
+
// hawa-bg-gray-300 dark:hawa-bg-red-600
|
6994
|
+
"hawa-flex hawa-flex-row hawa-gap-2 hawa-rounded-t hawa-p-1 hawa-bg-primary/15 hawa-pb-0 hawa-font-mono hawa-text-foreground",
|
6993
6995
|
tabs && fileName && "hawa-rounded-t-none"
|
6994
6996
|
)
|
6995
6997
|
},
|
@@ -7006,7 +7008,7 @@ var CodeBlock = ({
|
|
7006
7008
|
{
|
7007
7009
|
onClick: () => setSelectedTab(i),
|
7008
7010
|
className: cn(
|
7009
|
-
"hawa-mb-
|
7011
|
+
"hawa-mb-0.5 hawa-w-full hawa-max-w-[52px] hawa-cursor-pointer hawa-rounded-inner hawa-p-2 hawa-py-0.5 hawa-text-center hawa-text-[0.7rem] hawa-transition-all hover:hawa-bg-muted-foreground/20"
|
7010
7012
|
)
|
7011
7013
|
},
|
7012
7014
|
tab.title
|
@@ -7017,7 +7019,7 @@ var CodeBlock = ({
|
|
7017
7019
|
"div",
|
7018
7020
|
{
|
7019
7021
|
className: cn(
|
7020
|
-
"hawa-flex hawa-w-full hawa-flex-row hawa-items-start hawa-justify-between hawa-border hawa-bg-
|
7022
|
+
"hawa-flex hawa-w-full hawa-flex-row hawa-items-start hawa-justify-between hawa-border hawa-bg-gray-700 hawa-p-0 hawa-text-left hawa-text-sm sm:hawa-text-base ",
|
7021
7023
|
tabs || fileName ? "hawa-rounded-b hawa-rounded-t-none" : "hawa-rounded"
|
7022
7024
|
)
|
7023
7025
|
},
|
@@ -7046,12 +7048,12 @@ var CodeBlock = ({
|
|
7046
7048
|
size: "icon",
|
7047
7049
|
onClick: () => clipboard.copy(tabs ? tabs[selectedTab].code : code),
|
7048
7050
|
variant: "outline",
|
7049
|
-
className: "hawa-text-
|
7051
|
+
className: "hawa-text-gray-200 hawa-opacity-50 "
|
7050
7052
|
},
|
7051
7053
|
/* @__PURE__ */ import_react30.default.createElement(
|
7052
7054
|
"svg",
|
7053
7055
|
{
|
7054
|
-
"aria-label": "Copy
|
7056
|
+
"aria-label": "Copy",
|
7055
7057
|
stroke: "currentColor",
|
7056
7058
|
fill: "none",
|
7057
7059
|
strokeWidth: "2",
|
@@ -7078,11 +7080,13 @@ var Carousel = ({
|
|
7078
7080
|
showArrows,
|
7079
7081
|
options,
|
7080
7082
|
autoplay,
|
7083
|
+
direction = "ltr",
|
7081
7084
|
autoplayInterval = 3e3,
|
7082
7085
|
...props
|
7083
7086
|
}) => {
|
7084
7087
|
const [emblaRef, emblaApi] = (0, import_embla_carousel_react.default)({
|
7085
7088
|
...options,
|
7089
|
+
direction,
|
7086
7090
|
loop: autoplay ? true : (options == null ? void 0 : options.loop) || false
|
7087
7091
|
});
|
7088
7092
|
const [selectedIndex, setSelectedIndex] = (0, import_react31.useState)(0);
|
@@ -7121,6 +7125,7 @@ var Carousel = ({
|
|
7121
7125
|
))))), /* @__PURE__ */ import_react31.default.createElement(
|
7122
7126
|
Dots,
|
7123
7127
|
{
|
7128
|
+
direction,
|
7124
7129
|
itemsLength: length,
|
7125
7130
|
selectedIndex,
|
7126
7131
|
onDotClick: (index) => emblaApi == null ? void 0 : emblaApi.scrollTo(index)
|
@@ -7135,22 +7140,34 @@ var Carousel = ({
|
|
7135
7140
|
}
|
7136
7141
|
));
|
7137
7142
|
};
|
7138
|
-
var Dots = ({
|
7143
|
+
var Dots = ({
|
7144
|
+
onDotClick,
|
7145
|
+
itemsLength,
|
7146
|
+
selectedIndex,
|
7147
|
+
direction
|
7148
|
+
}) => {
|
7139
7149
|
const arr = new Array(itemsLength).fill(0);
|
7140
|
-
return /* @__PURE__ */ import_react31.default.createElement(
|
7141
|
-
|
7142
|
-
|
7143
|
-
|
7144
|
-
|
7145
|
-
|
7146
|
-
|
7147
|
-
|
7148
|
-
|
7149
|
-
|
7150
|
-
|
7151
|
-
|
7152
|
-
|
7153
|
-
|
7150
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
7151
|
+
"div",
|
7152
|
+
{
|
7153
|
+
dir: direction,
|
7154
|
+
className: "hawa-z-50 hawa-my-2 hawa-flex hawa-justify-center hawa-gap-1"
|
7155
|
+
},
|
7156
|
+
arr.map((_, index) => {
|
7157
|
+
const selected = index === selectedIndex;
|
7158
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
7159
|
+
"div",
|
7160
|
+
{
|
7161
|
+
key: index,
|
7162
|
+
onClick: () => onDotClick(index),
|
7163
|
+
className: cn(
|
7164
|
+
"hawa-h-2 hawa-rounded-full hawa-bg-primary hawa-transition-all hawa-duration-300 hover:hawa-cursor-pointer",
|
7165
|
+
!selected ? "hawa-w-2 hawa-opacity-50" : "hawa-w-6 hawa-opacity-100"
|
7166
|
+
)
|
7167
|
+
}
|
7168
|
+
);
|
7169
|
+
})
|
7170
|
+
);
|
7154
7171
|
};
|
7155
7172
|
var CarouselControls = (props) => {
|
7156
7173
|
return /* @__PURE__ */ import_react31.default.createElement("div", { className: "hawa-flex hawa-justify-end hawa-gap-2 " }, /* @__PURE__ */ import_react31.default.createElement(
|
package/dist/elements/index.mjs
CHANGED
@@ -75,6 +75,9 @@ import {
|
|
75
75
|
calculateLuminance,
|
76
76
|
cn
|
77
77
|
} from "../chunk-MQUAGP7K.mjs";
|
78
|
+
import {
|
79
|
+
__require
|
80
|
+
} from "../chunk-ZFXKCRJC.mjs";
|
78
81
|
|
79
82
|
// elements/accordion/Accordion.tsx
|
80
83
|
import * as React3 from "react";
|
@@ -2638,7 +2641,13 @@ var ScrollIndicator = ({
|
|
2638
2641
|
|
2639
2642
|
// elements/codeBlock/CodeBlock.tsx
|
2640
2643
|
import React27, { useState as useState11 } from "react";
|
2641
|
-
import {
|
2644
|
+
import {
|
2645
|
+
Highlight,
|
2646
|
+
themes,
|
2647
|
+
Prism
|
2648
|
+
} from "prism-react-renderer";
|
2649
|
+
(typeof global !== "undefined" ? global : window).Prism = Prism;
|
2650
|
+
__require("prismjs/components/prism-bash");
|
2642
2651
|
var CodeBlock = ({
|
2643
2652
|
tabs,
|
2644
2653
|
code,
|
@@ -2651,8 +2660,7 @@ var CodeBlock = ({
|
|
2651
2660
|
}) => {
|
2652
2661
|
const clipboard = useClipboard();
|
2653
2662
|
const [selectedTab, setSelectedTab] = useState11(0);
|
2654
|
-
const
|
2655
|
-
const theme = isDarkMode ? themes.vsDark : themes.vsLight;
|
2663
|
+
const theme = themes.oceanicNext;
|
2656
2664
|
let widthStyles = {
|
2657
2665
|
full: "hawa-w-full",
|
2658
2666
|
md: "hawa-w-full hawa-max-w-md",
|
@@ -2672,15 +2680,15 @@ var CodeBlock = ({
|
|
2672
2680
|
"div",
|
2673
2681
|
{
|
2674
2682
|
className: cn(
|
2675
|
-
"hawa-flex hawa-flex-row hawa-gap-2 hawa-rounded-t
|
2676
|
-
fileName && tabs ? "hawa-bg-
|
2683
|
+
"hawa-flex hawa-flex-row hawa-gap-2 hawa-rounded-t hawa-p-2 hawa-py-0.5 hawa-pb-0 hawa-font-mono hawa-text-foreground",
|
2684
|
+
fileName && tabs ? "hawa-bg-primary/10" : "hawa-bg-primary/15"
|
2677
2685
|
)
|
2678
2686
|
},
|
2679
2687
|
/* @__PURE__ */ React27.createElement(
|
2680
2688
|
"div",
|
2681
2689
|
{
|
2682
2690
|
className: cn(
|
2683
|
-
"mono hawa-w-full hawa-max-w-[52px] hawa-rounded-inner hawa-p-1 hawa-py-0.5 hawa-text-center hawa-text-[0.75rem]"
|
2691
|
+
"hawa-font-mono hawa-w-full hawa-max-w-[52px] hawa-rounded-inner hawa-p-1 hawa-py-0.5 hawa-text-center hawa-text-[0.75rem]"
|
2684
2692
|
)
|
2685
2693
|
},
|
2686
2694
|
fileName
|
@@ -2690,7 +2698,8 @@ var CodeBlock = ({
|
|
2690
2698
|
"div",
|
2691
2699
|
{
|
2692
2700
|
className: cn(
|
2693
|
-
|
2701
|
+
// hawa-bg-gray-300 dark:hawa-bg-red-600
|
2702
|
+
"hawa-flex hawa-flex-row hawa-gap-2 hawa-rounded-t hawa-p-1 hawa-bg-primary/15 hawa-pb-0 hawa-font-mono hawa-text-foreground",
|
2694
2703
|
tabs && fileName && "hawa-rounded-t-none"
|
2695
2704
|
)
|
2696
2705
|
},
|
@@ -2707,7 +2716,7 @@ var CodeBlock = ({
|
|
2707
2716
|
{
|
2708
2717
|
onClick: () => setSelectedTab(i),
|
2709
2718
|
className: cn(
|
2710
|
-
"hawa-mb-
|
2719
|
+
"hawa-mb-0.5 hawa-w-full hawa-max-w-[52px] hawa-cursor-pointer hawa-rounded-inner hawa-p-2 hawa-py-0.5 hawa-text-center hawa-text-[0.7rem] hawa-transition-all hover:hawa-bg-muted-foreground/20"
|
2711
2720
|
)
|
2712
2721
|
},
|
2713
2722
|
tab.title
|
@@ -2718,7 +2727,7 @@ var CodeBlock = ({
|
|
2718
2727
|
"div",
|
2719
2728
|
{
|
2720
2729
|
className: cn(
|
2721
|
-
"hawa-flex hawa-w-full hawa-flex-row hawa-items-start hawa-justify-between hawa-border hawa-bg-
|
2730
|
+
"hawa-flex hawa-w-full hawa-flex-row hawa-items-start hawa-justify-between hawa-border hawa-bg-gray-700 hawa-p-0 hawa-text-left hawa-text-sm sm:hawa-text-base ",
|
2722
2731
|
tabs || fileName ? "hawa-rounded-b hawa-rounded-t-none" : "hawa-rounded"
|
2723
2732
|
)
|
2724
2733
|
},
|
@@ -2747,12 +2756,12 @@ var CodeBlock = ({
|
|
2747
2756
|
size: "icon",
|
2748
2757
|
onClick: () => clipboard.copy(tabs ? tabs[selectedTab].code : code),
|
2749
2758
|
variant: "outline",
|
2750
|
-
className: "hawa-text-
|
2759
|
+
className: "hawa-text-gray-200 hawa-opacity-50 "
|
2751
2760
|
},
|
2752
2761
|
/* @__PURE__ */ React27.createElement(
|
2753
2762
|
"svg",
|
2754
2763
|
{
|
2755
|
-
"aria-label": "Copy
|
2764
|
+
"aria-label": "Copy",
|
2756
2765
|
stroke: "currentColor",
|
2757
2766
|
fill: "none",
|
2758
2767
|
strokeWidth: "2",
|
@@ -2779,11 +2788,13 @@ var Carousel = ({
|
|
2779
2788
|
showArrows,
|
2780
2789
|
options,
|
2781
2790
|
autoplay,
|
2791
|
+
direction = "ltr",
|
2782
2792
|
autoplayInterval = 3e3,
|
2783
2793
|
...props
|
2784
2794
|
}) => {
|
2785
2795
|
const [emblaRef, emblaApi] = useEmblaCarousel({
|
2786
2796
|
...options,
|
2797
|
+
direction,
|
2787
2798
|
loop: autoplay ? true : (options == null ? void 0 : options.loop) || false
|
2788
2799
|
});
|
2789
2800
|
const [selectedIndex, setSelectedIndex] = useState12(0);
|
@@ -2822,6 +2833,7 @@ var Carousel = ({
|
|
2822
2833
|
))))), /* @__PURE__ */ React28.createElement(
|
2823
2834
|
Dots,
|
2824
2835
|
{
|
2836
|
+
direction,
|
2825
2837
|
itemsLength: length,
|
2826
2838
|
selectedIndex,
|
2827
2839
|
onDotClick: (index) => emblaApi == null ? void 0 : emblaApi.scrollTo(index)
|
@@ -2836,22 +2848,34 @@ var Carousel = ({
|
|
2836
2848
|
}
|
2837
2849
|
));
|
2838
2850
|
};
|
2839
|
-
var Dots = ({
|
2851
|
+
var Dots = ({
|
2852
|
+
onDotClick,
|
2853
|
+
itemsLength,
|
2854
|
+
selectedIndex,
|
2855
|
+
direction
|
2856
|
+
}) => {
|
2840
2857
|
const arr = new Array(itemsLength).fill(0);
|
2841
|
-
return /* @__PURE__ */ React28.createElement(
|
2842
|
-
|
2843
|
-
|
2844
|
-
|
2845
|
-
|
2846
|
-
|
2847
|
-
|
2848
|
-
|
2849
|
-
|
2850
|
-
|
2851
|
-
|
2852
|
-
|
2853
|
-
|
2854
|
-
|
2858
|
+
return /* @__PURE__ */ React28.createElement(
|
2859
|
+
"div",
|
2860
|
+
{
|
2861
|
+
dir: direction,
|
2862
|
+
className: "hawa-z-50 hawa-my-2 hawa-flex hawa-justify-center hawa-gap-1"
|
2863
|
+
},
|
2864
|
+
arr.map((_, index) => {
|
2865
|
+
const selected = index === selectedIndex;
|
2866
|
+
return /* @__PURE__ */ React28.createElement(
|
2867
|
+
"div",
|
2868
|
+
{
|
2869
|
+
key: index,
|
2870
|
+
onClick: () => onDotClick(index),
|
2871
|
+
className: cn(
|
2872
|
+
"hawa-h-2 hawa-rounded-full hawa-bg-primary hawa-transition-all hawa-duration-300 hover:hawa-cursor-pointer",
|
2873
|
+
!selected ? "hawa-w-2 hawa-opacity-50" : "hawa-w-6 hawa-opacity-100"
|
2874
|
+
)
|
2875
|
+
}
|
2876
|
+
);
|
2877
|
+
})
|
2878
|
+
);
|
2855
2879
|
};
|
2856
2880
|
var CarouselControls = (props) => {
|
2857
2881
|
return /* @__PURE__ */ React28.createElement("div", { className: "hawa-flex hawa-justify-end hawa-gap-2 " }, /* @__PURE__ */ React28.createElement(
|