@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.
Files changed (101) hide show
  1. package/README.md +52 -12
  2. package/lib/badge/Badge.astro +27 -0
  3. package/lib/badge/classesBadge.ts +67 -0
  4. package/lib/button/Button.astro +17 -27
  5. package/lib/button/buttonCva.ts +6 -6
  6. package/lib/button/buttonIconCva.ts +2 -2
  7. package/lib/button/classesButtonClickAnimation.ts +1 -1
  8. package/lib/button/classesButtonClickAnimationPush.ts +1 -1
  9. package/lib/button/classesButtonClickAnimationSquish.ts +1 -1
  10. package/lib/card/CardWrapper.astro +6 -5
  11. package/lib/card/classesBorderWrapper.ts +1 -0
  12. package/lib/card/classesCardWrapper.ts +21 -9
  13. package/lib/card/classesShadow.ts +5 -0
  14. package/lib/details/Details.astro +20 -15
  15. package/lib/dev/TailwindIndicator.astro +2 -2
  16. package/lib/form/Fieldset.astro +8 -5
  17. package/lib/generate_demo_list/DemoList.astro +8 -6
  18. package/lib/generate_demo_list/generateDemoList.ts +2 -2
  19. package/lib/generate_image_list/generateImageList.ts +27 -3
  20. package/lib/grid/FeatureGridSection.astro +73 -0
  21. package/lib/grid/GridFeatureType.ts +5 -0
  22. package/lib/grid/classesGridCols.ts +27 -2
  23. package/lib/header/PageHeader.astro +25 -0
  24. package/lib/header/SectionHeader.astro +37 -0
  25. package/lib/icon/Icon.astro +26 -0
  26. package/lib/icons/iconGithub.ts +4 -0
  27. package/lib/icons/iconGoogle.ts +4 -0
  28. package/lib/icons/iconLinkedin.ts +2 -0
  29. package/lib/icons/iconNpm.ts +2 -0
  30. package/lib/icons/iconTelegram.ts +2 -0
  31. package/lib/icons/iconTrello.ts +2 -0
  32. package/lib/icons/iconXcom.ts +1 -0
  33. package/lib/img/ImageType.ts +1 -0
  34. package/lib/img/Img.astro +10 -7
  35. package/lib/img/TypedImg.astro +15 -13
  36. package/lib/img/TypedImgB2.astro +23 -0
  37. package/lib/img/classInvertBlack.ts +1 -0
  38. package/lib/img/classesImgZoomInOnHover10.ts +1 -0
  39. package/lib/img/classesImgZoomInOnHover5.ts +1 -0
  40. package/lib/layouts/MarkdownPageWrapper.astro +19 -0
  41. package/lib/layouts/MinimalLayout.astro +23 -16
  42. package/lib/layouts/parts/ThemeToggle.astro +10 -10
  43. package/lib/link/LinkButton.astro +18 -19
  44. package/lib/link/LinkText.astro +10 -7
  45. package/lib/link/classesTextLink.ts +1 -1
  46. package/lib/list/BlackBulletPoint.astro +1 -1
  47. package/lib/list/BlackBulletPoints.astro +7 -7
  48. package/lib/list/CheckPoint.astro +3 -3
  49. package/lib/list/CheckPoints.astro +3 -3
  50. package/lib/list/NumberedList.astro +1 -1
  51. package/lib/list/Ps.astro +8 -5
  52. package/lib/list/TextOrLink.astro +3 -9
  53. package/lib/md/MarkdownDiv.astro +18 -0
  54. package/lib/modal/Modal.astro +4 -4
  55. package/lib/modal/ModalButton.astro +24 -11
  56. package/lib/page/PageCentered.astro +5 -3
  57. package/lib/page/PageCenteredCard.astro +7 -5
  58. package/lib/page/{classesBg.ts → classesBg100.ts} +2 -2
  59. package/lib/page/classesBg50.ts +27 -0
  60. package/lib/page/classesPageCentered.ts +1 -1
  61. package/lib/popover/Popover1.astro +4 -4
  62. package/lib/select/Select.astro +14 -10
  63. package/lib/table/Table.astro +2 -2
  64. package/lib/table/TableD.astro +2 -2
  65. package/lib/table/TableM.astro +2 -2
  66. package/lib/table/TableMEntry.astro +2 -2
  67. package/lib/table/tableVisibilityClasses.ts +3 -3
  68. package/lib/utils/HasId.ts +3 -0
  69. package/lib/utils/HasSubtitle.ts +4 -0
  70. package/lib/utils/HasTitle.ts +4 -0
  71. package/lib/utils/MayHaveButtonVariant.ts +5 -0
  72. package/lib/utils/MayHaveClass.ts +3 -0
  73. package/lib/utils/MayHaveIcon.ts +4 -0
  74. package/lib/utils/MayHaveId.ts +3 -0
  75. package/lib/utils/MayHaveInnerClass.ts +3 -0
  76. package/lib/utils/MayHaveSubtitle.ts +4 -0
  77. package/lib/utils/MayHaveTitle.ts +4 -0
  78. package/package.json +19 -14
  79. package/lib/icon/Icon1.astro +0 -21
  80. package/lib/img/classInvertDiagram.ts +0 -1
  81. package/lib/img/classesImgZoomInOnHover.ts +0 -1
  82. package/lib/layouts/MarkdownWrapper.astro +0 -17
  83. package/lib/utils/bun/BunCmd.ts +0 -7
  84. package/lib/utils/bun/cryAndTryAgainLater.ts +0 -6
  85. package/lib/utils/bun/logBunCmd.ts +0 -1
  86. package/lib/utils/bun/runCmdAsync.ts +0 -44
  87. package/lib/utils/bun/runCmdLocally.ts +0 -13
  88. package/lib/utils/obj/objectKeys.ts +0 -21
  89. package/lib/utils/ran/generateId12.ts +0 -7
  90. package/lib/utils/ran/generateId3.ts +0 -7
  91. package/lib/utils/ran/generateId4.ts +0 -7
  92. package/lib/utils/ran/generateId5.ts +0 -7
  93. package/lib/utils/ran/generateId6.ts +0 -7
  94. package/lib/utils/ran/generateId7.ts +0 -7
  95. package/lib/utils/ran/generateReadableId.ts +0 -35
  96. package/lib/utils/ran/urlAlphabet32.ts +0 -8
  97. /package/lib/{layouts/parts → md}/markdown.css +0 -0
  98. /package/lib/utils/{ui/classArr.ts → classArr.ts} +0 -0
  99. /package/lib/utils/{ui/classMerge.ts → classMerge.ts} +0 -0
  100. /package/lib/utils/{ui/isDevEnv.ts → isDevEnv.ts} +0 -0
  101. /package/lib/utils/{ui/tailwindBreakpoint.ts → tailwindBreakpoint.ts} +0 -0
@@ -1,23 +1,26 @@
1
1
  ---
2
- import { classMerge } from "~/utils/ui/classMerge"
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 props = Astro.props
11
- const title = props.title
12
- const href = props.href
13
- const newTab = props.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", props.class)}
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,4 +1,4 @@
1
- import { classArr } from "../utils/ui/classArr"
1
+ import { classArr } from "../utils/classArr"
2
2
 
3
3
  export const classesTextLink = classArr(
4
4
  "text-blue-600 hover:text-black", // light
@@ -1,5 +1,5 @@
1
1
  ---
2
- import { classMerge } from "~/utils/ui/classMerge"
2
+ import { classMerge } from "~ui/utils/classMerge"
3
3
 
4
4
  interface Props {
5
5
  class?: string
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  import { mdiCircle } from "@mdi/js"
3
- import { classMerge } from "~/utils/ui/classMerge"
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 props = Astro.props
13
+ const p = Astro.props
14
14
  ---
15
15
 
16
16
  {
17
- props.points.map((p) => (
18
- <div class={classMerge("flex flex-row flex-nowrap", props.class)}>
19
- <Icon1 path={mdiCircle} class={classMerge("w-1.5 h-1.5 mt-3 mx-1.5 shrink-0", props.classBullet)} />
20
- <TextOrLink text={p} class={props.classText} />
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 "~/utils/ui/classMerge"
3
+ import { classMerge } from "~ui/utils/classMerge"
4
4
  import TextOrLink from "./TextOrLink.astro"
5
- import Icon1 from "~/icon/Icon1.astro"
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
- <Icon1 path={mdiCheck} class={classMerge("fill-green-600 dark:fill-green-600 mr-1 flex-none", p.classBullet)} />
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 "~/utils/ui/classMerge"
4
- import Icon1 from "~/icon/Icon1.astro"
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
- <Icon1 path={mdiCheck} class={classMerge("fill-green-600 dark:fill-green-600 mr-1 flex-none", props.classBullet)} />
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
  ))
@@ -1,5 +1,5 @@
1
1
  ---
2
- import { classMerge } from "~/utils/ui/classMerge"
2
+ import { classMerge } from "~ui/utils/classMerge"
3
3
 
4
4
  interface Props {
5
5
  points: string[] | Readonly<string[]>
package/lib/list/Ps.astro CHANGED
@@ -1,12 +1,15 @@
1
1
  ---
2
- interface Props {
3
- lines: string[] | Readonly<string[]>
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 props = Astro.props
7
- const lines = props.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={props.class}>{line}</p>)}
14
+ {lines.map((line) => <p class={p.class}>{line}</p>)}
12
15
  </>
@@ -1,6 +1,6 @@
1
1
  ---
2
- import LinkText from "~/link/LinkText.astro"
3
- import { classMerge } from "~/utils/ui/classMerge"
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>
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  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"
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 { generateId5 } from "~/utils/ran/generateId5"
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 "~/text/classesTextGray"
6
- import { classArr } from "~/utils/ui/classArr"
7
- import Button from "~/button/Button.astro"
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 props = Astro.props
26
- const id = props.id ?? `modal-id-${generateId5()}`
27
- const button = props.button
28
- const title = props.title ?? "Dialog Title"
29
- const classContentArea = props.classContentArea
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={props.class}
50
+ class={p.class}
38
51
  classContentArea={classContentArea}
39
52
  >
40
53
  <slot />
@@ -1,14 +1,16 @@
1
1
  ---
2
- import { classMerge } from "~/utils/ui/classMerge"
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 { classMerge } from "~/utils/ui/classMerge"
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 props = Astro.props
12
+ const p = Astro.props
11
13
  ---
12
14
 
13
- <PageCentered class={props.class}>
14
- <div class={classMerge(classesCardWrapperPage, props.classInner)}>
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 classesBg
1
+ export type ClassesBg = keyof typeof classesBg100
2
2
 
3
- export const classesBg = {
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,4 +1,4 @@
1
- import { classArr } from "~/utils/ui/classArr"
1
+ import { classArr } from "~ui/utils/classArr"
2
2
 
3
3
  export const classesPageCentered = classArr(
4
4
  "flex flex-col justify-center items-center my-auto", // align center
@@ -1,7 +1,7 @@
1
1
  ---
2
- import Icon1 from "~/icon/Icon1.astro"
3
- import { buttonVariant, type ButtonVariant, buttonCva2 } from "~/button/buttonCva"
4
- import { classArr } from "~/utils/ui/classArr"
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
- <Icon1 path={icon} />
26
+ <Icon path={icon} />
27
27
  {title}
28
28
  </summary>
29
29
  <div
@@ -1,18 +1,21 @@
1
1
  ---
2
- import { classArr } from "~/utils/ui/classArr"
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
- type NativeSingleSelectProps = {
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={props.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
- props.class,
37
+ p.class,
35
38
  )}
36
- value={props.initialValue}
39
+ value={p.initialValue}
40
+ {...p.restProps}
37
41
  >
38
42
  {
39
- props.options.map((option: string) => (
40
- <option value={option} class={props.optionClass}>
41
- {getDisplayValue(option, props.valueDisplay)}
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
  }
@@ -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 "~/utils/ui/classMerge"
6
- import { type TailwindBreakpoint, tailwindBreakpoint } from "~/utils/ui/tailwindBreakpoint"
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"
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  import { type DesktopTableClassses } from "./DesktopTableClassses"
3
3
  import { sharedTableRowClasses } from "./sharedTableRowClasses"
4
- // import { t4table } from "~/ui_tables/table3/t4table"
5
- import { classMerge } from "~/utils/ui/classMerge"
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 {
@@ -1,8 +1,8 @@
1
1
  ---
2
- import { classMerge } from "~/utils/ui/classMerge"
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 "~/table/MobileTableClassses"
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 "~/utils/ui/classMerge"
2
+ import { classMerge } from "~ui/utils/classMerge"
3
3
  import { type TableColumnDef } from "./TableColumnDef"
4
- import type { MobileTableClassses } from "~/table/MobileTableClassses"
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 "~/utils/ui/classMerge"
2
- import type { TailwindBreakpoint } from "~/utils/ui/tailwindBreakpoint"
3
- import { tailwindBreakpoint } from "~/utils/ui/tailwindBreakpoint"
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
@@ -0,0 +1,3 @@
1
+ export interface HasId {
2
+ id: string
3
+ }
@@ -0,0 +1,4 @@
1
+ export interface HasSubtitle {
2
+ subtitle: string
3
+ subtitleClass?: string
4
+ }
@@ -0,0 +1,4 @@
1
+ export interface HasTitle {
2
+ title: string
3
+ titleClass?: string
4
+ }
@@ -0,0 +1,5 @@
1
+ import type { ButtonVariant } from "~ui/button/buttonCva"
2
+
3
+ export interface MayHaveButtonVariant {
4
+ variant?: ButtonVariant
5
+ }
@@ -0,0 +1,3 @@
1
+ export interface MayHaveClass {
2
+ class?: string
3
+ }
@@ -0,0 +1,4 @@
1
+ export interface MayHaveIcon {
2
+ icon?: string
3
+ iconClass?: string
4
+ }
@@ -0,0 +1,3 @@
1
+ export interface MayHaveId {
2
+ id?: string
3
+ }
@@ -0,0 +1,3 @@
1
+ export interface MayHaveInnerClass {
2
+ innerClass?: string
3
+ }
@@ -0,0 +1,4 @@
1
+ export interface MayHaveSubtitle {
2
+ subtitle?: string
3
+ subtitleClass?: string
4
+ }
@@ -0,0 +1,4 @@
1
+ export interface MayHaveTitle {
2
+ title?: string
3
+ titleClass?: string
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptive-sm/astro-ui",
3
- "version": "0.1.1",
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
- "generateDemoList": "bun run ./src/pages/demos/generateDemoList.cli.ts",
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
- "@astrojs/check": "^0.9.4",
22
- "@biomejs/biome": "^2.2.4",
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.13",
26
+ "@tailwindcss/vite": "^4.1.17",
25
27
  "@types/bun": "latest",
26
- "astro": "^5.13.9",
27
- "dayjs": "^1.11.18",
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.3",
35
- "tailwind-merge": "^3.3.1",
36
- "tailwindcss": "^4.1.13",
37
- "typescript": "^5.9.2",
38
- "wrangler": "^4.38.0"
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
  }
@@ -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"