@lmfaole/basics 0.3.0 → 0.4.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 +182 -33
- package/basic-styling/components/basic-accordion.css +65 -0
- package/basic-styling/components/basic-alert.css +27 -0
- package/basic-styling/components/basic-dialog.css +41 -0
- package/basic-styling/components/basic-popover.css +54 -0
- package/basic-styling/components/basic-summary-table.css +76 -0
- package/basic-styling/components/basic-table.css +48 -0
- package/basic-styling/components/basic-tabs.css +45 -0
- package/basic-styling/components/basic-toast.css +102 -0
- package/basic-styling/components/basic-toc.css +30 -0
- package/basic-styling/components.css +9 -0
- package/basic-styling/global.css +61 -0
- package/basic-styling/index.css +2 -0
- package/basic-styling/tokens/base.css +19 -0
- package/basic-styling/tokens/palette.css +117 -0
- package/basic-styling/tokens/palette.tokens.json +1019 -0
- package/components/basic-accordion/index.d.ts +5 -5
- package/components/basic-accordion/index.js +169 -165
- package/components/basic-alert/index.d.ts +53 -0
- package/components/basic-alert/index.js +189 -0
- package/components/basic-alert/register.d.ts +1 -0
- package/components/basic-alert/register.js +3 -0
- package/components/basic-summary-table/index.js +188 -42
- package/components/basic-table/index.js +203 -145
- package/components/basic-toast/index.d.ts +65 -0
- package/components/basic-toast/index.js +429 -0
- package/components/basic-toast/register.d.ts +1 -0
- package/components/basic-toast/register.js +3 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/package.json +22 -57
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
basic-toast {
|
|
2
|
+
--basic-toast-offset: var(--basic-space-4);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
basic-toast [data-toast-open],
|
|
6
|
+
basic-toast [data-toast-close] {
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
padding: var(--basic-control-padding-block) var(--basic-control-padding-inline);
|
|
11
|
+
border: var(--basic-border-width) solid var(--basic-color-border);
|
|
12
|
+
border-radius: var(--basic-radius-pill);
|
|
13
|
+
background: var(--basic-color-surface);
|
|
14
|
+
color: inherit;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
basic-toast [data-toast-panel] {
|
|
19
|
+
position: fixed;
|
|
20
|
+
inset-block-start: auto;
|
|
21
|
+
inset-inline-start: auto;
|
|
22
|
+
inset-inline-end: var(--basic-toast-offset);
|
|
23
|
+
inset-block-end: var(--basic-toast-offset);
|
|
24
|
+
width: min(
|
|
25
|
+
var(--basic-toast-width, 20rem),
|
|
26
|
+
var(--basic-toast-max-width, calc(100vw - (var(--basic-toast-offset) * 2)))
|
|
27
|
+
);
|
|
28
|
+
padding: var(--basic-panel-padding);
|
|
29
|
+
border: var(--basic-border-width) solid var(--basic-color-border);
|
|
30
|
+
border-radius: var(--basic-radius);
|
|
31
|
+
background: var(--basic-color-surface);
|
|
32
|
+
transform: translate(0, 0);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
basic-toast[data-toast-position="top-left"] [data-toast-panel] {
|
|
36
|
+
inset-block-start: var(--basic-toast-offset);
|
|
37
|
+
inset-inline-start: var(--basic-toast-offset);
|
|
38
|
+
inset-inline-end: auto;
|
|
39
|
+
inset-block-end: auto;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
basic-toast[data-toast-position="top-center"] [data-toast-panel] {
|
|
43
|
+
inset-block-start: var(--basic-toast-offset);
|
|
44
|
+
inset-inline-start: 50%;
|
|
45
|
+
inset-inline-end: auto;
|
|
46
|
+
inset-block-end: auto;
|
|
47
|
+
transform: translateX(-50%);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
basic-toast[data-toast-position="top-right"] [data-toast-panel] {
|
|
51
|
+
inset-block-start: var(--basic-toast-offset);
|
|
52
|
+
inset-inline-start: auto;
|
|
53
|
+
inset-inline-end: var(--basic-toast-offset);
|
|
54
|
+
inset-block-end: auto;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
basic-toast[data-toast-position="center-left"] [data-toast-panel] {
|
|
58
|
+
inset-block-start: 50%;
|
|
59
|
+
inset-inline-start: var(--basic-toast-offset);
|
|
60
|
+
inset-inline-end: auto;
|
|
61
|
+
inset-block-end: auto;
|
|
62
|
+
transform: translateY(-50%);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
basic-toast[data-toast-position="center"] [data-toast-panel] {
|
|
66
|
+
inset-block-start: 50%;
|
|
67
|
+
inset-inline-start: 50%;
|
|
68
|
+
inset-inline-end: auto;
|
|
69
|
+
inset-block-end: auto;
|
|
70
|
+
transform: translate(-50%, -50%);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
basic-toast[data-toast-position="center-right"] [data-toast-panel] {
|
|
74
|
+
inset-block-start: 50%;
|
|
75
|
+
inset-inline-start: auto;
|
|
76
|
+
inset-inline-end: var(--basic-toast-offset);
|
|
77
|
+
inset-block-end: auto;
|
|
78
|
+
transform: translateY(-50%);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
basic-toast[data-toast-position="bottom-left"] [data-toast-panel] {
|
|
82
|
+
inset-block-start: auto;
|
|
83
|
+
inset-inline-start: var(--basic-toast-offset);
|
|
84
|
+
inset-inline-end: auto;
|
|
85
|
+
inset-block-end: var(--basic-toast-offset);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
basic-toast[data-toast-position="bottom-center"] [data-toast-panel] {
|
|
89
|
+
inset-block-start: auto;
|
|
90
|
+
inset-inline-start: 50%;
|
|
91
|
+
inset-inline-end: auto;
|
|
92
|
+
inset-block-end: var(--basic-toast-offset);
|
|
93
|
+
transform: translateX(-50%);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
basic-toast [data-toast-panel] > :where(*) {
|
|
97
|
+
margin-block: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
basic-toast [data-toast-panel] > :where(* + *) {
|
|
101
|
+
margin-block-start: var(--basic-flow-space);
|
|
102
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
basic-toc {
|
|
2
|
+
--basic-toc-panel-padding: var(--basic-panel-padding);
|
|
3
|
+
display: block;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
basic-toc [data-page-toc-nav] {
|
|
7
|
+
padding: var(--basic-toc-panel-padding);
|
|
8
|
+
border: var(--basic-border-width) solid var(--basic-color-border);
|
|
9
|
+
border-radius: var(--basic-radius);
|
|
10
|
+
background: var(--basic-color-surface);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
basic-toc [data-page-toc-nav] ol {
|
|
14
|
+
margin: 0;
|
|
15
|
+
padding-left: var(--basic-toc-list-indent, 1.25rem);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
basic-toc [data-page-toc-nav] li + li {
|
|
19
|
+
margin-top: var(--basic-space-2);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
basic-toc [data-page-toc-nav] ol ol {
|
|
23
|
+
margin-top: var(--basic-space-2);
|
|
24
|
+
padding-left: var(--basic-space-4);
|
|
25
|
+
border-left: var(--basic-border-width) solid var(--basic-color-border);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
basic-toc [data-page-toc-nav] a {
|
|
29
|
+
color: inherit;
|
|
30
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@import "./components/basic-alert.css";
|
|
2
|
+
@import "./components/basic-accordion.css";
|
|
3
|
+
@import "./components/basic-dialog.css";
|
|
4
|
+
@import "./components/basic-popover.css";
|
|
5
|
+
@import "./components/basic-table.css";
|
|
6
|
+
@import "./components/basic-summary-table.css";
|
|
7
|
+
@import "./components/basic-tabs.css";
|
|
8
|
+
@import "./components/basic-toc.css";
|
|
9
|
+
@import "./components/basic-toast.css";
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
@import "./tokens/base.css";
|
|
2
|
+
@import "./tokens/palette.css";
|
|
3
|
+
|
|
4
|
+
html {
|
|
5
|
+
color-scheme: light dark;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
*,
|
|
9
|
+
*::before,
|
|
10
|
+
*::after {
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
body {
|
|
15
|
+
margin: 0;
|
|
16
|
+
background: var(--basic-color-background);
|
|
17
|
+
color: var(--basic-color-text);
|
|
18
|
+
font-family: var(--basic-font-family);
|
|
19
|
+
font-size: var(--basic-font-size);
|
|
20
|
+
line-height: var(--basic-line-height);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
img,
|
|
24
|
+
svg,
|
|
25
|
+
video {
|
|
26
|
+
display: block;
|
|
27
|
+
max-width: 100%;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
button,
|
|
31
|
+
input,
|
|
32
|
+
select,
|
|
33
|
+
textarea {
|
|
34
|
+
font: inherit;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
a {
|
|
38
|
+
color: inherit;
|
|
39
|
+
text-underline-offset: 0.16em;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
a:hover {
|
|
43
|
+
color: inherit;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:focus-visible {
|
|
47
|
+
outline: 3px solid var(--basic-color-focus);
|
|
48
|
+
outline-offset: 2px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
dialog {
|
|
52
|
+
color: inherit;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
dialog::backdrop {
|
|
56
|
+
background: var(--basic-color-overlay);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
[hidden] {
|
|
60
|
+
display: none !important;
|
|
61
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--basic-font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
3
|
+
--basic-font-size: 1rem;
|
|
4
|
+
--basic-font-size-title: 1.125rem;
|
|
5
|
+
--basic-line-height: 1.5;
|
|
6
|
+
--basic-border-width: 1px;
|
|
7
|
+
--basic-radius: 0.5rem;
|
|
8
|
+
--basic-radius-pill: 999px;
|
|
9
|
+
--basic-space-1: 0.25rem;
|
|
10
|
+
--basic-space-2: 0.5rem;
|
|
11
|
+
--basic-space-3: 0.75rem;
|
|
12
|
+
--basic-space-4: 1rem;
|
|
13
|
+
--basic-space-5: 1.5rem;
|
|
14
|
+
--basic-flow-space: var(--basic-space-3);
|
|
15
|
+
--basic-stack-gap: var(--basic-space-3);
|
|
16
|
+
--basic-panel-padding: var(--basic-space-4);
|
|
17
|
+
--basic-control-padding-block: 0.625rem;
|
|
18
|
+
--basic-control-padding-inline: var(--basic-space-4);
|
|
19
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--basic-palette-surface-light: oklch(98.6% 0.004 255);
|
|
3
|
+
--basic-palette-surface-dark: oklch(27.8% 0.033 256.848);
|
|
4
|
+
--basic-palette-text-light: oklch(21% 0.034 264.665);
|
|
5
|
+
--basic-palette-text-dark: oklch(98.5% 0.002 247.839);
|
|
6
|
+
--basic-palette-accent-light: oklch(54.6% 0.245 262.881);
|
|
7
|
+
--basic-palette-accent-dark: oklch(70.7% 0.165 254.624);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
[data-basic-palette="sand"] {
|
|
11
|
+
--basic-palette-surface-light: oklch(97.8% 0.012 85);
|
|
12
|
+
--basic-palette-surface-dark: oklch(30.5% 0.022 75);
|
|
13
|
+
--basic-palette-text-light: oklch(29% 0.028 65);
|
|
14
|
+
--basic-palette-text-dark: oklch(96.4% 0.01 85);
|
|
15
|
+
--basic-palette-accent-light: oklch(63% 0.18 58);
|
|
16
|
+
--basic-palette-accent-dark: oklch(76% 0.14 72);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
[data-basic-palette="ocean"] {
|
|
20
|
+
--basic-palette-surface-light: oklch(97.4% 0.01 225);
|
|
21
|
+
--basic-palette-surface-dark: oklch(30% 0.04 245);
|
|
22
|
+
--basic-palette-text-light: oklch(28% 0.05 250);
|
|
23
|
+
--basic-palette-text-dark: oklch(95.2% 0.01 225);
|
|
24
|
+
--basic-palette-accent-light: oklch(62% 0.14 222);
|
|
25
|
+
--basic-palette-accent-dark: oklch(77% 0.11 210);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
[data-basic-palette="berry"] {
|
|
29
|
+
--basic-palette-surface-light: oklch(97.2% 0.012 10);
|
|
30
|
+
--basic-palette-surface-dark: oklch(30.2% 0.05 5);
|
|
31
|
+
--basic-palette-text-light: oklch(27.5% 0.06 8);
|
|
32
|
+
--basic-palette-text-dark: oklch(95.8% 0.012 8);
|
|
33
|
+
--basic-palette-accent-light: oklch(60% 0.2 12);
|
|
34
|
+
--basic-palette-accent-dark: oklch(73% 0.16 8);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:root,
|
|
38
|
+
[data-basic-palette] {
|
|
39
|
+
--basic-palette-background-light: color-mix(in oklch, var(--basic-palette-surface-light) 92%, oklch(100% 0 0));
|
|
40
|
+
--basic-palette-background-dark: color-mix(in oklch, var(--basic-palette-surface-dark) 82%, oklch(0% 0 0));
|
|
41
|
+
--basic-palette-surface-light-computed: color-mix(
|
|
42
|
+
in oklch,
|
|
43
|
+
var(--basic-palette-surface-light) 96%,
|
|
44
|
+
oklch(100% 0 0)
|
|
45
|
+
);
|
|
46
|
+
--basic-palette-surface-dark-computed: color-mix(
|
|
47
|
+
in oklch,
|
|
48
|
+
var(--basic-palette-surface-dark) 94%,
|
|
49
|
+
oklch(0% 0 0)
|
|
50
|
+
);
|
|
51
|
+
--basic-palette-surface-muted-light: color-mix(
|
|
52
|
+
in oklch,
|
|
53
|
+
var(--basic-palette-accent-light) 10%,
|
|
54
|
+
var(--basic-palette-surface-light)
|
|
55
|
+
);
|
|
56
|
+
--basic-palette-surface-muted-dark: color-mix(
|
|
57
|
+
in oklch,
|
|
58
|
+
var(--basic-palette-accent-dark) 18%,
|
|
59
|
+
var(--basic-palette-surface-dark)
|
|
60
|
+
);
|
|
61
|
+
--basic-palette-text-muted-light: color-mix(
|
|
62
|
+
in oklch,
|
|
63
|
+
var(--basic-palette-text-light) 68%,
|
|
64
|
+
var(--basic-palette-surface-light)
|
|
65
|
+
);
|
|
66
|
+
--basic-palette-text-muted-dark: color-mix(
|
|
67
|
+
in oklch,
|
|
68
|
+
var(--basic-palette-text-dark) 78%,
|
|
69
|
+
var(--basic-palette-surface-dark)
|
|
70
|
+
);
|
|
71
|
+
--basic-palette-border-light: color-mix(
|
|
72
|
+
in oklch,
|
|
73
|
+
var(--basic-palette-text-light) 16%,
|
|
74
|
+
var(--basic-palette-surface-light)
|
|
75
|
+
);
|
|
76
|
+
--basic-palette-border-dark: color-mix(
|
|
77
|
+
in oklch,
|
|
78
|
+
var(--basic-palette-text-dark) 24%,
|
|
79
|
+
var(--basic-palette-surface-dark)
|
|
80
|
+
);
|
|
81
|
+
--basic-palette-overlay-light: color-mix(
|
|
82
|
+
in oklch,
|
|
83
|
+
var(--basic-palette-text-light) 24%,
|
|
84
|
+
oklch(0% 0 0 / 0)
|
|
85
|
+
);
|
|
86
|
+
--basic-palette-overlay-dark: color-mix(in oklch, oklch(0% 0 0) 56%, oklch(0% 0 0 / 0));
|
|
87
|
+
--basic-palette-focus-light: color-mix(
|
|
88
|
+
in oklch,
|
|
89
|
+
var(--basic-palette-accent-light) 28%,
|
|
90
|
+
oklch(0% 0 0 / 0)
|
|
91
|
+
);
|
|
92
|
+
--basic-palette-focus-dark: color-mix(
|
|
93
|
+
in oklch,
|
|
94
|
+
var(--basic-palette-accent-dark) 38%,
|
|
95
|
+
oklch(0% 0 0 / 0)
|
|
96
|
+
);
|
|
97
|
+
--basic-color-background: light-dark(
|
|
98
|
+
var(--basic-palette-background-light),
|
|
99
|
+
var(--basic-palette-background-dark)
|
|
100
|
+
);
|
|
101
|
+
--basic-color-surface: light-dark(
|
|
102
|
+
var(--basic-palette-surface-light-computed),
|
|
103
|
+
var(--basic-palette-surface-dark-computed)
|
|
104
|
+
);
|
|
105
|
+
--basic-color-surface-muted: light-dark(
|
|
106
|
+
var(--basic-palette-surface-muted-light),
|
|
107
|
+
var(--basic-palette-surface-muted-dark)
|
|
108
|
+
);
|
|
109
|
+
--basic-color-text: light-dark(var(--basic-palette-text-light), var(--basic-palette-text-dark));
|
|
110
|
+
--basic-color-text-muted: light-dark(
|
|
111
|
+
var(--basic-palette-text-muted-light),
|
|
112
|
+
var(--basic-palette-text-muted-dark)
|
|
113
|
+
);
|
|
114
|
+
--basic-color-border: light-dark(var(--basic-palette-border-light), var(--basic-palette-border-dark));
|
|
115
|
+
--basic-color-overlay: light-dark(var(--basic-palette-overlay-light), var(--basic-palette-overlay-dark));
|
|
116
|
+
--basic-color-focus: light-dark(var(--basic-palette-focus-light), var(--basic-palette-focus-dark));
|
|
117
|
+
}
|