@chayns-ui/layout 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 CHANGED
@@ -9,16 +9,20 @@ pnpm add @chayns-ui/layout @chayns-ui/core @chayns-ui/tokens react
9
9
  ```
10
10
 
11
11
  Load the resolved token stylesheet, Core stylesheet required by the host
12
- application, and the AppLayout stylesheet:
12
+ application, and the Layout stylesheet:
13
13
 
14
14
  ```tsx
15
15
  import '@chayns-ui/tokens/baseline.css';
16
16
  import '@chayns-ui/tokens/patch.css';
17
17
  import '@chayns-ui/core/styles.css';
18
- import '@chayns-ui/layout/app-layout.css';
18
+ import '@chayns-ui/layout/styles.css';
19
19
 
20
20
  import { AppLayout } from '@chayns-ui/layout';
21
21
  ```
22
22
 
23
23
  `AppLayout` renders the application shell with a 64px header, recursive
24
24
  navigation, controlled or uncontrolled sidebar collapse, and consumer content.
25
+
26
+ Alternatively, the component stylesheet is available as
27
+ `@chayns-ui/layout/app-layout.css` or
28
+ `@chayns-ui/layout/tabs.css`.
@@ -10,146 +10,6 @@
10
10
  color: var(--on-accent);
11
11
  }
12
12
 
13
- .chayns-tabs {
14
- display: flex;
15
- flex-direction: column;
16
- container-type: inline-size;
17
- inline-size: 100%;
18
- block-size: 100%;
19
- min-inline-size: 0;
20
- }
21
-
22
- .chayns-tabs__list {
23
- display: flex;
24
- gap: var(--sp-1);
25
- align-items: stretch;
26
- min-inline-size: 0;
27
- overflow-x: auto;
28
- background: transparent;
29
- }
30
-
31
- .chayns-tabs__bar {
32
- display: flex;
33
- align-items: stretch;
34
- block-size: var(--ctrl-h);
35
- min-inline-size: 0;
36
- }
37
-
38
- .chayns-tabs__item {
39
- display: inline-flex;
40
- flex: 0 0 auto;
41
- align-items: stretch;
42
- border-radius: var(--k12) var(--k12) 0 0;
43
- overflow: hidden;
44
- }
45
-
46
- .chayns-tabs__tab {
47
- display: inline-flex;
48
- flex: 0 0 auto;
49
- align-items: center;
50
- justify-content: center;
51
- gap: var(--sp-2);
52
- block-size: var(--ctrl-h);
53
- min-block-size: var(--ctrl-h);
54
- min-inline-size: var(--ctrl-h);
55
- padding-block: 0;
56
- padding-inline: var(--sp-3) var(--sp-2);
57
- border: 0;
58
- border-radius: 0;
59
- color: var(--on-accent);
60
- font: inherit;
61
- cursor: pointer;
62
- background: transparent;
63
- }
64
-
65
- .chayns-tabs__item:has(.chayns-tabs__tab--active) {
66
- background: var(--surface);
67
- }
68
-
69
- .chayns-tabs__item:not(:has(.chayns-tabs__tab--active)) {
70
- background: color-mix(in srgb, var(--surface) 10%, transparent);
71
- }
72
-
73
- .chayns-tabs__remove,
74
- .chayns-tabs__add {
75
- display: inline-flex;
76
- align-items: center;
77
- justify-content: center;
78
- inline-size: var(--ctrl-h);
79
- block-size: var(--ctrl-h);
80
- min-block-size: var(--ctrl-h);
81
- padding: 0 var(--sp-2);
82
- border: 0;
83
- color: var(--on-accent);
84
- font: inherit;
85
- cursor: pointer;
86
- background: transparent;
87
- }
88
-
89
- .chayns-tabs__remove {
90
- inline-size: var(--icon);
91
- padding: 0;
92
- border-radius: 0;
93
- }
94
-
95
- .chayns-tabs__add {
96
- flex: 0 0 auto;
97
- border-radius: 0;
98
- color: var(--on-accent);
99
- }
100
-
101
- .chayns-tabs__item:has(:focus-visible) {
102
- outline: none;
103
- box-shadow: inset 0 0 0 var(--focus-ring-size)
104
- rgb(var(--focus-ring-rgb), var(--focus-ring-alpha-strong));
105
- }
106
-
107
- .chayns-tabs__tab:focus-visible,
108
- .chayns-tabs__remove:focus-visible,
109
- .chayns-tabs__add:focus-visible {
110
- outline: none;
111
- }
112
-
113
- .chayns-tabs__icon {
114
- display: inline-flex;
115
- flex: none;
116
- align-items: center;
117
- justify-content: center;
118
- inline-size: var(--icon);
119
- block-size: var(--icon);
120
- }
121
-
122
- .chayns-tabs__remove .chayns-tabs__icon {
123
- inline-size: var(--fs-meta);
124
- block-size: var(--fs-meta);
125
- font-size: var(--fs-meta);
126
- }
127
-
128
- .chayns-tabs__item:has(.chayns-tabs__tab--active) .chayns-tabs__tab,
129
- .chayns-tabs__item:has(.chayns-tabs__tab--active) .chayns-tabs__remove {
130
- color: var(--accent);
131
- }
132
-
133
- .chayns-tabs__panel {
134
- flex: 1 1 auto;
135
- min-inline-size: 0;
136
- min-block-size: 0;
137
- padding: var(--sp-4);
138
- overflow: auto;
139
- background: var(--surface);
140
- }
141
-
142
- @container (max-width: 20rem) {
143
- .chayns-tabs__label {
144
- position: absolute;
145
- inline-size: 1px;
146
- block-size: 1px;
147
- overflow: hidden;
148
- clip-path: inset(50%);
149
- white-space: nowrap;
150
- }
151
- }
152
-
153
13
  .chayns-app-layout__header {
154
14
  display: flex;
155
15
  grid-area: header;
@@ -0,0 +1,2 @@
1
+ @import url('./app-layout.css');
2
+ @import url('./tabs.css');
package/dist/tabs.css ADDED
@@ -0,0 +1,141 @@
1
+ @layer chayns.components {
2
+ .chayns-tabs {
3
+ display: flex;
4
+ flex-direction: column;
5
+ container-type: inline-size;
6
+ inline-size: 100%;
7
+ block-size: 100%;
8
+ min-inline-size: 0;
9
+ }
10
+
11
+ .chayns-tabs__list {
12
+ display: flex;
13
+ gap: var(--sp-1);
14
+ align-items: stretch;
15
+ min-inline-size: 0;
16
+ overflow-x: auto;
17
+ background: transparent;
18
+ }
19
+
20
+ .chayns-tabs__bar {
21
+ display: flex;
22
+ align-items: stretch;
23
+ block-size: var(--ctrl-h);
24
+ min-inline-size: 0;
25
+ }
26
+
27
+ .chayns-tabs__item {
28
+ display: inline-flex;
29
+ flex: 0 0 auto;
30
+ align-items: stretch;
31
+ border-radius: var(--k12) var(--k12) 0 0;
32
+ overflow: hidden;
33
+ }
34
+
35
+ .chayns-tabs__tab {
36
+ display: inline-flex;
37
+ flex: 0 0 auto;
38
+ align-items: center;
39
+ justify-content: center;
40
+ gap: var(--sp-2);
41
+ block-size: var(--ctrl-h);
42
+ min-block-size: var(--ctrl-h);
43
+ min-inline-size: var(--ctrl-h);
44
+ padding-block: 0;
45
+ padding-inline: var(--sp-3) var(--sp-2);
46
+ border: 0;
47
+ border-radius: 0;
48
+ color: var(--on-accent);
49
+ font: inherit;
50
+ cursor: pointer;
51
+ background: transparent;
52
+ }
53
+
54
+ .chayns-tabs__item:has(.chayns-tabs__tab--active) {
55
+ background: var(--surface);
56
+ }
57
+
58
+ .chayns-tabs__item:not(:has(.chayns-tabs__tab--active)) {
59
+ background: color-mix(in srgb, var(--surface) 10%, transparent);
60
+ }
61
+
62
+ .chayns-tabs__remove,
63
+ .chayns-tabs__add {
64
+ display: inline-flex;
65
+ align-items: center;
66
+ justify-content: center;
67
+ inline-size: var(--ctrl-h);
68
+ block-size: var(--ctrl-h);
69
+ min-block-size: var(--ctrl-h);
70
+ padding: 0 var(--sp-2);
71
+ border: 0;
72
+ color: var(--on-accent);
73
+ font: inherit;
74
+ cursor: pointer;
75
+ background: transparent;
76
+ }
77
+
78
+ .chayns-tabs__remove {
79
+ inline-size: var(--icon);
80
+ padding: 0;
81
+ border-radius: 0;
82
+ }
83
+
84
+ .chayns-tabs__add {
85
+ flex: 0 0 auto;
86
+ border-radius: 0;
87
+ color: var(--on-accent);
88
+ }
89
+
90
+ .chayns-tabs__item:has(:focus-visible) {
91
+ outline: none;
92
+ box-shadow: inset 0 0 0 var(--focus-ring-size)
93
+ rgb(var(--focus-ring-rgb), var(--focus-ring-alpha-strong));
94
+ }
95
+
96
+ .chayns-tabs__tab:focus-visible,
97
+ .chayns-tabs__remove:focus-visible,
98
+ .chayns-tabs__add:focus-visible {
99
+ outline: none;
100
+ }
101
+
102
+ .chayns-tabs__icon {
103
+ display: inline-flex;
104
+ flex: none;
105
+ align-items: center;
106
+ justify-content: center;
107
+ inline-size: var(--icon);
108
+ block-size: var(--icon);
109
+ }
110
+
111
+ .chayns-tabs__remove .chayns-tabs__icon {
112
+ inline-size: var(--fs-meta);
113
+ block-size: var(--fs-meta);
114
+ font-size: var(--fs-meta);
115
+ }
116
+
117
+ .chayns-tabs__item:has(.chayns-tabs__tab--active) .chayns-tabs__tab,
118
+ .chayns-tabs__item:has(.chayns-tabs__tab--active) .chayns-tabs__remove {
119
+ color: var(--accent);
120
+ }
121
+
122
+ .chayns-tabs__panel {
123
+ flex: 1 1 auto;
124
+ min-inline-size: 0;
125
+ min-block-size: 0;
126
+ padding: var(--sp-4);
127
+ overflow: auto;
128
+ background: var(--surface);
129
+ }
130
+
131
+ @container (max-width: 20rem) {
132
+ .chayns-tabs__label {
133
+ position: absolute;
134
+ inline-size: 1px;
135
+ block-size: 1px;
136
+ overflow: hidden;
137
+ clip-path: inset(50%);
138
+ white-space: nowrap;
139
+ }
140
+ }
141
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chayns-ui/layout",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Accessible application layout components for chayns UI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -23,6 +23,8 @@
23
23
  "import": "./dist/index.js"
24
24
  },
25
25
  "./app-layout.css": "./dist/app-layout.css",
26
+ "./tabs.css": "./dist/tabs.css",
27
+ "./styles.css": "./dist/styles.css",
26
28
  "./package.json": "./package.json"
27
29
  },
28
30
  "peerDependencies": {