@jsfour/root-ui 0.0.1
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/.stencil/.build/_README.log +8 -0
- package/.stencil/.build/optimizeCss_d508b9fc8ae8bf613c09ccb27d146e3a.log +1 -0
- package/.stencil/.build/optimizeModule_0b160af7f941adcacfa811e102b08adf.log +2 -0
- package/.stencil/.build/optimizeModule_0b246ca6c0647c40ed469a0cf4358a73.log +1 -0
- package/.stencil/.build/optimizeModule_1bed709b53ef02375e9f61a9dfa643f3.log +1 -0
- package/.stencil/.build/optimizeModule_1d7b03de1d56993f8736d0dfa953b016.log +1 -0
- package/.stencil/.build/optimizeModule_211068a08f9a2243f9b6bbc0d066ca7b.log +1 -0
- package/.stencil/.build/optimizeModule_2187d3c4a8fdf77d63b94a49e5339089.log +1 -0
- package/.stencil/.build/optimizeModule_25ac0c9c93505850d30d777a8983d6cc.log +1 -0
- package/.stencil/.build/optimizeModule_2a8347890bf34de8ebcd825e93de4eac.log +1 -0
- package/.stencil/.build/optimizeModule_310d74be43349d9cd4462216f44e3025.log +1 -0
- package/.stencil/.build/optimizeModule_35ed1b3083d56d1312b29cdc8702dde6.log +1 -0
- package/.stencil/.build/optimizeModule_3abf5364bd9f3e07cabdf31f25fdfccd.log +1 -0
- package/.stencil/.build/optimizeModule_3c694181a383d2d5d7c43959dae3fc40.log +2 -0
- package/.stencil/.build/optimizeModule_3e5a7a979ee157dee476e23a940398bf.log +1 -0
- package/.stencil/.build/optimizeModule_3f113b87a2543efdae16831cf4a13466.log +1 -0
- package/.stencil/.build/optimizeModule_4cf0a704790c64fa3e7636ba3472dff6.log +1 -0
- package/.stencil/.build/optimizeModule_5473d4453ebf4ef999ac7777394048db.log +1 -0
- package/.stencil/.build/optimizeModule_56e4598e7f285cec042c0632923a473c.log +1 -0
- package/.stencil/.build/optimizeModule_5721447e0280cf2192180b57b6ffd931.log +1 -0
- package/.stencil/.build/optimizeModule_5fe32756e8649adbca14ee76bdfbfad3.log +2 -0
- package/.stencil/.build/optimizeModule_60477845aacd02169ef3d0091bfb345f.log +1 -0
- package/.stencil/.build/optimizeModule_645cc880dd3009950a72ea147a926718.log +1 -0
- package/.stencil/.build/optimizeModule_64633d5e5c5103adb5683fc19edaa8b8.log +1 -0
- package/.stencil/.build/optimizeModule_6b615133c24ac4e6c5428eb74470b5cb.log +1 -0
- package/.stencil/.build/optimizeModule_6e9d6355a774b23f578c75f14d78e605.log +1 -0
- package/.stencil/.build/optimizeModule_8797e91e099ec89d9158d143cc9e8199.log +1 -0
- package/.stencil/.build/optimizeModule_8a9445cafc85dc657334e37e1fce6fdc.log +1 -0
- package/.stencil/.build/optimizeModule_8c399f3f088e7f1cbb87f65d8e96bfc4.log +1 -0
- package/.stencil/.build/optimizeModule_90f423b7b20b32670cb13ca6605940fa.log +1 -0
- package/.stencil/.build/optimizeModule_9d37b0c4d3ae587fe9c9f384659ac198.log +1 -0
- package/.stencil/.build/optimizeModule_9eb9260f8aec9636ffc5e00444eaa1ea.log +1 -0
- package/.stencil/.build/optimizeModule_a90d2726fdff70d788aaa8b3fbc0adc7.log +1 -0
- package/.stencil/.build/optimizeModule_ad865e38167d997d66ef7128fdb36b5e.log +1 -0
- package/.stencil/.build/optimizeModule_b1b3b2dbe6634f16e4a063d74c2df110.log +1 -0
- package/.stencil/.build/optimizeModule_b24fa4d64bacca187db7a0654705e182.log +1 -0
- package/.stencil/.build/optimizeModule_b90b0f1d4d3dd3aae106476a0cce19c0.log +1 -0
- package/.stencil/.build/optimizeModule_c0fee36e4d0c0c701c749a56eec1f7d8.log +1 -0
- package/.stencil/.build/optimizeModule_ceeae0c907ecc2a87e2ad19d79e99510.log +1 -0
- package/.stencil/.build/optimizeModule_d68f87c26c9b5557f71199e397b81fde.log +1 -0
- package/.stencil/.build/optimizeModule_d6b6b4cfa8009d54eb301d8147c45850.log +1 -0
- package/.stencil/.build/optimizeModule_d7a4dadc89824480596190cf7a033e72.log +1 -0
- package/.stencil/.build/optimizeModule_ddf02b2e19bf055fcfd20ed5dc8b956d.log +2 -0
- package/.stencil/.build/optimizeModule_eb39a27ff5ef48385b4bf233760a7d1f.log +1 -0
- package/.stencil/.build/optimizeModule_eee1991c594a387b17e535171c33abbf.log +1 -0
- package/.stencil/.build/optimizeModule_f0d6e7e6666905c8da7d7450a1b4088b.log +1 -0
- package/.stencil/.build/optimizeModule_f93c97ed92b866fd99189e5a0a44e774.log +1 -0
- package/.stencil/.build/optimizeModule_fdf66b9636906890546dde0f834d4d8e.log +1 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/index-CbJkKnHq.js +3244 -0
- package/dist/cjs/index.cjs.js +25 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/root-badge_6.cjs.entry.js +343 -0
- package/dist/cjs/stencil-library.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +17 -0
- package/dist/collection/components/badge/badge-variation.enum.js +9 -0
- package/dist/collection/components/badge/badge.css +45 -0
- package/dist/collection/components/badge/badge.js +148 -0
- package/dist/collection/components/banner/banner-variation.enum.js +9 -0
- package/dist/collection/components/banner/banner.css +18 -0
- package/dist/collection/components/banner/banner.js +147 -0
- package/dist/collection/components/breadcrumbs/breadcrumbs.css +49 -0
- package/dist/collection/components/breadcrumbs/breadcrumbs.js +95 -0
- package/dist/collection/components/button/button-size.enum.js +5 -0
- package/dist/collection/components/button/button-type.enum.js +6 -0
- package/dist/collection/components/button/button-variation.enum.js +10 -0
- package/dist/collection/components/button/button.css +61 -0
- package/dist/collection/components/button/button.js +207 -0
- package/dist/collection/components/index.js +6 -0
- package/dist/collection/components/input/input-type.enum.js +18 -0
- package/dist/collection/components/input/input.css +134 -0
- package/dist/collection/components/input/input.js +415 -0
- package/dist/collection/components/list/list.css +18 -0
- package/dist/collection/components/list/list.js +50 -0
- package/dist/collection/enums.js +3 -0
- package/dist/collection/global/utils/randomIdGenerator/index.js +7 -0
- package/dist/collection/index.js +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/p-CIjEN4Bv.js +1 -0
- package/dist/components/p-CvhBNbMT.js +1 -0
- package/dist/components/root-badge.d.ts +11 -0
- package/dist/components/root-badge.js +1 -0
- package/dist/components/root-banner.d.ts +11 -0
- package/dist/components/root-banner.js +1 -0
- package/dist/components/root-breadcrumbs.d.ts +11 -0
- package/dist/components/root-breadcrumbs.js +1 -0
- package/dist/components/root-button.d.ts +11 -0
- package/dist/components/root-button.js +1 -0
- package/dist/components/root-input.d.ts +11 -0
- package/dist/components/root-input.js +1 -0
- package/dist/components/root-list.d.ts +11 -0
- package/dist/components/root-list.js +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/index-Cygc6-mN.js +3236 -0
- package/dist/esm/index.js +25 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/root-badge_6.entry.js +336 -0
- package/dist/esm/stencil-library.js +21 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil-library/index.esm.js +1 -0
- package/dist/stencil-library/p-2b062e4c.entry.js +1 -0
- package/dist/stencil-library/p-Cygc6-mN.js +2 -0
- package/dist/stencil-library/p-DQuL1Twl.js +1 -0
- package/dist/stencil-library/stencil-library.esm.js +1 -0
- package/dist/types/components/badge/badge-variation.enum.d.ts +8 -0
- package/dist/types/components/badge/badge.d.ts +11 -0
- package/dist/types/components/banner/banner-variation.enum.d.ts +8 -0
- package/dist/types/components/banner/banner.d.ts +11 -0
- package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +12 -0
- package/dist/types/components/button/button-size.enum.d.ts +4 -0
- package/dist/types/components/button/button-type.enum.d.ts +5 -0
- package/dist/types/components/button/button-variation.enum.d.ts +9 -0
- package/dist/types/components/button/button.d.ts +15 -0
- package/dist/types/components/index.d.ts +6 -0
- package/dist/types/components/input/input-type.enum.d.ts +17 -0
- package/dist/types/components/input/input.d.ts +37 -0
- package/dist/types/components/list/list.d.ts +7 -0
- package/dist/types/components.d.ts +388 -0
- package/dist/types/enums.d.ts +3 -0
- package/dist/types/global/utils/randomIdGenerator/index.d.ts +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +1839 -0
- package/package.json +28 -0
- package/src/components/badge/badge-variation.enum.ts +9 -0
- package/src/components/badge/badge.scss +53 -0
- package/src/components/badge/badge.tsx +42 -0
- package/src/components/badge/readme.md +27 -0
- package/src/components/banner/banner-variation.enum.ts +9 -0
- package/src/components/banner/banner.scss +22 -0
- package/src/components/banner/banner.tsx +41 -0
- package/src/components/banner/readme.md +27 -0
- package/src/components/breadcrumbs/breadcrumbs.scss +57 -0
- package/src/components/breadcrumbs/breadcrumbs.tsx +74 -0
- package/src/components/breadcrumbs/readme.md +24 -0
- package/src/components/button/button-size.enum.ts +5 -0
- package/src/components/button/button-type.enum.ts +5 -0
- package/src/components/button/button-variation.enum.ts +10 -0
- package/src/components/button/button.scss +73 -0
- package/src/components/button/button.tsx +52 -0
- package/src/components/button/readme.md +29 -0
- package/src/components/index.ts +7 -0
- package/src/components/input/input-type.enum.ts +18 -0
- package/src/components/input/input.scss +156 -0
- package/src/components/input/input.tsx +264 -0
- package/src/components/input/readme.md +34 -0
- package/src/components/list/list.scss +21 -0
- package/src/components/list/list.tsx +24 -0
- package/src/components/list/readme.md +17 -0
- package/src/components.d.ts +388 -0
- package/src/enums.ts +3 -0
- package/src/global/styles/index.scss +0 -0
- package/src/global/utils/randomIdGenerator/index.ts +8 -0
- package/src/index.html +105 -0
- package/src/index.ts +2 -0
- package/stencil.config.ts +36 -0
- package/tsconfig.json +25 -0
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jsfour/root-ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Unofficial stencil UI components for Root",
|
|
5
|
+
"main": "dist/index.cjs.js",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"collection": "dist/collection/collection-manifest.json",
|
|
9
|
+
"collection:main": "dist/collection/index.js",
|
|
10
|
+
"unpkg": "dist/stencil-library/stencil-library.esm.js",
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"@stencil/core": "^4.7.2",
|
|
13
|
+
"@stencil/sass": "^3.0.7"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "stencil build",
|
|
17
|
+
"start": "stencil build --dev --watch --serve",
|
|
18
|
+
"test": "stencil test --spec --e2e",
|
|
19
|
+
"test.watch": "stencil test --spec --e2e --watchAll",
|
|
20
|
+
"generate": "stencil generate"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [],
|
|
23
|
+
"author": "",
|
|
24
|
+
"type": "commonjs",
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@stencil/react-output-target": "^1.2.0"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
.root-badge {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
color: var(--rootsdk-text-primary);
|
|
4
|
+
font-size: 0.625rem;
|
|
5
|
+
line-height: 1;
|
|
6
|
+
border-radius: 1rem;
|
|
7
|
+
padding: 0.53125rem 0.75rem 0.5rem;
|
|
8
|
+
min-width: 1.5rem;
|
|
9
|
+
text-transform: uppercase;
|
|
10
|
+
font-weight: bold;
|
|
11
|
+
background-color: transparent;
|
|
12
|
+
text-align: center;
|
|
13
|
+
|
|
14
|
+
&--primary {
|
|
15
|
+
background-color: var(--rootsdk-brand-primary);
|
|
16
|
+
color: var(--rootsdk-text-white);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&--secondary {
|
|
20
|
+
background-color: var(--rootsdk-brand-secondary);
|
|
21
|
+
color: var(--rootsdk-input);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&--tertiary {
|
|
25
|
+
background-color: var(--rootsdk-brand-tertiary);
|
|
26
|
+
color: var(--rootsdk-input);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&--danger {
|
|
30
|
+
background-color: var(--rootsdk-error);
|
|
31
|
+
color: var(--rootsdk-text-white);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&--outline {
|
|
35
|
+
background: transparent;
|
|
36
|
+
border: var(--border-width-m) solid var(--rootsdk-text-tertiary);
|
|
37
|
+
color: var(--rootsdk-text-primary);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&--muted {
|
|
41
|
+
background-color: var(--rootsdk-muted);
|
|
42
|
+
color: var(--rootsdk-text-white);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&--standard {
|
|
46
|
+
background: var(--rootsdk-text-primary);
|
|
47
|
+
color: var(--rootsdk-background-tertiary);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&--full-width {
|
|
51
|
+
width: 100%;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Component, h, Prop, Event, EventEmitter } from '@stencil/core';
|
|
2
|
+
import { randomIdGenerator } from '../../global/utils/randomIdGenerator';
|
|
3
|
+
import { RootBadgeVariation } from './badge-variation.enum';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
tag: 'root-badge',
|
|
7
|
+
styleUrl: 'badge.scss',
|
|
8
|
+
shadow: true
|
|
9
|
+
})
|
|
10
|
+
export class RootBadge {
|
|
11
|
+
@Prop() badgeId: string = randomIdGenerator('root-badge');
|
|
12
|
+
|
|
13
|
+
@Prop() variation: RootBadgeVariation = RootBadgeVariation.PRIMARY;
|
|
14
|
+
|
|
15
|
+
@Prop() fullWidth: boolean = false;
|
|
16
|
+
|
|
17
|
+
@Prop() disabled: boolean = false;
|
|
18
|
+
|
|
19
|
+
@Event() rootBadgeClick: EventEmitter<MouseEvent>;
|
|
20
|
+
|
|
21
|
+
clickHandler(e: MouseEvent) {
|
|
22
|
+
this.rootBadgeClick.emit(e);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
render() {
|
|
26
|
+
const classes = {
|
|
27
|
+
'root-badge': true,
|
|
28
|
+
[`root-badge--${this.variation}`]: !!this.variation,
|
|
29
|
+
'root-badge--full-width': this.fullWidth,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<span
|
|
34
|
+
id={this.badgeId}
|
|
35
|
+
class={classes}
|
|
36
|
+
onClick={(e) => this.clickHandler(e)}
|
|
37
|
+
>
|
|
38
|
+
<slot></slot>
|
|
39
|
+
</span>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# root-badge
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
<!-- Auto Generated Below -->
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Properties
|
|
9
|
+
|
|
10
|
+
| Property | Attribute | Description | Type | Default |
|
|
11
|
+
| ----------- | ------------ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
|
|
12
|
+
| `badgeId` | `badge-id` | | `string` | `randomIdGenerator('root-badge')` |
|
|
13
|
+
| `disabled` | `disabled` | | `boolean` | `false` |
|
|
14
|
+
| `fullWidth` | `full-width` | | `boolean` | `false` |
|
|
15
|
+
| `variation` | `variation` | | `RootBadgeVariation.DANGER \| RootBadgeVariation.MUTED \| RootBadgeVariation.OUTLINE \| RootBadgeVariation.PRIMARY \| RootBadgeVariation.SECONDARY \| RootBadgeVariation.TERTIARY` | `RootBadgeVariation.PRIMARY` |
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## Events
|
|
19
|
+
|
|
20
|
+
| Event | Description | Type |
|
|
21
|
+
| ---------------- | ----------- | ------------------------- |
|
|
22
|
+
| `rootBadgeClick` | | `CustomEvent<MouseEvent>` |
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
----------------------------------------------
|
|
26
|
+
|
|
27
|
+
*Built with [StencilJS](https://stenciljs.com/)*
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.root-banner {
|
|
2
|
+
text-align: center;
|
|
3
|
+
color: var(--rootsdk-text-primary);
|
|
4
|
+
padding: .4rem;
|
|
5
|
+
|
|
6
|
+
&--primary {
|
|
7
|
+
background-color: var(--rootsdk-brand-primary);
|
|
8
|
+
color: var(--rootsdk-text-white);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&--danger {
|
|
12
|
+
background-color: var(--rootsdk-error);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&--warning {
|
|
16
|
+
background-color: var(--rootsdk-warning);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&--success {
|
|
20
|
+
background-color: var(--rootsdk-brand-tertiary);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Component, h, Prop, Event, EventEmitter } from '@stencil/core';
|
|
2
|
+
import { randomIdGenerator } from '../../global/utils/randomIdGenerator';
|
|
3
|
+
import { RootBannerVariation } from './banner-variation.enum';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
tag: 'root-banner',
|
|
7
|
+
styleUrl: 'banner.scss',
|
|
8
|
+
shadow: true
|
|
9
|
+
})
|
|
10
|
+
export class RootBanner {
|
|
11
|
+
@Prop() bannerId: string = randomIdGenerator('root-banner');
|
|
12
|
+
|
|
13
|
+
@Prop() variation: RootBannerVariation = RootBannerVariation.PRIMARY;
|
|
14
|
+
|
|
15
|
+
@Prop() fullWidth: boolean = false;
|
|
16
|
+
|
|
17
|
+
@Prop() disabled: boolean = false;
|
|
18
|
+
|
|
19
|
+
@Event() rootBannerClick: EventEmitter<MouseEvent>;
|
|
20
|
+
|
|
21
|
+
clickHandler(e: MouseEvent) {
|
|
22
|
+
this.rootBannerClick.emit(e);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
render() {
|
|
26
|
+
const classes = {
|
|
27
|
+
'root-banner': true,
|
|
28
|
+
[`root-banner--${this.variation}`]: !!this.variation
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div
|
|
33
|
+
id={this.bannerId}
|
|
34
|
+
class={classes}
|
|
35
|
+
onClick={(e) => this.clickHandler(e)}
|
|
36
|
+
>
|
|
37
|
+
<slot></slot>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# root-banner
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
<!-- Auto Generated Below -->
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Properties
|
|
9
|
+
|
|
10
|
+
| Property | Attribute | Description | Type | Default |
|
|
11
|
+
| ----------- | ------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------- |
|
|
12
|
+
| `bannerId` | `banner-id` | | `string` | `randomIdGenerator('root-banner')` |
|
|
13
|
+
| `disabled` | `disabled` | | `boolean` | `false` |
|
|
14
|
+
| `fullWidth` | `full-width` | | `boolean` | `false` |
|
|
15
|
+
| `variation` | `variation` | | `RootBannerVariation.DANGER \| RootBannerVariation.PRIMARY \| RootBannerVariation.SECONDARY \| RootBannerVariation.SUCCESS \| RootBannerVariation.TERTIARY \| RootBannerVariation.WARNING` | `RootBannerVariation.PRIMARY` |
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## Events
|
|
19
|
+
|
|
20
|
+
| Event | Description | Type |
|
|
21
|
+
| ----------------- | ----------- | ------------------------- |
|
|
22
|
+
| `rootBannerClick` | | `CustomEvent<MouseEvent>` |
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
----------------------------------------------
|
|
26
|
+
|
|
27
|
+
*Built with [StencilJS](https://stenciljs.com/)*
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
.root-breadcrumbs {
|
|
2
|
+
display: flex;
|
|
3
|
+
list-style: none;
|
|
4
|
+
margin: 0;
|
|
5
|
+
padding: 0;
|
|
6
|
+
gap: 0.5rem;
|
|
7
|
+
align-items: center;
|
|
8
|
+
|
|
9
|
+
.root-breadcrumbs-item {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
|
|
13
|
+
&:not(:last-child)::after {
|
|
14
|
+
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 256 256"><g><g><polygon points="79.093,0 48.907,30.187 146.72,128 48.907,225.813 79.093,256 207.093,128"/></g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g></svg>') center;
|
|
15
|
+
content: " ";
|
|
16
|
+
display: inline-block;
|
|
17
|
+
filter: invert(64%) sepia(11%) saturate(0%) hue-rotate(149deg) brightness(99%) contrast(95%);
|
|
18
|
+
height: 0.5rem;
|
|
19
|
+
margin: 0 0.5rem;
|
|
20
|
+
opacity: .5;
|
|
21
|
+
width: 0.5rem;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&--active {
|
|
25
|
+
span {
|
|
26
|
+
background: var(--rootsdk-highlight-normal);
|
|
27
|
+
color: var(--rootsdk-text-tertiary);
|
|
28
|
+
border-radius: 1.5rem;
|
|
29
|
+
padding: 0.32rem 0.64rem;
|
|
30
|
+
font-size: 0.8rem;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.root-breadcrumbs-link {
|
|
35
|
+
text-decoration: underline;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
color: var(--rootsdk-text-primary);
|
|
38
|
+
padding: 0.32rem 0.64rem;
|
|
39
|
+
border-radius: 1.5rem;
|
|
40
|
+
transition-duration: 200ms;
|
|
41
|
+
transition-property: background, color;
|
|
42
|
+
font-size: 0.8rem;
|
|
43
|
+
|
|
44
|
+
.root-icon {
|
|
45
|
+
height: 1.1rem;
|
|
46
|
+
position: relative;
|
|
47
|
+
top: 1px;
|
|
48
|
+
vertical-align: top;
|
|
49
|
+
width: 1.1rem;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&:hover {
|
|
53
|
+
background-color: var(--rootsdk-highlight-normal);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Component, h, Prop, State, Element, EventEmitter, Event } from '@stencil/core';
|
|
2
|
+
import { randomIdGenerator } from '../../global/utils/randomIdGenerator';
|
|
3
|
+
import { HTMLStencilElement } from '@stencil/sass/dist/declarations';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
tag: 'root-breadcrumbs',
|
|
7
|
+
styleUrl: 'breadcrumbs.scss',
|
|
8
|
+
shadow: true
|
|
9
|
+
})
|
|
10
|
+
export class RootBreadcrumbs {
|
|
11
|
+
@Element() hostElement: HTMLStencilElement;
|
|
12
|
+
|
|
13
|
+
@Prop() breadcrumbsId: string = randomIdGenerator('root-breadcrumbs');
|
|
14
|
+
|
|
15
|
+
@State() linkItems = [];
|
|
16
|
+
|
|
17
|
+
@Event() linkClick: EventEmitter;
|
|
18
|
+
|
|
19
|
+
componentDidLoad() {
|
|
20
|
+
this.getBreadcrumbs();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
getBreadcrumbs() {
|
|
24
|
+
const elements = this.hostElement.children;
|
|
25
|
+
|
|
26
|
+
if (!elements || elements?.length <= 0) {
|
|
27
|
+
console.warn(`The slot contains no link elements.`, this.hostElement);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
this.linkItems = [...elements]
|
|
32
|
+
.filter((element) => element.tagName.toLowerCase() === 'a')
|
|
33
|
+
.map((element) => {
|
|
34
|
+
return {
|
|
35
|
+
text: element.textContent,
|
|
36
|
+
href: element.getAttribute('href') || ''
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
clickHandler(e: Event) {
|
|
42
|
+
this.linkClick.emit(e);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
render() {
|
|
46
|
+
return (
|
|
47
|
+
<ol
|
|
48
|
+
class={'root-breadcrumbs'}
|
|
49
|
+
id={this.breadcrumbsId}
|
|
50
|
+
>
|
|
51
|
+
{this.linkItems.map((item, index) => {
|
|
52
|
+
const isLast = index === this.linkItems.length - 1;
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<li class={{'root-breadcrumbs-item': true, 'root-breadcrumbs-item--active': isLast}}>
|
|
56
|
+
{isLast ? (
|
|
57
|
+
<span>{item.text}</span>
|
|
58
|
+
) : (
|
|
59
|
+
<a
|
|
60
|
+
class="root-breadcrumbs-link"
|
|
61
|
+
onClick={(e) => this.clickHandler(e)}
|
|
62
|
+
href={item.href}
|
|
63
|
+
>
|
|
64
|
+
{item.text}
|
|
65
|
+
</a>
|
|
66
|
+
)}
|
|
67
|
+
</li>
|
|
68
|
+
);
|
|
69
|
+
})}
|
|
70
|
+
|
|
71
|
+
</ol>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# root-breadcrumbs
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
<!-- Auto Generated Below -->
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Properties
|
|
9
|
+
|
|
10
|
+
| Property | Attribute | Description | Type | Default |
|
|
11
|
+
| --------------- | ---------------- | ----------- | -------- | --------------------------------------- |
|
|
12
|
+
| `breadcrumbsId` | `breadcrumbs-id` | | `string` | `randomIdGenerator('root-breadcrumbs')` |
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## Events
|
|
16
|
+
|
|
17
|
+
| Event | Description | Type |
|
|
18
|
+
| ----------- | ----------- | ------------------ |
|
|
19
|
+
| `linkClick` | | `CustomEvent<any>` |
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
----------------------------------------------
|
|
23
|
+
|
|
24
|
+
*Built with [StencilJS](https://stenciljs.com/)*
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
.root-button {
|
|
2
|
+
height: 2rem;
|
|
3
|
+
border-radius: 1.5rem;
|
|
4
|
+
padding: 0 1.75rem;
|
|
5
|
+
min-width: fit-content;
|
|
6
|
+
background-color: transparent;
|
|
7
|
+
color: var(--rootsdk-text-primary);
|
|
8
|
+
outline: none;
|
|
9
|
+
font-size: 1rem;
|
|
10
|
+
border: none;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
border: 1px solid transparent;
|
|
13
|
+
text-transform: capitalize;
|
|
14
|
+
|
|
15
|
+
&--submit {
|
|
16
|
+
background: var(--rootsdk-text-primary);
|
|
17
|
+
color: var(--rootsdk-background-tertiary);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&--danger {
|
|
21
|
+
background: var(--rootsdk-error);
|
|
22
|
+
color: var(--rootsdk-text-white);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&--primary {
|
|
26
|
+
background: var(--rootsdk-brand-primary);
|
|
27
|
+
color: var(--rootsdk-text-white);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&--secondary {
|
|
31
|
+
background: var(--rootsdk-brand-secondary);
|
|
32
|
+
color: var(--rootsdk-input);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&--tertiary {
|
|
36
|
+
background: var(--rootsdk-brand-tertiary);
|
|
37
|
+
color: var(--rootsdk-input);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&--outline {
|
|
41
|
+
background: transparent;
|
|
42
|
+
border: 0.0625rem solid var(--rootsdk-text-tertiary);
|
|
43
|
+
color: var(--rootsdk-text-primary);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&--cancel {
|
|
47
|
+
background: transparent;
|
|
48
|
+
border: 0.0625rem solid var(--rootsdk-text-tertiary);
|
|
49
|
+
color: var(--rootsdk-text-primary);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&--large {
|
|
53
|
+
height: 3.25rem;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&[disabled] {
|
|
57
|
+
opacity: 0.6;
|
|
58
|
+
cursor: not-allowed;
|
|
59
|
+
pointer-events: none;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&--full-width {
|
|
63
|
+
width: 100%;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&:hover {
|
|
67
|
+
opacity: 80%;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&:active {
|
|
71
|
+
transform: scale(.98);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Component, h, Prop, Event, EventEmitter } from '@stencil/core';
|
|
2
|
+
import { randomIdGenerator } from '../../global/utils/randomIdGenerator';
|
|
3
|
+
import { RootButtonVariation } from './button-variation.enum';
|
|
4
|
+
import { RootButtonSize } from './button-size.enum';
|
|
5
|
+
import { RootButtonType } from './button-type.enum';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
tag: 'root-button',
|
|
9
|
+
styleUrl: 'button.scss',
|
|
10
|
+
shadow: true
|
|
11
|
+
})
|
|
12
|
+
export class RootButton {
|
|
13
|
+
@Prop() buttonId: string = randomIdGenerator('root-button');
|
|
14
|
+
|
|
15
|
+
@Prop() size: RootButtonSize = RootButtonSize.SMALL;
|
|
16
|
+
|
|
17
|
+
@Prop() variation: RootButtonVariation = RootButtonVariation.PRIMARY;
|
|
18
|
+
|
|
19
|
+
@Prop() type: RootButtonType = RootButtonType.BUTTON;
|
|
20
|
+
|
|
21
|
+
@Prop() fullWidth: boolean = false;
|
|
22
|
+
|
|
23
|
+
@Prop() disabled: boolean = false;
|
|
24
|
+
|
|
25
|
+
@Event() rootButtonClick: EventEmitter<MouseEvent>;
|
|
26
|
+
|
|
27
|
+
clickHandler(e: MouseEvent) {
|
|
28
|
+
this.rootButtonClick.emit(e);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
render() {
|
|
33
|
+
const classes = {
|
|
34
|
+
'root-button': true,
|
|
35
|
+
[`root-button--${this.size}`]: !!this.size,
|
|
36
|
+
[`root-button--${this.variation}`]: !!this.variation,
|
|
37
|
+
'root-button--full-width': this.fullWidth,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<button
|
|
42
|
+
id={this.buttonId}
|
|
43
|
+
class={classes}
|
|
44
|
+
disabled={this.disabled}
|
|
45
|
+
type={this.type}
|
|
46
|
+
onClick={(e) => this.clickHandler(e)}
|
|
47
|
+
>
|
|
48
|
+
<slot></slot>
|
|
49
|
+
</button>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# root-button
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
<!-- Auto Generated Below -->
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Properties
|
|
9
|
+
|
|
10
|
+
| Property | Attribute | Description | Type | Default |
|
|
11
|
+
| ----------- | ------------ | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
|
|
12
|
+
| `buttonId` | `button-id` | | `string` | `randomIdGenerator('root-button')` |
|
|
13
|
+
| `disabled` | `disabled` | | `boolean` | `false` |
|
|
14
|
+
| `fullWidth` | `full-width` | | `boolean` | `false` |
|
|
15
|
+
| `size` | `size` | | `RootButtonSize.LARGE \| RootButtonSize.SMALL` | `RootButtonSize.SMALL` |
|
|
16
|
+
| `type` | `type` | | `RootButtonType.BUTTON \| RootButtonType.RESET \| RootButtonType.SUBMIT` | `RootButtonType.BUTTON` |
|
|
17
|
+
| `variation` | `variation` | | `RootButtonVariation.CANCEL \| RootButtonVariation.DANGER \| RootButtonVariation.OUTLINE \| RootButtonVariation.PRIMARY \| RootButtonVariation.SECONDARY \| RootButtonVariation.SUBMIT \| RootButtonVariation.TERTIARY` | `RootButtonVariation.PRIMARY` |
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Events
|
|
21
|
+
|
|
22
|
+
| Event | Description | Type |
|
|
23
|
+
| ----------------- | ----------- | ------------------------- |
|
|
24
|
+
| `rootButtonClick` | | `CustomEvent<MouseEvent>` |
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
----------------------------------------------
|
|
28
|
+
|
|
29
|
+
*Built with [StencilJS](https://stenciljs.com/)*
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
export enum RootInputType {
|
|
3
|
+
COLOR = 'color',
|
|
4
|
+
DATE = 'date',
|
|
5
|
+
EMAIL = 'email',
|
|
6
|
+
FILE = 'file',
|
|
7
|
+
IMAGE = 'image',
|
|
8
|
+
MONTH = 'month',
|
|
9
|
+
NUMBER = 'number',
|
|
10
|
+
PASSWORD = 'password',
|
|
11
|
+
SEARCH = 'search',
|
|
12
|
+
SUBMIT = 'submit',
|
|
13
|
+
TEL = 'tel',
|
|
14
|
+
TEXT = 'text',
|
|
15
|
+
TIME = 'time',
|
|
16
|
+
URL = 'url',
|
|
17
|
+
WEEK = 'week',
|
|
18
|
+
}
|