jbx 2.8.0 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +8 -1
- package/dist/index.js +47 -58
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -131,11 +131,18 @@ declare const CodeTextarea: (props: {
|
|
|
131
131
|
style?: React.CSSProperties | undefined;
|
|
132
132
|
}) => JSX.Element;
|
|
133
133
|
declare const CheckboxHidden: (props: {
|
|
134
|
+
isChecked: boolean;
|
|
135
|
+
} & {
|
|
134
136
|
children?: ReactNode;
|
|
135
137
|
style?: React.CSSProperties | undefined;
|
|
136
138
|
}) => JSX.Element;
|
|
139
|
+
declare const Checkbox: ({ label, checked, onChange }: {
|
|
140
|
+
label: string;
|
|
141
|
+
checked: boolean;
|
|
142
|
+
onChange?: ((value: boolean) => void) | undefined;
|
|
143
|
+
}) => React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
137
144
|
declare function Bullet({ value }: {
|
|
138
145
|
value: number;
|
|
139
146
|
}): React.JSX.Element;
|
|
140
147
|
|
|
141
|
-
export { A, Box, Bullet, Button, CheckboxHidden, CodeSnippet, CodeTextarea, Component, Container, Dropzone, HR, HeaderH1, HeaderH2, HeaderH3, HeaderH4, Inline, Input, Li, MainHeader, Range, SmallText, Space, Stack, Tab, Tabs, Text, Ul };
|
|
148
|
+
export { A, Box, Bullet, Button, Checkbox, CheckboxHidden, CodeSnippet, CodeTextarea, Component, Container, Dropzone, HR, HeaderH1, HeaderH2, HeaderH3, HeaderH4, Inline, Input, Li, MainHeader, Range, SmallText, Space, Stack, Tab, Tabs, Text, Ul };
|
package/dist/index.js
CHANGED
|
@@ -2726,72 +2726,61 @@ const CodeSnippet = Component(`jbx-code-snippet`, {}, {
|
|
|
2726
2726
|
const CodeTextarea = Component(`jbx-code-area`, {}, {
|
|
2727
2727
|
element: 'textarea'
|
|
2728
2728
|
});
|
|
2729
|
-
const CheckboxHidden = Component(`jbx-checkbox-hidden`, ({
|
|
2729
|
+
const CheckboxHidden = Component(`jbx-checkbox-hidden`, ({ isChecked })=>{
|
|
2730
2730
|
return {
|
|
2731
2731
|
height: SIZE * 2 - 4,
|
|
2732
2732
|
width: SIZE * 2 - 4,
|
|
2733
2733
|
paddingTop: 2,
|
|
2734
2734
|
paddingLeft: 2,
|
|
2735
|
-
backgroundColor:
|
|
2735
|
+
backgroundColor: isChecked ? 'var(--accent-color)' : 'white',
|
|
2736
2736
|
borderRadius: BASE_RADIUS,
|
|
2737
|
-
boxShadow:
|
|
2737
|
+
boxShadow: isChecked ? 'inset rgba(0, 0, 0, 0.07) 0 0 0 1px' : 'inset rgba(0, 0, 0, 0.33) 0 0 0 1.5px',
|
|
2738
2738
|
cursor: 'pointer'
|
|
2739
2739
|
};
|
|
2740
2740
|
});
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
//
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
// },
|
|
2785
|
-
// React.createElement('path', {
|
|
2786
|
-
// d: 'M20 6L9 17 4 12'
|
|
2787
|
-
// })
|
|
2788
|
-
// )
|
|
2789
|
-
// ),
|
|
2790
|
-
// React.createElement(Space, { key: 1, w: 0.5 }),
|
|
2791
|
-
// React.createElement(Text, { key: 2, style: { userSelect: 'none' } }, label)
|
|
2792
|
-
// ]
|
|
2793
|
-
// );
|
|
2794
|
-
// };
|
|
2741
|
+
const Checkbox = function Checkbox({ label, checked, onChange }) {
|
|
2742
|
+
return /*#__PURE__*/ React.createElement(Inline, {
|
|
2743
|
+
// @ts-ignore
|
|
2744
|
+
onClick: ()=>{
|
|
2745
|
+
if (onChange) {
|
|
2746
|
+
onChange(!checked);
|
|
2747
|
+
}
|
|
2748
|
+
},
|
|
2749
|
+
style: {
|
|
2750
|
+
alignItems: 'center',
|
|
2751
|
+
cursor: 'pointer'
|
|
2752
|
+
}
|
|
2753
|
+
}, [
|
|
2754
|
+
/*#__PURE__*/ React.createElement(CheckboxHidden, {
|
|
2755
|
+
key: 0,
|
|
2756
|
+
isChecked: checked
|
|
2757
|
+
}, /*#__PURE__*/ React.createElement('svg', {
|
|
2758
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
2759
|
+
width: SIZE * 2 - 8,
|
|
2760
|
+
height: SIZE * 2 - 8,
|
|
2761
|
+
fill: 'none',
|
|
2762
|
+
stroke: 'currentColor',
|
|
2763
|
+
strokeLinecap: 'round',
|
|
2764
|
+
strokeLinejoin: 'round',
|
|
2765
|
+
strokeWidth: '2',
|
|
2766
|
+
className: 'feather feather-check',
|
|
2767
|
+
viewBox: '0 0 24 24',
|
|
2768
|
+
color: checked ? 'white' : '#ddd'
|
|
2769
|
+
}, /*#__PURE__*/ React.createElement('path', {
|
|
2770
|
+
d: 'M20 6L9 17 4 12'
|
|
2771
|
+
}))),
|
|
2772
|
+
/*#__PURE__*/ React.createElement(Space, {
|
|
2773
|
+
key: 1,
|
|
2774
|
+
w: 0.5
|
|
2775
|
+
}),
|
|
2776
|
+
/*#__PURE__*/ React.createElement(Text, {
|
|
2777
|
+
key: 2,
|
|
2778
|
+
style: {
|
|
2779
|
+
userSelect: 'none'
|
|
2780
|
+
}
|
|
2781
|
+
}, label)
|
|
2782
|
+
]);
|
|
2783
|
+
};
|
|
2795
2784
|
function Bullet({ value }) {
|
|
2796
2785
|
return /*#__PURE__*/ React.createElement("div", {
|
|
2797
2786
|
className: "jbx-bullet-container"
|
|
@@ -2800,4 +2789,4 @@ function Bullet({ value }) {
|
|
|
2800
2789
|
}, value));
|
|
2801
2790
|
}
|
|
2802
2791
|
|
|
2803
|
-
export { A, Box, Bullet, Button, CheckboxHidden, CodeSnippet, CodeTextarea, Component, Container, Dropzone, HR, HeaderH1, HeaderH2, HeaderH3, HeaderH4, Inline, Input, Li, MainHeader, Range, SmallText, Space, Stack, Tab, Tabs, Text, Ul };
|
|
2792
|
+
export { A, Box, Bullet, Button, Checkbox, CheckboxHidden, CodeSnippet, CodeTextarea, Component, Container, Dropzone, HR, HeaderH1, HeaderH2, HeaderH3, HeaderH4, Inline, Input, Li, MainHeader, Range, SmallText, Space, Stack, Tab, Tabs, Text, Ul };
|