@adaptive-sm/astro-ui 0.1.1 → 0.3.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 +52 -12
- 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 +6 -6
- 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 +20 -15
- package/lib/dev/TailwindIndicator.astro +2 -2
- package/lib/form/Fieldset.astro +8 -5
- package/lib/generate_demo_list/DemoList.astro +8 -6
- package/lib/generate_demo_list/generateDemoList.ts +2 -2
- package/lib/generate_image_list/generateImageList.ts +27 -3
- package/lib/grid/FeatureGridSection.astro +73 -0
- package/lib/grid/GridFeatureType.ts +5 -0
- 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/iconGithub.ts +4 -0
- package/lib/icons/iconGoogle.ts +4 -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/ImageType.ts +1 -0
- package/lib/img/Img.astro +10 -7
- package/lib/img/TypedImg.astro +15 -13
- package/lib/img/TypedImgB2.astro +23 -0
- package/lib/img/classInvertBlack.ts +1 -0
- package/lib/img/classesImgZoomInOnHover10.ts +1 -0
- package/lib/img/classesImgZoomInOnHover5.ts +1 -0
- package/lib/layouts/MarkdownPageWrapper.astro +19 -0
- package/lib/layouts/MinimalLayout.astro +23 -16
- package/lib/layouts/parts/ThemeToggle.astro +10 -10
- 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 +4 -4
- package/lib/modal/ModalButton.astro +24 -11
- package/lib/page/PageCentered.astro +5 -3
- package/lib/page/PageCenteredCard.astro +7 -5
- package/lib/page/{classesBg.ts → classesBg100.ts} +2 -2
- package/lib/page/classesBg50.ts +27 -0
- 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 +19 -14
- package/lib/icon/Icon1.astro +0 -21
- package/lib/img/classInvertDiagram.ts +0 -1
- package/lib/img/classesImgZoomInOnHover.ts +0 -1
- 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/link/LinkText.astro
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
---
|
|
2
|
-
import {
|
|
2
|
+
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
import { classMerge } from "~ui/utils/classMerge"
|
|
3
4
|
|
|
4
5
|
interface Props {
|
|
5
6
|
title?: string
|
|
6
7
|
href: string
|
|
7
8
|
newTab?: boolean
|
|
8
9
|
class?: string
|
|
10
|
+
restProps?: HTMLAttributes<"a">
|
|
9
11
|
}
|
|
10
|
-
const
|
|
11
|
-
const title =
|
|
12
|
-
const href =
|
|
13
|
-
const newTab =
|
|
12
|
+
const p = Astro.props
|
|
13
|
+
const title = p.title
|
|
14
|
+
const href = p.href
|
|
15
|
+
const newTab = p.newTab
|
|
14
16
|
---
|
|
15
17
|
|
|
16
18
|
<a
|
|
17
19
|
href={href}
|
|
18
|
-
class={classMerge("text-blue-500 no-underline hover:underline",
|
|
20
|
+
class={classMerge("text-blue-500 no-underline hover:underline", p.class)}
|
|
19
21
|
target={newTab ? "_blank" : undefined}
|
|
20
22
|
title={title}
|
|
23
|
+
{...p.restProps}
|
|
21
24
|
>
|
|
22
|
-
<slot/>
|
|
25
|
+
<slot />
|
|
23
26
|
</a>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { mdiCircle } from "@mdi/js"
|
|
3
|
-
import
|
|
3
|
+
import Icon from "~ui/icon/Icon.astro"
|
|
4
|
+
import { classMerge } from "~ui/utils/classMerge"
|
|
4
5
|
import TextOrLink from "./TextOrLink.astro"
|
|
5
|
-
import Icon1 from "~/icon/Icon1.astro"
|
|
6
6
|
|
|
7
7
|
interface Props {
|
|
8
8
|
points: string[] | Readonly<string[]>
|
|
@@ -10,14 +10,14 @@ interface Props {
|
|
|
10
10
|
classText?: string
|
|
11
11
|
classBullet?: string
|
|
12
12
|
}
|
|
13
|
-
const
|
|
13
|
+
const p = Astro.props
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
{
|
|
17
|
-
|
|
18
|
-
<div class={classMerge("flex
|
|
19
|
-
<
|
|
20
|
-
<TextOrLink text={
|
|
17
|
+
p.points.map((point) => (
|
|
18
|
+
<div class={classMerge("flex gap-1", p.class)}>
|
|
19
|
+
<Icon path={mdiCircle} class={classMerge("size-1.5 mt-2.5 shrink-0", p.classBullet)} />
|
|
20
|
+
<TextOrLink text={point} class={p.classText} />
|
|
21
21
|
</div>
|
|
22
22
|
))
|
|
23
23
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { mdiCheck } from "@mdi/js"
|
|
3
|
-
import { classMerge } from "
|
|
3
|
+
import { classMerge } from "~ui/utils/classMerge"
|
|
4
4
|
import TextOrLink from "./TextOrLink.astro"
|
|
5
|
-
import
|
|
5
|
+
import Icon from "~ui/icon/Icon.astro"
|
|
6
6
|
|
|
7
7
|
interface Props {
|
|
8
8
|
point: string
|
|
@@ -14,7 +14,7 @@ const p = Astro.props
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
<div class={classMerge("flex flex-row flex-nowrap", p.class)}>
|
|
17
|
-
<
|
|
17
|
+
<Icon path={mdiCheck} class={classMerge("fill-green-600 dark:fill-green-600 mr-1 flex-none", p.classBullet)} />
|
|
18
18
|
<TextOrLink text={p.point} class={p.classText} />
|
|
19
19
|
<slot />
|
|
20
20
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { mdiCheck } from "@mdi/js"
|
|
3
|
-
import { classMerge } from "
|
|
4
|
-
import
|
|
3
|
+
import { classMerge } from "~ui/utils/classMerge"
|
|
4
|
+
import Icon from "~ui/icon/Icon.astro"
|
|
5
5
|
import TextOrLink from "./TextOrLink.astro"
|
|
6
6
|
|
|
7
7
|
interface Props {
|
|
@@ -16,7 +16,7 @@ const props = Astro.props
|
|
|
16
16
|
{
|
|
17
17
|
props.points.map((p) => (
|
|
18
18
|
<div class={classMerge("flex flex-row flex-nowrap", props.class)}>
|
|
19
|
-
<
|
|
19
|
+
<Icon path={mdiCheck} class={classMerge("fill-green-600 dark:fill-green-600 mr-1 flex-none", props.classBullet)} />
|
|
20
20
|
<TextOrLink text={p} class={props.classText} />
|
|
21
21
|
</div>
|
|
22
22
|
))
|
package/lib/list/Ps.astro
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import type { MayHaveClass } from "~ui/utils/MayHaveClass"
|
|
3
|
+
|
|
4
|
+
interface Props extends MayHaveClass {
|
|
5
|
+
text?: string
|
|
6
|
+
lines?: string[]
|
|
4
7
|
class?: string
|
|
5
8
|
}
|
|
6
|
-
const
|
|
7
|
-
const lines =
|
|
9
|
+
const p = Astro.props
|
|
10
|
+
const lines = p.lines ?? (p.text ? p.text.split("\n") : [])
|
|
8
11
|
---
|
|
9
12
|
|
|
10
13
|
<>
|
|
11
|
-
{lines.map((line) => <p class={
|
|
14
|
+
{lines.map((line) => <p class={p.class}>{line}</p>)}
|
|
12
15
|
</>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
import LinkText from "
|
|
3
|
-
import { classMerge } from "
|
|
2
|
+
import LinkText from "~ui/link/LinkText.astro"
|
|
3
|
+
import { classMerge } from "~ui/utils/classMerge"
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
6
|
text: string
|
|
@@ -10,10 +10,4 @@ const props = Astro.props
|
|
|
10
10
|
const text = props.text
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
{
|
|
14
|
-
text.startsWith("http") ? (
|
|
15
|
-
<LinkText href={text}>{text}</LinkText>
|
|
16
|
-
) : (
|
|
17
|
-
<p class={classMerge("leading-relaxed", props.class)}>{text}</p>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
13
|
+
{text.startsWith("http") ? <LinkText href={text}>{text}</LinkText> : <p class={classMerge(props.class)}>{text}</p>}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { classArr } from "~ui/utils/classArr"
|
|
3
|
+
|
|
4
|
+
import type { HTMLAttributes } from "astro/types"
|
|
5
|
+
import "./markdown.css"
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
id?: string
|
|
9
|
+
class?: string
|
|
10
|
+
restProps?: HTMLAttributes<"div">
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const p = Astro.props
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<div id={p.id} class={classArr("markdown-body", p.class)} {...p.restProps}>
|
|
17
|
+
<slot />
|
|
18
|
+
</div>
|
package/lib/modal/Modal.astro
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
import "./Modal.module.css"
|
|
3
|
-
import { classesTextHeader } from "
|
|
4
|
-
import { classMerge } from "
|
|
5
|
-
import { buttonVariant } from "
|
|
6
|
-
import Button from "
|
|
3
|
+
import { classesTextHeader } from "~ui/text/classesTextHeader"
|
|
4
|
+
import { classMerge } from "~ui/utils/classMerge"
|
|
5
|
+
import { buttonVariant } from "~ui/button/buttonCva"
|
|
6
|
+
import Button from "~ui/button/Button.astro"
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* https://github.com/markteekman/accessible-astro-components/blob/main/Modal.astro
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
import {
|
|
3
|
-
import type { ButtonSize, ButtonVariant } from "~/button/buttonCva"
|
|
2
|
+
import type { ButtonSize, ButtonVariant } from "~ui/button/buttonCva"
|
|
4
3
|
import Modal from "./Modal.astro"
|
|
5
|
-
import { classesTextGray } from "
|
|
6
|
-
import { classArr } from "
|
|
7
|
-
import Button from "
|
|
4
|
+
import { classesTextGray } from "~ui/text/classesTextGray"
|
|
5
|
+
import { classArr } from "~ui/utils/classArr"
|
|
6
|
+
import Button from "~ui/button/Button.astro"
|
|
8
7
|
|
|
9
8
|
interface Props {
|
|
10
9
|
button: {
|
|
@@ -22,11 +21,25 @@ interface Props {
|
|
|
22
21
|
class?: string
|
|
23
22
|
classContentArea?: string
|
|
24
23
|
}
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
const p = Astro.props
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Generates a random alphanumeric string ID
|
|
28
|
+
*
|
|
29
|
+
* Uses Math.random() converted to base-36 to create a string of letters and numbers.
|
|
30
|
+
* The substring(2, 11) removes the "0." prefix and takes 9 characters for a good balance
|
|
31
|
+
* of uniqueness and brevity (approximately 10^36 possible combinations).
|
|
32
|
+
*
|
|
33
|
+
* @returns {string} A 9-character random alphanumeric string
|
|
34
|
+
*/
|
|
35
|
+
function generateRandomId(): string {
|
|
36
|
+
return Math.random().toString(36).substring(2, 11)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const id = p.id ?? `modal-id-${generateRandomId()}`
|
|
40
|
+
const button = p.button
|
|
41
|
+
const title = p.title ?? "Dialog Title"
|
|
42
|
+
const classContentArea = p.classContentArea
|
|
30
43
|
---
|
|
31
44
|
|
|
32
45
|
<Button id={id} {...button} />
|
|
@@ -34,7 +47,7 @@ const classContentArea = props.classContentArea
|
|
|
34
47
|
triggerId={id}
|
|
35
48
|
title={title}
|
|
36
49
|
titleClass={classArr(classesTextGray, "text-xl", "mb-2")}
|
|
37
|
-
class={
|
|
50
|
+
class={p.class}
|
|
38
51
|
classContentArea={classContentArea}
|
|
39
52
|
>
|
|
40
53
|
<slot />
|
|
@@ -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,6 +1,6 @@
|
|
|
1
|
-
export type ClassesBg = keyof typeof
|
|
1
|
+
export type ClassesBg = keyof typeof classesBg100
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const classesBg100 = {
|
|
4
4
|
white: "bg-white dark:bg-black",
|
|
5
5
|
orange: "bg-orange-100 dark:bg-yellow-900",
|
|
6
6
|
red: "bg-red-100 dark:bg-red-900",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type ClassesBg = keyof typeof classesBg50
|
|
2
|
+
|
|
3
|
+
export const classesBg50 = {
|
|
4
|
+
white: "bg-white dark:bg-black",
|
|
5
|
+
orange: "bg-orange-50 dark:bg-yellow-950",
|
|
6
|
+
red: "bg-red-50 dark:bg-red-950",
|
|
7
|
+
amber: "bg-amber-50 dark:bg-amber-950",
|
|
8
|
+
yellow: "bg-yellow-50 dark:bg-yellow-950",
|
|
9
|
+
lime: "bg-lime-50 dark:bg-lime-950",
|
|
10
|
+
green: "bg-green-50 dark:bg-green-950",
|
|
11
|
+
emerald: "bg-emerald-50 dark:bg-emerald-950",
|
|
12
|
+
teal: "bg-teal-50 dark:bg-teal-950",
|
|
13
|
+
cyan: "bg-cyan-50 dark:bg-cyan-950",
|
|
14
|
+
sky: "bg-sky-50 dark:bg-sky-950",
|
|
15
|
+
blue: "bg-blue-50 dark:bg-blue-950",
|
|
16
|
+
indigo: "bg-indigo-50 dark:bg-indigo-950",
|
|
17
|
+
violet: "bg-violet-50 dark:bg-violet-950",
|
|
18
|
+
purple: "bg-purple-50 dark:bg-purple-950",
|
|
19
|
+
fuchsia: "bg-fuchsia-50 dark:bg-fuchsia-950",
|
|
20
|
+
pink: "bg-pink-50 dark:bg-pink-950",
|
|
21
|
+
rose: "bg-rose-50 dark:bg-rose-950",
|
|
22
|
+
slate: "bg-slate-50 dark:bg-slate-950",
|
|
23
|
+
gray: "bg-gray-50 dark:bg-gray-950",
|
|
24
|
+
zinc: "bg-zinc-50 dark:bg-zinc-950",
|
|
25
|
+
neutral: "bg-neutral-50 dark:bg-neutral-950",
|
|
26
|
+
stone: "bg-stone-50 dark:bg-stone-950",
|
|
27
|
+
} as const
|
|
@@ -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.3.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"astro": "astro",
|
|
6
6
|
"dev": "nice -5 astro dev",
|
|
@@ -9,33 +9,35 @@
|
|
|
9
9
|
"deploy": "bun run build && bun run upload && bun run tag",
|
|
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 ./src/demos/generateDemoList.cli.ts",
|
|
13
14
|
"generateImageList": "bun run ./src/pages/images/generateImageList.cli.ts",
|
|
14
15
|
"generateAiRulesLib": "bash ./lib/generate_ai_rules/generate_agent_rules_1_lib.bash",
|
|
15
16
|
"update": "nice -15 bun x npm-check-updates -u && bun i",
|
|
16
|
-
"update:commit": "bun x npm-check-updates -u && bun i && git add package.json && bun run tsc && git commit -m \"update dependencies\" && git push",
|
|
17
|
+
"update:commit": "bun x npm-check-updates -u && bun i && git add package.json && bun run tsc && git commit -m \"chore(deps): update dependencies\" && git push",
|
|
17
18
|
"clean": "rm -rf ./dist",
|
|
18
19
|
"reset": "rm -rf ./node_modules"
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
21
|
-
"@
|
|
22
|
-
"@
|
|
22
|
+
"@adaptive-sm/utils": "^0.5.0",
|
|
23
|
+
"@astrojs/check": "^0.9.5",
|
|
24
|
+
"@biomejs/biome": "^2.3.6",
|
|
23
25
|
"@mdi/js": "^7.4.47",
|
|
24
|
-
"@tailwindcss/vite": "^4.1.
|
|
26
|
+
"@tailwindcss/vite": "^4.1.17",
|
|
25
27
|
"@types/bun": "latest",
|
|
26
|
-
"astro": "^5.
|
|
27
|
-
"dayjs": "^1.11.
|
|
28
|
+
"astro": "^5.15.9",
|
|
29
|
+
"dayjs": "^1.11.19",
|
|
28
30
|
"image-size": "^2.0.2",
|
|
29
31
|
"prettier": "^3.6.2",
|
|
30
32
|
"prettier-plugin-astro": "^0.14.1",
|
|
31
33
|
"rehype-autolink-headings": "^7.1.0",
|
|
32
34
|
"rehype-slug": "^6.0.0",
|
|
33
35
|
"remark-toc": "^9.0.0",
|
|
34
|
-
"rollup-plugin-visualizer": "^6.0.
|
|
35
|
-
"tailwind-merge": "^3.
|
|
36
|
-
"tailwindcss": "^4.1.
|
|
37
|
-
"typescript": "^5.9.
|
|
38
|
-
"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"
|
|
39
41
|
},
|
|
40
42
|
"prettier": {
|
|
41
43
|
"semi": false,
|
|
@@ -66,5 +68,8 @@
|
|
|
66
68
|
"web-development",
|
|
67
69
|
"frontend",
|
|
68
70
|
"typescript"
|
|
69
|
-
]
|
|
71
|
+
],
|
|
72
|
+
"repository": {
|
|
73
|
+
"url": "git+https://github.com/adaptive-shield-matrix/astro-ui.git"
|
|
74
|
+
}
|
|
70
75
|
}
|
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 align-middle dark:fill-white", props.class)}
|
|
19
|
-
>
|
|
20
|
-
<path d={props.path}></path>
|
|
21
|
-
</svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const classInvertDiagram = "invert-diagram"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const classesImgZoomInOnHover = "transform transition-transform duration-200 -translate-x-3 hover:scale-110"
|