@adaptive-sm/astro-ui 0.2.1 → 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 +7 -7
- package/lib/badge/Badge.astro +27 -0
- package/lib/badge/classesBadge.ts +67 -0
- package/lib/button/Button.astro +17 -27
- package/lib/button/buttonCva.ts +4 -2
- package/lib/button/buttonIconCva.ts +2 -2
- package/lib/button/classesButtonClickAnimation.ts +1 -1
- package/lib/button/classesButtonClickAnimationPush.ts +1 -1
- package/lib/button/classesButtonClickAnimationSquish.ts +1 -1
- package/lib/card/CardWrapper.astro +6 -5
- package/lib/card/classesBorderWrapper.ts +1 -0
- package/lib/card/classesCardWrapper.ts +21 -9
- package/lib/card/classesShadow.ts +5 -0
- package/lib/details/Details.astro +13 -8
- package/lib/dev/TailwindIndicator.astro +2 -2
- package/lib/form/Fieldset.astro +8 -5
- package/lib/generate_demo_list/DemoList.astro +3 -3
- package/lib/generate_demo_list/generateDemoList.ts +2 -2
- package/lib/generate_image_list/generateImageList.ts +3 -3
- package/lib/grid/FeatureGridSection.astro +28 -35
- package/lib/grid/classesGridCols.ts +27 -2
- package/lib/header/PageHeader.astro +25 -0
- package/lib/header/SectionHeader.astro +37 -0
- package/lib/icon/Icon.astro +26 -0
- package/lib/icons/iconApple.ts +1 -0
- package/lib/icons/iconGithub.ts +4 -0
- package/lib/icons/iconGoogle.ts +4 -0
- package/lib/icons/iconGooglePlay.ts +2 -0
- package/lib/icons/iconLinkedin.ts +2 -0
- package/lib/icons/iconNpm.ts +2 -0
- package/lib/icons/iconTelegram.ts +2 -0
- package/lib/icons/iconTrello.ts +2 -0
- package/lib/icons/iconXcom.ts +1 -0
- package/lib/img/Img.astro +10 -5
- package/lib/img/TypedImg.astro +11 -10
- package/lib/img/TypedImgB2.astro +25 -0
- package/lib/layouts/MarkdownPageWrapper.astro +19 -0
- package/lib/layouts/MinimalLayout.astro +23 -16
- package/lib/layouts/parts/ThemeToggle.astro +9 -9
- package/lib/link/LinkButton.astro +18 -19
- package/lib/link/LinkText.astro +10 -7
- package/lib/link/classesTextLink.ts +1 -1
- package/lib/list/BlackBulletPoint.astro +1 -1
- package/lib/list/BlackBulletPoints.astro +7 -7
- package/lib/list/CheckPoint.astro +3 -3
- package/lib/list/CheckPoints.astro +3 -3
- package/lib/list/NumberedList.astro +1 -1
- package/lib/list/Ps.astro +8 -5
- package/lib/list/TextOrLink.astro +3 -9
- package/lib/md/MarkdownDiv.astro +18 -0
- package/lib/modal/Modal.astro +28 -12
- package/lib/modal/ModalButton.astro +35 -12
- package/lib/page/PageCentered.astro +5 -3
- package/lib/page/PageCenteredCard.astro +7 -5
- package/lib/page/classesPageCentered.ts +1 -1
- package/lib/popover/Popover1.astro +4 -4
- package/lib/select/Select.astro +14 -10
- package/lib/table/Table.astro +2 -2
- package/lib/table/TableD.astro +2 -2
- package/lib/table/TableM.astro +2 -2
- package/lib/table/TableMEntry.astro +2 -2
- package/lib/table/tableVisibilityClasses.ts +3 -3
- package/lib/utils/HasId.ts +3 -0
- package/lib/utils/HasSubtitle.ts +4 -0
- package/lib/utils/HasTitle.ts +4 -0
- package/lib/utils/MayHaveButtonVariant.ts +5 -0
- package/lib/utils/MayHaveClass.ts +3 -0
- package/lib/utils/MayHaveIcon.ts +4 -0
- package/lib/utils/MayHaveId.ts +3 -0
- package/lib/utils/MayHaveInnerClass.ts +3 -0
- package/lib/utils/MayHaveSubtitle.ts +4 -0
- package/lib/utils/MayHaveTitle.ts +4 -0
- package/package.json +13 -12
- package/lib/icon/Icon1.astro +0 -21
- package/lib/layouts/MarkdownWrapper.astro +0 -17
- package/lib/utils/bun/BunCmd.ts +0 -7
- package/lib/utils/bun/cryAndTryAgainLater.ts +0 -6
- package/lib/utils/bun/logBunCmd.ts +0 -1
- package/lib/utils/bun/runCmdAsync.ts +0 -44
- package/lib/utils/bun/runCmdLocally.ts +0 -13
- package/lib/utils/obj/objectKeys.ts +0 -21
- package/lib/utils/ran/generateId12.ts +0 -7
- package/lib/utils/ran/generateId3.ts +0 -7
- package/lib/utils/ran/generateId4.ts +0 -7
- package/lib/utils/ran/generateId5.ts +0 -7
- package/lib/utils/ran/generateId6.ts +0 -7
- package/lib/utils/ran/generateId7.ts +0 -7
- package/lib/utils/ran/generateReadableId.ts +0 -35
- package/lib/utils/ran/urlAlphabet32.ts +0 -8
- /package/lib/{layouts/parts → md}/markdown.css +0 -0
- /package/lib/utils/{ui/classArr.ts → classArr.ts} +0 -0
- /package/lib/utils/{ui/classMerge.ts → classMerge.ts} +0 -0
- /package/lib/utils/{ui/isDevEnv.ts → isDevEnv.ts} +0 -0
- /package/lib/utils/{ui/tailwindBreakpoint.ts → tailwindBreakpoint.ts} +0 -0
package/lib/modal/Modal.astro
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
+
import Button from "~ui/button/Button.astro"
|
|
3
|
+
import { buttonVariant, type ButtonSize, type ButtonVariant } from "~ui/button/buttonCva"
|
|
4
|
+
import { classesTextHeader } from "~ui/text/classesTextHeader"
|
|
5
|
+
import { classMerge } from "~ui/utils/classMerge"
|
|
2
6
|
import "./Modal.module.css"
|
|
3
|
-
import { classesTextHeader } from "~/text/classesTextHeader"
|
|
4
|
-
import { classMerge } from "~/utils/ui/classMerge"
|
|
5
|
-
import { buttonVariant } from "~/button/buttonCva"
|
|
6
|
-
import Button from "~/button/Button.astro"
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* https://github.com/markteekman/accessible-astro-components/blob/main/Modal.astro
|
|
@@ -13,16 +13,25 @@ interface Props {
|
|
|
13
13
|
title: string
|
|
14
14
|
titleClass?: string
|
|
15
15
|
closeText?: string
|
|
16
|
+
|
|
17
|
+
close?: {
|
|
18
|
+
text?: string
|
|
19
|
+
variant?: ButtonVariant
|
|
20
|
+
size?: ButtonSize
|
|
21
|
+
class?: string
|
|
22
|
+
icon?: string
|
|
23
|
+
iconClass?: string
|
|
24
|
+
}
|
|
25
|
+
|
|
16
26
|
class?: string
|
|
17
27
|
classContentArea?: string
|
|
18
28
|
}
|
|
19
29
|
|
|
20
|
-
const
|
|
21
|
-
const triggerId =
|
|
22
|
-
const title =
|
|
23
|
-
const titleClass =
|
|
24
|
-
const
|
|
25
|
-
const classContentArea = props.classContentArea
|
|
30
|
+
const p = Astro.props
|
|
31
|
+
const triggerId = p.triggerId
|
|
32
|
+
const title = p.title
|
|
33
|
+
const titleClass = p.titleClass
|
|
34
|
+
const classContentArea = p.classContentArea
|
|
26
35
|
const closeId = `${triggerId}-close`
|
|
27
36
|
---
|
|
28
37
|
|
|
@@ -33,7 +42,7 @@ const closeId = `${triggerId}-close`
|
|
|
33
42
|
"max-w-5xl",
|
|
34
43
|
"bg-white dark:bg-gray-900 text-black dark:text-white", // bg
|
|
35
44
|
"border-1 border-black p-4 rounded-xl", // border
|
|
36
|
-
|
|
45
|
+
p.class,
|
|
37
46
|
)}
|
|
38
47
|
aria-labelledby={triggerId}
|
|
39
48
|
>
|
|
@@ -43,7 +52,14 @@ const closeId = `${triggerId}-close`
|
|
|
43
52
|
{title}
|
|
44
53
|
</h2>
|
|
45
54
|
<slot>Modal description</slot>
|
|
46
|
-
<Button
|
|
55
|
+
<Button
|
|
56
|
+
id={closeId}
|
|
57
|
+
icon={p.close?.icon}
|
|
58
|
+
iconClass={p.close?.iconClass}
|
|
59
|
+
size={p.close?.size}
|
|
60
|
+
variant={p.close?.variant ?? buttonVariant.outline}
|
|
61
|
+
class={classMerge("modal-close w-full", p.close?.class)}>{p.close?.text ?? "Close"}</Button
|
|
62
|
+
>
|
|
47
63
|
</div>
|
|
48
64
|
</div>
|
|
49
65
|
</dialog>
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
3
|
-
import type { ButtonSize, ButtonVariant } from "
|
|
2
|
+
import Button from "~ui/button/Button.astro"
|
|
3
|
+
import type { ButtonSize, ButtonVariant } from "~ui/button/buttonCva"
|
|
4
|
+
import { classesTextGray } from "~ui/text/classesTextGray"
|
|
5
|
+
import { classArr } from "~ui/utils/classArr"
|
|
4
6
|
import Modal from "./Modal.astro"
|
|
5
|
-
import { classesTextGray } from "~/text/classesTextGray"
|
|
6
|
-
import { classArr } from "~/utils/ui/classArr"
|
|
7
|
-
import Button from "~/button/Button.astro"
|
|
8
7
|
|
|
9
8
|
interface Props {
|
|
10
9
|
button: {
|
|
@@ -17,25 +16,49 @@ interface Props {
|
|
|
17
16
|
iconClass?: string
|
|
18
17
|
class?: string
|
|
19
18
|
}
|
|
19
|
+
close?: {
|
|
20
|
+
text?: string
|
|
21
|
+
variant?: ButtonVariant
|
|
22
|
+
size?: ButtonSize
|
|
23
|
+
class?: string
|
|
24
|
+
icon?: string
|
|
25
|
+
iconClass?: string
|
|
26
|
+
}
|
|
20
27
|
id?: string
|
|
21
28
|
title?: string
|
|
29
|
+
titleClass?: string
|
|
22
30
|
class?: string
|
|
23
31
|
classContentArea?: string
|
|
24
32
|
}
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
const p = Astro.props
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Generates a random alphanumeric string ID
|
|
37
|
+
*
|
|
38
|
+
* Uses Math.random() converted to base-36 to create a string of letters and numbers.
|
|
39
|
+
* The substring(2, 11) removes the "0." prefix and takes 9 characters for a good balance
|
|
40
|
+
* of uniqueness and brevity (approximately 10^36 possible combinations).
|
|
41
|
+
*
|
|
42
|
+
* @returns {string} A 9-character random alphanumeric string
|
|
43
|
+
*/
|
|
44
|
+
function generateRandomId(): string {
|
|
45
|
+
return Math.random().toString(36).substring(2, 11)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const id = p.id ?? `modal-id-${generateRandomId()}`
|
|
49
|
+
const button = p.button
|
|
50
|
+
const title = p.title ?? "Dialog Title"
|
|
51
|
+
const classContentArea = p.classContentArea
|
|
30
52
|
---
|
|
31
53
|
|
|
32
54
|
<Button id={id} {...button} />
|
|
33
55
|
<Modal
|
|
34
56
|
triggerId={id}
|
|
35
57
|
title={title}
|
|
36
|
-
titleClass={classArr(classesTextGray, "text-xl", "mb-2")}
|
|
37
|
-
class={
|
|
58
|
+
titleClass={classArr(classesTextGray, "text-xl", "mb-2", p.titleClass)}
|
|
59
|
+
class={p.class}
|
|
38
60
|
classContentArea={classContentArea}
|
|
61
|
+
close={p.close}
|
|
39
62
|
>
|
|
40
63
|
<slot />
|
|
41
64
|
</Modal>
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { classMerge } from "
|
|
2
|
+
import { classMerge } from "~ui/utils/classMerge"
|
|
3
3
|
import { classesPageCentered } from "./classesPageCentered"
|
|
4
|
+
import type { HTMLAttributes } from "astro/types"
|
|
4
5
|
|
|
5
6
|
interface Props {
|
|
6
|
-
id?:string
|
|
7
|
+
id?: string
|
|
7
8
|
class?: string
|
|
9
|
+
restProps?: HTMLAttributes<"div">
|
|
8
10
|
}
|
|
9
11
|
const p = Astro.props
|
|
10
12
|
---
|
|
11
13
|
|
|
12
|
-
<div id={p.id} class={classMerge(classesPageCentered, p.class)}>
|
|
14
|
+
<div id={p.id} class={classMerge(classesPageCentered, p.class)} {...p.restProps}>
|
|
13
15
|
<slot />
|
|
14
16
|
</div>
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
---
|
|
2
|
-
import {
|
|
2
|
+
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
import { classesCardWrapperPage } from "~ui/card/classesCardWrapper"
|
|
4
|
+
import { classMerge } from "~ui/utils/classMerge"
|
|
3
5
|
import PageCentered from "./PageCentered.astro"
|
|
4
|
-
import { classesCardWrapperPage } from "~/card/classesCardWrapper"
|
|
5
6
|
|
|
6
7
|
interface Props {
|
|
7
8
|
class?: string
|
|
8
9
|
classInner?: string
|
|
10
|
+
restProps?: HTMLAttributes<"div">
|
|
9
11
|
}
|
|
10
|
-
const
|
|
12
|
+
const p = Astro.props
|
|
11
13
|
---
|
|
12
14
|
|
|
13
|
-
<PageCentered class={
|
|
14
|
-
<div class={classMerge(classesCardWrapperPage,
|
|
15
|
+
<PageCentered class={p.class} restProps={p.restProps}>
|
|
16
|
+
<div class={classMerge(classesCardWrapperPage, p.classInner)}>
|
|
15
17
|
<slot />
|
|
16
18
|
</div>
|
|
17
19
|
</PageCentered>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
3
|
-
import { buttonVariant, type ButtonVariant, buttonCva2 } from "
|
|
4
|
-
import { classArr } from "
|
|
2
|
+
import Icon from "~ui/icon/Icon.astro"
|
|
3
|
+
import { buttonVariant, type ButtonVariant, buttonCva2 } from "~ui/button/buttonCva"
|
|
4
|
+
import { classArr } from "~ui/utils/classArr"
|
|
5
5
|
import { setupPopoverListeners } from "./setupPopoverListeners"
|
|
6
6
|
|
|
7
7
|
interface Props {
|
|
@@ -23,7 +23,7 @@ const summaryClasses = buttonCva2(variant, null, "flex flex-wrap gap-2 text-xl f
|
|
|
23
23
|
)}
|
|
24
24
|
>
|
|
25
25
|
<summary class={summaryClasses}>
|
|
26
|
-
<
|
|
26
|
+
<Icon path={icon} />
|
|
27
27
|
{title}
|
|
28
28
|
</summary>
|
|
29
29
|
<div
|
package/lib/select/Select.astro
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
---
|
|
2
|
-
import {
|
|
2
|
+
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
import { classArr } from "~ui/utils/classArr"
|
|
4
|
+
import type { MayHaveClass } from "~ui/utils/MayHaveClass"
|
|
5
|
+
import type { MayHaveId } from "~ui/utils/MayHaveId"
|
|
3
6
|
|
|
4
7
|
type ValueDisplayFn = (value: string) => string
|
|
5
8
|
|
|
6
|
-
|
|
9
|
+
export interface Props extends MayHaveId, MayHaveClass {
|
|
7
10
|
initialValue: string
|
|
8
11
|
options: string[]
|
|
9
12
|
optionClass?: string
|
|
10
13
|
valueDisplay?: ValueDisplayFn
|
|
11
14
|
id?: string
|
|
12
15
|
class?: string
|
|
16
|
+
restProps?: HTMLAttributes<"select">
|
|
13
17
|
}
|
|
14
|
-
|
|
15
|
-
const props = Astro.props as NativeSingleSelectProps
|
|
18
|
+
const p = Astro.props
|
|
16
19
|
|
|
17
20
|
const getDisplayValue = (itemValue: string, valueDisplay?: ValueDisplayFn) => {
|
|
18
21
|
if (!valueDisplay) return itemValue
|
|
@@ -23,7 +26,7 @@ const getDisplayValue = (itemValue: string, valueDisplay?: ValueDisplayFn) => {
|
|
|
23
26
|
---
|
|
24
27
|
|
|
25
28
|
<select
|
|
26
|
-
id={
|
|
29
|
+
id={p.id}
|
|
27
30
|
class={classArr(
|
|
28
31
|
"block w-full p-2.5",
|
|
29
32
|
"text-gray-900 dark:text-white text-sm",
|
|
@@ -31,14 +34,15 @@ const getDisplayValue = (itemValue: string, valueDisplay?: ValueDisplayFn) => {
|
|
|
31
34
|
"bg-gray-50 dark:bg-gray-700",
|
|
32
35
|
"rounded-lg border border-gray-300 dark:border-gray-600",
|
|
33
36
|
"focus:ring-blue-500 focus:border-blue-500 dark:focus:border-blue-500 dark:focus:ring-blue-500",
|
|
34
|
-
|
|
37
|
+
p.class,
|
|
35
38
|
)}
|
|
36
|
-
value={
|
|
39
|
+
value={p.initialValue}
|
|
40
|
+
{...p.restProps}
|
|
37
41
|
>
|
|
38
42
|
{
|
|
39
|
-
|
|
40
|
-
<option value={option} class={
|
|
41
|
-
{getDisplayValue(option,
|
|
43
|
+
p.options.map((option: string) => (
|
|
44
|
+
<option value={option} class={p.optionClass} selected={option === p.initialValue}>
|
|
45
|
+
{getDisplayValue(option, p.valueDisplay)}
|
|
42
46
|
</option>
|
|
43
47
|
))
|
|
44
48
|
}
|
package/lib/table/Table.astro
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import type { DesktopTableClassses } from "./DesktopTableClassses"
|
|
3
3
|
import type { MobileTableClassses } from "./MobileTableClassses"
|
|
4
4
|
import { tableVisibilityClasses } from "./tableVisibilityClasses"
|
|
5
|
-
import { classMerge } from "
|
|
6
|
-
import { type TailwindBreakpoint, tailwindBreakpoint } from "
|
|
5
|
+
import { classMerge } from "~ui/utils/classMerge"
|
|
6
|
+
import { type TailwindBreakpoint, tailwindBreakpoint } from "~ui/utils/tailwindBreakpoint"
|
|
7
7
|
import type { TableColumnDef } from "./TableColumnDef"
|
|
8
8
|
import TableD from "./TableD.astro"
|
|
9
9
|
import TableM from "./TableM.astro"
|
package/lib/table/TableD.astro
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { type DesktopTableClassses } from "./DesktopTableClassses"
|
|
3
3
|
import { sharedTableRowClasses } from "./sharedTableRowClasses"
|
|
4
|
-
// import { t4table } from "
|
|
5
|
-
import { classMerge } from "
|
|
4
|
+
// import { t4table } from "~ui/ui_tables/table3/t4table"
|
|
5
|
+
import { classMerge } from "~ui/utils/classMerge"
|
|
6
6
|
import { type TableColumnDef } from "./TableColumnDef"
|
|
7
7
|
|
|
8
8
|
interface Props {
|
package/lib/table/TableM.astro
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { classMerge } from "
|
|
2
|
+
import { classMerge } from "~ui/utils/classMerge"
|
|
3
3
|
import { type TableColumnDef } from "./TableColumnDef"
|
|
4
4
|
import TableMEntry from "./TableMEntry.astro"
|
|
5
|
-
import type { MobileTableClassses } from "
|
|
5
|
+
import type { MobileTableClassses } from "~ui/table/MobileTableClassses"
|
|
6
6
|
|
|
7
7
|
interface Props {
|
|
8
8
|
rows: string[]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { classMerge } from "
|
|
2
|
+
import { classMerge } from "~ui/utils/classMerge"
|
|
3
3
|
import { type TableColumnDef } from "./TableColumnDef"
|
|
4
|
-
import type { MobileTableClassses } from "
|
|
4
|
+
import type { MobileTableClassses } from "~ui/table/MobileTableClassses"
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
7
7
|
row: string
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { classMerge } from "
|
|
2
|
-
import type { TailwindBreakpoint } from "
|
|
3
|
-
import { tailwindBreakpoint } from "
|
|
1
|
+
import { classMerge } from "~ui/utils/classMerge"
|
|
2
|
+
import type { TailwindBreakpoint } from "~ui/utils/tailwindBreakpoint"
|
|
3
|
+
import { tailwindBreakpoint } from "~ui/utils/tailwindBreakpoint"
|
|
4
4
|
|
|
5
5
|
function tableDesktopclass(b: TailwindBreakpoint) {
|
|
6
6
|
const tb = tailwindBreakpoint
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptive-sm/astro-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"astro": "astro",
|
|
6
6
|
"dev": "nice -5 astro dev",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"upload": "bun run wrangler pages deploy ./dist --project-name=adaptive-astro-ui --commit-dirty",
|
|
11
11
|
"tag": "git branch -f deployed",
|
|
12
12
|
"release": "bash ./ops/release.sh",
|
|
13
|
-
"generateDemoList": "bun run ./
|
|
13
|
+
"generateDemoList": "bun run ./src/demos/generateDemoList.cli.ts",
|
|
14
14
|
"generateImageList": "bun run ./src/pages/images/generateImageList.cli.ts",
|
|
15
15
|
"generateAiRulesLib": "bash ./lib/generate_ai_rules/generate_agent_rules_1_lib.bash",
|
|
16
16
|
"update": "nice -15 bun x npm-check-updates -u && bun i",
|
|
@@ -19,24 +19,25 @@
|
|
|
19
19
|
"reset": "rm -rf ./node_modules"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@
|
|
23
|
-
"@
|
|
22
|
+
"@adaptive-sm/utils": "^0.5.0",
|
|
23
|
+
"@astrojs/check": "^0.9.5",
|
|
24
|
+
"@biomejs/biome": "^2.3.6",
|
|
24
25
|
"@mdi/js": "^7.4.47",
|
|
25
|
-
"@tailwindcss/vite": "^4.1.
|
|
26
|
+
"@tailwindcss/vite": "^4.1.17",
|
|
26
27
|
"@types/bun": "latest",
|
|
27
|
-
"astro": "^5.
|
|
28
|
-
"dayjs": "^1.11.
|
|
28
|
+
"astro": "^5.15.9",
|
|
29
|
+
"dayjs": "^1.11.19",
|
|
29
30
|
"image-size": "^2.0.2",
|
|
30
31
|
"prettier": "^3.6.2",
|
|
31
32
|
"prettier-plugin-astro": "^0.14.1",
|
|
32
33
|
"rehype-autolink-headings": "^7.1.0",
|
|
33
34
|
"rehype-slug": "^6.0.0",
|
|
34
35
|
"remark-toc": "^9.0.0",
|
|
35
|
-
"rollup-plugin-visualizer": "^6.0.
|
|
36
|
-
"tailwind-merge": "^3.
|
|
37
|
-
"tailwindcss": "^4.1.
|
|
38
|
-
"typescript": "^5.9.
|
|
39
|
-
"wrangler": "^4.
|
|
36
|
+
"rollup-plugin-visualizer": "^6.0.5",
|
|
37
|
+
"tailwind-merge": "^3.4.0",
|
|
38
|
+
"tailwindcss": "^4.1.17",
|
|
39
|
+
"typescript": "^5.9.3",
|
|
40
|
+
"wrangler": "^4.49.0"
|
|
40
41
|
},
|
|
41
42
|
"prettier": {
|
|
42
43
|
"semi": false,
|
package/lib/icon/Icon1.astro
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { classMerge } from "~/utils/ui/classMerge"
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
path: string
|
|
6
|
-
class?: string
|
|
7
|
-
title?: string
|
|
8
|
-
ariaHidden?: boolean
|
|
9
|
-
}
|
|
10
|
-
const props = Astro.props
|
|
11
|
-
const ariaHidden = props.ariaHidden ?? !props.title
|
|
12
|
-
// TODO: maybe re-add title={title}
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
<svg
|
|
16
|
-
viewBox={"0 0 24 24"}
|
|
17
|
-
aria-hidden={ariaHidden}
|
|
18
|
-
class={classMerge("size-6 flex-shrink-0 align-middle dark:fill-white", props.class)}
|
|
19
|
-
>
|
|
20
|
-
<path d={props.path}></path>
|
|
21
|
-
</svg>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import PageCenteredCard from "~/page/PageCenteredCard.astro"
|
|
3
|
-
import { classMerge } from "~/utils/ui/classMerge"
|
|
4
|
-
import { classArr } from "~/utils/ui/classArr"
|
|
5
|
-
|
|
6
|
-
import "./parts/markdown.css"
|
|
7
|
-
|
|
8
|
-
interface Props {
|
|
9
|
-
class?: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const p = Astro.props
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
<PageCenteredCard class={classMerge("max-w-5xl my-12", p.class)} classInner={classArr("markdown-body", p.class)}>
|
|
16
|
-
<slot />
|
|
17
|
-
</PageCenteredCard>
|
package/lib/utils/bun/BunCmd.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const logBunCmd = true
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import console from "node:console"
|
|
2
|
-
import type { BunCmd } from "./BunCmd"
|
|
3
|
-
import { logBunCmd } from "./logBunCmd"
|
|
4
|
-
|
|
5
|
-
export async function runCmdAsync(cmd: string[]): Promise<BunCmd> {
|
|
6
|
-
const startedAt = performance.now()
|
|
7
|
-
if (logBunCmd) {
|
|
8
|
-
console.log({ cmd })
|
|
9
|
-
}
|
|
10
|
-
const process = Bun.spawn(cmd, {
|
|
11
|
-
stdout: "pipe",
|
|
12
|
-
stderr: "pipe",
|
|
13
|
-
})
|
|
14
|
-
const exitCode = await process.exited
|
|
15
|
-
const output = await Bun.readableStreamToText(process.stdout)
|
|
16
|
-
const error = await Bun.readableStreamToText(process.stderr)
|
|
17
|
-
const outputLines = output.split("\n").filter((s) => s.length > 0)
|
|
18
|
-
const errorLines = error.split("\n").filter((s) => s.length > 0)
|
|
19
|
-
const lines = [...outputLines, ...errorLines]
|
|
20
|
-
const endedAt = performance.now()
|
|
21
|
-
const ms = Math.round(endedAt - startedAt)
|
|
22
|
-
const r: BunCmd = {
|
|
23
|
-
cmd,
|
|
24
|
-
success: exitCode === 0,
|
|
25
|
-
exitCode,
|
|
26
|
-
lines,
|
|
27
|
-
ms,
|
|
28
|
-
}
|
|
29
|
-
if (logBunCmd) {
|
|
30
|
-
if (lines.length < 8) {
|
|
31
|
-
console.log(r)
|
|
32
|
-
} else {
|
|
33
|
-
const l: Omit<BunCmd, "lines"> = {
|
|
34
|
-
cmd,
|
|
35
|
-
success: exitCode === 0,
|
|
36
|
-
exitCode,
|
|
37
|
-
ms,
|
|
38
|
-
}
|
|
39
|
-
console.log(l)
|
|
40
|
-
console.log(JSON.stringify(lines, null, 2))
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return r
|
|
44
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { BunCmd } from "./BunCmd"
|
|
2
|
-
import { cryAndTryAgainLater } from "./cryAndTryAgainLater"
|
|
3
|
-
import { runCmdAsync } from "./runCmdAsync"
|
|
4
|
-
|
|
5
|
-
export async function runCmdLocally(cmd: string | string[]): Promise<BunCmd> {
|
|
6
|
-
return runCmdAsync(["sh", "-c", Array.isArray(cmd) ? cmd.join(" ") : cmd])
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export async function runCmdLocallyAndExitOnError(cmd: string | string[]): Promise<BunCmd> {
|
|
10
|
-
const got = await runCmdLocally(cmd)
|
|
11
|
-
if (!got.success) return cryAndTryAgainLater(got)
|
|
12
|
-
return got
|
|
13
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Like Object.keys, but unsound in exchange for more convenience.
|
|
3
|
-
*
|
|
4
|
-
* Casts the result of Object.keys to the known keys of an object type,
|
|
5
|
-
* even though JavaScript objects may contain additional keys.
|
|
6
|
-
*
|
|
7
|
-
* Only use this function when you know/control the provenance of the object
|
|
8
|
-
* you're iterating, and can verify it contains exactly the keys declared
|
|
9
|
-
* to the type system.
|
|
10
|
-
*
|
|
11
|
-
* Example:
|
|
12
|
-
* ```
|
|
13
|
-
* const o = {x: "ok", y: 10}
|
|
14
|
-
* o["z"] = "UNTRACKED_KEY"
|
|
15
|
-
* const safeKeys = Object.keys(o)
|
|
16
|
-
* const unsafeKeys = objectKeys(o)
|
|
17
|
-
* ```
|
|
18
|
-
* => const safeKeys: string[]
|
|
19
|
-
* => const unsafeKeys: ("x" | "y")[] // Missing "z"
|
|
20
|
-
*/
|
|
21
|
-
export const objectKeys = Object.keys as <T>(obj: T) => Array<keyof T>
|