@vitus-labs/rocketstories 0.20.0 → 0.21.0-alpha.3

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.
@@ -46,7 +46,7 @@ component.displayName = '@vitus-labs/rocketstories/Empty';
46
46
  /* eslint-disable no-underscore-dangle */
47
47
  const getTheme = () => window.__VITUS_LABS_STORIES__.decorators.theme;
48
48
 
49
- /* eslint-disable @typescript-eslint/no-explicit-any */
49
+ /* eslint-disable no-param-reassign */
50
50
  const parseProps = (props) => Object.entries(props).reduce((acc, [key, value]) => {
51
51
  if (value === null)
52
52
  return acc;
@@ -218,7 +218,6 @@ const CONTROL_TYPES = [
218
218
  'inline-check',
219
219
  ];
220
220
 
221
- /* eslint-disable @typescript-eslint/no-explicit-any */
222
221
  const isValidControl = (value) => typeof value === 'object' &&
223
222
  value !== null &&
224
223
  CONTROL_TYPES.includes(value.type);
@@ -680,7 +679,6 @@ var text = {
680
679
  },
681
680
  };
682
681
 
683
- /* eslint-disable @typescript-eslint/no-explicit-any */
684
682
  const isColor = (value) => {
685
683
  const s = new Option().style;
686
684
  s.color = value;
@@ -757,6 +755,7 @@ const valuesToControls = ({ component, values, dimensionControls = {}, }) => {
757
755
  };
758
756
  };
759
757
 
758
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
760
759
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
761
760
  // @ts-ignore
762
761
  const makeDimensionStories = ({ name, component: component$1, dimension, attrs = {}, storyOptions = {}, ignore,
@@ -806,53 +805,51 @@ const makeDimensionStories = ({ name, component: component$1, dimension, attrs =
806
805
  // STORY COMPONENT
807
806
  // ------------------------------------------------------
808
807
  const WrapElement = isEmpty(storyOptions) ? Fragment : Element;
809
- const Enhanced = (props) => {
810
- return (React.createElement(WrapElement, { block: true, contentDirection: storyOptions.direction, contentAlignX: storyOptions.alignX, contentAlignY: storyOptions.alignY,
811
- // @ts-ignore
812
- style: { gap: storyOptions.gap } }, Object.keys(currentDimension).map((item) => {
813
- const shouldBeIgnored = ignore.includes(item);
814
- const key = `${dimension}-${item}`;
815
- // do not render ignored dimension keys
816
- if (shouldBeIgnored)
817
- return null;
818
- if (storyOptions.pseudo) {
819
- return (React.createElement(WrapElement, { key: key, "data-story": key, contentDirection: storyOptions.direction === 'rows' ? 'inline' : 'rows', contentAlignX: storyOptions.alignX, contentAlignY: storyOptions.alignY,
820
- // @ts-ignore
821
- style: { gap: storyOptions.gap / 2 } },
822
- React.createElement("div", null,
823
- React.createElement(Text, { paragraph: true }, "Base"),
824
- createElement(component$1, {
825
- ...props,
826
- [dimension]: isMultiKey ? [item] : item,
827
- })),
828
- React.createElement("div", null,
829
- React.createElement(Text, { paragraph: true }, "Hover"),
830
- createElement(component$1, {
831
- ...props,
832
- [dimension]: isMultiKey ? [item] : item,
833
- hover: true,
834
- })),
835
- React.createElement("div", null,
836
- React.createElement(Text, { paragraph: true }, "Pressed"),
837
- createElement(component$1, {
838
- ...props,
839
- [dimension]: isMultiKey ? [item] : item,
840
- pressed: true,
841
- })),
842
- React.createElement("div", null,
843
- React.createElement(Text, { paragraph: true }, "Active"),
844
- createElement(component$1, {
845
- ...props,
846
- [dimension]: isMultiKey ? [item] : item,
847
- active: true,
848
- }))));
849
- }
850
- return (React.createElement(WrapElement, { key: key, "data-story": `${dimension}-${item}`, ...storyOptions, contentDirection: "rows" }, createElement(component$1, {
851
- ...props,
852
- [dimension]: isMultiKey ? [item] : item,
853
- })));
808
+ const Enhanced = (props) => (React.createElement(WrapElement, { block: true, contentDirection: storyOptions.direction, contentAlignX: storyOptions.alignX, contentAlignY: storyOptions.alignY,
809
+ // @ts-ignore
810
+ style: { gap: storyOptions.gap } }, Object.keys(currentDimension).map((item) => {
811
+ const shouldBeIgnored = ignore.includes(item);
812
+ const key = `${dimension}-${item}`;
813
+ // do not render ignored dimension keys
814
+ if (shouldBeIgnored)
815
+ return null;
816
+ if (storyOptions.pseudo) {
817
+ return (React.createElement(WrapElement, { key: key, "data-story": key, contentDirection: storyOptions.direction === 'rows' ? 'inline' : 'rows', contentAlignX: storyOptions.alignX, contentAlignY: storyOptions.alignY,
818
+ // @ts-ignore
819
+ style: { gap: storyOptions.gap / 2 } },
820
+ React.createElement("div", null,
821
+ React.createElement(Text, { paragraph: true }, "Base"),
822
+ createElement(component$1, {
823
+ ...props,
824
+ [dimension]: isMultiKey ? [item] : item,
825
+ })),
826
+ React.createElement("div", null,
827
+ React.createElement(Text, { paragraph: true }, "Hover"),
828
+ createElement(component$1, {
829
+ ...props,
830
+ [dimension]: isMultiKey ? [item] : item,
831
+ hover: true,
832
+ })),
833
+ React.createElement("div", null,
834
+ React.createElement(Text, { paragraph: true }, "Pressed"),
835
+ createElement(component$1, {
836
+ ...props,
837
+ [dimension]: isMultiKey ? [item] : item,
838
+ pressed: true,
839
+ })),
840
+ React.createElement("div", null,
841
+ React.createElement(Text, { paragraph: true }, "Active"),
842
+ createElement(component$1, {
843
+ ...props,
844
+ [dimension]: isMultiKey ? [item] : item,
845
+ active: true,
846
+ }))));
847
+ }
848
+ return (React.createElement(WrapElement, { key: key, "data-story": `${dimension}-${item}`, ...storyOptions, contentDirection: "rows" }, createElement(component$1, {
849
+ ...props,
850
+ [dimension]: isMultiKey ? [item] : item,
854
851
  })));
855
- };
852
+ })));
856
853
  Enhanced.args = args;
857
854
  Enhanced.argTypes = {
858
855
  ...storybookControls,
@@ -942,7 +939,6 @@ const mainStory = ({ name, component, attrs }) => {
942
939
  return Enhanced;
943
940
  };
944
941
 
945
- /* eslint-disable @typescript-eslint/no-explicit-any */
946
942
  const story = ({ component, attrs }) => {
947
943
  const definedControls = filterControls(attrs);
948
944
  const values = filterValues(attrs);
@@ -1032,7 +1028,7 @@ const createRocketstories = (options, defaultOptions) => {
1032
1028
  }),
1033
1029
  // generate main story
1034
1030
  main: () => mainStory(result),
1035
- //define storyOptions
1031
+ // define storyOptions
1036
1032
  storyOptions: (storyOptions) => createRocketstories({ storyOptions }, result),
1037
1033
  // generate stories of defined dimension
1038
1034
  dimension: (dimension, params = {}) => {