@spectrum-web-components/divider 0.3.1 → 0.4.2
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/README.md +45 -15
- package/package.json +4 -4
- package/src/Divider.d.ts +1 -1
- package/src/Divider.js +2 -1
- package/src/Divider.js.map +1 -1
- package/stories/typography-decorator.js +2 -1
- package/stories/typography-decorator.js.map +1 -1
package/README.md
CHANGED
@@ -26,9 +26,11 @@ import { Divider } from '@spectrum-web-components/divider';
|
|
26
26
|
|
27
27
|
## Horizontal
|
28
28
|
|
29
|
-
|
29
|
+
<sp-tabs selected="m" auto label="Horizontal Size Attribute Options">
|
30
|
+
<sp-tab value="s">Small</sp-tab>
|
31
|
+
<sp-tab-panel value="s">
|
30
32
|
|
31
|
-
```html-live
|
33
|
+
```html-live demo
|
32
34
|
<h2 class="spectrum-Heading spectrum-Heading--sizeXS">Small</h2>
|
33
35
|
<sp-divider size="s"></sp-divider>
|
34
36
|
<p class="spectrum-Body">
|
@@ -36,9 +38,11 @@ import { Divider } from '@spectrum-web-components/divider';
|
|
36
38
|
</p>
|
37
39
|
```
|
38
40
|
|
39
|
-
|
41
|
+
</sp-tab-panel>
|
42
|
+
<sp-tab value="m">Medium</sp-tab>
|
43
|
+
<sp-tab-panel value="m">
|
40
44
|
|
41
|
-
```html-live
|
45
|
+
```html-live demo
|
42
46
|
<h2 class="spectrum-Heading spectrum-Heading--sizeS">Medium</h2>
|
43
47
|
<sp-divider size="m"></sp-divider>
|
44
48
|
<p class="spectrum-Body">
|
@@ -47,56 +51,82 @@ import { Divider } from '@spectrum-web-components/divider';
|
|
47
51
|
</p>
|
48
52
|
```
|
49
53
|
|
50
|
-
|
54
|
+
</sp-tab-panel>
|
55
|
+
<sp-tab value="l">Large</sp-tab>
|
56
|
+
<sp-tab-panel value="l">
|
51
57
|
|
52
|
-
```html-live
|
58
|
+
```html-live demo
|
53
59
|
<h2 class="spectrum-Heading spectrum-Heading--sizeM">Large</h2>
|
54
60
|
<sp-divider size="l"></sp-divider>
|
55
61
|
<p class="spectrum-Body">Page or Section Titles.</p>
|
56
62
|
```
|
57
63
|
|
64
|
+
</sp-tab-panel>
|
65
|
+
</sp-tabs>
|
66
|
+
|
58
67
|
## Vertical
|
59
68
|
|
60
69
|
When a vertical Divider is used inside of a flex container, use `align-self: stretch; height: auto;` on the Divider.
|
61
70
|
|
62
|
-
|
71
|
+
<sp-tabs selected="m" auto label="Vertical Size Attribute Options">
|
72
|
+
<sp-tab value="s">Small</sp-tab>
|
73
|
+
<sp-tab-panel value="s">
|
63
74
|
|
64
|
-
```html-live
|
75
|
+
```html-live demo
|
65
76
|
<div style="height: 32px; display: flex;">
|
66
77
|
<sp-action-button quiet label="Zoom in">
|
67
78
|
<sp-icon-magnify slot="icon"></sp-icon-magnify>
|
68
79
|
</sp-action-button>
|
69
|
-
<sp-divider
|
80
|
+
<sp-divider
|
81
|
+
size="s"
|
82
|
+
style="align-self: stretch; height: auto;"
|
83
|
+
vertical
|
84
|
+
></sp-divider>
|
70
85
|
<sp-action-button quiet label="Zoom in">
|
71
86
|
<sp-icon-magnify slot="icon"></sp-icon-magnify>
|
72
87
|
</sp-action-button>
|
73
88
|
</div>
|
74
89
|
```
|
75
90
|
|
76
|
-
|
91
|
+
</sp-tab-panel>
|
92
|
+
<sp-tab value="m">Medium</sp-tab>
|
93
|
+
<sp-tab-panel value="m">
|
77
94
|
|
78
|
-
```html-live
|
95
|
+
```html-live demo
|
79
96
|
<div style="height: 32px; display: flex;">
|
80
97
|
<sp-action-button quiet label="Zoom in">
|
81
98
|
<sp-icon-magnify slot="icon"></sp-icon-magnify>
|
82
99
|
</sp-action-button>
|
83
|
-
<sp-divider
|
100
|
+
<sp-divider
|
101
|
+
size="m"
|
102
|
+
style="align-self: stretch; height: auto;"
|
103
|
+
vertical
|
104
|
+
></sp-divider>
|
84
105
|
<sp-action-button quiet label="Zoom in">
|
85
106
|
<sp-icon-magnify slot="icon"></sp-icon-magnify>
|
86
107
|
</sp-action-button>
|
87
108
|
</div>
|
88
109
|
```
|
89
110
|
|
90
|
-
|
111
|
+
</sp-tab-panel>
|
112
|
+
<sp-tab value="l">Large</sp-tab>
|
113
|
+
<sp-tab-panel value="l">
|
91
114
|
|
92
|
-
```html-live
|
115
|
+
```html-live demo
|
93
116
|
<div style="height: 32px; display: flex;">
|
94
117
|
<sp-action-button quiet label="Zoom in">
|
95
118
|
<sp-icon-magnify slot="icon"></sp-icon-magnify>
|
96
119
|
</sp-action-button>
|
97
|
-
<sp-divider
|
120
|
+
<sp-divider
|
121
|
+
size="l"
|
122
|
+
style="align-self: stretch; height: auto;"
|
123
|
+
vertical
|
124
|
+
></sp-divider>
|
98
125
|
<sp-action-button quiet label="Zoom in">
|
99
126
|
<sp-icon-magnify slot="icon"></sp-icon-magnify>
|
100
127
|
</sp-action-button>
|
101
128
|
</div>
|
102
129
|
```
|
130
|
+
|
131
|
+
</sp-tab-panel>
|
132
|
+
</sp-tabs>
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@spectrum-web-components/divider",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.4.2",
|
4
4
|
"publishConfig": {
|
5
5
|
"access": "public"
|
6
6
|
},
|
@@ -44,11 +44,11 @@
|
|
44
44
|
"lit-html"
|
45
45
|
],
|
46
46
|
"dependencies": {
|
47
|
-
"@spectrum-web-components/base": "^0.
|
47
|
+
"@spectrum-web-components/base": "^0.5.1",
|
48
48
|
"tslib": "^2.0.0"
|
49
49
|
},
|
50
50
|
"devDependencies": {
|
51
|
-
"@spectrum-css/divider": "^1.0.
|
51
|
+
"@spectrum-css/divider": "^1.0.13"
|
52
52
|
},
|
53
53
|
"types": "./src/index.d.ts",
|
54
54
|
"customElements": "custom-elements.json",
|
@@ -56,5 +56,5 @@
|
|
56
56
|
"./sp-*.js",
|
57
57
|
"./stories/typography-decorator.js"
|
58
58
|
],
|
59
|
-
"gitHead": "
|
59
|
+
"gitHead": "279380c6d72c0819fe224b405844af9ddcb87f8a"
|
60
60
|
}
|
package/src/Divider.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { CSSResultArray, PropertyValues, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
|
2
2
|
declare const Divider_base: typeof SpectrumElement & {
|
3
3
|
new (...args: any[]): import("@spectrum-web-components/base").SizedElementInterface;
|
4
4
|
prototype: import("@spectrum-web-components/base").SizedElementInterface;
|
package/src/Divider.js
CHANGED
@@ -10,7 +10,8 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
10
10
|
governing permissions and limitations under the License.
|
11
11
|
*/
|
12
12
|
import { __decorate } from "tslib";
|
13
|
-
import { html,
|
13
|
+
import { html, SizedMixin, SpectrumElement, } from '@spectrum-web-components/base';
|
14
|
+
import { property } from '@spectrum-web-components/base/src/decorators.js';
|
14
15
|
import styles from './divider.css.js';
|
15
16
|
/**
|
16
17
|
* @element sp-divider
|
package/src/Divider.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Divider.js","sourceRoot":"","sources":["Divider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,
|
1
|
+
{"version":3,"file":"Divider.js","sourceRoot":"","sources":["Divider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,EAEJ,UAAU,EACV,eAAe,GAElB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAE3E,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC;;GAEG;AACH,MAAM,OAAO,OAAQ,SAAQ,UAAU,CAAC,eAAe,EAAE;IACrD,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;CAC9B,CAAC;IAFF;;QAMW,aAAQ,GAAG,KAAK,CAAC;IAqB5B,CAAC;IAnBa,MAAM;QACZ,OAAO,IAAI,CAAA,EAAE,CAAC;IAClB,CAAC;IAES,YAAY,CAAC,OAA6B;QAChD,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC5B,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC3C,CAAC;IAES,OAAO,CAAC,OAA6B;QAC3C,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACvB,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YACzB,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACf,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;aACrD;iBAAM;gBACH,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;aAC5C;SACJ;IACL,CAAC;;AAvBa,cAAM,GAAmB,CAAC,MAAM,CAAC,CAAC;AAGhD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCACnB","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SizedMixin,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport styles from './divider.css.js';\n\n/**\n * @element sp-divider\n */\nexport class Divider extends SizedMixin(SpectrumElement, {\n validSizes: ['s', 'm', 'l'],\n}) {\n public static styles: CSSResultArray = [styles];\n\n @property({ type: Boolean, reflect: true })\n public vertical = false;\n\n protected render(): TemplateResult {\n return html``;\n }\n\n protected firstUpdated(changed: PropertyValues<this>): void {\n super.firstUpdated(changed);\n this.setAttribute('role', 'separator');\n }\n\n protected updated(changed: PropertyValues<this>): void {\n super.updated(changed);\n if (changed.has('vertical')) {\n if (this.vertical) {\n this.setAttribute('aria-orientation', 'vertical');\n } else {\n this.removeAttribute('aria-orientation');\n }\n }\n }\n}\n"]}
|
@@ -9,7 +9,8 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
9
9
|
governing permissions and limitations under the License.
|
10
10
|
*/
|
11
11
|
import { __decorate } from "tslib";
|
12
|
-
import { html, LitElement,
|
12
|
+
import { html, LitElement, } from '@spectrum-web-components/base';
|
13
|
+
import { customElement, property, } from '@spectrum-web-components/base/src/decorators.js';
|
13
14
|
import styles from '@spectrum-web-components/theme/src/typography.css.js';
|
14
15
|
/**
|
15
16
|
* @element typography-decorator
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"typography-decorator.js","sourceRoot":"","sources":["typography-decorator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;EASE;;AAEF,OAAO,
|
1
|
+
{"version":3,"file":"typography-decorator.js","sourceRoot":"","sources":["typography-decorator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;EASE;;AAEF,OAAO,EAEH,IAAI,EACJ,UAAU,GAEb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACH,aAAa,EACb,QAAQ,GACX,MAAM,iDAAiD,CAAC;AAEzD,OAAO,MAAM,MAAM,sDAAsD,CAAC;AAE1E;;GAEG;AAEH,IAAa,UAAU,GAAvB,MAAa,UAAW,SAAQ,UAAU;IAM5B,MAAM;QACZ,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAA,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAA;+CAC4B,IAAI,CAAC,KAAK;SAChD,CAAC;IACN,CAAC;CACJ,CAAA;AAXU,iBAAM,GAAmB,CAAC,MAAM,CAAE,CAAA;AAGzC;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;yCACD;AAJrB,UAAU;IADtB,aAAa,CAAC,sBAAsB,CAAC;GACzB,UAAU,CAYtB;SAZY,UAAU","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n LitElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n customElement,\n property,\n} from '@spectrum-web-components/base/src/decorators.js';\n\nimport styles from '@spectrum-web-components/theme/src/typography.css.js';\n\n/**\n * @element typography-decorator\n */\n@customElement('typography-decorator')\nexport class Typography extends LitElement {\n static styles: CSSResultArray = [styles];\n\n @property({ attribute: false })\n public story?: TemplateResult;\n\n protected render(): TemplateResult {\n if (!this.story) return html``;\n return html`\n <div class=\"spectrum-Typography\">${this.story}</div>\n `;\n }\n}\n"]}
|