@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
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { urlAlphabet32 } from "./urlAlphabet32"
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* * works in browser
|
|
5
|
-
* * completely random, not sequential as a feature
|
|
6
|
-
* * 32 chars: url friendly, readable, not disambiguate
|
|
7
|
-
* * variable length
|
|
8
|
-
* * uses secure crypto/web-crypto/node:crypto api
|
|
9
|
-
* * generates in batches of 4 for better perf
|
|
10
|
-
* @param len - character amount
|
|
11
|
-
*/
|
|
12
|
-
export function generateReadableId(len: number = 16): () => string {
|
|
13
|
-
const arr = new Uint16Array(Math.ceil(len / 4))
|
|
14
|
-
return () => {
|
|
15
|
-
crypto.getRandomValues(arr)
|
|
16
|
-
let r = ""
|
|
17
|
-
for (const a of arr) {
|
|
18
|
-
const n1 = (a >> 9) % 32
|
|
19
|
-
r += urlAlphabet32[n1]!
|
|
20
|
-
if (r.length >= len) return r
|
|
21
|
-
|
|
22
|
-
const n2 = (a >> 6) % 32
|
|
23
|
-
r += urlAlphabet32[n2]!
|
|
24
|
-
|
|
25
|
-
if (r.length >= len) return r
|
|
26
|
-
const n3 = (a >> 3) % 32
|
|
27
|
-
r += urlAlphabet32[n3]!
|
|
28
|
-
|
|
29
|
-
if (r.length >= len) return r
|
|
30
|
-
const n4 = a % 32
|
|
31
|
-
r += urlAlphabet32[n4]!
|
|
32
|
-
}
|
|
33
|
-
return r
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* - calculate strength - https://zelark.github.io/nano-id-cc/
|
|
3
|
-
* - remove 0, O, i, l for better readability and no disambiguity
|
|
4
|
-
* - 32 length = 10 (numbers) - 1 (no zero) + 26 (alphabet) - 3 (i,l,o)
|
|
5
|
-
* - ignores casing
|
|
6
|
-
* - Crockford's Base32 - https://www.crockford.com/base32.html
|
|
7
|
-
*/
|
|
8
|
-
export const urlAlphabet32 = "123456789abcdefghjkmnpqrstuvwxyz"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|