Skip to content

Commit 1323a55

Browse files
authored
Merge pull request #167 from unoforge/changes
Fix offcanvas & improve docs
2 parents a3911f4 + e20170a commit 1323a55

File tree

151 files changed

+7954
-15977
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+7954
-15977
lines changed

docs/package-lock.json

Lines changed: 6811 additions & 9349 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
},
1616
"dependencies": {
1717
"@astrojs/check": "^0.9.4",
18-
"@astrojs/mdx": "^4.0.6",
19-
"@astrojs/partytown": "^2.1.3",
20-
"@astrojs/preact": "^4.0.2",
21-
"@astrojs/vercel": "^8.0.2",
22-
"@astrojs/vue": "^5.0.5",
23-
"@flexilla/flexilla": "^2.1.10",
24-
"@flexilla/utilities": "^2.0.71",
18+
"@astrojs/mdx": "^4.3.4",
19+
"@astrojs/partytown": "^2.1.4",
20+
"@astrojs/preact": "^4.1.0",
21+
"@astrojs/vercel": "^8.0.4",
22+
"@astrojs/vue": "^5.1.0",
23+
"@flexilla/flexilla": "^2.2.8-beta.1",
24+
"@flexilla/utilities": "^2.4.2",
2525
"@fontsource/geist-sans": "^5.1.0",
2626
"@preact/signals": "^1.2.2",
27-
"astro": "^5.1.7",
27+
"astro": "^5.13.4",
2828
"class-variance-authority": "^0.7.0",
2929
"clsx": "^2.1.0",
3030
"overlayscrollbars": "2.5.0",
@@ -35,9 +35,9 @@
3535
},
3636
"devDependencies": {
3737
"@iconify-json/carbon": "^1.1.30",
38-
"@shikijs/transformers": "^1.20.0",
39-
"@unifydev/flexilla": "^0.1.0",
40-
"@unocss/preset-icons": "^0.58.5",
41-
"unocss": "^66.1.0-beta.6"
38+
"@shikijs/transformers": "^3.12.0",
39+
"@unifydev/flexilla": "^0.1.3",
40+
"@unocss/preset-icons": "^66.4.2",
41+
"unocss": "^66.4.2"
4242
}
4343
}

docs/src/assets/js/doc-script.ts

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Tabs, Collapse, Dismissible, Popover, Dropdown, Accordion, Tooltip, Modal, OffCanvas, AutoResizeTextArea } from "@flexilla/flexilla";
2-
import { $, $$ } from "@flexilla/utilities";
1+
import { Tabs, Collapse, Dismissible, Popover, Dropdown, Accordion, Tooltip, Modal, OffCanvas, AutoResizeTextArea } from "@flexilla/flexilla";
2+
import { $, $$, actionToggler } from "@flexilla/utilities";
33

44

55
const initTableOfContent = () => {
@@ -78,6 +78,40 @@ const initAllCustomComponents = () => {
7878

7979

8080
export const initAppScript = () => {
81+
82+
const sidebarOverlay = $("[data-sidebar-overlay]")
83+
let sidebarAction: {
84+
toInitial: () => void;
85+
}
86+
const setInitial = () => sidebarAction.toInitial()
87+
88+
sidebarAction = actionToggler({
89+
trigger: "[data-trigger-sidebar]",
90+
targets: [
91+
{
92+
element: "[data-app-sidebar]",
93+
attributes: {
94+
initial: { "data-state": "close" },
95+
to: { "data-state": "open" }
96+
}
97+
},
98+
{
99+
element: "[data-sidebar-overlay]",
100+
attributes: {
101+
initial: { "data-state": "hidden" },
102+
to: { "data-state": "visible" }
103+
}
104+
}
105+
],
106+
onToggle: ({ isExpanded }) => {
107+
if (isExpanded) {
108+
if (sidebarOverlay) sidebarOverlay.addEventListener("click", setInitial)
109+
} else {
110+
if (sidebarOverlay) sidebarOverlay.removeEventListener("click", setInitial)
111+
}
112+
}
113+
})
114+
81115
Dismissible.autoInit("[data-dismissible]")
82116
Collapse.autoInit("[data-collapsible-example]")
83117
Tabs.autoInit("[data-tab-fx-site]")
@@ -88,8 +122,6 @@ export const initAppScript = () => {
88122
Dropdown.autoInit("[data-dropdown-demo]")
89123
Modal.autoInit("[data-modal-demo]")
90124
OffCanvas.autoInit("[data-slideover-demo]")
91-
const sidebar = $("[data-sidebar-offcanvas]")
92-
if(sidebar instanceof HTMLElement) OffCanvas.init(sidebar)
93125
AutoResizeTextArea.autoInit("[data-autoresizable]")
94126
Tooltip.autoInit("[data-tooltip-demo]")
95127
}

docs/src/components/atoms/Button.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ export const buttonVariants = cva("flex items-center relative text-sm", {
1616
"bg-gradient-to-t from-zinc9 to-zinc7 dark-from-zinc50 dark-to-zinc200 text-white dark-text-zinc9",
1717
gradient:
1818
"bg-gradient-to-t from-zinc50 to-zinc1 dark-from-zinc950/80 dark-to-zinc9 b b-zinc2/80 dark-b-zinc8/90",
19-
flat:"text-zinc8 dark-text-zinc2 hover-bg-zinc2/60 dark-hover-bg-zinc-8/60 active-bg-zinc2/40 dark-active-bg-zinc8/30",
19+
flat:"text-zinc8 dark-text-zinc2 hover-bg-zinc2/60 dark-hover-bg-zinc-8/60 active-bg-zinc2/40 dark-active-bg-zinc-800/30",
2020
none:"",
2121
},
2222
size: {
2323
default: "h11 px6",
24-
md: "h9 px5",
24+
md: "h-9 px5",
2525
sm: "h8 px4",
2626
xs:"h7 px4",
2727
icon: "w12 h12",
@@ -30,8 +30,8 @@ export const buttonVariants = cva("flex items-center relative text-sm", {
3030
},
3131
radius: {
3232
default: "rd-xl",
33-
lg: "rd-lg",
34-
md: "rd-md",
33+
lg: "rounded-lg",
34+
md: "rounded-md",
3535
sm:"rd-sm",
3636
},
3737
},

docs/src/components/atoms/Container.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ interface Props extends HTMLAttributes<'div'>{
77
88
const { class:className, ...rest } = Astro.props
99
---
10-
<div class={`${cn('mx-auto wfull max-w-[83rem] px5 sm-px10 lg-px8', className)}`} {...rest}>
10+
<div class={`${cn('mx-auto w-full max-w-[83rem] px5 sm-px10 lg-px8', className)}`} {...rest}>
1111
<slot/>
1212
</div>

docs/src/components/atoms/SwitchThemeBtn.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<button
22
data-switch-theme
33
aria-label="Toggle Website Theme, Switch theme"
4-
class="rd-lg transition ease-linear hover-bg-zinc2/90 dark-hover-bg-zinc9/90 p2.5"
4+
class="rounded-lg transition ease-linear hover-bg-zinc2/90 dark-hover-bg-zinc9/90 p2.5"
55
>
66
<span aria-hidden="true" class="i-carbon-light flex dark-hidden text-xl"
77
></span>

0 commit comments

Comments
 (0)