jbx 2.8.0 → 2.10.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 CHANGED
@@ -9,6 +9,11 @@ type BoxProps = {
9
9
  };
10
10
  declare function Box({ children, smallText, padding, flex, style }: BoxProps): React.JSX.Element;
11
11
 
12
+ type MoreExperimentsProps = {
13
+ exclude?: string;
14
+ };
15
+ declare function MoreExperiments({ exclude }: MoreExperimentsProps): React.JSX.Element;
16
+
12
17
  declare function Component<T>(className: string, styleSrc?: {}, config?: {
13
18
  element?: string;
14
19
  props?: any;
@@ -131,11 +136,18 @@ declare const CodeTextarea: (props: {
131
136
  style?: React.CSSProperties | undefined;
132
137
  }) => JSX.Element;
133
138
  declare const CheckboxHidden: (props: {
139
+ isChecked: boolean;
140
+ } & {
134
141
  children?: ReactNode;
135
142
  style?: React.CSSProperties | undefined;
136
143
  }) => JSX.Element;
144
+ declare const Checkbox: ({ label, checked, onChange }: {
145
+ label: string;
146
+ checked: boolean;
147
+ onChange?: ((value: boolean) => void) | undefined;
148
+ }) => React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
137
149
  declare function Bullet({ value }: {
138
150
  value: number;
139
151
  }): React.JSX.Element;
140
152
 
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 };
153
+ export { A, Box, Bullet, Button, Checkbox, CheckboxHidden, CodeSnippet, CodeTextarea, Component, Container, Dropzone, HR, HeaderH1, HeaderH2, HeaderH3, HeaderH4, Inline, Input, Li, MainHeader, MoreExperiments, Range, SmallText, Space, Stack, Tab, Tabs, Text, Ul };
package/dist/index.js CHANGED
@@ -2627,6 +2627,60 @@ function Box({ children, smallText, padding, flex, style }) {
2627
2627
  }, children);
2628
2628
  }
2629
2629
 
2630
+ const PROJECT_DATA = [
2631
+ {
2632
+ name: 'PINTR',
2633
+ description: 'Tool that turns your images into plotter-like line drawings',
2634
+ url: 'https://javier.xyz/pintr'
2635
+ },
2636
+ {
2637
+ name: 'Visual Center',
2638
+ description: 'Tool that help you visually center objects in a container',
2639
+ url: 'https://javier.xyz/visual-center'
2640
+ },
2641
+ {
2642
+ name: 'Brutalita',
2643
+ description: 'Grid based font editor and font. Create fonts in the browser and export OpenType files',
2644
+ url: 'https://brutalita.com'
2645
+ },
2646
+ {
2647
+ name: 'Morphin',
2648
+ description: 'Create animated CSS transitions. Add sprites and get the code ready to paste in your site',
2649
+ url: 'https://javier.xyz/morphin'
2650
+ },
2651
+ {
2652
+ name: 'Droste Creator',
2653
+ description: 'Create recursive images with the droste effect',
2654
+ url: 'https://javier.xyz/droste-creator'
2655
+ },
2656
+ {
2657
+ name: 'Sombras.app',
2658
+ description: 'Create art with shadows. Draw shadows and get 3D objects that project them.',
2659
+ url: 'https://sombras.app'
2660
+ },
2661
+ {
2662
+ name: 'Cohesive Colors',
2663
+ description: 'Tool that can help you to create cohesive color palettes',
2664
+ url: 'https://javier.xyz/cohesive-colors'
2665
+ }
2666
+ ];
2667
+ const seed = 0;
2668
+ const maxItems = 5;
2669
+ function MoreExperiments({ exclude }) {
2670
+ const projects = exclude ? PROJECT_DATA.filter((project)=>!project.url.includes(exclude)) : PROJECT_DATA;
2671
+ const items = new Array(Math.min(maxItems, projects.length)).fill('').map((_0, idx)=>{
2672
+ const project = projects[(seed + idx) % projects.length];
2673
+ return /*#__PURE__*/ React.createElement(Li, {
2674
+ key: project.url
2675
+ }, /*#__PURE__*/ React.createElement(A, {
2676
+ href: project.url
2677
+ }, project.name), `, `, project.description, ".");
2678
+ });
2679
+ return /*#__PURE__*/ React.createElement(reactExports.Fragment, null, /*#__PURE__*/ React.createElement(Text, null, "More experiments"), /*#__PURE__*/ React.createElement(Space, {
2680
+ h: 1
2681
+ }), /*#__PURE__*/ React.createElement(Ul, null, items));
2682
+ }
2683
+
2630
2684
  function Component(className, styleSrc = {}, config = {}) {
2631
2685
  const { element = `div`, props: otherProps } = config;
2632
2686
  return function MakeComponent({ children, style = {}, ...props }) {
@@ -2726,72 +2780,61 @@ const CodeSnippet = Component(`jbx-code-snippet`, {}, {
2726
2780
  const CodeTextarea = Component(`jbx-code-area`, {}, {
2727
2781
  element: 'textarea'
2728
2782
  });
2729
- const CheckboxHidden = Component(`jbx-checkbox-hidden`, ({ checked })=>{
2783
+ const CheckboxHidden = Component(`jbx-checkbox-hidden`, ({ isChecked })=>{
2730
2784
  return {
2731
2785
  height: SIZE * 2 - 4,
2732
2786
  width: SIZE * 2 - 4,
2733
2787
  paddingTop: 2,
2734
2788
  paddingLeft: 2,
2735
- backgroundColor: checked ? 'var(--accent-color)' : 'white',
2789
+ backgroundColor: isChecked ? 'var(--accent-color)' : 'white',
2736
2790
  borderRadius: BASE_RADIUS,
2737
- boxShadow: checked ? 'inset rgba(0, 0, 0, 0.07) 0 0 0 1px' : 'inset rgba(0, 0, 0, 0.33) 0 0 0 1.5px',
2791
+ 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
2792
  cursor: 'pointer'
2739
2793
  };
2740
2794
  });
2741
- // export const Checkbox = function Checkbox({
2742
- // label,
2743
- // checked,
2744
- // onChange
2745
- // }: {
2746
- // label: string;
2747
- // checked: boolean;
2748
- // onChange?: (value: boolean) => void;
2749
- // }) {
2750
- // return React.createElement(
2751
- // Inline,
2752
- // {
2753
- // onClick: () => {
2754
- // if (onChange) {
2755
- // onChange(!checked);
2756
- // }
2757
- // },
2758
- // style: {
2759
- // alignItems: 'center',
2760
- // cursor: 'pointer'
2761
- // }
2762
- // },
2763
- // [
2764
- // React.createElement(
2765
- // CheckboxHidden,
2766
- // {
2767
- // key: 0,
2768
- // checked
2769
- // },
2770
- // React.createElement(
2771
- // 'svg',
2772
- // {
2773
- // xmlns: 'http://www.w3.org/2000/svg',
2774
- // width: SIZE * 2 - 8,
2775
- // height: SIZE * 2 - 8,
2776
- // fill: 'none',
2777
- // stroke: 'currentColor',
2778
- // strokeLinecap: 'round',
2779
- // strokeLinejoin: 'round',
2780
- // strokeWidth: '2',
2781
- // className: 'feather feather-check',
2782
- // viewBox: '0 0 24 24',
2783
- // color: checked ? 'white' : '#ddd'
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
- // };
2795
+ const Checkbox = function Checkbox({ label, checked, onChange }) {
2796
+ return /*#__PURE__*/ React.createElement(Inline, {
2797
+ // @ts-ignore
2798
+ onClick: ()=>{
2799
+ if (onChange) {
2800
+ onChange(!checked);
2801
+ }
2802
+ },
2803
+ style: {
2804
+ alignItems: 'center',
2805
+ cursor: 'pointer'
2806
+ }
2807
+ }, [
2808
+ /*#__PURE__*/ React.createElement(CheckboxHidden, {
2809
+ key: 0,
2810
+ isChecked: checked
2811
+ }, /*#__PURE__*/ React.createElement('svg', {
2812
+ xmlns: 'http://www.w3.org/2000/svg',
2813
+ width: SIZE * 2 - 8,
2814
+ height: SIZE * 2 - 8,
2815
+ fill: 'none',
2816
+ stroke: 'currentColor',
2817
+ strokeLinecap: 'round',
2818
+ strokeLinejoin: 'round',
2819
+ strokeWidth: '2',
2820
+ className: 'feather feather-check',
2821
+ viewBox: '0 0 24 24',
2822
+ color: checked ? 'white' : '#ddd'
2823
+ }, /*#__PURE__*/ React.createElement('path', {
2824
+ d: 'M20 6L9 17 4 12'
2825
+ }))),
2826
+ /*#__PURE__*/ React.createElement(Space, {
2827
+ key: 1,
2828
+ w: 0.5
2829
+ }),
2830
+ /*#__PURE__*/ React.createElement(Text, {
2831
+ key: 2,
2832
+ style: {
2833
+ userSelect: 'none'
2834
+ }
2835
+ }, label)
2836
+ ]);
2837
+ };
2795
2838
  function Bullet({ value }) {
2796
2839
  return /*#__PURE__*/ React.createElement("div", {
2797
2840
  className: "jbx-bullet-container"
@@ -2800,4 +2843,4 @@ function Bullet({ value }) {
2800
2843
  }, value));
2801
2844
  }
2802
2845
 
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 };
2846
+ export { A, Box, Bullet, Button, Checkbox, CheckboxHidden, CodeSnippet, CodeTextarea, Component, Container, Dropzone, HR, HeaderH1, HeaderH2, HeaderH3, HeaderH4, Inline, Input, Li, MainHeader, MoreExperiments, Range, SmallText, Space, Stack, Tab, Tabs, Text, Ul };
package/dist/main.css CHANGED
@@ -356,8 +356,8 @@ a.jbx-a:hover::before,
356
356
  height: calc(var(--size) * 1.25);
357
357
  width: calc(var(--size) * 1.25);
358
358
  border-radius: 100%;
359
- top: -4px;
360
- margin-right: 4px;
359
+ top: -2px;
360
+ margin-right: 2px;
361
361
  }
362
362
 
363
363
  .jbx-hr {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jbx",
3
- "version": "2.8.0",
3
+ "version": "2.10.0",
4
4
  "author": "hi@javier.xyz",
5
5
  "license": "Unlicensed",
6
6
  "main": "./dist/index.js",