@sewadah/selaras-docs 1.0.1 โ 1.2.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/CHANGELOG.md +73 -0
- package/README.md +53 -0
- package/app/assets/style.css +28 -7
- package/app/components/content/DocsViewportPreview.vue +67 -0
- package/package.json +2 -2
- package/types.d.ts +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,78 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v1.2.0
|
|
4
|
+
|
|
5
|
+
[compare changes](https://github.com/sewadahapp/selaras/compare/selaras-docs-v1.1.0...selaras-docs-v1.2.0)
|
|
6
|
+
|
|
7
|
+
### ๐ Enhancements
|
|
8
|
+
|
|
9
|
+
- **feat(docs):** provide reusable viewport preview component ([ccead99](https://github.com/sewadahapp/selaras/commit/ccead99a5c07c1eb11e573285ad362d23ee3263a))
|
|
10
|
+
- **feat(docs):** add device previews for adaptive interfaces ([dcd620f](https://github.com/sewadahapp/selaras/commit/dcd620fb331fbe7df1d443ce5d5219be665cf714))
|
|
11
|
+
- **feat(docs):** replace logo and favicon ([0ba8a12](https://github.com/sewadahapp/selaras/commit/0ba8a1234c5395682261d7170c18aeca60ee7dc5))
|
|
12
|
+
- **feat(agent):** add Selaras skill and local MCP server ([b15bc01](https://github.com/sewadahapp/selaras/commit/b15bc0181e86981d902640d7608554072bf095f0))
|
|
13
|
+
|
|
14
|
+
### ๐ฉน Fixes
|
|
15
|
+
|
|
16
|
+
- **fix(autocomplete):** use a modal for adaptive mobile editing ([330540f](https://github.com/sewadahapp/selaras/commit/330540f8073cd9b28782f01492f93e990b2d9ed1))
|
|
17
|
+
|
|
18
|
+
### ๐ Documentation
|
|
19
|
+
|
|
20
|
+
- **docs:** organize overview guides and add agent documentation exports ([3f5537b](https://github.com/sewadahapp/selaras/commit/3f5537b3138c5bc345da0d88dabb620f73dcd176))
|
|
21
|
+
|
|
22
|
+
### ๐ค Other changes
|
|
23
|
+
|
|
24
|
+
- **build(docs):** install local icon collections ([5f4fcaa](https://github.com/sewadahapp/selaras/commit/5f4fcaa9ccb403b4fccdf6debbe11ca78c1a739d))
|
|
25
|
+
|
|
26
|
+
Published against `@sewadah/selaras` ^0.4.0.
|
|
27
|
+
|
|
28
|
+
## v1.1.0
|
|
29
|
+
|
|
30
|
+
[compare changes](https://github.com/sewadahapp/selaras/compare/selaras-docs-v1.0.1...selaras-docs-v1.1.0)
|
|
31
|
+
|
|
32
|
+
### ๐ Enhancements
|
|
33
|
+
|
|
34
|
+
- **feat(color-mode-switch):** add switch for light and dark modes ([0fea5d4](https://github.com/sewadahapp/selaras/commit/0fea5d4cfcdd1be2fcdad10241d0e5dabbaf720a))
|
|
35
|
+
- **feat(button):** add subtle variant and underline links on hover ([62e77b3](https://github.com/sewadahapp/selaras/commit/62e77b312a6a32c53cab0127006fd27305658f37))
|
|
36
|
+
- **feat:** add confirm service and refine component behavior ([f3cf73b](https://github.com/sewadahapp/selaras/commit/f3cf73b9f492f7cb8ed44a4ded4c26ec6b165e19))
|
|
37
|
+
- **feat(select):** support object options as values ([be2ae38](https://github.com/sewadahapp/selaras/commit/be2ae38485110f2fa1e6cfdfc2e12eecf69885e4))
|
|
38
|
+
- **feat(code-group):** add Bun package manager icon ([4d8c927](https://github.com/sewadahapp/selaras/commit/4d8c927d4a2f8058d0a1a6a61e2996609bf4550a))
|
|
39
|
+
- **feat(docs):** redesign theme picker ([22cc5f2](https://github.com/sewadahapp/selaras/commit/22cc5f229eba4aae0dc65a7104d0d6d26a74a42d))
|
|
40
|
+
|
|
41
|
+
### ๐ฉน Fixes
|
|
42
|
+
|
|
43
|
+
- **fix(ci):** allow headroom in packed consumer CSS budgets ([d1bd54a](https://github.com/sewadahapp/selaras/commit/d1bd54adb2247945e9ec05477fa6b944ac4a1a41))
|
|
44
|
+
- **fix(button):** strengthen text variant hover colors ([586d38c](https://github.com/sewadahapp/selaras/commit/586d38c570b7e19ff5cd5f167319a2cd098d26ff))
|
|
45
|
+
- **fix(docs):** remove default footer attribution ([5cd46ba](https://github.com/sewadahapp/selaras/commit/5cd46ba3a538ccbe37ef12177fcf49babce459b3))
|
|
46
|
+
- **fix(theme):** allow chip variant conditions ([2ecefb0](https://github.com/sewadahapp/selaras/commit/2ecefb0425083d08cea9447d212278291407f7c3))
|
|
47
|
+
- **fix(degung):** join grouped buttons back into one segmented pill ([ca3a14e](https://github.com/sewadahapp/selaras/commit/ca3a14e0a8a7c1083b2f1da2bc904aae133cbdf2))
|
|
48
|
+
- **fix(degung):** taper each display rim before its own corner ([4e025fe](https://github.com/sewadahapp/selaras/commit/4e025feb87f70c0f8e66c555ebe08aa7b53b05c6))
|
|
49
|
+
- **fix(degung):** use a fixed-pixel display rim inset instead of a percentage ([ac6567d](https://github.com/sewadahapp/selaras/commit/ac6567dd1d042686ec3cf432a09e9a87397c61b9))
|
|
50
|
+
- **fix(degung):** apply the display look to every accordion, flatten nested groups ([38b8d20](https://github.com/sewadahapp/selaras/commit/38b8d2058478ac80e58d724d8b6a886860416e14))
|
|
51
|
+
- **fix(degung):** collapse the rail's leftover gutter on nested nav rows ([e138ce8](https://github.com/sewadahapp/selaras/commit/e138ce80f178cefe5470340f63a16df249a8c3e3))
|
|
52
|
+
- **fix(degung):** tone down the display text glow for readability ([a65a32a](https://github.com/sewadahapp/selaras/commit/a65a32a038e93bc0ace34d4d19daf2ef23eda9d9))
|
|
53
|
+
- **fix(degung):** drop the tree-connector rail and readable nav hover ([f712787](https://github.com/sewadahapp/selaras/commit/f71278758a3a686229f589dac0de9242d0fc259a))
|
|
54
|
+
- **fix(toast):** carry a card's full background into its stacked cover ([d7c7562](https://github.com/sewadahapp/selaras/commit/d7c7562e6a3f32bbec646eaafbdc51c40c0df9e7))
|
|
55
|
+
|
|
56
|
+
### ๐ Documentation
|
|
57
|
+
|
|
58
|
+
- **docs(degung):** restyle the preset as rounded glossy hardware ([9be8a84](https://github.com/sewadahapp/selaras/commit/9be8a84cdd37706a982a05c80c093cf3636ecbc1))
|
|
59
|
+
|
|
60
|
+
### ๐ค Other changes
|
|
61
|
+
|
|
62
|
+
- **chore(test):** restore default worker parallelism ([e4b7f59](https://github.com/sewadahapp/selaras/commit/e4b7f59a6628a0de1567a5ef61e5e29870394d17))
|
|
63
|
+
- **chore(scripts):** run docs template from docs dev ([f743ad4](https://github.com/sewadahapp/selaras/commit/f743ad4e99bcdeff581c18f287cb3dc3729b03b5))
|
|
64
|
+
- **chore(dev):** add Nix shell and limit test workers ([055c03d](https://github.com/sewadahapp/selaras/commit/055c03dcbbe7b6b5fab37210c59b36f03c1a6580))
|
|
65
|
+
- **style(docs):** refine footer and display finish ([31a9dae](https://github.com/sewadahapp/selaras/commit/31a9dae7d7fa23a22d6dbad1e19d5d0616552453))
|
|
66
|
+
- **style(docs):** refine footer content and alignment ([d29b947](https://github.com/sewadahapp/selaras/commit/d29b9479a86caca36c39d1d66d1580257f74b184))
|
|
67
|
+
- **style(degung):** brighten, lengthen and thin the display rim highlight ([413cad5](https://github.com/sewadahapp/selaras/commit/413cad5fae769b5338f45b0c9537f65bc17aa9ab))
|
|
68
|
+
- **style(degung):** enlarge the slider thumb, inset the display rim from the edge ([7530118](https://github.com/sewadahapp/selaras/commit/75301182347d14d16d5b2d7aa1ad7e4381e94465))
|
|
69
|
+
- **style(degung):** tighten the display rim to a hairline ([ed8d531](https://github.com/sewadahapp/selaras/commit/ed8d53190907fa630aff7c2db26eb1333b47702f))
|
|
70
|
+
- **style(degung):** widen the slider thumb, tuck the display rim to all four edges ([8d51891](https://github.com/sewadahapp/selaras/commit/8d51891c41a5323b0713d50568b88fef281e886b))
|
|
71
|
+
- **style(degung):** twin-edge display highlight, chrome pill slider thumb ([c385bb9](https://github.com/sewadahapp/selaras/commit/c385bb948194bfd04f0c3aca3d34e1b9eb7ae911))
|
|
72
|
+
- **style(degung):** add display glow, screen highlight and selection color ([5a2897e](https://github.com/sewadahapp/selaras/commit/5a2897e627f90acf134f4bfc07f35d8bb4365a58))
|
|
73
|
+
|
|
74
|
+
Published against `@sewadah/selaras` ^0.3.2.
|
|
75
|
+
|
|
3
76
|
## v1.0.1
|
|
4
77
|
|
|
5
78
|
[compare changes](https://github.com/sewadahapp/selaras/compare/selaras-docs-v1.0.0...selaras-docs-v1.0.1)
|
package/README.md
CHANGED
|
@@ -122,3 +122,56 @@ the logo to the footer while leaving the header as configured.
|
|
|
122
122
|
For a host that owns Tailwind compilation or uses a class prefix, set
|
|
123
123
|
`selarasDocs: { css: false }` in `nuxt.config.ts` and import Selaras and the
|
|
124
124
|
docs stylesheet from the host CSS entry.
|
|
125
|
+
|
|
126
|
+
## Viewport previews
|
|
127
|
+
|
|
128
|
+
`DocsViewportPreview` embeds an example page in a real iframe viewport. Device
|
|
129
|
+
buttons change its width, so media queries and Selaras' `adaptive` controls
|
|
130
|
+
respond without resizing the documentation browser. It is available in Vue
|
|
131
|
+
components and Markdown:
|
|
132
|
+
|
|
133
|
+
```md
|
|
134
|
+
::docs-viewport-preview{src="/examples/team-picker" title="Team picker" :height="540"}
|
|
135
|
+
::
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Create the example route in your application's `pages/` directory (or
|
|
139
|
+
`app/pages/` with Nuxt's default directory structure). Use `layout: false` to
|
|
140
|
+
render only the example:
|
|
141
|
+
|
|
142
|
+
```vue
|
|
143
|
+
<script setup lang="ts">
|
|
144
|
+
definePageMeta({ layout: false })
|
|
145
|
+
const team = ref<string>()
|
|
146
|
+
</script>
|
|
147
|
+
|
|
148
|
+
<template>
|
|
149
|
+
<main class="p-6">
|
|
150
|
+
<SSelect v-model="team" :items="['Design', 'Engineering']" adaptive />
|
|
151
|
+
</main>
|
|
152
|
+
</template>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Root-relative `src` paths automatically include the application's `baseURL`.
|
|
156
|
+
When generating a static site, add example routes to `nitro.prerender.routes`;
|
|
157
|
+
iframe URLs are not ordinary navigation links for the prerender crawler.
|
|
158
|
+
|
|
159
|
+
| Prop / model | Default | Purpose |
|
|
160
|
+
| --- | --- | --- |
|
|
161
|
+
| `src` | Required | URL of the example page. |
|
|
162
|
+
| `title` | `Responsive example` | Accessible preview label and iframe title. |
|
|
163
|
+
| `devices` | Desktop 1024px, tablet 768px, mobile 390px | Entries with `value`, `label`, `width`, and optional `icon`. Widths are CSS pixels. |
|
|
164
|
+
| `defaultDevice` | `mobile` | Initial selection; an unknown value falls back to the first device. |
|
|
165
|
+
| `v-model:device` | Uncontrolled | Read or control the selected device value. |
|
|
166
|
+
| `height` | `540` | Iframe height in CSS pixels. |
|
|
167
|
+
| `reloadKey` | Unset | Change this to reload the embedded page, for example after a theme change. |
|
|
168
|
+
|
|
169
|
+
The frame scrolls horizontally when the chosen viewport is wider than its
|
|
170
|
+
container. Changing devices preserves the embedded page's state; changing
|
|
171
|
+
`reloadKey` remounts it. The example page controls its own theme and providers.
|
|
172
|
+
An empty `devices` array uses the default devices.
|
|
173
|
+
|
|
174
|
+
`toolbar-start` and `toolbar-end` accept additional toolbar content and receive
|
|
175
|
+
`{ device }`. The `toolbar` slot replaces the entire toolbar and receives
|
|
176
|
+
`{ device, devices, selectDevice }`. Custom device entries can use the exported
|
|
177
|
+
`SelarasDocsViewportDevice` type from `@sewadah/selaras-docs`.
|
package/app/assets/style.css
CHANGED
|
@@ -156,6 +156,7 @@
|
|
|
156
156
|
position: relative;
|
|
157
157
|
width: min(100%, 90rem);
|
|
158
158
|
margin-inline: auto;
|
|
159
|
+
isolation: isolate;
|
|
159
160
|
}
|
|
160
161
|
|
|
161
162
|
.selaras-docs-footer--fluid {
|
|
@@ -164,11 +165,13 @@
|
|
|
164
165
|
|
|
165
166
|
.selaras-docs-footer::before {
|
|
166
167
|
position: absolute;
|
|
168
|
+
z-index: -1;
|
|
169
|
+
inset-block: 0;
|
|
167
170
|
inset-inline-start: 50%;
|
|
168
|
-
top: 0;
|
|
169
171
|
width: 100vw;
|
|
170
172
|
transform: translateX(-50%);
|
|
171
|
-
border-top: 1px solid var(--selaras-resolved-border-default);
|
|
173
|
+
border-top: 1px solid color-mix(in oklab, var(--selaras-resolved-border-default) 72%, transparent);
|
|
174
|
+
background: color-mix(in oklab, var(--selaras-resolved-surface-canvas) 34%, var(--selaras-resolved-surface-default));
|
|
172
175
|
content: '';
|
|
173
176
|
pointer-events: none;
|
|
174
177
|
}
|
|
@@ -181,7 +184,8 @@
|
|
|
181
184
|
align-items: center;
|
|
182
185
|
justify-content: space-between;
|
|
183
186
|
gap: 1rem;
|
|
184
|
-
min-height: 5rem;
|
|
187
|
+
min-height: 4.5rem;
|
|
188
|
+
padding-block: 0.875rem;
|
|
185
189
|
}
|
|
186
190
|
|
|
187
191
|
.selaras-docs-footer-text {
|
|
@@ -193,21 +197,37 @@
|
|
|
193
197
|
.selaras-docs-footer-links {
|
|
194
198
|
display: flex;
|
|
195
199
|
flex-wrap: wrap;
|
|
196
|
-
|
|
200
|
+
align-items: center;
|
|
201
|
+
gap: 0.375rem;
|
|
197
202
|
}
|
|
198
203
|
|
|
199
204
|
.selaras-docs-footer-links a {
|
|
200
205
|
display: inline-flex;
|
|
206
|
+
min-height: 2.25rem;
|
|
207
|
+
padding: 0.5rem 0.75rem;
|
|
201
208
|
align-items: center;
|
|
202
209
|
gap: 0.375rem;
|
|
203
210
|
color: var(--selaras-resolved-text-muted);
|
|
204
211
|
font-size: 0.875rem;
|
|
205
212
|
text-decoration: none;
|
|
213
|
+
border-radius: var(--selaras-resolved-radius-md);
|
|
214
|
+
transition: color 150ms ease, background-color 150ms ease;
|
|
206
215
|
}
|
|
207
216
|
|
|
208
217
|
.selaras-docs-footer-links a:hover {
|
|
209
218
|
color: var(--selaras-resolved-text-default);
|
|
210
|
-
|
|
219
|
+
background: var(--selaras-resolved-surface-elevated);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.selaras-docs-footer-links a:focus-visible {
|
|
223
|
+
outline: 2px solid var(--selaras-resolved-color-primary-fill);
|
|
224
|
+
outline-offset: 2px;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
@media (prefers-reduced-motion: reduce) {
|
|
228
|
+
.selaras-docs-footer-links a {
|
|
229
|
+
transition: none;
|
|
230
|
+
}
|
|
211
231
|
}
|
|
212
232
|
|
|
213
233
|
@media (min-width: 64rem) {
|
|
@@ -245,8 +265,9 @@
|
|
|
245
265
|
align-items: flex-start;
|
|
246
266
|
flex-direction: column;
|
|
247
267
|
justify-content: center;
|
|
248
|
-
|
|
249
|
-
padding-
|
|
268
|
+
gap: 0.5rem;
|
|
269
|
+
padding-top: 1.25rem;
|
|
270
|
+
padding-bottom: 1.25rem;
|
|
250
271
|
}
|
|
251
272
|
}
|
|
252
273
|
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelarasDocsViewportDevice } from '../../../types'
|
|
3
|
+
|
|
4
|
+
const props = withDefaults(defineProps<{
|
|
5
|
+
src: string
|
|
6
|
+
title?: string
|
|
7
|
+
devices?: readonly SelarasDocsViewportDevice[]
|
|
8
|
+
defaultDevice?: string
|
|
9
|
+
height?: number
|
|
10
|
+
reloadKey?: string | number
|
|
11
|
+
}>(), {
|
|
12
|
+
title: 'Responsive example',
|
|
13
|
+
defaultDevice: 'mobile',
|
|
14
|
+
height: 540,
|
|
15
|
+
})
|
|
16
|
+
const selected = defineModel<string>('device')
|
|
17
|
+
const defaultDevices: readonly SelarasDocsViewportDevice[] = [
|
|
18
|
+
{ value: 'desktop', label: 'Desktop', icon: 'hugeicons:computer', width: 1024 },
|
|
19
|
+
{ value: 'tablet', label: 'Tablet', icon: 'hugeicons:tablet-01', width: 768 },
|
|
20
|
+
{ value: 'mobile', label: 'Mobile', icon: 'hugeicons:smart-phone-01', width: 390 },
|
|
21
|
+
]
|
|
22
|
+
const devices = computed(() => props.devices?.length ? props.devices : defaultDevices)
|
|
23
|
+
const device = computed(() => devices.value.find(device => device.value === (selected.value ?? props.defaultDevice)) ?? devices.value[0]!)
|
|
24
|
+
function selectDevice(value: string) {
|
|
25
|
+
selected.value = value
|
|
26
|
+
}
|
|
27
|
+
const assetUrl = useDocsAssetUrl()
|
|
28
|
+
const previewUrl = computed(() => assetUrl(props.src))
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<section class="not-prose min-w-0" :aria-label="title">
|
|
33
|
+
<slot name="toolbar" :device="device" :devices="devices" :select-device="selectDevice">
|
|
34
|
+
<div class="mb-3 flex flex-wrap items-center justify-between gap-3">
|
|
35
|
+
<slot name="toolbar-start" :device="device">
|
|
36
|
+
<p class="text-sm text-[var(--selaras-resolved-text-muted)]" aria-live="polite">
|
|
37
|
+
{{ device.label }} ยท {{ device.width }}px
|
|
38
|
+
</p>
|
|
39
|
+
</slot>
|
|
40
|
+
<div class="flex items-center gap-2">
|
|
41
|
+
<div class="inline-flex gap-1 rounded-[var(--selaras-resolved-radius-md)] border border-[var(--selaras-resolved-border-default)] p-1" role="group" aria-label="Preview viewport">
|
|
42
|
+
<SButton
|
|
43
|
+
v-for="option in devices" :key="option.value"
|
|
44
|
+
:icon="option.icon" :aria-label="option.label" :aria-pressed="device.value === option.value"
|
|
45
|
+
:variant="device.value === option.value ? 'solid' : 'ghost'"
|
|
46
|
+
:color="device.value === option.value ? 'primary' : 'neutral'"
|
|
47
|
+
size="sm" :square="!!option.icon" @click="selectDevice(option.value)"
|
|
48
|
+
>
|
|
49
|
+
<template v-if="!option.icon">
|
|
50
|
+
{{ option.label }}
|
|
51
|
+
</template>
|
|
52
|
+
</SButton>
|
|
53
|
+
</div>
|
|
54
|
+
<slot name="toolbar-end" :device="device" />
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</slot>
|
|
58
|
+
<div class="overflow-x-auto rounded-[var(--selaras-resolved-radius-md)] border border-[var(--selaras-resolved-border-default)] bg-[var(--selaras-resolved-surface-elevated)] p-3 sm:p-4">
|
|
59
|
+
<iframe
|
|
60
|
+
:key="reloadKey" :src="previewUrl"
|
|
61
|
+
:title="`${title} โ ${device.label}`"
|
|
62
|
+
:style="{ width: `${device.width}px`, height: `${height}px`, boxSizing: 'content-box' }"
|
|
63
|
+
class="mx-auto block max-w-none rounded-[var(--selaras-resolved-radius-md)] border border-[var(--selaras-resolved-border-default)] bg-[var(--selaras-resolved-surface-default)]"
|
|
64
|
+
/>
|
|
65
|
+
</div>
|
|
66
|
+
</section>
|
|
67
|
+
</template>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sewadah/selaras-docs",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"description": "Nuxt Content documentation layer for Selaras",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@nuxt/content": "^3.16.0",
|
|
35
35
|
"@nuxt/kit": "^4.5.2",
|
|
36
|
-
"@sewadah/selaras": "^0.
|
|
36
|
+
"@sewadah/selaras": "^0.4.0",
|
|
37
37
|
"tailwindcss": "^4.3.0"
|
|
38
38
|
}
|
|
39
39
|
}
|
package/types.d.ts
CHANGED
|
@@ -128,3 +128,11 @@ declare module 'nuxt/schema' {
|
|
|
128
128
|
selarasDocs: SelarasDocsModuleOptions
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
+
|
|
132
|
+
/** A viewport offered by DocsViewportPreview. Width is measured in CSS pixels. */
|
|
133
|
+
export interface SelarasDocsViewportDevice {
|
|
134
|
+
value: string
|
|
135
|
+
label: string
|
|
136
|
+
width: number
|
|
137
|
+
icon?: string
|
|
138
|
+
}
|