@automattic/vip-design-system 2.13.5 → 2.13.6

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.
@@ -1,5 +1,5 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import { baseControlBorderStyle, baseControlFocusStyle, inputBaseBackground, inputBaseText } from '../Input.styles';
2
+ import { baseControlBorderStyle, baseControlFocusStyle, inputBaseBackground } from '../Input.styles';
3
3
 
4
4
  // The output willl be 16px because of the 1px border.
5
5
  var CHECKBOX_SIZE = 14;
@@ -27,7 +27,6 @@ export var checkboxStyle = function checkboxStyle(variant) {
27
27
  },
28
28
  '& ~ label': {
29
29
  fontWeight: 'regular',
30
- color: inputBaseText,
31
30
  m: 0,
32
31
  ml: 2
33
32
  },
@@ -33,7 +33,10 @@ export var Label = /*#__PURE__*/React.forwardRef(function (_ref, forwardRef) {
33
33
  return _jsxs(Box, _extends({
34
34
  as: as,
35
35
  sx: _extends({
36
- all: 'unset'
36
+ margin: 0,
37
+ padding: 0,
38
+ border: 0,
39
+ outline: 0
37
40
  }, baseLabelStyle, {
38
41
  display: 'block',
39
42
  mb: 2,
@@ -1,8 +1,8 @@
1
1
  /** @jsxImportSource theme-ui */
2
- /// <reference types="react" />
3
- declare const _default: {
4
- title: string;
5
- };
6
- export default _default;
7
- export declare const Default: () => import("react").JSX.Element;
8
- export declare const Required: () => import("react").JSX.Element;
2
+ import { Label } from '..';
3
+ import type { Meta, StoryObj } from '@storybook/react';
4
+ declare const meta: Meta<typeof Label>;
5
+ export default meta;
6
+ type Story = StoryObj<typeof Label>;
7
+ export declare const Default: Story;
8
+ export declare const Required: Story;
@@ -1,32 +1,53 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
1
  /** @jsxImportSource theme-ui */
3
2
 
4
- /**
5
- * Internal dependencies
6
- */
7
- import { Form, Label } from '..';
8
- import { jsx as _jsx } from "theme-ui/jsx-runtime";
9
- import { Fragment as _Fragment } from "theme-ui/jsx-runtime";
10
- export default {
11
- title: 'Form/Label'
3
+ import { Label } from '..';
4
+ var meta = {
5
+ title: 'Form/Label',
6
+ component: Label,
7
+ parameters: {
8
+ docs: {
9
+ source: {
10
+ type: 'auto'
11
+ }
12
+ }
13
+ },
14
+ argTypes: {
15
+ children: {
16
+ control: 'text',
17
+ defaultValue: 'Label text',
18
+ description: 'The label content'
19
+ },
20
+ required: {
21
+ control: 'boolean',
22
+ defaultValue: false,
23
+ description: 'Whether to show the required label'
24
+ },
25
+ clickable: {
26
+ control: 'boolean',
27
+ defaultValue: false,
28
+ description: 'Whether the label should have pointer cursor'
29
+ },
30
+ sx: {
31
+ control: 'object',
32
+ description: 'Theme UI sx-style overrides'
33
+ },
34
+ as: {
35
+ control: 'select',
36
+ options: ['label', 'span', 'div'],
37
+ defaultValue: 'label',
38
+ description: 'The HTML element to render as'
39
+ }
40
+ }
12
41
  };
13
- var DefaultComponent = function DefaultComponent(props) {
14
- return _jsx(Form.Root, {
15
- children: _jsx(Label, _extends({}, props, {
16
- children: "Label"
17
- }))
18
- });
42
+ export default meta;
43
+ export var Default = {
44
+ args: {
45
+ children: 'Label text'
46
+ }
19
47
  };
20
- export var Default = function Default() {
21
- return _jsx(_Fragment, {
22
- children: _jsx(DefaultComponent, {})
23
- });
24
- };
25
- export var Required = function Required() {
26
- var args = {
48
+ export var Required = {
49
+ args: {
50
+ children: 'Label text',
27
51
  required: true
28
- };
29
- return _jsx(_Fragment, {
30
- children: _jsx(DefaultComponent, _extends({}, args))
31
- });
52
+ }
32
53
  };
@@ -603,6 +603,28 @@
603
603
  }
604
604
  }
605
605
  },
606
+ "slider": {
607
+ "background": {
608
+ "default": {
609
+ "value": "#d7d4d3",
610
+ "type": "color"
611
+ },
612
+ "disabled": {
613
+ "value": "#d7d4d3",
614
+ "type": "color"
615
+ }
616
+ },
617
+ "handle": {
618
+ "default": {
619
+ "value": "#13191e",
620
+ "type": "color"
621
+ },
622
+ "disabled": {
623
+ "value": "#9b9796",
624
+ "type": "color"
625
+ }
626
+ }
627
+ },
606
628
  "support": {
607
629
  "background": {
608
630
  "error": {
@@ -665,6 +687,10 @@
665
687
  "type": "color",
666
688
  "value": "#e29101"
667
689
  },
690
+ "strong-warning": {
691
+ "type": "color",
692
+ "value": "#ff7b28"
693
+ },
668
694
  "info": {
669
695
  "type": "color",
670
696
  "value": "#30b5c4"
@@ -851,6 +851,28 @@
851
851
  }
852
852
  }
853
853
  },
854
+ "slider": {
855
+ "background": {
856
+ "default": {
857
+ "value": "#d7d4d3",
858
+ "type": "color"
859
+ },
860
+ "disabled": {
861
+ "value": "#d7d4d3",
862
+ "type": "color"
863
+ }
864
+ },
865
+ "handle": {
866
+ "default": {
867
+ "value": "#13191e",
868
+ "type": "color"
869
+ },
870
+ "disabled": {
871
+ "value": "#9b9796",
872
+ "type": "color"
873
+ }
874
+ }
875
+ },
854
876
  "support": {
855
877
  "background": {
856
878
  "error": {
@@ -913,6 +935,10 @@
913
935
  "type": "color",
914
936
  "value": "#b86e01"
915
937
  },
938
+ "strong-warning": {
939
+ "type": "color",
940
+ "value": "#e76205"
941
+ },
916
942
  "info": {
917
943
  "type": "color",
918
944
  "value": "#0190a0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/vip-design-system",
3
- "version": "2.13.5",
3
+ "version": "2.13.6",
4
4
  "main": "build/system/index.js",
5
5
  "scripts": {
6
6
  "build-storybook": "storybook build",
@@ -4,7 +4,6 @@ import {
4
4
  baseControlBorderStyle,
5
5
  baseControlFocusStyle,
6
6
  inputBaseBackground,
7
- inputBaseText,
8
7
  } from '../Input.styles';
9
8
 
10
9
  // The output willl be 16px because of the 1px border.
@@ -36,7 +35,6 @@ export const checkboxStyle = ( variant: string ): ThemeUIStyleObject => {
36
35
  },
37
36
  '& ~ label': {
38
37
  fontWeight: 'regular',
39
- color: inputBaseText,
40
38
  m: 0,
41
39
  ml: 2,
42
40
  },
@@ -1,36 +1,55 @@
1
1
  /** @jsxImportSource theme-ui */
2
2
 
3
- /**
4
- * Internal dependencies
5
- */
6
- import { Form, Label } from '..';
3
+ import { Label } from '..';
7
4
 
8
- export default {
5
+ import type { Meta, StoryObj } from '@storybook/react';
6
+
7
+ const meta: Meta< typeof Label > = {
9
8
  title: 'Form/Label',
9
+ component: Label,
10
+ parameters: { docs: { source: { type: 'auto' } } },
11
+ argTypes: {
12
+ children: {
13
+ control: 'text',
14
+ defaultValue: 'Label text',
15
+ description: 'The label content',
16
+ },
17
+ required: {
18
+ control: 'boolean',
19
+ defaultValue: false,
20
+ description: 'Whether to show the required label',
21
+ },
22
+ clickable: {
23
+ control: 'boolean',
24
+ defaultValue: false,
25
+ description: 'Whether the label should have pointer cursor',
26
+ },
27
+ sx: {
28
+ control: 'object',
29
+ description: 'Theme UI sx-style overrides',
30
+ },
31
+ as: {
32
+ control: 'select',
33
+ options: [ 'label', 'span', 'div' ],
34
+ defaultValue: 'label',
35
+ description: 'The HTML element to render as',
36
+ },
37
+ },
10
38
  };
11
39
 
12
- const DefaultComponent = props => (
13
- <Form.Root>
14
- <Label { ...props }>Label</Label>
15
- </Form.Root>
16
- );
40
+ export default meta;
41
+
42
+ type Story = StoryObj< typeof Label >;
17
43
 
18
- export const Default = () => {
19
- return (
20
- <>
21
- <DefaultComponent />
22
- </>
23
- );
44
+ export const Default: Story = {
45
+ args: {
46
+ children: 'Label text',
47
+ },
24
48
  };
25
49
 
26
- export const Required = () => {
27
- const args = {
50
+ export const Required: Story = {
51
+ args: {
52
+ children: 'Label text',
28
53
  required: true,
29
- };
30
-
31
- return (
32
- <>
33
- <DefaultComponent { ...args } />
34
- </>
35
- );
54
+ },
36
55
  };
@@ -31,7 +31,10 @@ export const Label = React.forwardRef< HTMLLabelElement, LabelProps >(
31
31
  <Box
32
32
  as={ as }
33
33
  sx={ {
34
- all: 'unset',
34
+ margin: 0,
35
+ padding: 0,
36
+ border: 0,
37
+ outline: 0,
35
38
  ...baseLabelStyle,
36
39
  display: 'block',
37
40
  mb: 2,
@@ -603,6 +603,28 @@
603
603
  }
604
604
  }
605
605
  },
606
+ "slider": {
607
+ "background": {
608
+ "default": {
609
+ "value": "#d7d4d3",
610
+ "type": "color"
611
+ },
612
+ "disabled": {
613
+ "value": "#d7d4d3",
614
+ "type": "color"
615
+ }
616
+ },
617
+ "handle": {
618
+ "default": {
619
+ "value": "#13191e",
620
+ "type": "color"
621
+ },
622
+ "disabled": {
623
+ "value": "#9b9796",
624
+ "type": "color"
625
+ }
626
+ }
627
+ },
606
628
  "support": {
607
629
  "background": {
608
630
  "error": {
@@ -665,6 +687,10 @@
665
687
  "type": "color",
666
688
  "value": "#e29101"
667
689
  },
690
+ "strong-warning": {
691
+ "type": "color",
692
+ "value": "#ff7b28"
693
+ },
668
694
  "info": {
669
695
  "type": "color",
670
696
  "value": "#30b5c4"
@@ -851,6 +851,28 @@
851
851
  }
852
852
  }
853
853
  },
854
+ "slider": {
855
+ "background": {
856
+ "default": {
857
+ "value": "#d7d4d3",
858
+ "type": "color"
859
+ },
860
+ "disabled": {
861
+ "value": "#d7d4d3",
862
+ "type": "color"
863
+ }
864
+ },
865
+ "handle": {
866
+ "default": {
867
+ "value": "#13191e",
868
+ "type": "color"
869
+ },
870
+ "disabled": {
871
+ "value": "#9b9796",
872
+ "type": "color"
873
+ }
874
+ }
875
+ },
854
876
  "support": {
855
877
  "background": {
856
878
  "error": {
@@ -913,6 +935,10 @@
913
935
  "type": "color",
914
936
  "value": "#b86e01"
915
937
  },
938
+ "strong-warning": {
939
+ "type": "color",
940
+ "value": "#e76205"
941
+ },
916
942
  "info": {
917
943
  "type": "color",
918
944
  "value": "#0190a0"
@@ -709,6 +709,28 @@
709
709
  }
710
710
  }
711
711
  },
712
+ "slider": {
713
+ "background": {
714
+ "default": {
715
+ "value": "{color.gray.15}",
716
+ "type": "color"
717
+ },
718
+ "disabled": {
719
+ "value": "{color.gray.15}",
720
+ "type": "color"
721
+ }
722
+ },
723
+ "handle": {
724
+ "default": {
725
+ "value": "{color.black}",
726
+ "type": "color"
727
+ },
728
+ "disabled": {
729
+ "value": "{color.gray.40}",
730
+ "type": "color"
731
+ }
732
+ }
733
+ },
712
734
  "support": {
713
735
  "background": {
714
736
  "error": {
@@ -771,6 +793,10 @@
771
793
  "type": "color",
772
794
  "value": "{color.yellow.50}"
773
795
  },
796
+ "strong-warning": {
797
+ "type": "color",
798
+ "value": "{color.orange.45}"
799
+ },
774
800
  "info": {
775
801
  "type": "color",
776
802
  "value": "{color.blue.50}"
@@ -1681,4 +1707,4 @@
1681
1707
  "type": "typography"
1682
1708
  }
1683
1709
  }
1684
- }
1710
+ }
@@ -603,6 +603,28 @@
603
603
  }
604
604
  }
605
605
  },
606
+ "slider": {
607
+ "background": {
608
+ "default": {
609
+ "value": "{color.gray.15}",
610
+ "type": "color"
611
+ },
612
+ "disabled": {
613
+ "value": "{color.gray.15}",
614
+ "type": "color"
615
+ }
616
+ },
617
+ "handle": {
618
+ "default": {
619
+ "value": "{color.black}",
620
+ "type": "color"
621
+ },
622
+ "disabled": {
623
+ "value": "{color.gray.40}",
624
+ "type": "color"
625
+ }
626
+ }
627
+ },
606
628
  "support": {
607
629
  "background": {
608
630
  "error": {
@@ -665,6 +687,10 @@
665
687
  "type": "color",
666
688
  "value": "{color.yellow.35}"
667
689
  },
690
+ "strong-warning": {
691
+ "type": "color",
692
+ "value": "{color.orange.35}"
693
+ },
668
694
  "info": {
669
695
  "type": "color",
670
696
  "value": "{color.blue.35}"
@@ -1352,4 +1378,4 @@
1352
1378
  }
1353
1379
  }
1354
1380
  }
1355
- }
1381
+ }