@aurodesignsystem-dev/auro-background 0.0.0-pr60.2 → 0.0.0-pr67.0
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 +59 -63
- package/custom-elements.json +398 -0
- package/demo/api.html +3 -3
- package/demo/api.md +109 -92
- package/demo/auro-background.min.js +80 -29
- package/demo/index.html +3 -3
- package/demo/index.md +26 -64
- package/dist/{auro-background-Bq6XF4Pn.js → auro-background-B1Q_3Y1A.js} +3 -3
- package/dist/index.d.ts +220 -8
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +22 -13
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,222 @@
|
|
|
1
|
-
import { css, LitElement, html } from 'lit';
|
|
2
|
-
import { styleMap } from 'lit/directives/style-map.js';
|
|
3
1
|
|
|
4
|
-
|
|
5
|
-
`,a=css`:host{--ds-auro-background-container-color: transparent}
|
|
6
|
-
`;class g extends LitElement{constructor(){super(),this.runtimeUtils=new n;}static get properties(){return {bg:{type:String},bgSm:{type:String},bgMd:{type:String},bgLg:{type:String},height:{type:String},heightSm:{type:String},heightMd:{type:String},heightLg:{type:String},width:{type:String},widthSm:{type:String},widthMd:{type:String},widthLg:{type:String},inset:{type:String},insetSm:{type:String},insetMd:{type:String},insetLg:{type:String}}}static get styles(){return [s,a]}static register(t="auro-background"){n.prototype.registerComponent(t,g);}firstUpdated(){this.runtimeUtils.handleComponentTagRename(this,"auro-background");}getInsetValues(t){const e={none:"0",xxxs:"25",xxs:"50",xs:"100",sm:"150",md:"200",lg:"300",xl:"400",xxl:"600",xxxl:"800"};return e[t]?`var(--ds-size-${e[t]})`:t}render(){const t={"--background":this.bg||"var(--ds-auro-background-container-color)","--backgroundSm":this.bgSm||"var(--background)","--backgroundMd":this.bgMd||"var(--backgroundSm)","--backgroundLg":this.bgLg||"var(--backgroundMd)","--width":this.width||"auto","--widthSm":this.widthSm||"var(--width)","--widthMd":this.widthMd||"var(--widthSm)","--widthLg":this.widthLg||"var(--widthMd)","--height":this.height||"auto","--heightSm":this.heightSm||"var(--height)","--heightMd":this.heightMd||"var(--heightSm)","--heightLg":this.heightLg||"var(--heightMd)","--inset":this.getInsetValues(this.inset)||"0","--insetSm":this.getInsetValues(this.insetSm)||"var(--inset)","--insetMd":this.getInsetValues(this.insetMd)||"var(--insetSm)","--insetLg":this.getInsetValues(this.insetLg)||"var(--insetMd)"};return html`
|
|
7
|
-
<div class="background" style=${styleMap(t)}><slot></slot></div>
|
|
8
|
-
`}}
|
|
2
|
+
import type { AuroBackground } from "src/auro-background.js";
|
|
9
3
|
|
|
10
|
-
|
|
4
|
+
/**
|
|
5
|
+
* This type can be used to create scoped tags for your components.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* import type { ScopedElements } from "path/to/library/jsx-integration";
|
|
11
|
+
*
|
|
12
|
+
* declare module "my-library" {
|
|
13
|
+
* namespace JSX {
|
|
14
|
+
* interface IntrinsicElements
|
|
15
|
+
* extends ScopedElements<'test-', ''> {}
|
|
16
|
+
* }
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @deprecated Runtime scoped elements result in duplicate types and can confusing for developers. It is recommended to use the `prefix` and `suffix` options to generate new types instead.
|
|
21
|
+
*/
|
|
22
|
+
export type ScopedElements<
|
|
23
|
+
Prefix extends string = "",
|
|
24
|
+
Suffix extends string = ""
|
|
25
|
+
> = {
|
|
26
|
+
[Key in keyof CustomElements as `${Prefix}${Key}${Suffix}`]: CustomElements[Key];
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
type BaseProps<T extends HTMLElement> = {
|
|
30
|
+
|
|
31
|
+
/** Content added between the opening and closing tags of the element */
|
|
32
|
+
children?: any;
|
|
33
|
+
/** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
|
|
34
|
+
class?: string;
|
|
35
|
+
/** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
|
|
36
|
+
className?: string;
|
|
37
|
+
/** Takes an object where the key is the class name(s) and the value is a boolean expression. When true, the class is applied, and when false, it is removed. */
|
|
38
|
+
classList?: Record<string, boolean | undefined>;
|
|
39
|
+
/** Specifies the text direction of the element. */
|
|
40
|
+
dir?: "ltr" | "rtl";
|
|
41
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
42
|
+
exportparts?: string;
|
|
43
|
+
/** For <label> and <output>, lets you associate the label with some control. */
|
|
44
|
+
htmlFor?: string;
|
|
45
|
+
/** Specifies whether the element should be hidden. */
|
|
46
|
+
hidden?: boolean | string;
|
|
47
|
+
/** A unique identifier for the element. */
|
|
48
|
+
id?: string;
|
|
49
|
+
/** Keys tell React which array item each component corresponds to */
|
|
50
|
+
key?: string | number;
|
|
51
|
+
/** Specifies the language of the element. */
|
|
52
|
+
lang?: string;
|
|
53
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
54
|
+
part?: string;
|
|
55
|
+
/** Use the ref attribute with a variable to assign a DOM element to the variable once the element is rendered. */
|
|
56
|
+
ref?: T | ((e: T) => void);
|
|
57
|
+
/** Adds a reference for a custom element slot */
|
|
58
|
+
slot?: string;
|
|
59
|
+
/** Prop for setting inline styles */
|
|
60
|
+
style?: Record<string, string | number>;
|
|
61
|
+
/** Overrides the default Tab button behavior. Avoid using values other than -1 and 0. */
|
|
62
|
+
tabIndex?: number;
|
|
63
|
+
/** Specifies the tooltip text for the element. */
|
|
64
|
+
title?: string;
|
|
65
|
+
/** Passing 'no' excludes the element content from being translated. */
|
|
66
|
+
translate?: "yes" | "no";
|
|
67
|
+
/** The popover global attribute is used to designate an element as a popover element. */
|
|
68
|
+
popover?: "auto" | "hint" | "manual";
|
|
69
|
+
/** Turns an element element into a popover control button; takes the ID of the popover element to control as its value. */
|
|
70
|
+
popovertarget?: "top" | "bottom" | "left" | "right" | "auto";
|
|
71
|
+
/** Specifies the action to be performed on a popover element being controlled by a control element. */
|
|
72
|
+
popovertargetaction?: "show" | "hide" | "toggle";
|
|
73
|
+
|
|
74
|
+
} ;
|
|
75
|
+
|
|
76
|
+
type BaseEvents = {
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
export type AuroBackgroundProps = {
|
|
84
|
+
/** Sets the background image at all breakpoints */
|
|
85
|
+
"bg"?: AuroBackground['bg'];
|
|
86
|
+
/** Sets the background image at `ds-grid-breakpoint-lg` and above */
|
|
87
|
+
"bgLg"?: AuroBackground['bgLg'];
|
|
88
|
+
/** Sets the background image at `ds-grid-breakpoint-md` and above */
|
|
89
|
+
"bgMd"?: AuroBackground['bgMd'];
|
|
90
|
+
/** Sets the background image at `ds-grid-breakpoint-sm` and above */
|
|
91
|
+
"bgSm"?: AuroBackground['bgSm'];
|
|
92
|
+
/** Applies custom height at all breakpoints */
|
|
93
|
+
"height"?: AuroBackground['height'];
|
|
94
|
+
/** Applies custom height at `ds-grid-breakpoint-lg` and above */
|
|
95
|
+
"heightLg"?: AuroBackground['heightLg'];
|
|
96
|
+
/** Applies custom height at `ds-grid-breakpoint-md` and above */
|
|
97
|
+
"heightMd"?: AuroBackground['heightMd'];
|
|
98
|
+
/** Applies custom height at `ds-grid-breakpoint-sm` and above */
|
|
99
|
+
"heightSm"?: AuroBackground['heightSm'];
|
|
100
|
+
/** Applies internal padding at all breakpoints */
|
|
101
|
+
"inset"?: AuroBackground['inset'];
|
|
102
|
+
/** Applies internal padding at `ds-grid-breakpoint-lg` and above */
|
|
103
|
+
"insetLg"?: AuroBackground['insetLg'];
|
|
104
|
+
/** Applies internal padding at `ds-grid-breakpoint-md` and above */
|
|
105
|
+
"insetMd"?: AuroBackground['insetMd'];
|
|
106
|
+
/** Applies internal padding at `ds-grid-breakpoint-sm` and above */
|
|
107
|
+
"insetSm"?: AuroBackground['insetSm'];
|
|
108
|
+
/** Applies custom width at all breakpoints */
|
|
109
|
+
"width"?: AuroBackground['width'];
|
|
110
|
+
/** Applies custom width at `ds-grid-breakpoint-lg` and above */
|
|
111
|
+
"widthLg"?: AuroBackground['widthLg'];
|
|
112
|
+
/** Applies custom width at `ds-grid-breakpoint-md` and above */
|
|
113
|
+
"widthMd"?: AuroBackground['widthMd'];
|
|
114
|
+
/** Applies custom width at `ds-grid-breakpoint-sm` and above */
|
|
115
|
+
"widthSm"?: AuroBackground['widthSm'];
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export type CustomElements = {
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The `auro-background` element provides users a way to add a background image or color block including a gradient.
|
|
125
|
+
*
|
|
126
|
+
* ## Attributes & Properties
|
|
127
|
+
*
|
|
128
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
129
|
+
*
|
|
130
|
+
* - `bg`: Sets the background image at all breakpoints
|
|
131
|
+
* - `bgLg`: Sets the background image at `ds-grid-breakpoint-lg` and above
|
|
132
|
+
* - `bgMd`: Sets the background image at `ds-grid-breakpoint-md` and above
|
|
133
|
+
* - `bgSm`: Sets the background image at `ds-grid-breakpoint-sm` and above
|
|
134
|
+
* - `height`: Applies custom height at all breakpoints
|
|
135
|
+
* - `heightLg`: Applies custom height at `ds-grid-breakpoint-lg` and above
|
|
136
|
+
* - `heightMd`: Applies custom height at `ds-grid-breakpoint-md` and above
|
|
137
|
+
* - `heightSm`: Applies custom height at `ds-grid-breakpoint-sm` and above
|
|
138
|
+
* - `inset`: Applies internal padding at all breakpoints
|
|
139
|
+
* - `insetLg`: Applies internal padding at `ds-grid-breakpoint-lg` and above
|
|
140
|
+
* - `insetMd`: Applies internal padding at `ds-grid-breakpoint-md` and above
|
|
141
|
+
* - `insetSm`: Applies internal padding at `ds-grid-breakpoint-sm` and above
|
|
142
|
+
* - `width`: Applies custom width at all breakpoints
|
|
143
|
+
* - `widthLg`: Applies custom width at `ds-grid-breakpoint-lg` and above
|
|
144
|
+
* - `widthMd`: Applies custom width at `ds-grid-breakpoint-md` and above
|
|
145
|
+
* - `widthSm`: Applies custom width at `ds-grid-breakpoint-sm` and above
|
|
146
|
+
*
|
|
147
|
+
* ## Slots
|
|
148
|
+
*
|
|
149
|
+
* Areas where markup can be added to the component.
|
|
150
|
+
*
|
|
151
|
+
* - `(default)`: Default slot for content within the background container.
|
|
152
|
+
*
|
|
153
|
+
* ## Methods
|
|
154
|
+
*
|
|
155
|
+
* Methods that can be called to access component functionality.
|
|
156
|
+
*
|
|
157
|
+
* - `register(name?: string = "auro-background") => void`: This will register this element with the browser.
|
|
158
|
+
*/
|
|
159
|
+
"auro-background": Partial<AuroBackgroundProps & BaseProps<AuroBackground> & BaseEvents>;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export type CustomCssProperties = {
|
|
163
|
+
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
declare module 'react' {
|
|
168
|
+
namespace JSX {
|
|
169
|
+
interface IntrinsicElements extends CustomElements {}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
declare module 'preact' {
|
|
175
|
+
namespace JSX {
|
|
176
|
+
interface IntrinsicElements extends CustomElements {}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
declare module '@builder.io/qwik' {
|
|
182
|
+
namespace JSX {
|
|
183
|
+
interface IntrinsicElements extends CustomElements {}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
declare module '@stencil/core' {
|
|
189
|
+
namespace JSX {
|
|
190
|
+
interface IntrinsicElements extends CustomElements {}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
declare module 'hono/jsx' {
|
|
196
|
+
namespace JSX {
|
|
197
|
+
interface IntrinsicElements extends CustomElements {}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
declare module 'react-native' {
|
|
203
|
+
namespace JSX {
|
|
204
|
+
interface IntrinsicElements extends CustomElements {}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
declare global {
|
|
210
|
+
namespace JSX {
|
|
211
|
+
interface IntrinsicElements extends CustomElements {}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
}
|
|
215
|
+
declare global {
|
|
216
|
+
namespace svelteHTML {
|
|
217
|
+
interface IntrinsicElements extends CustomElements {}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
export { AuroBackground } from "./index.js";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as AuroBackground}from"./auro-background-
|
|
1
|
+
export{A as AuroBackground}from"./auro-background-B1Q_3Y1A.js";import"lit";import"lit/directives/style-map.js";
|
package/dist/registered.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as r}from"./auro-background-
|
|
1
|
+
import{A as r}from"./auro-background-B1Q_3Y1A.js";import"lit";import"lit/directives/style-map.js";r.register();
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"================================================================================"
|
|
8
8
|
],
|
|
9
9
|
"name": "@aurodesignsystem-dev/auro-background",
|
|
10
|
-
"version": "0.0.0-
|
|
10
|
+
"version": "0.0.0-pr67.0",
|
|
11
11
|
"description": "auro-background HTML custom element",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
"types": "dist/index.d.ts",
|
|
19
19
|
"license": "Apache-2.0",
|
|
20
20
|
"engines": {
|
|
21
|
-
"node": "
|
|
21
|
+
"node": ">=20"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"lit": "^3.3.
|
|
24
|
+
"lit": "^3.3.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@aurodesignsystem/auro-cli": "^3.0
|
|
28
|
-
"@aurodesignsystem/auro-config": "^1.3.
|
|
29
|
-
"@aurodesignsystem/auro-library": "^5.5.
|
|
30
|
-
"@aurodesignsystem/design-tokens": "^8.
|
|
31
|
-
"@aurodesignsystem/webcorestylesheets": "^10.
|
|
27
|
+
"@aurodesignsystem/auro-cli": "^3.5.0",
|
|
28
|
+
"@aurodesignsystem/auro-config": "^1.3.1",
|
|
29
|
+
"@aurodesignsystem/auro-library": "^5.5.4",
|
|
30
|
+
"@aurodesignsystem/design-tokens": "^8.7.0",
|
|
31
|
+
"@aurodesignsystem/webcorestylesheets": "^10.1.4",
|
|
32
32
|
"husky": "^9.1.7"
|
|
33
33
|
},
|
|
34
34
|
"browserslist": [
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
"last 2 Safari major versions"
|
|
40
40
|
],
|
|
41
41
|
"publishConfig": {
|
|
42
|
-
"access": "public"
|
|
42
|
+
"access": "public",
|
|
43
|
+
"provenance": true
|
|
43
44
|
},
|
|
44
45
|
"keywords": [
|
|
45
46
|
"alaska airlines",
|
|
@@ -55,14 +56,20 @@
|
|
|
55
56
|
"lint:fix": "biome check --fix --no-errors-on-unmatched && stylelint \"./src/**/*.scss\" --fix",
|
|
56
57
|
"test": "auro test",
|
|
57
58
|
"test:watch": "auro test --watch",
|
|
58
|
-
"prepare": "husky"
|
|
59
|
+
"prepare": "husky",
|
|
60
|
+
"test:coverage": "auro test --coverage-report --open"
|
|
59
61
|
},
|
|
60
62
|
"exports": {
|
|
61
63
|
"./package.json": "./package.json",
|
|
62
64
|
"./readme.md": "./README.md",
|
|
63
|
-
".":
|
|
65
|
+
".": {
|
|
66
|
+
"module": "./dist/registered.js",
|
|
67
|
+
"types": "./dist/index.d.ts",
|
|
68
|
+
"default": "./dist/registered.js"
|
|
69
|
+
},
|
|
64
70
|
"./demo/*.md": "./demo/*.md",
|
|
65
71
|
"./demo/*.js": "./demo/*.min.js",
|
|
72
|
+
"./custom-elements.json": "./custom-elements.json",
|
|
66
73
|
"./class": {
|
|
67
74
|
"module": "./dist/index.js",
|
|
68
75
|
"types": "./dist/index.d.ts",
|
|
@@ -75,6 +82,8 @@
|
|
|
75
82
|
"CHANGELOG.md",
|
|
76
83
|
"README.md",
|
|
77
84
|
"LICENSE",
|
|
78
|
-
"NOTICE"
|
|
79
|
-
|
|
85
|
+
"NOTICE",
|
|
86
|
+
"custom-elements.json"
|
|
87
|
+
],
|
|
88
|
+
"customElements": "custom-elements.json"
|
|
80
89
|
}
|