@gem-sdk/core 1.10.26 → 1.10.35

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.
@@ -10,65 +10,65 @@ const getBorderStyle = (value)=>{
10
10
  bw: value?.width
11
11
  });
12
12
  };
13
- const handleConvertBorderStyle = (value)=>{
13
+ const handleConvertBorderStyle = (value, type)=>{
14
14
  if (!value) return undefined;
15
15
  if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
16
16
  const data = value;
17
17
  const newVal = {
18
18
  desktop: {
19
- normal: data.desktop?.normal?.border,
20
- hover: data.desktop?.hover?.border,
21
- focus: data.desktop?.focus?.border
19
+ normal: type === 'button' && data.desktop?.normal?.borderType === 'none' && !data.desktop?.normal?.isCustom ? 'solid' : data.desktop?.normal?.border,
20
+ hover: type === 'button' && data.desktop?.hover?.borderType === 'none' && !data.desktop?.hover?.isCustom ? 'solid' : data.desktop?.hover?.border,
21
+ focus: type === 'button' && data.desktop?.focus?.borderType === 'none' && !data.desktop?.focus?.isCustom ? 'solid' : data.desktop?.focus?.border
22
22
  },
23
23
  tablet: {
24
- normal: data.tablet?.normal?.border,
25
- hover: data.tablet?.hover?.border,
26
- focus: data.tablet?.focus?.border
24
+ normal: type === 'button' && data.tablet?.normal?.borderType === 'none' && !data.tablet?.normal?.isCustom ? 'solid' : data.tablet?.normal?.border,
25
+ hover: type === 'button' && data.tablet?.hover?.borderType === 'none' && !data.tablet?.hover?.isCustom ? 'solid' : data.tablet?.hover?.border,
26
+ focus: type === 'button' && data.tablet?.focus?.borderType === 'none' && !data.tablet?.focus?.isCustom ? 'solid' : data.tablet?.focus?.border
27
27
  },
28
28
  mobile: {
29
- normal: data.mobile?.normal?.border,
30
- hover: data.mobile?.hover?.border,
31
- focus: data.mobile?.focus?.border
29
+ normal: type === 'button' && data.mobile?.normal?.borderType === 'none' && !data.mobile?.normal?.isCustom ? 'solid' : data.mobile?.normal?.border,
30
+ hover: type === 'button' && data.mobile?.hover?.borderType === 'none' && !data.mobile?.hover?.isCustom ? 'solid' : data.mobile?.hover?.border,
31
+ focus: type === 'button' && data.mobile?.focus?.borderType === 'none' && !data.mobile?.focus?.isCustom ? 'solid' : data.mobile?.focus?.border
32
32
  }
33
33
  };
34
34
  return makeStyle.makeStyleResponsiveState('bs', newVal);
35
35
  }
36
36
  const data = value;
37
37
  const newVal = {
38
- normal: data?.normal?.border,
39
- hover: data?.hover?.border,
40
- focus: data?.focus?.border
38
+ normal: type === 'button' && data.normal?.borderType === 'none' && !data.normal?.isCustom ? 'solid' : data?.normal?.border,
39
+ hover: type === 'button' && data.hover?.borderType === 'none' && !data.hover?.isCustom ? 'solid' : data?.hover?.border,
40
+ focus: type === 'button' && data.focus?.borderType === 'none' && !data.focus?.isCustom ? 'solid' : data?.focus?.border
41
41
  };
42
42
  return makeStyle.makeStyleState('bs', newVal);
43
43
  };
44
- const handleConvertBorderWidth = (value)=>{
44
+ const handleConvertBorderWidth = (value, type)=>{
45
45
  if (!value) return undefined;
46
46
  if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
47
47
  const data = value;
48
48
  const newVal = {
49
49
  desktop: {
50
- normal: data.desktop?.normal?.width,
51
- hover: data.desktop?.hover?.width,
52
- focus: data.desktop?.focus?.width
50
+ normal: type === 'button' && data.desktop?.normal?.borderType === 'none' && !data?.desktop?.normal?.isCustom ? '1px 1px 1px 1px' : data.desktop?.normal?.width,
51
+ hover: type === 'button' && data.desktop?.hover?.borderType === 'none' && !data?.desktop?.normal?.isCustom ? '1px 1px 1px 1px' : data.desktop?.hover?.width,
52
+ focus: type === 'button' && data.desktop?.focus?.borderType === 'none' && !data?.desktop?.normal?.isCustom ? '1px 1px 1px 1px' : data.desktop?.focus?.width
53
53
  },
54
54
  tablet: {
55
- normal: data.tablet?.normal?.width,
56
- hover: data.tablet?.hover?.width,
57
- focus: data.tablet?.focus?.width
55
+ normal: type === 'button' && data.tablet?.normal?.borderType === 'none' && !data?.tablet?.normal?.isCustom ? '1px 1px 1px 1px' : data.tablet?.normal?.width,
56
+ hover: type === 'button' && data.tablet?.hover?.borderType === 'none' && !data?.tablet?.hover?.isCustom ? '1px 1px 1px 1px' : data.tablet?.hover?.width,
57
+ focus: type === 'button' && data.tablet?.focus?.borderType === 'none' && !data?.tablet?.focus?.isCustom ? '1px 1px 1px 1px' : data.tablet?.focus?.width
58
58
  },
59
59
  mobile: {
60
- normal: data.mobile?.normal?.width,
61
- hover: data.mobile?.hover?.width,
62
- focus: data.mobile?.focus?.width
60
+ normal: type === 'button' && data.mobile?.normal?.borderType === 'none' && !data?.mobile?.normal?.isCustom ? '1px 1px 1px 1px' : data.mobile?.normal?.width,
61
+ hover: type === 'button' && data.mobile?.hover?.borderType === 'none' && !data?.mobile?.hover?.isCustom ? '1px 1px 1px 1px' : data.mobile?.hover?.width,
62
+ focus: type === 'button' && data.mobile?.focus?.borderType === 'none' && !data?.mobile?.focus?.isCustom ? '1px 1px 1px 1px' : data.mobile?.focus?.width
63
63
  }
64
64
  };
65
65
  return makeStyle.makeStyleResponsiveState('bw', newVal);
66
66
  }
67
67
  const data = value;
68
68
  const newVal = {
69
- normal: data?.normal?.width,
70
- hover: data?.hover?.width,
71
- focus: data?.focus?.width
69
+ normal: type === 'button' && data.normal?.borderType === 'none' && !data.normal?.isCustom ? '1px 1px 1px 1px' : data?.normal?.width,
70
+ hover: type === 'button' && data.hover?.borderType === 'none' && !data.hover?.isCustom ? '1px 1px 1px 1px' : data?.hover?.width,
71
+ focus: type === 'button' && data.focus?.borderType === 'none' && !data.focus?.isCustom ? '1px 1px 1px 1px' : data?.focus?.width
72
72
  };
73
73
  return makeStyle.makeStyleState('bw', newVal);
74
74
  };
@@ -17,9 +17,9 @@ const optionLayoutStyle = (column)=>{
17
17
  };
18
18
  const composeGridLayout = (layout)=>{
19
19
  const display = getResonsiveValue.getResponsiveValue(layout, 'display');
20
- const desktop = (getResonsiveValue.getResponsiveValueByScreen(display, 'desktop') === 'fit' ? layout?.desktop?.cols?.map(()=>`auto`) : layout?.desktop?.cols?.map((col)=>`minmax(0, ${col}fr)`))?.join(' ');
21
- const tablet = (getResonsiveValue.getResponsiveValueByScreen(display, 'tablet') === 'fit' ? layout?.tablet?.cols?.map(()=>`auto`) : layout?.tablet?.cols?.map((col)=>`minmax(0, ${col}fr)`))?.join(' ');
22
- const mobile = (getResonsiveValue.getResponsiveValueByScreen(display, 'mobile') === 'fit' ? layout?.mobile?.cols?.map(()=>`auto`) : layout?.mobile?.cols?.map((col)=>`minmax(0, ${col}fr)`))?.join(' ');
20
+ const desktop = (getResonsiveValue.getResponsiveValueByScreen(display, 'desktop') === 'fit' ? layout?.desktop?.cols?.map(()=>`minmax(0, auto)`) : layout?.desktop?.cols?.map((col)=>`minmax(0, ${col}fr)`))?.join(' ');
21
+ const tablet = (getResonsiveValue.getResponsiveValueByScreen(display, 'tablet') === 'fit' ? layout?.tablet?.cols?.map(()=>`minmax(0, auto)`) : layout?.tablet?.cols?.map((col)=>`minmax(0, ${col}fr)`))?.join(' ');
22
+ const mobile = (getResonsiveValue.getResponsiveValueByScreen(display, 'mobile') === 'fit' ? layout?.mobile?.cols?.map(()=>`minmax(0, auto)`) : layout?.mobile?.cols?.map((col)=>`minmax(0, ${col}fr)`))?.join(' ');
23
23
  return {
24
24
  [`--gtc`]: desktop,
25
25
  [`--gtc-tablet`]: tablet,
@@ -8,65 +8,65 @@ const getBorderStyle = (value)=>{
8
8
  bw: value?.width
9
9
  });
10
10
  };
11
- const handleConvertBorderStyle = (value)=>{
11
+ const handleConvertBorderStyle = (value, type)=>{
12
12
  if (!value) return undefined;
13
13
  if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
14
14
  const data = value;
15
15
  const newVal = {
16
16
  desktop: {
17
- normal: data.desktop?.normal?.border,
18
- hover: data.desktop?.hover?.border,
19
- focus: data.desktop?.focus?.border
17
+ normal: type === 'button' && data.desktop?.normal?.borderType === 'none' && !data.desktop?.normal?.isCustom ? 'solid' : data.desktop?.normal?.border,
18
+ hover: type === 'button' && data.desktop?.hover?.borderType === 'none' && !data.desktop?.hover?.isCustom ? 'solid' : data.desktop?.hover?.border,
19
+ focus: type === 'button' && data.desktop?.focus?.borderType === 'none' && !data.desktop?.focus?.isCustom ? 'solid' : data.desktop?.focus?.border
20
20
  },
21
21
  tablet: {
22
- normal: data.tablet?.normal?.border,
23
- hover: data.tablet?.hover?.border,
24
- focus: data.tablet?.focus?.border
22
+ normal: type === 'button' && data.tablet?.normal?.borderType === 'none' && !data.tablet?.normal?.isCustom ? 'solid' : data.tablet?.normal?.border,
23
+ hover: type === 'button' && data.tablet?.hover?.borderType === 'none' && !data.tablet?.hover?.isCustom ? 'solid' : data.tablet?.hover?.border,
24
+ focus: type === 'button' && data.tablet?.focus?.borderType === 'none' && !data.tablet?.focus?.isCustom ? 'solid' : data.tablet?.focus?.border
25
25
  },
26
26
  mobile: {
27
- normal: data.mobile?.normal?.border,
28
- hover: data.mobile?.hover?.border,
29
- focus: data.mobile?.focus?.border
27
+ normal: type === 'button' && data.mobile?.normal?.borderType === 'none' && !data.mobile?.normal?.isCustom ? 'solid' : data.mobile?.normal?.border,
28
+ hover: type === 'button' && data.mobile?.hover?.borderType === 'none' && !data.mobile?.hover?.isCustom ? 'solid' : data.mobile?.hover?.border,
29
+ focus: type === 'button' && data.mobile?.focus?.borderType === 'none' && !data.mobile?.focus?.isCustom ? 'solid' : data.mobile?.focus?.border
30
30
  }
31
31
  };
32
32
  return makeStyleResponsiveState('bs', newVal);
33
33
  }
34
34
  const data = value;
35
35
  const newVal = {
36
- normal: data?.normal?.border,
37
- hover: data?.hover?.border,
38
- focus: data?.focus?.border
36
+ normal: type === 'button' && data.normal?.borderType === 'none' && !data.normal?.isCustom ? 'solid' : data?.normal?.border,
37
+ hover: type === 'button' && data.hover?.borderType === 'none' && !data.hover?.isCustom ? 'solid' : data?.hover?.border,
38
+ focus: type === 'button' && data.focus?.borderType === 'none' && !data.focus?.isCustom ? 'solid' : data?.focus?.border
39
39
  };
40
40
  return makeStyleState('bs', newVal);
41
41
  };
42
- const handleConvertBorderWidth = (value)=>{
42
+ const handleConvertBorderWidth = (value, type)=>{
43
43
  if (!value) return undefined;
44
44
  if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
45
45
  const data = value;
46
46
  const newVal = {
47
47
  desktop: {
48
- normal: data.desktop?.normal?.width,
49
- hover: data.desktop?.hover?.width,
50
- focus: data.desktop?.focus?.width
48
+ normal: type === 'button' && data.desktop?.normal?.borderType === 'none' && !data?.desktop?.normal?.isCustom ? '1px 1px 1px 1px' : data.desktop?.normal?.width,
49
+ hover: type === 'button' && data.desktop?.hover?.borderType === 'none' && !data?.desktop?.normal?.isCustom ? '1px 1px 1px 1px' : data.desktop?.hover?.width,
50
+ focus: type === 'button' && data.desktop?.focus?.borderType === 'none' && !data?.desktop?.normal?.isCustom ? '1px 1px 1px 1px' : data.desktop?.focus?.width
51
51
  },
52
52
  tablet: {
53
- normal: data.tablet?.normal?.width,
54
- hover: data.tablet?.hover?.width,
55
- focus: data.tablet?.focus?.width
53
+ normal: type === 'button' && data.tablet?.normal?.borderType === 'none' && !data?.tablet?.normal?.isCustom ? '1px 1px 1px 1px' : data.tablet?.normal?.width,
54
+ hover: type === 'button' && data.tablet?.hover?.borderType === 'none' && !data?.tablet?.hover?.isCustom ? '1px 1px 1px 1px' : data.tablet?.hover?.width,
55
+ focus: type === 'button' && data.tablet?.focus?.borderType === 'none' && !data?.tablet?.focus?.isCustom ? '1px 1px 1px 1px' : data.tablet?.focus?.width
56
56
  },
57
57
  mobile: {
58
- normal: data.mobile?.normal?.width,
59
- hover: data.mobile?.hover?.width,
60
- focus: data.mobile?.focus?.width
58
+ normal: type === 'button' && data.mobile?.normal?.borderType === 'none' && !data?.mobile?.normal?.isCustom ? '1px 1px 1px 1px' : data.mobile?.normal?.width,
59
+ hover: type === 'button' && data.mobile?.hover?.borderType === 'none' && !data?.mobile?.hover?.isCustom ? '1px 1px 1px 1px' : data.mobile?.hover?.width,
60
+ focus: type === 'button' && data.mobile?.focus?.borderType === 'none' && !data?.mobile?.focus?.isCustom ? '1px 1px 1px 1px' : data.mobile?.focus?.width
61
61
  }
62
62
  };
63
63
  return makeStyleResponsiveState('bw', newVal);
64
64
  }
65
65
  const data = value;
66
66
  const newVal = {
67
- normal: data?.normal?.width,
68
- hover: data?.hover?.width,
69
- focus: data?.focus?.width
67
+ normal: type === 'button' && data.normal?.borderType === 'none' && !data.normal?.isCustom ? '1px 1px 1px 1px' : data?.normal?.width,
68
+ hover: type === 'button' && data.hover?.borderType === 'none' && !data.hover?.isCustom ? '1px 1px 1px 1px' : data?.hover?.width,
69
+ focus: type === 'button' && data.focus?.borderType === 'none' && !data.focus?.isCustom ? '1px 1px 1px 1px' : data?.focus?.width
70
70
  };
71
71
  return makeStyleState('bw', newVal);
72
72
  };
@@ -15,9 +15,9 @@ const optionLayoutStyle = (column)=>{
15
15
  };
16
16
  const composeGridLayout = (layout)=>{
17
17
  const display = getResponsiveValue(layout, 'display');
18
- const desktop = (getResponsiveValueByScreen(display, 'desktop') === 'fit' ? layout?.desktop?.cols?.map(()=>`auto`) : layout?.desktop?.cols?.map((col)=>`minmax(0, ${col}fr)`))?.join(' ');
19
- const tablet = (getResponsiveValueByScreen(display, 'tablet') === 'fit' ? layout?.tablet?.cols?.map(()=>`auto`) : layout?.tablet?.cols?.map((col)=>`minmax(0, ${col}fr)`))?.join(' ');
20
- const mobile = (getResponsiveValueByScreen(display, 'mobile') === 'fit' ? layout?.mobile?.cols?.map(()=>`auto`) : layout?.mobile?.cols?.map((col)=>`minmax(0, ${col}fr)`))?.join(' ');
18
+ const desktop = (getResponsiveValueByScreen(display, 'desktop') === 'fit' ? layout?.desktop?.cols?.map(()=>`minmax(0, auto)`) : layout?.desktop?.cols?.map((col)=>`minmax(0, ${col}fr)`))?.join(' ');
19
+ const tablet = (getResponsiveValueByScreen(display, 'tablet') === 'fit' ? layout?.tablet?.cols?.map(()=>`minmax(0, auto)`) : layout?.tablet?.cols?.map((col)=>`minmax(0, ${col}fr)`))?.join(' ');
20
+ const mobile = (getResponsiveValueByScreen(display, 'mobile') === 'fit' ? layout?.mobile?.cols?.map(()=>`minmax(0, auto)`) : layout?.mobile?.cols?.map((col)=>`minmax(0, ${col}fr)`))?.join(' ');
21
21
  return {
22
22
  [`--gtc`]: desktop,
23
23
  [`--gtc-tablet`]: tablet,
@@ -7494,8 +7494,8 @@ type BorderStyle = StateProp<Border> | ResponsiveStateProp<Border>;
7494
7494
  declare const getBorderStyle: (value?: Border) => {
7495
7495
  [k: string]: Record<"--b" | "--bc" | "--bw", string | undefined>;
7496
7496
  };
7497
- declare const handleConvertBorderStyle: (value?: BorderStyle) => {} | undefined;
7498
- declare const handleConvertBorderWidth: (value?: BorderStyle) => {} | undefined;
7497
+ declare const handleConvertBorderStyle: (value?: BorderStyle, type?: 'button') => {} | undefined;
7498
+ declare const handleConvertBorderWidth: (value?: BorderStyle, type?: 'button') => {} | undefined;
7499
7499
  declare const handleConvertBorderColor: (value?: BorderStyle) => React.CSSProperties | undefined;
7500
7500
  declare const handleConvertClassColor: (value?: BorderStyle) => string | undefined;
7501
7501
  declare const handleConvertClassColorDynamicBtn: (value?: BorderStyle) => string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.10.26",
3
+ "version": "1.10.35",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",