@vev/silke 1.0.14 → 1.0.15

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/styles.css CHANGED
@@ -1544,17 +1544,17 @@ img.silke-icon_icon_84f9e9d6b3 {
1544
1544
  * Get font size base on base font size
1545
1545
  * scaling = round(size * 1.200) (Minor Third)
1546
1546
  */
1547
- .silke-steps_number_e3e97b6c1a {
1548
- width: 24px;
1549
- height: 24px;
1550
- outline: 1px solid #fff;
1551
- border-radius: 50%;
1552
- text-align: center;
1553
- transition: 500ms outline;
1547
+ .silke-toolbar_root_dde856ffa5 {
1548
+ position: relative;
1554
1549
  }
1555
-
1556
- .silke-steps_number_e3e97b6c1a.silke-steps_done_e3e97b6c1a {
1557
- outline: 1px solid var(--color-success-30);
1550
+ .silke-toolbar_root_dde856ffa5:before {
1551
+ background-color: rgba(var(--color-neutral-100-rgb), var(--opacity-level-light));
1552
+ position: absolute;
1553
+ content: "";
1554
+ bottom: 0;
1555
+ left: 0;
1556
+ right: 0;
1557
+ height: 1px;
1558
1558
  }
1559
1559
  /**********************
1560
1560
  * SOME MATH
@@ -1572,17 +1572,17 @@ img.silke-icon_icon_84f9e9d6b3 {
1572
1572
  * Get font size base on base font size
1573
1573
  * scaling = round(size * 1.200) (Minor Third)
1574
1574
  */
1575
- .silke-toolbar_root_dde856ffa5 {
1576
- position: relative;
1575
+ .silke-steps_number_e3e97b6c1a {
1576
+ width: 24px;
1577
+ height: 24px;
1578
+ outline: 1px solid #fff;
1579
+ border-radius: 50%;
1580
+ text-align: center;
1581
+ transition: 500ms outline;
1577
1582
  }
1578
- .silke-toolbar_root_dde856ffa5:before {
1579
- background-color: rgba(var(--color-neutral-100-rgb), var(--opacity-level-light));
1580
- position: absolute;
1581
- content: "";
1582
- bottom: 0;
1583
- left: 0;
1584
- right: 0;
1585
- height: 1px;
1583
+
1584
+ .silke-steps_number_e3e97b6c1a.silke-steps_done_e3e97b6c1a {
1585
+ outline: 1px solid var(--color-success-30);
1586
1586
  }
1587
1587
  /**********************
1588
1588
  * SOME MATH
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vev/silke",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/types/index.d.ts",
@@ -30,8 +30,8 @@
30
30
  "@mdx-js/mdx": "^2.0.0-next.9",
31
31
  "@mdx-js/react": "^2.1.2",
32
32
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
33
- "@vev/react": "0.0.3",
34
- "@vev/utils": "1.0.7",
33
+ "@vev/react": "0.0.4",
34
+ "@vev/utils": "1.0.8",
35
35
  "@uiw/react-codemirror": "^4.12.3",
36
36
  "@uiw/codemirror-theme-dracula": "^4.12.3",
37
37
  "classnames": ">=2.2.0",
@@ -82,7 +82,7 @@ export function ColorInfo({ rgba, noTransparency, onChange }: ColorInfoProps) {
82
82
  />
83
83
  </SilkeBox>
84
84
 
85
- <SilkeBox style={{ width: 100 }} flex gap="s">
85
+ <SilkeBox style={{ width: 88 }} flex gap="s">
86
86
  {format === 'HEX' ? (
87
87
  <SilkeTextField
88
88
  flex
@@ -109,7 +109,7 @@ export function ColorInfo({ rgba, noTransparency, onChange }: ColorInfoProps) {
109
109
  )}
110
110
  </SilkeBox>
111
111
 
112
- <SilkeBox style={{ width: 40 }}>
112
+ <SilkeBox style={{ width: 52 }}>
113
113
  <SilkeCssNumberField
114
114
  min={0}
115
115
  max={100}
@@ -9,10 +9,10 @@ import { SilkeText, SilkeTextSmall } from '../../silke-text';
9
9
  import styles from './styles.scss';
10
10
  import { ArrayFieldModal } from './array-field-modal';
11
11
  import { ArrayFieldInline } from './array-field-inline';
12
- import { getTitle } from './string-field';
13
12
  import { SilkeOverflowMenu } from '../../silke-overflow-menu';
14
13
  import { generateTitle, generateImage } from './utils';
15
14
  import { isString, startCase } from 'lodash';
15
+ import { getTitle } from './utils/schema-util';
16
16
 
17
17
  const ArrayField = ({ value = [], schema, onChange }: SchemaFieldProps<ArrayFieldType>) => {
18
18
  const [selected, setSelected] = useState<number | undefined>(undefined);
@@ -5,8 +5,8 @@ import { SilkeIcon, SilkeIcons } from '../../silke-icon';
5
5
  import { SilkeTextSmall } from '../../silke-text';
6
6
  import { IconField as IconFieldType, SchemaFieldProps } from '@vev/react';
7
7
  import { useSchemaContext } from '../silke-schema-context';
8
- import { getTitle } from './string-field';
9
8
  import { EmojiType } from '@vev/utils';
9
+ import { getTitle } from './utils/schema-util';
10
10
 
11
11
  const IconField = ({ value, schema, onChange }: SchemaFieldProps<IconFieldType>) => {
12
12
  const { actions } = useSchemaContext();
@@ -6,7 +6,8 @@ import { SilkeTextSmall } from '../../silke-text';
6
6
  import { ImageField as ImageFieldType, SchemaFieldProps } from '@vev/react';
7
7
  import { useSchemaContext } from '../silke-schema-context';
8
8
  import styles from './styles.scss';
9
- import { getTitle } from './string-field';
9
+
10
+ import { getTitle } from './utils/schema-util';
10
11
 
11
12
  const ImageField = ({ value, schema, onChange }: SchemaFieldProps<ImageFieldType>) => {
12
13
  const { actions } = useSchemaContext();
@@ -6,7 +6,8 @@ import { SilkeToggle } from '../../silke-toggle';
6
6
  import { SilkeText, SilkeTextSmall } from '../../silke-text';
7
7
 
8
8
  import { useSchemaContext } from '../silke-schema-context';
9
- import { getTitle } from './string-field';
9
+
10
+ import { getTitle } from './utils/schema-util';
10
11
 
11
12
  const SelectField = (props: SchemaFieldProps<LinkFieldType>) => {
12
13
  const { onChange, schema, value } = props;
@@ -5,7 +5,8 @@ import { SilkeBox } from '../../silke-box';
5
5
  import { SilkeSlider } from '../../silke-slider';
6
6
  import { SilkeText, SilkeTextSmall } from '../../silke-text';
7
7
  import { SilkeTextField } from '../../silke-text-field';
8
- import { getTitle } from './string-field';
8
+
9
+ import { getTitle } from './utils/schema-util';
9
10
 
10
11
  const NumberField = (props: SchemaFieldProps<NumberFieldType>) => {
11
12
  const [errorMessage, setErrorMessage] = useState<string>();
@@ -4,7 +4,8 @@ import { SilkeBox } from '../../silke-box';
4
4
  import { SilkeObjectField } from '../../silke-object-field';
5
5
  import { SilkeTextSmall } from '../../silke-text';
6
6
  import { SilkeSchemaFields } from '../silke-schema-fields';
7
- import { getTitle } from './string-field';
7
+
8
+ import { getTitle } from './utils/schema-util';
8
9
 
9
10
  export default function ObjectField({
10
11
  value = {},
@@ -1,20 +1,21 @@
1
1
  import { SchemaFieldProps, SelectField as SelectFieldType, SelectFieldItem } from '@vev/react';
2
- import { isArray, isFunction, startCase } from 'lodash';
2
+ import { isArray, isFunction } from 'lodash';
3
3
  import React, { useEffect, useState } from 'react';
4
- import { SilkeText, SilkeTextSmall } from '../../silke-text/silke-text';
4
+ import { SilkeText, SilkeTextSmall } from '../../silke-text';
5
5
  import { SilkeAutocompleteField } from '../../silke-autocomplete-field';
6
6
  import { SilkeBox } from '../../silke-box';
7
7
  import { SilkeCheckbox } from '../../silke-checkbox';
8
8
  import { SilkeRadioButton } from '../../silke-radio-button';
9
9
  import { SilkeSelectField } from '../../silke-select-field';
10
10
  import { useSchemaContext } from '../silke-schema-context';
11
- import { getTitle } from './string-field';
11
+
12
+ import { getTitle } from './utils/schema-util';
12
13
 
13
14
  const SelectField = (props: SchemaFieldProps<SelectFieldType>) => {
14
15
  const {
15
16
  onChange,
16
17
  schema,
17
- schema: { options, name, title, options: { multiselect = false, display } = {} },
18
+ schema: { options, name, options: { multiselect = false, display } = {} },
18
19
  value,
19
20
  } = props;
20
21
 
@@ -33,8 +34,6 @@ const SelectField = (props: SchemaFieldProps<SelectFieldType>) => {
33
34
  }
34
35
  }, [schemaItems, context]);
35
36
 
36
- const label = title || startCase(name);
37
-
38
37
  if (multiselect && (!display || display === 'checkbox')) {
39
38
  const values = (value as string[]) || [];
40
39
  return (
@@ -43,7 +42,7 @@ const SelectField = (props: SchemaFieldProps<SelectFieldType>) => {
43
42
  <SilkeCheckbox
44
43
  key={index}
45
44
  label={item.label}
46
- value={!!values.includes(item.value) || false}
45
+ value={values.includes(item.value) || false}
47
46
  onChange={(checked: boolean) =>
48
47
  checked
49
48
  ? onChange([...values, item.value])
@@ -1,7 +1,7 @@
1
- import { SchemaFieldProps, StringField as StringFieldType, VevProps } from '@vev/react';
1
+ import { SchemaFieldProps, StringField as StringFieldType } from '@vev/react';
2
2
  import React from 'react';
3
3
  import { SilkeTextField } from '../../silke-text-field';
4
- import { startCase } from 'lodash';
4
+ import { getTitle } from './utils/schema-util';
5
5
 
6
6
  const StringField = ({ schema, ...rest }: SchemaFieldProps<StringFieldType>) => {
7
7
  const { options } = schema;
@@ -24,8 +24,4 @@ const StringField = ({ schema, ...rest }: SchemaFieldProps<StringFieldType>) =>
24
24
  );
25
25
  };
26
26
 
27
- export const getTitle = (schema: VevProps) => {
28
- return schema.title || startCase(schema.name);
29
- };
30
-
31
27
  export default StringField;
@@ -3,20 +3,24 @@ import React from 'react';
3
3
  import { SilkeBox } from '../../silke-box';
4
4
  import { SilkeToggle } from '../../silke-toggle';
5
5
  import { SilkeTextSmall } from '../../silke-text';
6
+ import { getTitle } from './utils/schema-util';
6
7
 
7
- const Toggle = (props: SchemaFieldProps<BooleanField>) => {
8
+ const Toggle = ({ schema, value, onChange }: SchemaFieldProps<BooleanField>) => {
8
9
  return (
9
- <SilkeBox flex>
10
- <SilkeBox align="start" style={{ width: '80px' }}>
11
- <SilkeBox vAlign="center" flex>
12
- <SilkeTextSmall weight="strong">
13
- {props.schema.title || props.schema.description || props.schema.name}
14
- </SilkeTextSmall>
10
+ <SilkeBox column>
11
+ <SilkeBox flex>
12
+ <SilkeBox align="center" style={{ width: '80px' }}>
13
+ <SilkeBox vAlign="center" flex>
14
+ <SilkeTextSmall weight="strong">{getTitle(schema)}</SilkeTextSmall>
15
+ </SilkeBox>
16
+ </SilkeBox>
17
+ <SilkeBox flex pad="xs">
18
+ <SilkeToggle value={value || false} onChange={onChange} small />
15
19
  </SilkeBox>
16
20
  </SilkeBox>
17
- <SilkeBox flex pad="xs">
18
- <SilkeToggle value={props.value || false} onChange={props.onChange} small />
19
- </SilkeBox>
21
+ {schema.description && (
22
+ <SilkeTextSmall color="neutral-80">{schema.description}</SilkeTextSmall>
23
+ )}
20
24
  </SilkeBox>
21
25
  );
22
26
  };
@@ -0,0 +1,6 @@
1
+ import { VevProps } from '@vev/utils';
2
+ import { startCase } from 'lodash';
3
+
4
+ export const getTitle = (schema: VevProps) => {
5
+ return schema.title || startCase(schema.name);
6
+ };