@sewadah/selaras-docs 1.0.0 → 1.1.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 +152 -0
- package/README.md +51 -2
- package/app/app.config.ts +20 -1
- package/app/app.vue +13 -0
- package/app/assets/style.css +136 -9
- package/app/components/DocsFooter.vue +3 -4
- package/app/components/DocsFooterBrand.vue +10 -0
- package/app/components/DocsHeader.vue +25 -24
- package/app/components/DocsHeaderBrand.vue +11 -0
- package/app/components/DocsLogo.vue +19 -0
- package/app/components/DocsSearchButton.vue +5 -3
- package/app/components/DocsSidebar.vue +4 -1
- package/app/composables/useDocsLogo.ts +30 -0
- package/app/composables/useDocsNavigation.ts +51 -2
- package/app/layouts/selaras-docs.vue +16 -2
- package/app/pages/[...slug].vue +15 -4
- package/content.config.ts +33 -4
- package/nuxt.config.mjs +10 -0
- package/package.json +8 -2
- package/types.d.ts +38 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## v1.1.0
|
|
4
|
+
|
|
5
|
+
[compare changes](https://github.com/sewadahapp/selaras/compare/selaras-docs-v1.0.1...selaras-docs-v1.1.0)
|
|
6
|
+
|
|
7
|
+
### 🚀 Enhancements
|
|
8
|
+
|
|
9
|
+
- **feat(color-mode-switch):** add switch for light and dark modes ([0fea5d4](https://github.com/sewadahapp/selaras/commit/0fea5d4cfcdd1be2fcdad10241d0e5dabbaf720a))
|
|
10
|
+
- **feat(button):** add subtle variant and underline links on hover ([62e77b3](https://github.com/sewadahapp/selaras/commit/62e77b312a6a32c53cab0127006fd27305658f37))
|
|
11
|
+
- **feat:** add confirm service and refine component behavior ([f3cf73b](https://github.com/sewadahapp/selaras/commit/f3cf73b9f492f7cb8ed44a4ded4c26ec6b165e19))
|
|
12
|
+
- **feat(select):** support object options as values ([be2ae38](https://github.com/sewadahapp/selaras/commit/be2ae38485110f2fa1e6cfdfc2e12eecf69885e4))
|
|
13
|
+
- **feat(code-group):** add Bun package manager icon ([4d8c927](https://github.com/sewadahapp/selaras/commit/4d8c927d4a2f8058d0a1a6a61e2996609bf4550a))
|
|
14
|
+
- **feat(docs):** redesign theme picker ([22cc5f2](https://github.com/sewadahapp/selaras/commit/22cc5f229eba4aae0dc65a7104d0d6d26a74a42d))
|
|
15
|
+
|
|
16
|
+
### 🩹 Fixes
|
|
17
|
+
|
|
18
|
+
- **fix(ci):** allow headroom in packed consumer CSS budgets ([d1bd54a](https://github.com/sewadahapp/selaras/commit/d1bd54adb2247945e9ec05477fa6b944ac4a1a41))
|
|
19
|
+
- **fix(button):** strengthen text variant hover colors ([586d38c](https://github.com/sewadahapp/selaras/commit/586d38c570b7e19ff5cd5f167319a2cd098d26ff))
|
|
20
|
+
- **fix(docs):** remove default footer attribution ([5cd46ba](https://github.com/sewadahapp/selaras/commit/5cd46ba3a538ccbe37ef12177fcf49babce459b3))
|
|
21
|
+
- **fix(theme):** allow chip variant conditions ([2ecefb0](https://github.com/sewadahapp/selaras/commit/2ecefb0425083d08cea9447d212278291407f7c3))
|
|
22
|
+
- **fix(degung):** join grouped buttons back into one segmented pill ([ca3a14e](https://github.com/sewadahapp/selaras/commit/ca3a14e0a8a7c1083b2f1da2bc904aae133cbdf2))
|
|
23
|
+
- **fix(degung):** taper each display rim before its own corner ([4e025fe](https://github.com/sewadahapp/selaras/commit/4e025feb87f70c0f8e66c555ebe08aa7b53b05c6))
|
|
24
|
+
- **fix(degung):** use a fixed-pixel display rim inset instead of a percentage ([ac6567d](https://github.com/sewadahapp/selaras/commit/ac6567dd1d042686ec3cf432a09e9a87397c61b9))
|
|
25
|
+
- **fix(degung):** apply the display look to every accordion, flatten nested groups ([38b8d20](https://github.com/sewadahapp/selaras/commit/38b8d2058478ac80e58d724d8b6a886860416e14))
|
|
26
|
+
- **fix(degung):** collapse the rail's leftover gutter on nested nav rows ([e138ce8](https://github.com/sewadahapp/selaras/commit/e138ce80f178cefe5470340f63a16df249a8c3e3))
|
|
27
|
+
- **fix(degung):** tone down the display text glow for readability ([a65a32a](https://github.com/sewadahapp/selaras/commit/a65a32a038e93bc0ace34d4d19daf2ef23eda9d9))
|
|
28
|
+
- **fix(degung):** drop the tree-connector rail and readable nav hover ([f712787](https://github.com/sewadahapp/selaras/commit/f71278758a3a686229f589dac0de9242d0fc259a))
|
|
29
|
+
- **fix(toast):** carry a card's full background into its stacked cover ([d7c7562](https://github.com/sewadahapp/selaras/commit/d7c7562e6a3f32bbec646eaafbdc51c40c0df9e7))
|
|
30
|
+
|
|
31
|
+
### 📖 Documentation
|
|
32
|
+
|
|
33
|
+
- **docs(degung):** restyle the preset as rounded glossy hardware ([9be8a84](https://github.com/sewadahapp/selaras/commit/9be8a84cdd37706a982a05c80c093cf3636ecbc1))
|
|
34
|
+
|
|
35
|
+
### 🤖 Other changes
|
|
36
|
+
|
|
37
|
+
- **chore(test):** restore default worker parallelism ([e4b7f59](https://github.com/sewadahapp/selaras/commit/e4b7f59a6628a0de1567a5ef61e5e29870394d17))
|
|
38
|
+
- **chore(scripts):** run docs template from docs dev ([f743ad4](https://github.com/sewadahapp/selaras/commit/f743ad4e99bcdeff581c18f287cb3dc3729b03b5))
|
|
39
|
+
- **chore(dev):** add Nix shell and limit test workers ([055c03d](https://github.com/sewadahapp/selaras/commit/055c03dcbbe7b6b5fab37210c59b36f03c1a6580))
|
|
40
|
+
- **style(docs):** refine footer and display finish ([31a9dae](https://github.com/sewadahapp/selaras/commit/31a9dae7d7fa23a22d6dbad1e19d5d0616552453))
|
|
41
|
+
- **style(docs):** refine footer content and alignment ([d29b947](https://github.com/sewadahapp/selaras/commit/d29b9479a86caca36c39d1d66d1580257f74b184))
|
|
42
|
+
- **style(degung):** brighten, lengthen and thin the display rim highlight ([413cad5](https://github.com/sewadahapp/selaras/commit/413cad5fae769b5338f45b0c9537f65bc17aa9ab))
|
|
43
|
+
- **style(degung):** enlarge the slider thumb, inset the display rim from the edge ([7530118](https://github.com/sewadahapp/selaras/commit/75301182347d14d16d5b2d7aa1ad7e4381e94465))
|
|
44
|
+
- **style(degung):** tighten the display rim to a hairline ([ed8d531](https://github.com/sewadahapp/selaras/commit/ed8d53190907fa630aff7c2db26eb1333b47702f))
|
|
45
|
+
- **style(degung):** widen the slider thumb, tuck the display rim to all four edges ([8d51891](https://github.com/sewadahapp/selaras/commit/8d51891c41a5323b0713d50568b88fef281e886b))
|
|
46
|
+
- **style(degung):** twin-edge display highlight, chrome pill slider thumb ([c385bb9](https://github.com/sewadahapp/selaras/commit/c385bb948194bfd04f0c3aca3d34e1b9eb7ae911))
|
|
47
|
+
- **style(degung):** add display glow, screen highlight and selection color ([5a2897e](https://github.com/sewadahapp/selaras/commit/5a2897e627f90acf134f4bfc07f35d8bb4365a58))
|
|
48
|
+
|
|
49
|
+
Published against `@sewadah/selaras` ^0.3.2.
|
|
50
|
+
|
|
51
|
+
## v1.0.1
|
|
52
|
+
|
|
53
|
+
[compare changes](https://github.com/sewadahapp/selaras/compare/selaras-docs-v1.0.0...selaras-docs-v1.0.1)
|
|
54
|
+
|
|
55
|
+
### 🚀 Enhancements
|
|
56
|
+
|
|
57
|
+
- **feat(docs):** add Degung theme preset ([9af1f54](https://github.com/sewadahapp/selaras/commit/9af1f54af58d18bd9305ddf944243052bda9a022))
|
|
58
|
+
- **feat(docs):** tint logo with active theme color ([102f525](https://github.com/sewadahapp/selaras/commit/102f5254a553e5c646357307c685816a2147bcf7))
|
|
59
|
+
- **feat(docs):** add Pelog and Slendro theme presets ([90dfe04](https://github.com/sewadahapp/selaras/commit/90dfe04f247ad032cd3f6ef03fca662c46d9f936))
|
|
60
|
+
- **feat:** refine code tree viewer ([ef27831](https://github.com/sewadahapp/selaras/commit/ef2783151a5814abf9ca8711a386e303c1c9ab93))
|
|
61
|
+
- **feat(docs):** add app and navigation config ([9d71ef6](https://github.com/sewadahapp/selaras/commit/9d71ef61209dfb6f3c844a06d62660040cc51a7a))
|
|
62
|
+
- **feat(table):** support hierarchical tree rows ([fee43bb](https://github.com/sewadahapp/selaras/commit/fee43bb3da59299529a89fca97627a233ae54489))
|
|
63
|
+
- **feat(table):** move column filters to popovers ([12d2e88](https://github.com/sewadahapp/selaras/commit/12d2e88bf97776f85257968d3c6bd5c256f887ff))
|
|
64
|
+
- **feat(table):** make column sorting opt-in ([0cd56fb](https://github.com/sewadahapp/selaras/commit/0cd56fb0b6ce5127adf2cb71e2f9180361e5af48))
|
|
65
|
+
- **feat(table):** add row hover and click selection ([2dd2a7c](https://github.com/sewadahapp/selaras/commit/2dd2a7cf62ea1f40b575ecc7534cb9ac11b8dada))
|
|
66
|
+
- **feat(dropdown):** add adaptive mobile mode ([6403583](https://github.com/sewadahapp/selaras/commit/640358314fb706ee0a3eb59ebb6ca8de48a244eb))
|
|
67
|
+
- **feat(timeline):** add timeline component ([92438fe](https://github.com/sewadahapp/selaras/commit/92438fe10284ce9cdb7467b277f01d89fc904d28))
|
|
68
|
+
- **feat:** add keyboard shortcuts to menu items ([748a869](https://github.com/sewadahapp/selaras/commit/748a8696c124d7423c52696af4f85e483c484bcc))
|
|
69
|
+
- **feat(toast):** add positioning and stack controls ([9ff6a45](https://github.com/sewadahapp/selaras/commit/9ff6a45b78a47a857cbdfe4ebba19d50799e5aa7))
|
|
70
|
+
- **feat(code-group):** show icons in tabs ([be3f024](https://github.com/sewadahapp/selaras/commit/be3f024557ec4422ece61b685920230b67c6f14b))
|
|
71
|
+
- **feat(docs):** add temporary logo ([18bf96f](https://github.com/sewadahapp/selaras/commit/18bf96f8b78630413d27694719f54bd71dd7063c))
|
|
72
|
+
- **feat(docs):** place header navigation beside the brand ([cdf95ef](https://github.com/sewadahapp/selaras/commit/cdf95ef5afcff595cc70fa5b268d661d2cde713a))
|
|
73
|
+
- **feat(docs):** add brand override points and a favicon option ([78a1ac7](https://github.com/sewadahapp/selaras/commit/78a1ac72b4a95056aea1835c4a4cea2acf035b98))
|
|
74
|
+
- **feat(directives):** add v-mask input masking ([bf93ddc](https://github.com/sewadahapp/selaras/commit/bf93ddc40c99f94420f212a4b4e6a564a7fed039))
|
|
75
|
+
- **feat(overlay):** expose arrow and positioning controls ([7a89248](https://github.com/sewadahapp/selaras/commit/7a892487dd295754f1c662ca38fae874e39b9d77))
|
|
76
|
+
- **feat(overlay):** support configurable arrows ([2606363](https://github.com/sewadahapp/selaras/commit/2606363651be8ca712da9e821f648c1146de22c8))
|
|
77
|
+
- **feat(form-field):** add floating labels and grouped examples ([d5f8c9c](https://github.com/sewadahapp/selaras/commit/d5f8c9cce09348b675bdb8236ee38a75fe14f835))
|
|
78
|
+
- **feat(calendar):** add composable schedule examples ([fc85fd0](https://github.com/sewadahapp/selaras/commit/fc85fd0393f8e3254f5737a769a99a9fa5aa3b5b))
|
|
79
|
+
- **feat(theme):** use white text for light intent fills ([f382884](https://github.com/sewadahapp/selaras/commit/f382884f7d07817e9794e12cd0a6b98440959e13))
|
|
80
|
+
- **feat(tabs):** add scrolling, vertical layout, and panel retention ([5b86c32](https://github.com/sewadahapp/selaras/commit/5b86c32b82b5464079a15348d159c755ba70c815))
|
|
81
|
+
- **feat(docs):** add default powered by footer ([5a9b881](https://github.com/sewadahapp/selaras/commit/5a9b881d07195a4403f3ea1def943d666bd6dcd2))
|
|
82
|
+
- **feat(release):** ship a changelog with the docs layer ([8fe893c](https://github.com/sewadahapp/selaras/commit/8fe893c5ca44334e34107e05e761e10eaa3938bd))
|
|
83
|
+
|
|
84
|
+
### 🩹 Fixes
|
|
85
|
+
|
|
86
|
+
- **fix(docs):** enable default page navigation ([cf07fbb](https://github.com/sewadahapp/selaras/commit/cf07fbb8fc9fa719861d528c366df3e4b1956ff1))
|
|
87
|
+
- **fix(toast):** layer toasts into a scaled stack with enter and exit motion ([9e0f922](https://github.com/sewadahapp/selaras/commit/9e0f922d79a1e24526ae357c53ef39d42d7ce75d))
|
|
88
|
+
- **fix(code-tree):** follow scoped light and dark themes for syntax colors ([a98c8fb](https://github.com/sewadahapp/selaras/commit/a98c8fb4d8be3c703838f8e552f80d6864f60c4d))
|
|
89
|
+
- **fix(dropdown,timeline):** route new layout classes through the theme and class prefix ([08c65d6](https://github.com/sewadahapp/selaras/commit/08c65d6e4aa48034f5380c1c4978f8c6235d9228))
|
|
90
|
+
- **fix(dropdown):** keep adaptive trigger aria in sync after a resize ([15d1a59](https://github.com/sewadahapp/selaras/commit/15d1a5974f5decbf54993eff900236e59b76cdd8))
|
|
91
|
+
- **fix(table):** limit row hover to body rows ([16762ec](https://github.com/sewadahapp/selaras/commit/16762eccebb19fc407bbe485b4e15319352b72c9))
|
|
92
|
+
- **fix(navigation-menu):** bind item hotkeys page-wide like other menus ([5bbc6d5](https://github.com/sewadahapp/selaras/commit/5bbc6d5c7873d63a404c28d46ed2ca0c519be491))
|
|
93
|
+
- **fix(hotkey):** match shifted symbols and option chords ([b7a5acb](https://github.com/sewadahapp/selaras/commit/b7a5acb4524b808621602d875cc07f30857c9a9d))
|
|
94
|
+
- **fix(menus):** keep shortcut hints inside item slots ([bcffe01](https://github.com/sewadahapp/selaras/commit/bcffe01d1468fa0e9d9f05f337cab60a1ac862c7))
|
|
95
|
+
- **fix(dropdown):** keep disabled mobile link items inert ([c0a5c86](https://github.com/sewadahapp/selaras/commit/c0a5c86e19da37f9a3343836c0e33ae8acdaf377))
|
|
96
|
+
- **fix(code-tree):** ignore highlights for a file no longer selected ([40136c2](https://github.com/sewadahapp/selaras/commit/40136c2645431e8abdfaf96096e643c0712ebe88))
|
|
97
|
+
- **fix(toast):** make stacking the documented default ([0ae4f40](https://github.com/sewadahapp/selaras/commit/0ae4f40adf7dce709acda188ac8c516cbe3b1c74))
|
|
98
|
+
- **fix(docs):** theme native scrollbars ([5903f0f](https://github.com/sewadahapp/selaras/commit/5903f0f5eb6968b90b7acd5bb84b18ab8539c8a7))
|
|
99
|
+
- **fix(docs):** show navigation menu flyouts ([9330c39](https://github.com/sewadahapp/selaras/commit/9330c3983c5da84999e70ec4642f862b0e1905af))
|
|
100
|
+
- **fix(docs):** hide the search shortcut hint on small screens ([ec811bd](https://github.com/sewadahapp/selaras/commit/ec811bdda58027271ca573c0b0424ca9964b6f1c))
|
|
101
|
+
- **fix(calendar):** key weekday headers by index ([94943d6](https://github.com/sewadahapp/selaras/commit/94943d62ed23a1183459d885a00e418e7ac3ae0f))
|
|
102
|
+
- **fix(tabs):** scroll a controlled tab into view once ([80aaeae](https://github.com/sewadahapp/selaras/commit/80aaeae41f1dd698d4c18a8eb89ceb446f70a957))
|
|
103
|
+
- **fix(autocomplete):** select after home/end navigation ([12259f4](https://github.com/sewadahapp/selaras/commit/12259f45777d9b81c9173ac12d610c1f7c7a34ad))
|
|
104
|
+
- **fix(toast):** skip toasts added during server render ([8995cb4](https://github.com/sewadahapp/selaras/commit/8995cb47ffbcc7a8db6a084d4846241a605ca6e6))
|
|
105
|
+
- **fix(date-picker):** skip form submission while disabled ([9330b38](https://github.com/sewadahapp/selaras/commit/9330b385516a1eb5d5bfbd2d0050fa0159ae224f))
|
|
106
|
+
- **fix(color-picker):** keep one trigger mounted and respect form state ([2f7bd82](https://github.com/sewadahapp/selaras/commit/2f7bd828fc5a2fb52ef9debac569436c48098fc2))
|
|
107
|
+
- **fix(directives):** rewrite v-mask without a third-party dependency ([9d91636](https://github.com/sewadahapp/selaras/commit/9d916365673192190dafafed529f16662bfeb169))
|
|
108
|
+
- **fix(autocomplete):** improve multiple selection behavior ([66c8a86](https://github.com/sewadahapp/selaras/commit/66c8a86d03f05b87a59fc6fafe583ce4ad6fb68f))
|
|
109
|
+
- **fix(color-picker):** align popover to trigger start ([28c39a3](https://github.com/sewadahapp/selaras/commit/28c39a3381e9c82401422df41717e5ec5e889c81))
|
|
110
|
+
- **fix(calendar):** keep default grid compact ([4962470](https://github.com/sewadahapp/selaras/commit/4962470e46f40314d77b76e01cddc14234ffe74f))
|
|
111
|
+
- **fix(docs):** keep centered header sticky ([0bf8504](https://github.com/sewadahapp/selaras/commit/0bf8504baec22426273b49a78376244cb2d72452))
|
|
112
|
+
- **fix(docs):** preserve full width rules and layer hmr ([94ec893](https://github.com/sewadahapp/selaras/commit/94ec89321f9205ccb4a77bcc63116a3d51db4e8a))
|
|
113
|
+
|
|
114
|
+
### 📖 Documentation
|
|
115
|
+
|
|
116
|
+
- **docs(toast):** add a live position example ([8b2cc7d](https://github.com/sewadahapp/selaras/commit/8b2cc7d0a9f2e7b774b99e78de28b7039813aea7))
|
|
117
|
+
- **docs:** add a landing page with a live theming demo ([3d456c7](https://github.com/sewadahapp/selaras/commit/3d456c7eaa932e4d7fd7f5feff4795e720b63559))
|
|
118
|
+
- **docs:** add the selaras logo and favicon ([7bd2e9f](https://github.com/sewadahapp/selaras/commit/7bd2e9fe9b368cfe0ab7f10023d86b05ee8bd66c))
|
|
119
|
+
- **docs(directives):** drop plain Vue usage notes ([b6b514e](https://github.com/sewadahapp/selaras/commit/b6b514e7838e7772a9629e6ade52e11bd9928053))
|
|
120
|
+
- **docs:** highlight theme source snippets ([de7519c](https://github.com/sewadahapp/selaras/commit/de7519c42f31778abe1282f2345c2f2c9a15ce19))
|
|
121
|
+
- **docs:** clarify square button example ([349ea36](https://github.com/sewadahapp/selaras/commit/349ea36d546da40121606f054f884aa8fed9d25a))
|
|
122
|
+
- **docs:** rename blocks group to composites ([e14a727](https://github.com/sewadahapp/selaras/commit/e14a727ace5ff2a73d607f2098679612f699d468))
|
|
123
|
+
|
|
124
|
+
### 🤖 Other changes
|
|
125
|
+
|
|
126
|
+
- **test:** align packed checks with component defaults ([75c3eb9](https://github.com/sewadahapp/selaras/commit/75c3eb9beff0d45bacbc2af5402002679ddb938b))
|
|
127
|
+
- **test(docs):** align packed consumer content schema ([818cce7](https://github.com/sewadahapp/selaras/commit/818cce7f38d8ae0b5a22dadefe771dbd74a78edf))
|
|
128
|
+
- **test(compat):** allow unprefixed CSS size variance ([f55d537](https://github.com/sewadahapp/selaras/commit/f55d537a866ee75cab8641635307ca447cbe454f))
|
|
129
|
+
- **ci(docs):** add standalone pages deployment ([f322dcb](https://github.com/sewadahapp/selaras/commit/f322dcb1140023ce8a699ee5c2a91637ed5db439))
|
|
130
|
+
- **test(compat):** align packed CSS budgets ([cdced95](https://github.com/sewadahapp/selaras/commit/cdced95b46a92f5b5fd299839734b8b25c53eeb2))
|
|
131
|
+
- **test(css):** raise the prefixed stylesheet budget ([d501562](https://github.com/sewadahapp/selaras/commit/d50156269478e9bf13b60cb586f9fe7dd15ceab3))
|
|
132
|
+
- **style:** fix lint errors from recent changes ([9e7054c](https://github.com/sewadahapp/selaras/commit/9e7054cb0d9d8d13da63bca5b012ac0ed00e1130))
|
|
133
|
+
- **style(toast):** refine semantic toast styling ([dd879f6](https://github.com/sewadahapp/selaras/commit/dd879f69be398ad314b5012bee70fe3ccd6eb3b4))
|
|
134
|
+
- **style(docs):** refine dark modal scrim and docs header ([5cd1e22](https://github.com/sewadahapp/selaras/commit/5cd1e2269d8b0d3325afde39e74954273a5ae7a7))
|
|
135
|
+
- **ci:** use npm trusted publishing ([e5f3dd7](https://github.com/sewadahapp/selaras/commit/e5f3dd7bb4c726ff708363d2b2c75defb6918caf))
|
|
136
|
+
- **style(callout):** match alert surface ([0269454](https://github.com/sewadahapp/selaras/commit/0269454b6a2c9372b2e3b55ec015b7ecf436dc7e))
|
|
137
|
+
- **style(docs):** enlarge the brand name and search button ([e49a97d](https://github.com/sewadahapp/selaras/commit/e49a97d42ddb7e30d1bfeedc511caa77292a7da7))
|
|
138
|
+
- **test(form-library):** scope the date cell click to the picker ([4644ae6](https://github.com/sewadahapp/selaras/commit/4644ae699fe6c803e725278f63921f61638bf5b2))
|
|
139
|
+
- **test(compat):** fix packed consumer checks ([7e9d501](https://github.com/sewadahapp/selaras/commit/7e9d501ebc8902f6a362fad631ef30bfd33dcdab))
|
|
140
|
+
- **test(css):** update prefixed stylesheet budget ([122133f](https://github.com/sewadahapp/selaras/commit/122133f0759e0147380c38ba6cd636c84c0051f2))
|
|
141
|
+
- **style(docs):** remove sidebar border ([864d33c](https://github.com/sewadahapp/selaras/commit/864d33cfb6564b3b4521bead9b24320d874b9d68))
|
|
142
|
+
- **style(tabs):** refine pill variant ([09b9ee6](https://github.com/sewadahapp/selaras/commit/09b9ee600f3b5f053774e400d0c9aaea5a5fed7b))
|
|
143
|
+
- **style(docs):** constrain header and footer shells ([723afe6](https://github.com/sewadahapp/selaras/commit/723afe6b1dc90da72cff5a403a18d4c4c7a3958a))
|
|
144
|
+
- **style(docs):** center header and footer content ([3ec7f9c](https://github.com/sewadahapp/selaras/commit/3ec7f9cdd03975037e6658bbe96b9e01e5abc1e3))
|
|
145
|
+
|
|
146
|
+
Published against `@sewadah/selaras` ^0.3.1.
|
|
147
|
+
|
|
148
|
+
## v1.0.0
|
|
149
|
+
|
|
150
|
+
First tagged release of the documentation layer, published against `@sewadah/selaras` ^0.3.0.
|
|
151
|
+
|
|
152
|
+
The itemized history leading up to this release lives in the [core changelog](https://github.com/sewadahapp/selaras/blob/main/CHANGELOG.md) - every `docs:` and `docs-layer:` change shipped through the core release stream until the layer gained its own version.
|
package/README.md
CHANGED
|
@@ -47,12 +47,21 @@ export default defineAppConfig({
|
|
|
47
47
|
site: {
|
|
48
48
|
name: 'My project',
|
|
49
49
|
description: 'Documentation for my project.',
|
|
50
|
+
titleTemplate: '%s · My project',
|
|
51
|
+
url: 'https://example.com',
|
|
52
|
+
// Files in public/. Use one path, or separate light and dark images.
|
|
53
|
+
// `tint: true` colors a monochrome SVG with the active primary theme color.
|
|
54
|
+
logo: { light: '/logo.svg', dark: '/logo-dark.svg', tint: true },
|
|
55
|
+
favicon: '/favicon.svg',
|
|
50
56
|
},
|
|
51
57
|
repository: {
|
|
52
58
|
url: 'https://github.com/example/project',
|
|
53
59
|
editLinks: true,
|
|
54
60
|
},
|
|
55
61
|
header: {
|
|
62
|
+
search: true,
|
|
63
|
+
colorMode: true,
|
|
64
|
+
fluid: false,
|
|
56
65
|
links: [
|
|
57
66
|
{ label: 'Guide', to: '/guide/getting-started' },
|
|
58
67
|
{
|
|
@@ -64,12 +73,52 @@ export default defineAppConfig({
|
|
|
64
73
|
},
|
|
65
74
|
],
|
|
66
75
|
},
|
|
76
|
+
main: { fluid: false, padded: true },
|
|
77
|
+
sidebar: {
|
|
78
|
+
enabled: true,
|
|
79
|
+
collapsed: false,
|
|
80
|
+
exclude: ['/internal/draft'],
|
|
81
|
+
},
|
|
82
|
+
toc: { enabled: true, title: 'On this page' },
|
|
83
|
+
footer: { text: '© 2026 My project', fluid: false },
|
|
67
84
|
},
|
|
68
85
|
})
|
|
69
86
|
```
|
|
70
87
|
|
|
88
|
+
Folder navigation can be configured with a `.navigation.yml` file alongside
|
|
89
|
+
the Markdown pages in that folder:
|
|
90
|
+
|
|
91
|
+
```yaml
|
|
92
|
+
title: Getting started
|
|
93
|
+
icon: hugeicons:rocket
|
|
94
|
+
order: 1
|
|
95
|
+
collapse: false
|
|
96
|
+
navBadges:
|
|
97
|
+
- New
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Use `navigation: false` in a page's frontmatter to omit it from navigation, or
|
|
101
|
+
set `navigation` to an object to override its navigation `title`, `icon`,
|
|
102
|
+
`order`, and `navBadges`. Page frontmatter can also set `toc: false`,
|
|
103
|
+
`aside: false`, `editLink: false`, or `prevNext: false` to hide those parts of
|
|
104
|
+
the page shell. The sidebar also accepts an app-wide `collapsed` default; a
|
|
105
|
+
folder's `collapse` value takes precedence. `main.fluid` expands the
|
|
106
|
+
content width, `main.padded: false` removes its outer inset, and `header.fluid`
|
|
107
|
+
and `footer.fluid` allow those regions to span the viewport.
|
|
108
|
+
|
|
71
109
|
Create an application component with the same name as a layer component, such
|
|
72
|
-
as `components/DocsHeader.vue`, to replace that part of the shell.
|
|
73
|
-
|
|
110
|
+
as `components/DocsHeader.vue`, to replace that part of the shell. Smaller
|
|
111
|
+
pieces can be replaced on their own:
|
|
112
|
+
|
|
113
|
+
| Component | Controls | Default |
|
|
114
|
+
| --- | --- | --- |
|
|
115
|
+
| `DocsHeaderBrand` | The header's home link content | `site.logo` and the site name |
|
|
116
|
+
| `DocsFooterBrand` | The start of the footer | `footer.text` |
|
|
117
|
+
| `DocsLogo` | The logo image, used by `DocsHeaderBrand` | `site.logo`, switching light/dark; size it with `--selaras-docs-logo-height` |
|
|
118
|
+
|
|
119
|
+
For example, a `components/DocsFooterBrand.vue` containing `<DocsLogo />` adds
|
|
120
|
+
the logo to the footer while leaving the header as configured.
|
|
121
|
+
|
|
122
|
+
For a host that owns Tailwind compilation or uses a class prefix, set
|
|
74
123
|
`selarasDocs: { css: false }` in `nuxt.config.ts` and import Selaras and the
|
|
75
124
|
docs stylesheet from the host CSS entry.
|
package/app/app.config.ts
CHANGED
|
@@ -12,11 +12,30 @@ export default defineAppConfig({
|
|
|
12
12
|
showTitle: true,
|
|
13
13
|
search: true,
|
|
14
14
|
colorMode: true,
|
|
15
|
+
fluid: false,
|
|
16
|
+
},
|
|
17
|
+
main: {
|
|
18
|
+
fluid: false,
|
|
19
|
+
padded: true,
|
|
20
|
+
},
|
|
21
|
+
sidebar: {
|
|
22
|
+
enabled: true,
|
|
23
|
+
collapsed: false,
|
|
15
24
|
},
|
|
16
25
|
toc: {
|
|
17
26
|
enabled: true,
|
|
18
27
|
title: 'On this page',
|
|
19
28
|
},
|
|
20
|
-
footer: {
|
|
29
|
+
footer: {
|
|
30
|
+
fluid: false,
|
|
31
|
+
links: [
|
|
32
|
+
{
|
|
33
|
+
label: 'Powered by Selaras',
|
|
34
|
+
to: 'https://sewadahapp.github.io/selaras',
|
|
35
|
+
target: '_blank',
|
|
36
|
+
rel: 'noreferrer',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
21
40
|
},
|
|
22
41
|
})
|
package/app/app.vue
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const appConfig = useAppConfig()
|
|
3
|
+
const assetUrl = useDocsAssetUrl()
|
|
4
|
+
|
|
5
|
+
useHead(() => {
|
|
6
|
+
const favicon = assetUrl(appConfig.selarasDocs?.site?.favicon)
|
|
7
|
+
return {
|
|
8
|
+
link: favicon ? [{ rel: 'icon', href: favicon, type: favicon.endsWith('.svg') ? 'image/svg+xml' : undefined }] : [],
|
|
9
|
+
}
|
|
10
|
+
})
|
|
11
|
+
</script>
|
|
12
|
+
|
|
1
13
|
<template>
|
|
2
14
|
<SApp>
|
|
3
15
|
<NuxtLayout>
|
|
@@ -5,6 +17,7 @@
|
|
|
5
17
|
</NuxtLayout>
|
|
6
18
|
<ClientOnly>
|
|
7
19
|
<DocsSearch />
|
|
20
|
+
<SToast />
|
|
8
21
|
</ClientOnly>
|
|
9
22
|
</SApp>
|
|
10
23
|
</template>
|
package/app/assets/style.css
CHANGED
|
@@ -4,8 +4,19 @@
|
|
|
4
4
|
color: inherit;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
:root {
|
|
8
|
+
color-scheme: light;
|
|
9
|
+
background: var(--selaras-resolved-surface-canvas, var(--selaras-resolved-surface-default));
|
|
10
|
+
scrollbar-color: var(--selaras-resolved-border-default) var(--selaras-resolved-surface-canvas, var(--selaras-resolved-surface-default));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:root.dark {
|
|
14
|
+
color-scheme: dark;
|
|
15
|
+
}
|
|
16
|
+
|
|
7
17
|
.selaras-docs-root {
|
|
8
18
|
background: var(--selaras-resolved-surface-canvas, var(--selaras-resolved-surface-default));
|
|
19
|
+
scrollbar-color: var(--selaras-resolved-border-default) var(--selaras-resolved-surface-canvas, var(--selaras-resolved-surface-default));
|
|
9
20
|
}
|
|
10
21
|
|
|
11
22
|
.selaras-docs-skip-link {
|
|
@@ -27,6 +38,49 @@
|
|
|
27
38
|
outline-offset: 2px;
|
|
28
39
|
}
|
|
29
40
|
|
|
41
|
+
/* Match the main documentation shell's centered width. */
|
|
42
|
+
.selaras-docs-header {
|
|
43
|
+
position: sticky;
|
|
44
|
+
z-index: 20;
|
|
45
|
+
top: 0;
|
|
46
|
+
width: 100%;
|
|
47
|
+
background: var(--selaras-resolved-surface-canvas, var(--selaras-resolved-surface-default));
|
|
48
|
+
border-bottom: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.selaras-docs-header-inner {
|
|
52
|
+
box-sizing: border-box;
|
|
53
|
+
width: min(100%, 90rem);
|
|
54
|
+
min-width: 0;
|
|
55
|
+
height: 100%;
|
|
56
|
+
margin-inline: auto;
|
|
57
|
+
padding-inline: 1.5rem;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.selaras-docs-header-inner--fluid {
|
|
61
|
+
width: 100%;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.selaras-docs-header-actions {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex: none;
|
|
67
|
+
align-items: center;
|
|
68
|
+
gap: 0.5rem;
|
|
69
|
+
margin-inline-start: auto;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.selaras-docs-header::after {
|
|
73
|
+
position: absolute;
|
|
74
|
+
z-index: 1;
|
|
75
|
+
inset-inline-start: 50%;
|
|
76
|
+
bottom: 0;
|
|
77
|
+
width: 100vw;
|
|
78
|
+
transform: translateX(-50%);
|
|
79
|
+
border-bottom: 1px solid var(--selaras-resolved-border-default);
|
|
80
|
+
content: '';
|
|
81
|
+
pointer-events: none;
|
|
82
|
+
}
|
|
83
|
+
|
|
30
84
|
.selaras-docs-shell {
|
|
31
85
|
display: flex;
|
|
32
86
|
width: min(100%, 90rem);
|
|
@@ -34,8 +88,8 @@
|
|
|
34
88
|
margin: 0 auto;
|
|
35
89
|
}
|
|
36
90
|
|
|
37
|
-
.selaras-docs-
|
|
38
|
-
|
|
91
|
+
.selaras-docs-root--fluid .selaras-docs-shell {
|
|
92
|
+
width: 100%;
|
|
39
93
|
}
|
|
40
94
|
|
|
41
95
|
.selaras-docs-main {
|
|
@@ -44,11 +98,19 @@
|
|
|
44
98
|
padding: 2rem;
|
|
45
99
|
}
|
|
46
100
|
|
|
101
|
+
.selaras-docs-main--unpadded {
|
|
102
|
+
padding: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
47
105
|
.selaras-docs-page {
|
|
48
106
|
max-width: 78rem;
|
|
49
107
|
margin: 0 auto;
|
|
50
108
|
}
|
|
51
109
|
|
|
110
|
+
.selaras-docs-page--fluid {
|
|
111
|
+
max-width: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
52
114
|
.selaras-docs-page-grid {
|
|
53
115
|
display: grid;
|
|
54
116
|
grid-template-columns: minmax(0, 1fr);
|
|
@@ -91,15 +153,39 @@
|
|
|
91
153
|
}
|
|
92
154
|
|
|
93
155
|
.selaras-docs-footer {
|
|
94
|
-
|
|
156
|
+
position: relative;
|
|
157
|
+
width: min(100%, 90rem);
|
|
158
|
+
margin-inline: auto;
|
|
159
|
+
isolation: isolate;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.selaras-docs-footer--fluid {
|
|
163
|
+
width: 100%;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.selaras-docs-footer::before {
|
|
167
|
+
position: absolute;
|
|
168
|
+
z-index: -1;
|
|
169
|
+
inset-block: 0;
|
|
170
|
+
inset-inline-start: 50%;
|
|
171
|
+
width: 100vw;
|
|
172
|
+
transform: translateX(-50%);
|
|
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));
|
|
175
|
+
content: '';
|
|
176
|
+
pointer-events: none;
|
|
95
177
|
}
|
|
96
178
|
|
|
97
179
|
.selaras-docs-footer-inner {
|
|
180
|
+
box-sizing: border-box;
|
|
98
181
|
display: flex;
|
|
182
|
+
width: 100%;
|
|
183
|
+
padding-inline: 1.5rem;
|
|
99
184
|
align-items: center;
|
|
100
185
|
justify-content: space-between;
|
|
101
186
|
gap: 1rem;
|
|
102
|
-
min-height: 5rem;
|
|
187
|
+
min-height: 4.5rem;
|
|
188
|
+
padding-block: 0.875rem;
|
|
103
189
|
}
|
|
104
190
|
|
|
105
191
|
.selaras-docs-footer-text {
|
|
@@ -111,21 +197,37 @@
|
|
|
111
197
|
.selaras-docs-footer-links {
|
|
112
198
|
display: flex;
|
|
113
199
|
flex-wrap: wrap;
|
|
114
|
-
|
|
200
|
+
align-items: center;
|
|
201
|
+
gap: 0.375rem;
|
|
115
202
|
}
|
|
116
203
|
|
|
117
204
|
.selaras-docs-footer-links a {
|
|
118
205
|
display: inline-flex;
|
|
206
|
+
min-height: 2.25rem;
|
|
207
|
+
padding: 0.5rem 0.75rem;
|
|
119
208
|
align-items: center;
|
|
120
209
|
gap: 0.375rem;
|
|
121
210
|
color: var(--selaras-resolved-text-muted);
|
|
122
211
|
font-size: 0.875rem;
|
|
123
212
|
text-decoration: none;
|
|
213
|
+
border-radius: var(--selaras-resolved-radius-md);
|
|
214
|
+
transition: color 150ms ease, background-color 150ms ease;
|
|
124
215
|
}
|
|
125
216
|
|
|
126
217
|
.selaras-docs-footer-links a:hover {
|
|
127
218
|
color: var(--selaras-resolved-text-default);
|
|
128
|
-
|
|
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
|
+
}
|
|
129
231
|
}
|
|
130
232
|
|
|
131
233
|
@media (min-width: 64rem) {
|
|
@@ -133,6 +235,14 @@
|
|
|
133
235
|
display: none;
|
|
134
236
|
}
|
|
135
237
|
|
|
238
|
+
/* Reserve the sidebar's width for the brand, so the header menu's first
|
|
239
|
+
label lines up with the page content: sidebar (16rem) + the content's
|
|
240
|
+
inset from it (4rem), less the header's own padding (1.5rem), the
|
|
241
|
+
brand-to-menu gap (0.5rem), and the menu link's own padding (0.625rem). */
|
|
242
|
+
.selaras-docs-brand-area {
|
|
243
|
+
min-width: 17.375rem;
|
|
244
|
+
}
|
|
245
|
+
|
|
136
246
|
.selaras-docs-page-grid {
|
|
137
247
|
grid-template-columns: minmax(0, 1fr) 14rem;
|
|
138
248
|
}
|
|
@@ -143,6 +253,10 @@
|
|
|
143
253
|
padding: 1.5rem;
|
|
144
254
|
}
|
|
145
255
|
|
|
256
|
+
.selaras-docs-main--unpadded {
|
|
257
|
+
padding: 0;
|
|
258
|
+
}
|
|
259
|
+
|
|
146
260
|
.selaras-docs-header-link.selaras-docs-header-link--desktop {
|
|
147
261
|
display: none;
|
|
148
262
|
}
|
|
@@ -151,8 +265,9 @@
|
|
|
151
265
|
align-items: flex-start;
|
|
152
266
|
flex-direction: column;
|
|
153
267
|
justify-content: center;
|
|
154
|
-
|
|
155
|
-
padding-
|
|
268
|
+
gap: 0.5rem;
|
|
269
|
+
padding-top: 1.25rem;
|
|
270
|
+
padding-bottom: 1.25rem;
|
|
156
271
|
}
|
|
157
272
|
}
|
|
158
273
|
|
|
@@ -165,13 +280,25 @@
|
|
|
165
280
|
|
|
166
281
|
.selaras-docs-brand {
|
|
167
282
|
gap: 0.625rem;
|
|
283
|
+
font-size: 1.125rem;
|
|
168
284
|
font-weight: 600;
|
|
285
|
+
letter-spacing: -0.01em;
|
|
169
286
|
}
|
|
170
287
|
|
|
171
288
|
.selaras-docs-logo {
|
|
172
289
|
display: block;
|
|
173
290
|
width: auto;
|
|
174
|
-
height: 1.75rem;
|
|
291
|
+
height: var(--selaras-docs-logo-height, 1.75rem);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.selaras-docs-logo--tinted {
|
|
295
|
+
width: var(--selaras-docs-logo-height, 1.75rem);
|
|
296
|
+
flex: none;
|
|
297
|
+
background-color: var(--selaras-resolved-color-primary-fill);
|
|
298
|
+
mask-image: var(--selaras-docs-logo-mask);
|
|
299
|
+
mask-repeat: no-repeat;
|
|
300
|
+
mask-position: center;
|
|
301
|
+
mask-size: contain;
|
|
175
302
|
}
|
|
176
303
|
|
|
177
304
|
.selaras-docs-logo--dark {
|
|
@@ -5,17 +5,16 @@ const footer = computed(() => docsConfig.value.footer)
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<template>
|
|
8
|
-
<footer v-if="footer?.text || footer?.links?.length" class="selaras-docs-footer">
|
|
8
|
+
<footer v-if="footer?.text || footer?.links?.length" class="selaras-docs-footer" :class="{ 'selaras-docs-footer--fluid': footer?.fluid }">
|
|
9
9
|
<SContainer size="full" class="selaras-docs-footer-inner">
|
|
10
|
-
<
|
|
11
|
-
{{ footer.text }}
|
|
12
|
-
</p>
|
|
10
|
+
<DocsFooterBrand />
|
|
13
11
|
<nav v-if="footer?.links?.length" class="selaras-docs-footer-links" aria-label="Footer navigation">
|
|
14
12
|
<NuxtLink
|
|
15
13
|
v-for="link in footer.links"
|
|
16
14
|
:key="`${link.to}:${link.label ?? link.icon ?? ''}`"
|
|
17
15
|
:to="link.to"
|
|
18
16
|
:target="link.target"
|
|
17
|
+
:rel="link.rel"
|
|
19
18
|
:aria-label="link.ariaLabel ?? link.label"
|
|
20
19
|
>
|
|
21
20
|
<SIcon v-if="link.icon" :name="link.icon" />
|
|
@@ -6,14 +6,9 @@ const navigationOpen = ref(false)
|
|
|
6
6
|
|
|
7
7
|
const docsConfig = computed(() => appConfig.selarasDocs ?? {})
|
|
8
8
|
const siteName = computed(() => docsConfig.value.header?.title ?? docsConfig.value.site?.name ?? 'Documentation')
|
|
9
|
-
const showTitle = computed(() => docsConfig.value.header?.showTitle !== false)
|
|
10
|
-
const logo = computed(() => docsConfig.value.site?.logo)
|
|
11
|
-
const logoAlt = computed(() => typeof logo.value === 'object' ? (logo.value.alt ?? siteName.value) : siteName.value)
|
|
12
|
-
const lightLogo = computed(() => typeof logo.value === 'string' ? logo.value : (logo.value?.light ?? logo.value?.dark))
|
|
13
|
-
const darkLogo = computed(() => typeof logo.value === 'object' ? (logo.value.dark ?? logo.value.light) : logo.value)
|
|
14
|
-
const hasDistinctLogos = computed(() => Boolean(lightLogo.value && darkLogo.value && lightLogo.value !== darkLogo.value))
|
|
15
9
|
const headerLinks = computed(() => docsConfig.value.header?.links ?? [])
|
|
16
10
|
const repositoryUrl = computed(() => docsConfig.value.repository?.url)
|
|
11
|
+
const sidebarEnabled = computed(() => docsConfig.value.sidebar?.enabled !== false)
|
|
17
12
|
|
|
18
13
|
watch(() => route.path, () => {
|
|
19
14
|
navigationOpen.value = false
|
|
@@ -21,23 +16,28 @@ watch(() => route.path, () => {
|
|
|
21
16
|
</script>
|
|
22
17
|
|
|
23
18
|
<template>
|
|
24
|
-
<SHeader
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
19
|
+
<SHeader
|
|
20
|
+
:ui="{
|
|
21
|
+
root: 'selaras-docs-header',
|
|
22
|
+
left: docsConfig.header?.fluid ? 'selaras-docs-header-inner selaras-docs-header-inner--fluid' : 'selaras-docs-header-inner',
|
|
23
|
+
right: 'hidden',
|
|
24
|
+
}"
|
|
25
|
+
>
|
|
26
|
+
<div class="selaras-docs-brand-area">
|
|
27
|
+
<NuxtLink to="/" class="selaras-docs-brand" :aria-label="`${siteName} home`">
|
|
28
|
+
<DocsHeaderBrand />
|
|
29
|
+
</NuxtLink>
|
|
30
|
+
</div>
|
|
31
|
+
<SNavigationMenu
|
|
32
|
+
v-if="headerLinks.length"
|
|
33
|
+
:items="headerLinks"
|
|
34
|
+
variant="link"
|
|
35
|
+
:ui="{ root: 'hidden w-auto lg:flex' }"
|
|
36
|
+
/>
|
|
37
|
+
<div class="selaras-docs-header-actions">
|
|
39
38
|
<DocsSearchButton v-if="docsConfig.header?.search !== false" />
|
|
40
39
|
<SColorModeToggle v-if="docsConfig.header?.colorMode !== false" />
|
|
40
|
+
<DocsThemePicker v-if="docsConfig.header?.themePicker" />
|
|
41
41
|
<SButton
|
|
42
42
|
v-if="repositoryUrl"
|
|
43
43
|
as="a"
|
|
@@ -51,6 +51,7 @@ watch(() => route.path, () => {
|
|
|
51
51
|
color="neutral"
|
|
52
52
|
/>
|
|
53
53
|
<SButton
|
|
54
|
+
v-if="sidebarEnabled"
|
|
54
55
|
variant="ghost"
|
|
55
56
|
color="neutral"
|
|
56
57
|
class="selaras-docs-nav-toggle"
|
|
@@ -59,11 +60,11 @@ watch(() => route.path, () => {
|
|
|
59
60
|
>
|
|
60
61
|
Menu
|
|
61
62
|
</SButton>
|
|
62
|
-
</
|
|
63
|
+
</div>
|
|
63
64
|
</SHeader>
|
|
64
|
-
<SDrawer v-model:open="navigationOpen" side="left" title="Documentation navigation" :handle="false">
|
|
65
|
+
<SDrawer v-if="sidebarEnabled" v-model:open="navigationOpen" side="left" title="Documentation navigation" :handle="false">
|
|
65
66
|
<template #body>
|
|
66
|
-
<SContentNavigation :navigation="navigation ?? []" />
|
|
67
|
+
<SContentNavigation :navigation="navigation ?? []" :collapsed="docsConfig.sidebar?.collapsed" />
|
|
67
68
|
</template>
|
|
68
69
|
</SDrawer>
|
|
69
70
|
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const appConfig = useAppConfig()
|
|
3
|
+
const docsConfig = computed(() => appConfig.selarasDocs ?? {})
|
|
4
|
+
const siteName = computed(() => docsConfig.value.header?.title ?? docsConfig.value.site?.name ?? 'Documentation')
|
|
5
|
+
const showTitle = computed(() => docsConfig.value.header?.showTitle !== false)
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<DocsLogo />
|
|
10
|
+
<span v-if="showTitle">{{ siteName }}</span>
|
|
11
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const logo = useDocsLogo()
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<template v-if="logo.light">
|
|
7
|
+
<span
|
|
8
|
+
v-if="logo.tint"
|
|
9
|
+
role="img"
|
|
10
|
+
:aria-label="logo.alt"
|
|
11
|
+
class="selaras-docs-logo selaras-docs-logo--tinted"
|
|
12
|
+
:style="{ '--selaras-docs-logo-mask': `url('${logo.light}')` }"
|
|
13
|
+
/>
|
|
14
|
+
<template v-else>
|
|
15
|
+
<img :src="logo.light" :alt="logo.alt" class="selaras-docs-logo" :class="{ 'selaras-docs-logo--light': logo.distinct }">
|
|
16
|
+
<img v-if="logo.distinct" :src="logo.dark" :alt="logo.alt" class="selaras-docs-logo selaras-docs-logo--dark">
|
|
17
|
+
</template>
|
|
18
|
+
</template>
|
|
19
|
+
</template>
|
|
@@ -5,9 +5,11 @@ const messages = useMessages()
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<template>
|
|
8
|
-
<SButton variant="soft" color="neutral" size="sm" :icon="icons.search" aria-label="Search documentation" @click="open">
|
|
8
|
+
<SButton variant="soft" color="neutral" size="sm" :icon="icons.search" aria-label="Search documentation" class="sm:min-w-48 xl:min-w-60" @click="open">
|
|
9
9
|
<span class="hidden sm:inline">{{ messages.search }}</span>
|
|
10
|
-
<
|
|
11
|
-
|
|
10
|
+
<span class="ms-auto hidden gap-1 sm:flex">
|
|
11
|
+
<SKbd value="meta" size="sm" />
|
|
12
|
+
<SKbd value="K" size="sm" />
|
|
13
|
+
</span>
|
|
12
14
|
</SButton>
|
|
13
15
|
</template>
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
const appConfig = useAppConfig()
|
|
2
3
|
const { data: navigation } = useDocsNavigation()
|
|
4
|
+
const sidebar = computed(() => appConfig.selarasDocs?.sidebar)
|
|
3
5
|
</script>
|
|
4
6
|
|
|
5
7
|
<template>
|
|
6
8
|
<SPageAside
|
|
9
|
+
v-if="sidebar?.enabled !== false"
|
|
7
10
|
class="selaras-docs-sidebar"
|
|
8
11
|
aria-label="Documentation navigation"
|
|
9
12
|
:ui="{ root: 'top-16 h-[calc(100vh-4rem)]' }"
|
|
10
13
|
>
|
|
11
|
-
<SContentNavigation :navigation="navigation ?? []" />
|
|
14
|
+
<SContentNavigation :navigation="navigation ?? []" :collapsed="sidebar?.collapsed" />
|
|
12
15
|
</SPageAside>
|
|
13
16
|
</template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prefixes a root-relative path (`/logo.svg`) with the app's base URL, so a
|
|
3
|
+
* file in `public/` still resolves when the site is served from a subpath.
|
|
4
|
+
* Absolute URLs and relative paths pass through unchanged.
|
|
5
|
+
*/
|
|
6
|
+
export function useDocsAssetUrl() {
|
|
7
|
+
const baseURL = useRuntimeConfig().app.baseURL.replace(/\/$/, '')
|
|
8
|
+
return (path: string | undefined) => path?.startsWith('/') && !path.startsWith('//') ? `${baseURL}${path}` : path
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** The configured `site.logo`, resolved into light/dark image sources. */
|
|
12
|
+
export function useDocsLogo() {
|
|
13
|
+
const appConfig = useAppConfig()
|
|
14
|
+
const assetUrl = useDocsAssetUrl()
|
|
15
|
+
|
|
16
|
+
return computed(() => {
|
|
17
|
+
const config = appConfig.selarasDocs ?? {}
|
|
18
|
+
const logo = config.site?.logo
|
|
19
|
+
const name = config.header?.title ?? config.site?.name ?? 'Documentation'
|
|
20
|
+
const light = assetUrl(typeof logo === 'string' ? logo : (logo?.light ?? logo?.dark))
|
|
21
|
+
const dark = assetUrl(typeof logo === 'string' ? logo : (logo?.dark ?? logo?.light))
|
|
22
|
+
return {
|
|
23
|
+
light,
|
|
24
|
+
dark,
|
|
25
|
+
alt: typeof logo === 'object' ? (logo.alt ?? name) : name,
|
|
26
|
+
distinct: Boolean(light && dark && light !== dark),
|
|
27
|
+
tint: typeof logo === 'object' && logo.tint === true,
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
}
|
|
@@ -1,4 +1,53 @@
|
|
|
1
|
+
interface DocsNavigationNode {
|
|
2
|
+
title: string
|
|
3
|
+
path: string
|
|
4
|
+
icon?: string | false
|
|
5
|
+
order?: number
|
|
6
|
+
collapse?: boolean
|
|
7
|
+
navBadges?: Array<string | { text: string }>
|
|
8
|
+
navigation?: boolean | {
|
|
9
|
+
title?: string
|
|
10
|
+
icon?: string | false
|
|
11
|
+
order?: number
|
|
12
|
+
navBadges?: Array<string | { text: string }>
|
|
13
|
+
}
|
|
14
|
+
children?: DocsNavigationNode[]
|
|
15
|
+
}
|
|
16
|
+
|
|
1
17
|
export function useDocsNavigation() {
|
|
2
|
-
|
|
3
|
-
|
|
18
|
+
const appConfig = useAppConfig()
|
|
19
|
+
|
|
20
|
+
return useAsyncData('selaras-docs-navigation', async () => {
|
|
21
|
+
const tree = await queryCollectionNavigation('docs', ['order', 'icon', 'collapse', 'navBadges'])
|
|
22
|
+
.order('order', 'ASC')
|
|
23
|
+
|
|
24
|
+
const excluded = new Set(appConfig.selarasDocs?.sidebar?.exclude ?? [])
|
|
25
|
+
const visit = (items: DocsNavigationNode[], applyExclusions = false): DocsNavigationNode[] => items
|
|
26
|
+
.filter(item => !applyExclusions || !excluded.has(item.path))
|
|
27
|
+
.map((item) => {
|
|
28
|
+
const metadata = typeof item.navigation === 'object' && item.navigation ? item.navigation : {}
|
|
29
|
+
const children = item.children ? visit(item.children, applyExclusions) : undefined
|
|
30
|
+
return {
|
|
31
|
+
...item,
|
|
32
|
+
...metadata,
|
|
33
|
+
title: metadata.title ?? item.title,
|
|
34
|
+
icon: metadata.icon ?? item.icon,
|
|
35
|
+
order: metadata.order ?? item.order,
|
|
36
|
+
navBadges: metadata.navBadges ?? item.navBadges,
|
|
37
|
+
...(children && { children }),
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
.filter(item => !applyExclusions || !item.children || item.children.length > 0)
|
|
41
|
+
.sort((a, b) => {
|
|
42
|
+
if (a.order == null && b.order == null)
|
|
43
|
+
return 0
|
|
44
|
+
if (a.order == null)
|
|
45
|
+
return 1
|
|
46
|
+
if (b.order == null)
|
|
47
|
+
return -1
|
|
48
|
+
return a.order - b.order
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
return visit(tree as DocsNavigationNode[], excluded.size > 0)
|
|
52
|
+
})
|
|
4
53
|
}
|
|
@@ -1,10 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const appConfig = useAppConfig()
|
|
3
|
+
</script>
|
|
4
|
+
|
|
1
5
|
<template>
|
|
2
|
-
<div
|
|
6
|
+
<div
|
|
7
|
+
class="selaras-docs-root min-h-screen text-[var(--selaras-resolved-text-default)]"
|
|
8
|
+
:class="{
|
|
9
|
+
'selaras-docs-root--fluid': appConfig.selarasDocs?.main?.fluid,
|
|
10
|
+
}"
|
|
11
|
+
>
|
|
3
12
|
<a class="selaras-docs-skip-link" href="#selaras-docs-main">Skip to content</a>
|
|
4
13
|
<DocsHeader />
|
|
5
14
|
<div class="selaras-docs-shell">
|
|
6
15
|
<DocsSidebar />
|
|
7
|
-
<main
|
|
16
|
+
<main
|
|
17
|
+
id="selaras-docs-main"
|
|
18
|
+
class="selaras-docs-main"
|
|
19
|
+
:class="{ 'selaras-docs-main--unpadded': appConfig.selarasDocs?.main?.padded === false }"
|
|
20
|
+
tabindex="-1"
|
|
21
|
+
>
|
|
8
22
|
<slot />
|
|
9
23
|
</main>
|
|
10
24
|
</div>
|
package/app/pages/[...slug].vue
CHANGED
|
@@ -18,6 +18,12 @@ if (!page.value) {
|
|
|
18
18
|
|
|
19
19
|
definePageMeta({ layout: 'selaras-docs' })
|
|
20
20
|
useSeoMeta({ title: page.value.title, description: page.value.description ?? appConfig.selarasDocs?.site?.description })
|
|
21
|
+
useHead(() => ({
|
|
22
|
+
...(appConfig.selarasDocs?.site?.titleTemplate && { titleTemplate: appConfig.selarasDocs.site.titleTemplate }),
|
|
23
|
+
...(appConfig.selarasDocs?.site?.url && {
|
|
24
|
+
link: [{ rel: 'canonical', href: new URL(route.path, appConfig.selarasDocs.site.url).href }],
|
|
25
|
+
}),
|
|
26
|
+
}))
|
|
21
27
|
|
|
22
28
|
const proseComponents = {
|
|
23
29
|
h1: ProseH1,
|
|
@@ -34,17 +40,22 @@ const surround = useDocsSurround()
|
|
|
34
40
|
</script>
|
|
35
41
|
|
|
36
42
|
<template>
|
|
37
|
-
<SContainer size="full" class="selaras-docs-page">
|
|
43
|
+
<SContainer size="full" class="selaras-docs-page" :class="{ 'selaras-docs-page--fluid': appConfig.selarasDocs?.main?.fluid }">
|
|
38
44
|
<div class="selaras-docs-page-grid">
|
|
39
45
|
<article class="selaras-docs-article">
|
|
40
46
|
<p v-if="page!.description" class="selaras-docs-description">
|
|
41
47
|
{{ page!.description }}
|
|
42
48
|
</p>
|
|
43
49
|
<ContentRenderer :value="page!" :components="proseComponents" class="selaras-docs-content selaras-prose" />
|
|
44
|
-
<DocsEditLink :path="route.path" />
|
|
45
|
-
<SContentSurround
|
|
50
|
+
<DocsEditLink v-if="page!.editLink !== false" :path="route.path" />
|
|
51
|
+
<SContentSurround
|
|
52
|
+
v-if="page!.prevNext !== false"
|
|
53
|
+
:prev="surround.prev"
|
|
54
|
+
:next="surround.next"
|
|
55
|
+
class="selaras-docs-surround"
|
|
56
|
+
/>
|
|
46
57
|
</article>
|
|
47
|
-
<DocsTableOfContents :links="tocLinks" />
|
|
58
|
+
<DocsTableOfContents v-if="page!.toc !== false && page!.aside !== false" :links="tocLinks" />
|
|
48
59
|
</div>
|
|
49
60
|
</SContainer>
|
|
50
61
|
</template>
|
package/content.config.ts
CHANGED
|
@@ -8,12 +8,41 @@ export default defineContentConfig({
|
|
|
8
8
|
collections: {
|
|
9
9
|
docs: defineCollection({
|
|
10
10
|
type: 'page',
|
|
11
|
-
source:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
source: [
|
|
12
|
+
{
|
|
13
|
+
cwd: resolve(options.rootDir, 'content'),
|
|
14
|
+
include: '**/*.md',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
cwd: resolve(options.rootDir, 'content'),
|
|
18
|
+
// Nuxt Content reads this metadata into the navigation tree.
|
|
19
|
+
include: '**/.navigation.yml',
|
|
20
|
+
},
|
|
21
|
+
],
|
|
15
22
|
schema: z.object({
|
|
16
23
|
order: z.number().optional(),
|
|
24
|
+
icon: z.union([z.string(), z.literal(false)]).optional(),
|
|
25
|
+
collapse: z.boolean().optional(),
|
|
26
|
+
navBadges: z.array(z.union([
|
|
27
|
+
z.string(),
|
|
28
|
+
z.object({ text: z.string() }),
|
|
29
|
+
])).optional(),
|
|
30
|
+
navigation: z.union([
|
|
31
|
+
z.boolean(),
|
|
32
|
+
z.object({
|
|
33
|
+
title: z.string().optional(),
|
|
34
|
+
icon: z.union([z.string(), z.literal(false)]).optional(),
|
|
35
|
+
order: z.number().optional(),
|
|
36
|
+
navBadges: z.array(z.union([
|
|
37
|
+
z.string(),
|
|
38
|
+
z.object({ text: z.string() }),
|
|
39
|
+
])).optional(),
|
|
40
|
+
}),
|
|
41
|
+
]).optional(),
|
|
42
|
+
toc: z.boolean().default(true),
|
|
43
|
+
aside: z.boolean().default(true),
|
|
44
|
+
editLink: z.boolean().default(true),
|
|
45
|
+
prevNext: z.boolean().default(true),
|
|
17
46
|
}),
|
|
18
47
|
}),
|
|
19
48
|
},
|
package/nuxt.config.mjs
CHANGED
|
@@ -8,6 +8,16 @@ export default defineNuxtConfig({
|
|
|
8
8
|
// Selaras supports Node versions with node:sqlite. Keeping Content on its
|
|
9
9
|
// native connector lets an installed docs layer avoid a native addon.
|
|
10
10
|
content: {
|
|
11
|
+
// Include h3 headings in the docs sidebar TOC; Nuxt Content defaults to
|
|
12
|
+
// including headings through h2 only.
|
|
13
|
+
build: {
|
|
14
|
+
markdown: {
|
|
15
|
+
toc: {
|
|
16
|
+
depth: 3,
|
|
17
|
+
searchDepth: 3,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
11
21
|
experimental: {
|
|
12
22
|
sqliteConnector: 'native',
|
|
13
23
|
},
|
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sewadah/selaras-docs",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"description": "Nuxt Content documentation layer for Selaras",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/sewadahapp/selaras.git",
|
|
9
|
+
"directory": "packages/docs"
|
|
10
|
+
},
|
|
6
11
|
"exports": {
|
|
7
12
|
".": {
|
|
8
13
|
"types": "./types.d.ts",
|
|
@@ -12,6 +17,7 @@
|
|
|
12
17
|
},
|
|
13
18
|
"main": "./nuxt.config.mjs",
|
|
14
19
|
"files": [
|
|
20
|
+
"CHANGELOG.md",
|
|
15
21
|
"app",
|
|
16
22
|
"content.config.ts",
|
|
17
23
|
"modules",
|
|
@@ -27,7 +33,7 @@
|
|
|
27
33
|
"dependencies": {
|
|
28
34
|
"@nuxt/content": "^3.16.0",
|
|
29
35
|
"@nuxt/kit": "^4.5.2",
|
|
30
|
-
"@sewadah/selaras": "^0.3.
|
|
36
|
+
"@sewadah/selaras": "^0.3.2",
|
|
31
37
|
"tailwindcss": "^4.3.0"
|
|
32
38
|
}
|
|
33
39
|
}
|
package/types.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export interface SelarasDocsLink {
|
|
|
12
12
|
to: string
|
|
13
13
|
icon?: string
|
|
14
14
|
target?: string
|
|
15
|
+
rel?: string
|
|
15
16
|
ariaLabel?: string
|
|
16
17
|
}
|
|
17
18
|
|
|
@@ -32,13 +33,21 @@ export interface SelarasDocsLogo {
|
|
|
32
33
|
light?: string
|
|
33
34
|
dark?: string
|
|
34
35
|
alt?: string
|
|
36
|
+
/** Tint a monochrome SVG with the active primary theme color. */
|
|
37
|
+
tint?: boolean
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
export interface SelarasDocsAppConfig {
|
|
38
41
|
site?: {
|
|
39
42
|
name?: string
|
|
40
43
|
description?: string
|
|
44
|
+
/** Applied to browser titles; `%s` is replaced with the current page title. */
|
|
45
|
+
titleTemplate?: string
|
|
46
|
+
url?: string
|
|
47
|
+
/** Shown in the header and footer. A `/`-rooted path is served from `public/` under the app's base URL. */
|
|
41
48
|
logo?: string | SelarasDocsLogo
|
|
49
|
+
/** The browser tab icon, e.g. `/favicon.svg`, resolved like `logo`. */
|
|
50
|
+
favicon?: string
|
|
42
51
|
}
|
|
43
52
|
repository?: {
|
|
44
53
|
url?: string
|
|
@@ -51,8 +60,26 @@ export interface SelarasDocsAppConfig {
|
|
|
51
60
|
showTitle?: boolean
|
|
52
61
|
search?: boolean
|
|
53
62
|
colorMode?: boolean
|
|
63
|
+
/** Show the consuming site's visual preset picker. @default false */
|
|
64
|
+
themePicker?: boolean
|
|
65
|
+
/** Let the header span the viewport instead of the docs shell width. */
|
|
66
|
+
fluid?: boolean
|
|
54
67
|
links?: SelarasDocsNavigationItem[]
|
|
55
68
|
}
|
|
69
|
+
main?: {
|
|
70
|
+
/** Let the content area use the available width. @default false */
|
|
71
|
+
fluid?: boolean
|
|
72
|
+
/** Remove the default content inset. @default false */
|
|
73
|
+
padded?: boolean
|
|
74
|
+
}
|
|
75
|
+
sidebar?: {
|
|
76
|
+
/** Hide the desktop sidebar and its mobile navigation control. @default true */
|
|
77
|
+
enabled?: boolean
|
|
78
|
+
/** Start folder groups collapsed. Folder `.navigation.yml` can override this. @default false */
|
|
79
|
+
collapsed?: boolean
|
|
80
|
+
/** Exact page paths to omit from the sidebar. */
|
|
81
|
+
exclude?: string[]
|
|
82
|
+
}
|
|
56
83
|
toc?: {
|
|
57
84
|
enabled?: boolean
|
|
58
85
|
title?: string
|
|
@@ -60,9 +87,20 @@ export interface SelarasDocsAppConfig {
|
|
|
60
87
|
footer?: {
|
|
61
88
|
text?: string
|
|
62
89
|
links?: SelarasDocsLink[]
|
|
90
|
+
/** Let the footer span the viewport instead of the docs shell width. */
|
|
91
|
+
fluid?: boolean
|
|
63
92
|
}
|
|
64
93
|
}
|
|
65
94
|
|
|
95
|
+
/** Metadata accepted in a content page's `.navigation.yml` folder config. */
|
|
96
|
+
export interface SelarasDocsContentNavigationItem {
|
|
97
|
+
title?: string
|
|
98
|
+
icon?: string | false
|
|
99
|
+
order?: number
|
|
100
|
+
collapse?: boolean
|
|
101
|
+
navBadges?: Array<string | { text: string }>
|
|
102
|
+
}
|
|
103
|
+
|
|
66
104
|
declare module '@nuxt/schema' {
|
|
67
105
|
interface AppConfig {
|
|
68
106
|
selarasDocs?: SelarasDocsAppConfig
|