yummies 7.12.0 → 7.13.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 +5 -87
- package/async.cjs +17 -0
- package/async.cjs.map +1 -1
- package/async.d.ts +17 -0
- package/async.js +17 -0
- package/async.js.map +1 -1
- package/common.cjs.map +1 -1
- package/common.d.ts +18 -0
- package/common.js.map +1 -1
- package/complex.cjs.map +1 -1
- package/complex.d.ts +66 -0
- package/complex.js.map +1 -1
- package/cookie.cjs.map +1 -1
- package/cookie.d.ts +18 -0
- package/cookie.js.map +1 -1
- package/css.cjs +16 -0
- package/css.cjs.map +1 -1
- package/css.d.ts +17 -0
- package/css.js +16 -0
- package/css.js.map +1 -1
- package/data.cjs.map +1 -1
- package/data.d.ts +18 -0
- package/data.js.map +1 -1
- package/date-time.cjs +16 -0
- package/date-time.cjs.map +1 -1
- package/date-time.d.ts +17 -0
- package/date-time.js +16 -0
- package/date-time.js.map +1 -1
- package/device.cjs +17 -0
- package/device.cjs.map +1 -1
- package/device.d.ts +17 -0
- package/device.js +17 -0
- package/device.js.map +1 -1
- package/encodings.cjs.map +1 -1
- package/encodings.d.ts +17 -0
- package/encodings.js.map +1 -1
- package/errors.cjs +16 -0
- package/errors.cjs.map +1 -1
- package/errors.d.ts +17 -0
- package/errors.js +16 -0
- package/errors.js.map +1 -1
- package/file.cjs +16 -0
- package/file.cjs.map +1 -1
- package/file.d.ts +16 -0
- package/file.js +16 -0
- package/file.js.map +1 -1
- package/format.cjs.map +1 -1
- package/format.d.ts +18 -0
- package/format.js.map +1 -1
- package/html.cjs +16 -0
- package/html.cjs.map +1 -1
- package/html.d.ts +17 -0
- package/html.js +16 -0
- package/html.js.map +1 -1
- package/id.cjs +16 -0
- package/id.cjs.map +1 -1
- package/id.d.ts +16 -0
- package/id.js +16 -0
- package/id.js.map +1 -1
- package/imports.cjs +16 -0
- package/imports.cjs.map +1 -1
- package/imports.d.ts +16 -0
- package/imports.js +16 -0
- package/imports.js.map +1 -1
- package/math.cjs.map +1 -1
- package/math.d.ts +17 -0
- package/math.js.map +1 -1
- package/media.cjs +16 -0
- package/media.cjs.map +1 -1
- package/media.d.ts +16 -0
- package/media.js +16 -0
- package/media.js.map +1 -1
- package/mobx.cjs +96 -0
- package/mobx.cjs.map +1 -1
- package/mobx.d.ts +101 -0
- package/mobx.js +96 -0
- package/mobx.js.map +1 -1
- package/ms.cjs +16 -0
- package/ms.cjs.map +1 -1
- package/ms.d.ts +16 -0
- package/ms.js +16 -0
- package/ms.js.map +1 -1
- package/number.cjs +16 -0
- package/number.cjs.map +1 -1
- package/number.d.ts +16 -0
- package/number.js +16 -0
- package/number.js.map +1 -1
- package/package.json +2 -2
- package/parser.cjs.map +1 -1
- package/parser.d.ts +17 -0
- package/parser.js.map +1 -1
- package/price.cjs.map +1 -1
- package/price.d.ts +16 -0
- package/price.js.map +1 -1
- package/random.cjs +16 -0
- package/random.cjs.map +1 -1
- package/random.d.ts +16 -0
- package/random.js +16 -0
- package/random.js.map +1 -1
- package/sound.cjs +16 -0
- package/sound.cjs.map +1 -1
- package/sound.d.ts +16 -0
- package/sound.js +16 -0
- package/sound.js.map +1 -1
- package/storage.cjs.map +1 -1
- package/storage.d.ts +16 -0
- package/storage.js.map +1 -1
- package/text.cjs +16 -0
- package/text.cjs.map +1 -1
- package/text.d.ts +16 -0
- package/text.js +16 -0
- package/text.js.map +1 -1
- package/type-guard.cjs.map +1 -1
- package/type-guard.d.ts +18 -0
- package/type-guard.js.map +1 -1
- package/types.d.ts +41 -0
- package/types.global.d.ts +41 -0
- package/vibrate.cjs +16 -0
- package/vibrate.cjs.map +1 -1
- package/vibrate.d.ts +16 -0
- package/vibrate.js +16 -0
- package/vibrate.js.map +1 -1
package/css.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.cjs","names":[],"sources":["../src/css.ts"],"sourcesContent":["import { cva as cvaLib } from 'class-variance-authority';\nimport clsx, { type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\nimport type { Maybe } from 'yummies/types';\n\ntype ClassProp = {\n class?: ClassValue;\n className?: ClassValue;\n};\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T;\n\n/**\n * Converts a length in **pixels** to a CSS **`rem`** string (`\"<number>rem\"`).\n *\n * Use when authoring component styles in JS/TS where design tokens are in px but the stylesheet\n * should scale with root font size (accessibility, user zoom). `remValue` is the assumed\n * `1rem` size in px (browser default is typically `16`).\n *\n * @param px - Pixel value to convert (not rounded; stringification keeps full float).\n * @param remValue - How many pixels one `rem` equals. Defaults to `16`.\n * @returns A string like `\"1.5rem\"` suitable for `style` or CSS-in-JS.\n *\n * @example\n * ```ts\n * const width = toRem(24); // '1.5rem' with default 16px root\n * ```\n *\n * @example\n * ```ts\n * // Custom root / design system where 1rem === 10px\n * const gap = toRem(20, 10); // '2rem'\n * ```\n */\nexport const toRem = (px: number, remValue = 16) => `${px / remValue}rem`;\n\n/**\n * Composes conditional class names like {@link https://github.com/lukeed/clsx | clsx}, then runs\n * the result through {@link https://github.com/dcastil/tailwind-merge | tailwind-merge} so\n * conflicting Tailwind utilities collapse to the last/intended one (e.g. two `padding-x` classes).\n *\n * Accepts the same argument shapes as `clsx`: strings, objects, arrays, falsy values to omit.\n *\n * @param args - Same as `clsx(...args)` — `ClassValue` rest parameters.\n * @returns A single merged class string, safe for `className` on DOM/React.\n *\n * @example\n * ```ts\n * cx('px-2 py-1 text-sm', 'px-4'); // 'py-1 text-sm px-4' — padding-x merged\n * ```\n *\n * @example\n * ```ts\n * cx('btn', { 'btn--active': isActive, 'btn--disabled': disabled }, className);\n * ```\n */\nexport const cx = (...args: Parameters<typeof clsx>) => twMerge(clsx(...args));\n\ntype ConfigSchema = Record<string, Record<string, ClassValue>>;\ntype ConfigVariants<T extends ConfigSchema> = {\n [Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | null | undefined;\n};\ntype ConfigVariantsMulti<T extends ConfigSchema> = {\n [Variant in keyof T]?:\n | StringToBoolean<keyof T[Variant]>\n | StringToBoolean<keyof T[Variant]>[]\n | undefined;\n};\ntype Config<T> = T extends ConfigSchema\n ? {\n variants?: T;\n defaultVariants?: ConfigVariants<T>;\n compoundVariants?: (T extends ConfigSchema\n ? (ConfigVariants<T> | ConfigVariantsMulti<T>) & ClassProp\n : ClassProp)[];\n }\n : never;\n\ntype Props<T> = T extends ConfigSchema\n ? ConfigVariants<T> & ClassProp\n : ClassProp;\n\n/**\n * {@link https://cva.style/docs | Class Variance Authority (cva)} with the same **tailwind-merge**\n * pass as {@link cx}: the class string produced by the variant function is merged so Tailwind\n * conflicts resolve predictably.\n *\n * API matches `cva` from `class-variance-authority`: optional `base` classes, `config` with\n * `variants`, `defaultVariants`, and `compoundVariants`. The returned function accepts variant\n * props plus optional `class` / `className` for one-off overrides.\n *\n * Use {@link VariantProps} with `typeof buttonVariants` (or similar) to type component props.\n *\n * @param base - Base `ClassValue`(s) always applied.\n * @param config - Variant schema and defaults (same shape as upstream `cva`).\n * @returns A function `(props?) => string` that resolves variant classes, merged with tw-merge.\n *\n * @example\n * ```ts\n * const button = cva('rounded font-medium', {\n * variants: {\n * tone: { primary: 'bg-blue-600 text-white', ghost: 'bg-transparent' },\n * size: { sm: 'text-sm px-2', md: 'text-base px-4' },\n * },\n * defaultVariants: { tone: 'primary', size: 'md' },\n * });\n * button({ tone: 'ghost', className: 'ml-2' });\n * ```\n *\n * @example\n * ```ts\n * const card = cva('border p-4', {\n * variants: { elevated: { true: 'shadow-lg', false: 'shadow-none' } },\n * defaultVariants: { elevated: false },\n * });\n * card({ elevated: true });\n * ```\n */\nexport const cva = ((...args: any[]) => {\n const schema = cvaLib(...args);\n return (...inputArgs: any[]) => twMerge(schema(...inputArgs));\n}) as any as <T>(\n base?: ClassValue,\n config?: Config<T>,\n) => (props?: Props<T>) => string;\n\n/**\n * Utility type from `class-variance-authority`: infers the variant prop object from a `cva` instance.\n * Use it to type React (or other) components that forward variant props.\n *\n * @example\n * ```ts\n * const input = cva('border', { variants: { size: { sm: 'h-8', lg: 'h-12' } } });\n * type InputVariants = VariantProps<typeof input>;\n * // { size?: 'sm' | 'lg' | null }\n * ```\n */\nexport type { VariantProps } from 'class-variance-authority';\n\n/**\n * Re-export from `clsx`: a class name fragment — string, number, nested arrays, object map of\n * flags, or falsy nodes to skip. Used by {@link cx}, {@link cva}, and typical `className` helpers.\n *\n * @example\n * ```ts\n * const value: ClassValue = ['btn', false && 'hidden', { active: true }];\n * ```\n */\nexport type { ClassValue } from 'clsx';\n\n/**\n * Injects a stylesheet by appending a `<link rel=\"stylesheet\">` to `document.head`.\n * Resolves when the sheet fires `load`; rejects on `error` (e.g. 404 or network failure).\n *\n * **Id replacement:** if `attrubutes.id` is set, any existing element with that `id` is removed\n * first, so repeated calls with the same `id` replace the previous link (useful for theme or\n * font URLs that change).\n *\n * If `rel` is omitted in `attrubutes`, it defaults to `stylesheet`. Other attributes (`crossorigin`,\n * `media`, `data-*`, etc.) are set via `setAttribute` from the record entries.\n *\n * @param url - Stylesheet URL (`href`).\n * @param attrubutes - Optional HTML attributes for the `<link>` element (see `id` / `rel` behavior above).\n * @returns Promise that resolves to `undefined` on load, or rejects on load error.\n *\n * @example\n * ```ts\n * await loadCssFile('https://example.com/fonts.css', {\n * id: 'app-fonts',\n * crossOrigin: 'anonymous',\n * });\n * ```\n *\n * @example\n * ```ts\n * // Swap theme stylesheet without duplicate link tags\n * await loadCssFile('/themes/dark.css', { id: 'theme' });\n * await loadCssFile('/themes/light.css', { id: 'theme' });\n * ```\n */\nexport const loadCssFile = (url: string, attrubutes?: Record<string, any>) =>\n new Promise((resolve, reject) => {\n let link: Maybe<HTMLLinkElement>;\n\n if (attrubutes?.id) {\n link = document.getElementById(attrubutes.id) as HTMLLinkElement | null;\n\n if (link) {\n link.remove();\n }\n }\n\n link = document.createElement('link');\n\n const handleLoad = () => {\n resolve(undefined);\n link!.removeEventListener('load', handleLoad);\n link!.removeEventListener('error', handleError);\n };\n\n const handleError = () => {\n reject(undefined);\n link!.removeEventListener('load', handleLoad);\n link!.removeEventListener('error', handleError);\n };\n\n link.addEventListener('load', handleLoad);\n link.addEventListener('error', handleError);\n\n link.setAttribute('href', url);\n\n if (!attrubutes?.rel) {\n link.setAttribute('rel', 'stylesheet');\n }\n\n Object.entries(attrubutes || {}).forEach(([key, value]) => {\n link.setAttribute(key, value);\n });\n\n document.head.appendChild(link);\n });\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"css.cjs","names":[],"sources":["../src/css.ts"],"sourcesContent":["/**\n * ---header-docs-section---\n * # yummies/css\n *\n * ## Description\n *\n * Styling utilities for React and plain DOM: `rem` conversion, `clsx` + `tailwind-merge` via `cx`,\n * and a `cva` bridge for variant-driven class names. The goal is predictable class strings without\n * Tailwind conflicts and with less boilerplate than concatenating strings by hand across components.\n *\n * ## Usage\n *\n * ```ts\n * import { cx, toRem } from \"yummies/css\";\n * ```\n */\n\nimport { cva as cvaLib } from 'class-variance-authority';\nimport clsx, { type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\nimport type { Maybe } from 'yummies/types';\n\ntype ClassProp = {\n class?: ClassValue;\n className?: ClassValue;\n};\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T;\n\n/**\n * Converts a length in **pixels** to a CSS **`rem`** string (`\"<number>rem\"`).\n *\n * Use when authoring component styles in JS/TS where design tokens are in px but the stylesheet\n * should scale with root font size (accessibility, user zoom). `remValue` is the assumed\n * `1rem` size in px (browser default is typically `16`).\n *\n * @param px - Pixel value to convert (not rounded; stringification keeps full float).\n * @param remValue - How many pixels one `rem` equals. Defaults to `16`.\n * @returns A string like `\"1.5rem\"` suitable for `style` or CSS-in-JS.\n *\n * @example\n * ```ts\n * const width = toRem(24); // '1.5rem' with default 16px root\n * ```\n *\n * @example\n * ```ts\n * // Custom root / design system where 1rem === 10px\n * const gap = toRem(20, 10); // '2rem'\n * ```\n */\nexport const toRem = (px: number, remValue = 16) => `${px / remValue}rem`;\n\n/**\n * Composes conditional class names like {@link https://github.com/lukeed/clsx | clsx}, then runs\n * the result through {@link https://github.com/dcastil/tailwind-merge | tailwind-merge} so\n * conflicting Tailwind utilities collapse to the last/intended one (e.g. two `padding-x` classes).\n *\n * Accepts the same argument shapes as `clsx`: strings, objects, arrays, falsy values to omit.\n *\n * @param args - Same as `clsx(...args)` — `ClassValue` rest parameters.\n * @returns A single merged class string, safe for `className` on DOM/React.\n *\n * @example\n * ```ts\n * cx('px-2 py-1 text-sm', 'px-4'); // 'py-1 text-sm px-4' — padding-x merged\n * ```\n *\n * @example\n * ```ts\n * cx('btn', { 'btn--active': isActive, 'btn--disabled': disabled }, className);\n * ```\n */\nexport const cx = (...args: Parameters<typeof clsx>) => twMerge(clsx(...args));\n\ntype ConfigSchema = Record<string, Record<string, ClassValue>>;\ntype ConfigVariants<T extends ConfigSchema> = {\n [Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | null | undefined;\n};\ntype ConfigVariantsMulti<T extends ConfigSchema> = {\n [Variant in keyof T]?:\n | StringToBoolean<keyof T[Variant]>\n | StringToBoolean<keyof T[Variant]>[]\n | undefined;\n};\ntype Config<T> = T extends ConfigSchema\n ? {\n variants?: T;\n defaultVariants?: ConfigVariants<T>;\n compoundVariants?: (T extends ConfigSchema\n ? (ConfigVariants<T> | ConfigVariantsMulti<T>) & ClassProp\n : ClassProp)[];\n }\n : never;\n\ntype Props<T> = T extends ConfigSchema\n ? ConfigVariants<T> & ClassProp\n : ClassProp;\n\n/**\n * {@link https://cva.style/docs | Class Variance Authority (cva)} with the same **tailwind-merge**\n * pass as {@link cx}: the class string produced by the variant function is merged so Tailwind\n * conflicts resolve predictably.\n *\n * API matches `cva` from `class-variance-authority`: optional `base` classes, `config` with\n * `variants`, `defaultVariants`, and `compoundVariants`. The returned function accepts variant\n * props plus optional `class` / `className` for one-off overrides.\n *\n * Use {@link VariantProps} with `typeof buttonVariants` (or similar) to type component props.\n *\n * @param base - Base `ClassValue`(s) always applied.\n * @param config - Variant schema and defaults (same shape as upstream `cva`).\n * @returns A function `(props?) => string` that resolves variant classes, merged with tw-merge.\n *\n * @example\n * ```ts\n * const button = cva('rounded font-medium', {\n * variants: {\n * tone: { primary: 'bg-blue-600 text-white', ghost: 'bg-transparent' },\n * size: { sm: 'text-sm px-2', md: 'text-base px-4' },\n * },\n * defaultVariants: { tone: 'primary', size: 'md' },\n * });\n * button({ tone: 'ghost', className: 'ml-2' });\n * ```\n *\n * @example\n * ```ts\n * const card = cva('border p-4', {\n * variants: { elevated: { true: 'shadow-lg', false: 'shadow-none' } },\n * defaultVariants: { elevated: false },\n * });\n * card({ elevated: true });\n * ```\n */\nexport const cva = ((...args: any[]) => {\n const schema = cvaLib(...args);\n return (...inputArgs: any[]) => twMerge(schema(...inputArgs));\n}) as any as <T>(\n base?: ClassValue,\n config?: Config<T>,\n) => (props?: Props<T>) => string;\n\n/**\n * Utility type from `class-variance-authority`: infers the variant prop object from a `cva` instance.\n * Use it to type React (or other) components that forward variant props.\n *\n * @example\n * ```ts\n * const input = cva('border', { variants: { size: { sm: 'h-8', lg: 'h-12' } } });\n * type InputVariants = VariantProps<typeof input>;\n * // { size?: 'sm' | 'lg' | null }\n * ```\n */\nexport type { VariantProps } from 'class-variance-authority';\n\n/**\n * Re-export from `clsx`: a class name fragment — string, number, nested arrays, object map of\n * flags, or falsy nodes to skip. Used by {@link cx}, {@link cva}, and typical `className` helpers.\n *\n * @example\n * ```ts\n * const value: ClassValue = ['btn', false && 'hidden', { active: true }];\n * ```\n */\nexport type { ClassValue } from 'clsx';\n\n/**\n * Injects a stylesheet by appending a `<link rel=\"stylesheet\">` to `document.head`.\n * Resolves when the sheet fires `load`; rejects on `error` (e.g. 404 or network failure).\n *\n * **Id replacement:** if `attrubutes.id` is set, any existing element with that `id` is removed\n * first, so repeated calls with the same `id` replace the previous link (useful for theme or\n * font URLs that change).\n *\n * If `rel` is omitted in `attrubutes`, it defaults to `stylesheet`. Other attributes (`crossorigin`,\n * `media`, `data-*`, etc.) are set via `setAttribute` from the record entries.\n *\n * @param url - Stylesheet URL (`href`).\n * @param attrubutes - Optional HTML attributes for the `<link>` element (see `id` / `rel` behavior above).\n * @returns Promise that resolves to `undefined` on load, or rejects on load error.\n *\n * @example\n * ```ts\n * await loadCssFile('https://example.com/fonts.css', {\n * id: 'app-fonts',\n * crossOrigin: 'anonymous',\n * });\n * ```\n *\n * @example\n * ```ts\n * // Swap theme stylesheet without duplicate link tags\n * await loadCssFile('/themes/dark.css', { id: 'theme' });\n * await loadCssFile('/themes/light.css', { id: 'theme' });\n * ```\n */\nexport const loadCssFile = (url: string, attrubutes?: Record<string, any>) =>\n new Promise((resolve, reject) => {\n let link: Maybe<HTMLLinkElement>;\n\n if (attrubutes?.id) {\n link = document.getElementById(attrubutes.id) as HTMLLinkElement | null;\n\n if (link) {\n link.remove();\n }\n }\n\n link = document.createElement('link');\n\n const handleLoad = () => {\n resolve(undefined);\n link!.removeEventListener('load', handleLoad);\n link!.removeEventListener('error', handleError);\n };\n\n const handleError = () => {\n reject(undefined);\n link!.removeEventListener('load', handleLoad);\n link!.removeEventListener('error', handleError);\n };\n\n link.addEventListener('load', handleLoad);\n link.addEventListener('error', handleError);\n\n link.setAttribute('href', url);\n\n if (!attrubutes?.rel) {\n link.setAttribute('rel', 'stylesheet');\n }\n\n Object.entries(attrubutes || {}).forEach(([key, value]) => {\n link.setAttribute(key, value);\n });\n\n document.head.appendChild(link);\n });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,IAAa,SAAS,IAAY,WAAW,OAAO,GAAG,KAAK,SAAS;;;;;;;;;;;;;;;;;;;;;AAsBrE,IAAa,MAAM,GAAG,UAAA,GAAA,eAAA,UAAA,GAAA,KAAA,SAA+C,GAAG,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8D9E,IAAa,QAAQ,GAAG,SAAgB;CACtC,MAAM,UAAA,GAAA,yBAAA,KAAgB,GAAG,KAAK;AAC9B,SAAQ,GAAG,eAAA,GAAA,eAAA,SAA6B,OAAO,GAAG,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4D/D,IAAa,eAAe,KAAa,eACvC,IAAI,SAAS,SAAS,WAAW;CAC/B,IAAI;AAEJ,KAAI,YAAY,IAAI;AAClB,SAAO,SAAS,eAAe,WAAW,GAAG;AAE7C,MAAI,KACF,MAAK,QAAQ;;AAIjB,QAAO,SAAS,cAAc,OAAO;CAErC,MAAM,mBAAmB;AACvB,UAAQ,KAAA,EAAU;AAClB,OAAM,oBAAoB,QAAQ,WAAW;AAC7C,OAAM,oBAAoB,SAAS,YAAY;;CAGjD,MAAM,oBAAoB;AACxB,SAAO,KAAA,EAAU;AACjB,OAAM,oBAAoB,QAAQ,WAAW;AAC7C,OAAM,oBAAoB,SAAS,YAAY;;AAGjD,MAAK,iBAAiB,QAAQ,WAAW;AACzC,MAAK,iBAAiB,SAAS,YAAY;AAE3C,MAAK,aAAa,QAAQ,IAAI;AAE9B,KAAI,CAAC,YAAY,IACf,MAAK,aAAa,OAAO,aAAa;AAGxC,QAAO,QAAQ,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,WAAW;AACzD,OAAK,aAAa,KAAK,MAAM;GAC7B;AAEF,UAAS,KAAK,YAAY,KAAK;EAC/B"}
|
package/css.d.ts
CHANGED
|
@@ -2,6 +2,23 @@ import clsx, { ClassValue } from 'clsx';
|
|
|
2
2
|
export { ClassValue } from 'clsx';
|
|
3
3
|
export { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* ---header-docs-section---
|
|
7
|
+
* # yummies/css
|
|
8
|
+
*
|
|
9
|
+
* ## Description
|
|
10
|
+
*
|
|
11
|
+
* Styling utilities for React and plain DOM: `rem` conversion, `clsx` + `tailwind-merge` via `cx`,
|
|
12
|
+
* and a `cva` bridge for variant-driven class names. The goal is predictable class strings without
|
|
13
|
+
* Tailwind conflicts and with less boilerplate than concatenating strings by hand across components.
|
|
14
|
+
*
|
|
15
|
+
* ## Usage
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { cx, toRem } from "yummies/css";
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
|
|
5
22
|
type ClassProp = {
|
|
6
23
|
class?: ClassValue;
|
|
7
24
|
className?: ClassValue;
|
package/css.js
CHANGED
|
@@ -3,6 +3,22 @@ import clsx from "clsx";
|
|
|
3
3
|
import { twMerge } from "tailwind-merge";
|
|
4
4
|
//#region src/css.ts
|
|
5
5
|
/**
|
|
6
|
+
* ---header-docs-section---
|
|
7
|
+
* # yummies/css
|
|
8
|
+
*
|
|
9
|
+
* ## Description
|
|
10
|
+
*
|
|
11
|
+
* Styling utilities for React and plain DOM: `rem` conversion, `clsx` + `tailwind-merge` via `cx`,
|
|
12
|
+
* and a `cva` bridge for variant-driven class names. The goal is predictable class strings without
|
|
13
|
+
* Tailwind conflicts and with less boilerplate than concatenating strings by hand across components.
|
|
14
|
+
*
|
|
15
|
+
* ## Usage
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { cx, toRem } from "yummies/css";
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
6
22
|
* Converts a length in **pixels** to a CSS **`rem`** string (`"<number>rem"`).
|
|
7
23
|
*
|
|
8
24
|
* Use when authoring component styles in JS/TS where design tokens are in px but the stylesheet
|
package/css.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.js","names":[],"sources":["../src/css.ts"],"sourcesContent":["import { cva as cvaLib } from 'class-variance-authority';\nimport clsx, { type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\nimport type { Maybe } from 'yummies/types';\n\ntype ClassProp = {\n class?: ClassValue;\n className?: ClassValue;\n};\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T;\n\n/**\n * Converts a length in **pixels** to a CSS **`rem`** string (`\"<number>rem\"`).\n *\n * Use when authoring component styles in JS/TS where design tokens are in px but the stylesheet\n * should scale with root font size (accessibility, user zoom). `remValue` is the assumed\n * `1rem` size in px (browser default is typically `16`).\n *\n * @param px - Pixel value to convert (not rounded; stringification keeps full float).\n * @param remValue - How many pixels one `rem` equals. Defaults to `16`.\n * @returns A string like `\"1.5rem\"` suitable for `style` or CSS-in-JS.\n *\n * @example\n * ```ts\n * const width = toRem(24); // '1.5rem' with default 16px root\n * ```\n *\n * @example\n * ```ts\n * // Custom root / design system where 1rem === 10px\n * const gap = toRem(20, 10); // '2rem'\n * ```\n */\nexport const toRem = (px: number, remValue = 16) => `${px / remValue}rem`;\n\n/**\n * Composes conditional class names like {@link https://github.com/lukeed/clsx | clsx}, then runs\n * the result through {@link https://github.com/dcastil/tailwind-merge | tailwind-merge} so\n * conflicting Tailwind utilities collapse to the last/intended one (e.g. two `padding-x` classes).\n *\n * Accepts the same argument shapes as `clsx`: strings, objects, arrays, falsy values to omit.\n *\n * @param args - Same as `clsx(...args)` — `ClassValue` rest parameters.\n * @returns A single merged class string, safe for `className` on DOM/React.\n *\n * @example\n * ```ts\n * cx('px-2 py-1 text-sm', 'px-4'); // 'py-1 text-sm px-4' — padding-x merged\n * ```\n *\n * @example\n * ```ts\n * cx('btn', { 'btn--active': isActive, 'btn--disabled': disabled }, className);\n * ```\n */\nexport const cx = (...args: Parameters<typeof clsx>) => twMerge(clsx(...args));\n\ntype ConfigSchema = Record<string, Record<string, ClassValue>>;\ntype ConfigVariants<T extends ConfigSchema> = {\n [Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | null | undefined;\n};\ntype ConfigVariantsMulti<T extends ConfigSchema> = {\n [Variant in keyof T]?:\n | StringToBoolean<keyof T[Variant]>\n | StringToBoolean<keyof T[Variant]>[]\n | undefined;\n};\ntype Config<T> = T extends ConfigSchema\n ? {\n variants?: T;\n defaultVariants?: ConfigVariants<T>;\n compoundVariants?: (T extends ConfigSchema\n ? (ConfigVariants<T> | ConfigVariantsMulti<T>) & ClassProp\n : ClassProp)[];\n }\n : never;\n\ntype Props<T> = T extends ConfigSchema\n ? ConfigVariants<T> & ClassProp\n : ClassProp;\n\n/**\n * {@link https://cva.style/docs | Class Variance Authority (cva)} with the same **tailwind-merge**\n * pass as {@link cx}: the class string produced by the variant function is merged so Tailwind\n * conflicts resolve predictably.\n *\n * API matches `cva` from `class-variance-authority`: optional `base` classes, `config` with\n * `variants`, `defaultVariants`, and `compoundVariants`. The returned function accepts variant\n * props plus optional `class` / `className` for one-off overrides.\n *\n * Use {@link VariantProps} with `typeof buttonVariants` (or similar) to type component props.\n *\n * @param base - Base `ClassValue`(s) always applied.\n * @param config - Variant schema and defaults (same shape as upstream `cva`).\n * @returns A function `(props?) => string` that resolves variant classes, merged with tw-merge.\n *\n * @example\n * ```ts\n * const button = cva('rounded font-medium', {\n * variants: {\n * tone: { primary: 'bg-blue-600 text-white', ghost: 'bg-transparent' },\n * size: { sm: 'text-sm px-2', md: 'text-base px-4' },\n * },\n * defaultVariants: { tone: 'primary', size: 'md' },\n * });\n * button({ tone: 'ghost', className: 'ml-2' });\n * ```\n *\n * @example\n * ```ts\n * const card = cva('border p-4', {\n * variants: { elevated: { true: 'shadow-lg', false: 'shadow-none' } },\n * defaultVariants: { elevated: false },\n * });\n * card({ elevated: true });\n * ```\n */\nexport const cva = ((...args: any[]) => {\n const schema = cvaLib(...args);\n return (...inputArgs: any[]) => twMerge(schema(...inputArgs));\n}) as any as <T>(\n base?: ClassValue,\n config?: Config<T>,\n) => (props?: Props<T>) => string;\n\n/**\n * Utility type from `class-variance-authority`: infers the variant prop object from a `cva` instance.\n * Use it to type React (or other) components that forward variant props.\n *\n * @example\n * ```ts\n * const input = cva('border', { variants: { size: { sm: 'h-8', lg: 'h-12' } } });\n * type InputVariants = VariantProps<typeof input>;\n * // { size?: 'sm' | 'lg' | null }\n * ```\n */\nexport type { VariantProps } from 'class-variance-authority';\n\n/**\n * Re-export from `clsx`: a class name fragment — string, number, nested arrays, object map of\n * flags, or falsy nodes to skip. Used by {@link cx}, {@link cva}, and typical `className` helpers.\n *\n * @example\n * ```ts\n * const value: ClassValue = ['btn', false && 'hidden', { active: true }];\n * ```\n */\nexport type { ClassValue } from 'clsx';\n\n/**\n * Injects a stylesheet by appending a `<link rel=\"stylesheet\">` to `document.head`.\n * Resolves when the sheet fires `load`; rejects on `error` (e.g. 404 or network failure).\n *\n * **Id replacement:** if `attrubutes.id` is set, any existing element with that `id` is removed\n * first, so repeated calls with the same `id` replace the previous link (useful for theme or\n * font URLs that change).\n *\n * If `rel` is omitted in `attrubutes`, it defaults to `stylesheet`. Other attributes (`crossorigin`,\n * `media`, `data-*`, etc.) are set via `setAttribute` from the record entries.\n *\n * @param url - Stylesheet URL (`href`).\n * @param attrubutes - Optional HTML attributes for the `<link>` element (see `id` / `rel` behavior above).\n * @returns Promise that resolves to `undefined` on load, or rejects on load error.\n *\n * @example\n * ```ts\n * await loadCssFile('https://example.com/fonts.css', {\n * id: 'app-fonts',\n * crossOrigin: 'anonymous',\n * });\n * ```\n *\n * @example\n * ```ts\n * // Swap theme stylesheet without duplicate link tags\n * await loadCssFile('/themes/dark.css', { id: 'theme' });\n * await loadCssFile('/themes/light.css', { id: 'theme' });\n * ```\n */\nexport const loadCssFile = (url: string, attrubutes?: Record<string, any>) =>\n new Promise((resolve, reject) => {\n let link: Maybe<HTMLLinkElement>;\n\n if (attrubutes?.id) {\n link = document.getElementById(attrubutes.id) as HTMLLinkElement | null;\n\n if (link) {\n link.remove();\n }\n }\n\n link = document.createElement('link');\n\n const handleLoad = () => {\n resolve(undefined);\n link!.removeEventListener('load', handleLoad);\n link!.removeEventListener('error', handleError);\n };\n\n const handleError = () => {\n reject(undefined);\n link!.removeEventListener('load', handleLoad);\n link!.removeEventListener('error', handleError);\n };\n\n link.addEventListener('load', handleLoad);\n link.addEventListener('error', handleError);\n\n link.setAttribute('href', url);\n\n if (!attrubutes?.rel) {\n link.setAttribute('rel', 'stylesheet');\n }\n\n Object.entries(attrubutes || {}).forEach(([key, value]) => {\n link.setAttribute(key, value);\n });\n\n document.head.appendChild(link);\n });\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"css.js","names":[],"sources":["../src/css.ts"],"sourcesContent":["/**\n * ---header-docs-section---\n * # yummies/css\n *\n * ## Description\n *\n * Styling utilities for React and plain DOM: `rem` conversion, `clsx` + `tailwind-merge` via `cx`,\n * and a `cva` bridge for variant-driven class names. The goal is predictable class strings without\n * Tailwind conflicts and with less boilerplate than concatenating strings by hand across components.\n *\n * ## Usage\n *\n * ```ts\n * import { cx, toRem } from \"yummies/css\";\n * ```\n */\n\nimport { cva as cvaLib } from 'class-variance-authority';\nimport clsx, { type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\nimport type { Maybe } from 'yummies/types';\n\ntype ClassProp = {\n class?: ClassValue;\n className?: ClassValue;\n};\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T;\n\n/**\n * Converts a length in **pixels** to a CSS **`rem`** string (`\"<number>rem\"`).\n *\n * Use when authoring component styles in JS/TS where design tokens are in px but the stylesheet\n * should scale with root font size (accessibility, user zoom). `remValue` is the assumed\n * `1rem` size in px (browser default is typically `16`).\n *\n * @param px - Pixel value to convert (not rounded; stringification keeps full float).\n * @param remValue - How many pixels one `rem` equals. Defaults to `16`.\n * @returns A string like `\"1.5rem\"` suitable for `style` or CSS-in-JS.\n *\n * @example\n * ```ts\n * const width = toRem(24); // '1.5rem' with default 16px root\n * ```\n *\n * @example\n * ```ts\n * // Custom root / design system where 1rem === 10px\n * const gap = toRem(20, 10); // '2rem'\n * ```\n */\nexport const toRem = (px: number, remValue = 16) => `${px / remValue}rem`;\n\n/**\n * Composes conditional class names like {@link https://github.com/lukeed/clsx | clsx}, then runs\n * the result through {@link https://github.com/dcastil/tailwind-merge | tailwind-merge} so\n * conflicting Tailwind utilities collapse to the last/intended one (e.g. two `padding-x` classes).\n *\n * Accepts the same argument shapes as `clsx`: strings, objects, arrays, falsy values to omit.\n *\n * @param args - Same as `clsx(...args)` — `ClassValue` rest parameters.\n * @returns A single merged class string, safe for `className` on DOM/React.\n *\n * @example\n * ```ts\n * cx('px-2 py-1 text-sm', 'px-4'); // 'py-1 text-sm px-4' — padding-x merged\n * ```\n *\n * @example\n * ```ts\n * cx('btn', { 'btn--active': isActive, 'btn--disabled': disabled }, className);\n * ```\n */\nexport const cx = (...args: Parameters<typeof clsx>) => twMerge(clsx(...args));\n\ntype ConfigSchema = Record<string, Record<string, ClassValue>>;\ntype ConfigVariants<T extends ConfigSchema> = {\n [Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | null | undefined;\n};\ntype ConfigVariantsMulti<T extends ConfigSchema> = {\n [Variant in keyof T]?:\n | StringToBoolean<keyof T[Variant]>\n | StringToBoolean<keyof T[Variant]>[]\n | undefined;\n};\ntype Config<T> = T extends ConfigSchema\n ? {\n variants?: T;\n defaultVariants?: ConfigVariants<T>;\n compoundVariants?: (T extends ConfigSchema\n ? (ConfigVariants<T> | ConfigVariantsMulti<T>) & ClassProp\n : ClassProp)[];\n }\n : never;\n\ntype Props<T> = T extends ConfigSchema\n ? ConfigVariants<T> & ClassProp\n : ClassProp;\n\n/**\n * {@link https://cva.style/docs | Class Variance Authority (cva)} with the same **tailwind-merge**\n * pass as {@link cx}: the class string produced by the variant function is merged so Tailwind\n * conflicts resolve predictably.\n *\n * API matches `cva` from `class-variance-authority`: optional `base` classes, `config` with\n * `variants`, `defaultVariants`, and `compoundVariants`. The returned function accepts variant\n * props plus optional `class` / `className` for one-off overrides.\n *\n * Use {@link VariantProps} with `typeof buttonVariants` (or similar) to type component props.\n *\n * @param base - Base `ClassValue`(s) always applied.\n * @param config - Variant schema and defaults (same shape as upstream `cva`).\n * @returns A function `(props?) => string` that resolves variant classes, merged with tw-merge.\n *\n * @example\n * ```ts\n * const button = cva('rounded font-medium', {\n * variants: {\n * tone: { primary: 'bg-blue-600 text-white', ghost: 'bg-transparent' },\n * size: { sm: 'text-sm px-2', md: 'text-base px-4' },\n * },\n * defaultVariants: { tone: 'primary', size: 'md' },\n * });\n * button({ tone: 'ghost', className: 'ml-2' });\n * ```\n *\n * @example\n * ```ts\n * const card = cva('border p-4', {\n * variants: { elevated: { true: 'shadow-lg', false: 'shadow-none' } },\n * defaultVariants: { elevated: false },\n * });\n * card({ elevated: true });\n * ```\n */\nexport const cva = ((...args: any[]) => {\n const schema = cvaLib(...args);\n return (...inputArgs: any[]) => twMerge(schema(...inputArgs));\n}) as any as <T>(\n base?: ClassValue,\n config?: Config<T>,\n) => (props?: Props<T>) => string;\n\n/**\n * Utility type from `class-variance-authority`: infers the variant prop object from a `cva` instance.\n * Use it to type React (or other) components that forward variant props.\n *\n * @example\n * ```ts\n * const input = cva('border', { variants: { size: { sm: 'h-8', lg: 'h-12' } } });\n * type InputVariants = VariantProps<typeof input>;\n * // { size?: 'sm' | 'lg' | null }\n * ```\n */\nexport type { VariantProps } from 'class-variance-authority';\n\n/**\n * Re-export from `clsx`: a class name fragment — string, number, nested arrays, object map of\n * flags, or falsy nodes to skip. Used by {@link cx}, {@link cva}, and typical `className` helpers.\n *\n * @example\n * ```ts\n * const value: ClassValue = ['btn', false && 'hidden', { active: true }];\n * ```\n */\nexport type { ClassValue } from 'clsx';\n\n/**\n * Injects a stylesheet by appending a `<link rel=\"stylesheet\">` to `document.head`.\n * Resolves when the sheet fires `load`; rejects on `error` (e.g. 404 or network failure).\n *\n * **Id replacement:** if `attrubutes.id` is set, any existing element with that `id` is removed\n * first, so repeated calls with the same `id` replace the previous link (useful for theme or\n * font URLs that change).\n *\n * If `rel` is omitted in `attrubutes`, it defaults to `stylesheet`. Other attributes (`crossorigin`,\n * `media`, `data-*`, etc.) are set via `setAttribute` from the record entries.\n *\n * @param url - Stylesheet URL (`href`).\n * @param attrubutes - Optional HTML attributes for the `<link>` element (see `id` / `rel` behavior above).\n * @returns Promise that resolves to `undefined` on load, or rejects on load error.\n *\n * @example\n * ```ts\n * await loadCssFile('https://example.com/fonts.css', {\n * id: 'app-fonts',\n * crossOrigin: 'anonymous',\n * });\n * ```\n *\n * @example\n * ```ts\n * // Swap theme stylesheet without duplicate link tags\n * await loadCssFile('/themes/dark.css', { id: 'theme' });\n * await loadCssFile('/themes/light.css', { id: 'theme' });\n * ```\n */\nexport const loadCssFile = (url: string, attrubutes?: Record<string, any>) =>\n new Promise((resolve, reject) => {\n let link: Maybe<HTMLLinkElement>;\n\n if (attrubutes?.id) {\n link = document.getElementById(attrubutes.id) as HTMLLinkElement | null;\n\n if (link) {\n link.remove();\n }\n }\n\n link = document.createElement('link');\n\n const handleLoad = () => {\n resolve(undefined);\n link!.removeEventListener('load', handleLoad);\n link!.removeEventListener('error', handleError);\n };\n\n const handleError = () => {\n reject(undefined);\n link!.removeEventListener('load', handleLoad);\n link!.removeEventListener('error', handleError);\n };\n\n link.addEventListener('load', handleLoad);\n link.addEventListener('error', handleError);\n\n link.setAttribute('href', url);\n\n if (!attrubutes?.rel) {\n link.setAttribute('rel', 'stylesheet');\n }\n\n Object.entries(attrubutes || {}).forEach(([key, value]) => {\n link.setAttribute(key, value);\n });\n\n document.head.appendChild(link);\n });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,IAAa,SAAS,IAAY,WAAW,OAAO,GAAG,KAAK,SAAS;;;;;;;;;;;;;;;;;;;;;AAsBrE,IAAa,MAAM,GAAG,SAAkC,QAAQ,KAAK,GAAG,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8D9E,IAAa,QAAQ,GAAG,SAAgB;CACtC,MAAM,SAAS,MAAO,GAAG,KAAK;AAC9B,SAAQ,GAAG,cAAqB,QAAQ,OAAO,GAAG,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4D/D,IAAa,eAAe,KAAa,eACvC,IAAI,SAAS,SAAS,WAAW;CAC/B,IAAI;AAEJ,KAAI,YAAY,IAAI;AAClB,SAAO,SAAS,eAAe,WAAW,GAAG;AAE7C,MAAI,KACF,MAAK,QAAQ;;AAIjB,QAAO,SAAS,cAAc,OAAO;CAErC,MAAM,mBAAmB;AACvB,UAAQ,KAAA,EAAU;AAClB,OAAM,oBAAoB,QAAQ,WAAW;AAC7C,OAAM,oBAAoB,SAAS,YAAY;;CAGjD,MAAM,oBAAoB;AACxB,SAAO,KAAA,EAAU;AACjB,OAAM,oBAAoB,QAAQ,WAAW;AAC7C,OAAM,oBAAoB,SAAS,YAAY;;AAGjD,MAAK,iBAAiB,QAAQ,WAAW;AACzC,MAAK,iBAAiB,SAAS,YAAY;AAE3C,MAAK,aAAa,QAAQ,IAAI;AAE9B,KAAI,CAAC,YAAY,IACf,MAAK,aAAa,OAAO,aAAa;AAGxC,QAAO,QAAQ,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,WAAW;AACzD,OAAK,aAAa,KAAK,MAAM;GAC7B;AAEF,UAAS,KAAK,YAAY,KAAK;EAC/B"}
|
package/data.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.cjs","names":[],"sources":["../src/data.ts"],"sourcesContent":["import type { AnyObject, Maybe } from 'yummies/types';\n\n/**\n * Performs a shallow comparison for arrays, plain objects, dates and regular expressions.\n *\n * @example\n * ```ts\n * isShallowEqual({ id: 1 }, { id: 1 }); // true\n * ```\n */\nexport const isShallowEqual = (a: unknown, b: unknown): boolean => {\n if (a === b) return true;\n\n if (\n typeof a !== 'object' ||\n typeof b !== 'object' ||\n a === null ||\n b === null\n ) {\n return false;\n }\n\n if (a.constructor !== b.constructor) return false;\n\n const isArrayA = Array.isArray(a);\n\n if (isArrayA !== Array.isArray(b)) return false;\n\n if (isArrayA) {\n const arrA = a as unknown[];\n const arrB = b as unknown[];\n if (arrA.length !== arrB.length) return false;\n\n for (const [i, element] of arrA.entries()) {\n if (element !== arrB[i]) return false;\n }\n return true;\n }\n\n if (a instanceof Date) return a.getTime() === (b as Date).getTime();\n\n if (a instanceof RegExp) return a.toString() === (b as RegExp).toString();\n\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n\n if (aKeys.length !== bKeys.length) return false;\n\n const bObj = b as AnyObject;\n for (const key of aKeys) {\n if (!Object.hasOwn(bObj, key) || (a as AnyObject)[key] !== bObj[key]) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * Wraps a value in an array when it is not already an array.\n *\n * @example\n * ```ts\n * toArray('item'); // ['item']\n * ```\n */\nexport const toArray = <TValue>(value: TValue | TValue[]): TValue[] => {\n return Array.isArray(value) ? value : [value];\n};\n\ntype DeepArray<TValue> = TValue | Array<DeepArray<TValue>>;\n\n/**\n * Recursively flattens a nested array and maps the collected values.\n *\n * @example\n * ```ts\n * flatMapDeep([1, [2, [3]]], (value) => value * 2); // [2, 4, 6]\n * ```\n */\nexport const flatMapDeep = <TSource, TNewValue>(\n arr: DeepArray<TSource>,\n fn: (value: TSource, i: number, arr: TSource[]) => TNewValue,\n): TNewValue[] => {\n const source: TSource[] = [];\n\n const collect = (value: DeepArray<TSource>): void => {\n if (!Array.isArray(value)) {\n source.push(value);\n return;\n }\n\n for (const item of value) {\n collect(item);\n }\n };\n\n collect(arr);\n\n return source.map((value, i) => fn(value, i, source));\n};\n\n/**\n * Parses JSON safely and returns a fallback value when parsing fails.\n *\n * @example\n * ```ts\n * safeJsonParse('{\"enabled\":true}', {}); // { enabled: true }\n * ```\n */\nexport const safeJsonParse = <TValue = any, TFallback = null>(\n json: Maybe<string>,\n fallback: TFallback = null as TFallback,\n): TValue | TFallback => {\n if (json == null) return fallback;\n\n try {\n return JSON.parse(json);\n } catch {\n return fallback;\n }\n};\n\nconst UNSAFE_PROPERTY_KEYS = new Set(['__proto__', 'prototype', 'constructor']);\n\n/**\n * Checks whether a property key is unsafe and can lead to prototype pollution.\n *\n * @example\n * isUnsafeProperty('__proto__'); // true\n * isUnsafeProperty('name'); // false\n */\nexport const isUnsafeProperty = (key: any) => UNSAFE_PROPERTY_KEYS.has(key);\n"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"data.cjs","names":[],"sources":["../src/data.ts"],"sourcesContent":["/**\n * ---header-docs-section---\n * # yummies/data\n *\n * ## Description\n *\n * General-purpose data helpers: shallow equality, normalizing values to arrays, and recursive\n * `flatMap`-style transforms. They complement `Array`/`Object` builtins when you need stable\n * comparisons for memoization or small structural utilities without pulling a large lodash-style\n * dependency into the bundle.\n *\n * ## Usage\n *\n * ```ts\n * import { isShallowEqual, toArray } from \"yummies/data\";\n * ```\n */\n\nimport type { AnyObject, Maybe } from 'yummies/types';\n\n/**\n * Performs a shallow comparison for arrays, plain objects, dates and regular expressions.\n *\n * @example\n * ```ts\n * isShallowEqual({ id: 1 }, { id: 1 }); // true\n * ```\n */\nexport const isShallowEqual = (a: unknown, b: unknown): boolean => {\n if (a === b) return true;\n\n if (\n typeof a !== 'object' ||\n typeof b !== 'object' ||\n a === null ||\n b === null\n ) {\n return false;\n }\n\n if (a.constructor !== b.constructor) return false;\n\n const isArrayA = Array.isArray(a);\n\n if (isArrayA !== Array.isArray(b)) return false;\n\n if (isArrayA) {\n const arrA = a as unknown[];\n const arrB = b as unknown[];\n if (arrA.length !== arrB.length) return false;\n\n for (const [i, element] of arrA.entries()) {\n if (element !== arrB[i]) return false;\n }\n return true;\n }\n\n if (a instanceof Date) return a.getTime() === (b as Date).getTime();\n\n if (a instanceof RegExp) return a.toString() === (b as RegExp).toString();\n\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n\n if (aKeys.length !== bKeys.length) return false;\n\n const bObj = b as AnyObject;\n for (const key of aKeys) {\n if (!Object.hasOwn(bObj, key) || (a as AnyObject)[key] !== bObj[key]) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * Wraps a value in an array when it is not already an array.\n *\n * @example\n * ```ts\n * toArray('item'); // ['item']\n * ```\n */\nexport const toArray = <TValue>(value: TValue | TValue[]): TValue[] => {\n return Array.isArray(value) ? value : [value];\n};\n\ntype DeepArray<TValue> = TValue | Array<DeepArray<TValue>>;\n\n/**\n * Recursively flattens a nested array and maps the collected values.\n *\n * @example\n * ```ts\n * flatMapDeep([1, [2, [3]]], (value) => value * 2); // [2, 4, 6]\n * ```\n */\nexport const flatMapDeep = <TSource, TNewValue>(\n arr: DeepArray<TSource>,\n fn: (value: TSource, i: number, arr: TSource[]) => TNewValue,\n): TNewValue[] => {\n const source: TSource[] = [];\n\n const collect = (value: DeepArray<TSource>): void => {\n if (!Array.isArray(value)) {\n source.push(value);\n return;\n }\n\n for (const item of value) {\n collect(item);\n }\n };\n\n collect(arr);\n\n return source.map((value, i) => fn(value, i, source));\n};\n\n/**\n * Parses JSON safely and returns a fallback value when parsing fails.\n *\n * @example\n * ```ts\n * safeJsonParse('{\"enabled\":true}', {}); // { enabled: true }\n * ```\n */\nexport const safeJsonParse = <TValue = any, TFallback = null>(\n json: Maybe<string>,\n fallback: TFallback = null as TFallback,\n): TValue | TFallback => {\n if (json == null) return fallback;\n\n try {\n return JSON.parse(json);\n } catch {\n return fallback;\n }\n};\n\nconst UNSAFE_PROPERTY_KEYS = new Set(['__proto__', 'prototype', 'constructor']);\n\n/**\n * Checks whether a property key is unsafe and can lead to prototype pollution.\n *\n * @example\n * isUnsafeProperty('__proto__'); // true\n * isUnsafeProperty('name'); // false\n */\nexport const isUnsafeProperty = (key: any) => UNSAFE_PROPERTY_KEYS.has(key);\n"],"mappings":";;;;;;;;;;AA4BA,IAAa,kBAAkB,GAAY,MAAwB;AACjE,KAAI,MAAM,EAAG,QAAO;AAEpB,KACE,OAAO,MAAM,YACb,OAAO,MAAM,YACb,MAAM,QACN,MAAM,KAEN,QAAO;AAGT,KAAI,EAAE,gBAAgB,EAAE,YAAa,QAAO;CAE5C,MAAM,WAAW,MAAM,QAAQ,EAAE;AAEjC,KAAI,aAAa,MAAM,QAAQ,EAAE,CAAE,QAAO;AAE1C,KAAI,UA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|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import { Maybe } from 'yummies/types';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* ---header-docs-section---
|
|
5
|
+
* # yummies/data
|
|
6
|
+
*
|
|
7
|
+
* ## Description
|
|
8
|
+
*
|
|
9
|
+
* General-purpose data helpers: shallow equality, normalizing values to arrays, and recursive
|
|
10
|
+
* `flatMap`-style transforms. They complement `Array`/`Object` builtins when you need stable
|
|
11
|
+
* comparisons for memoization or small structural utilities without pulling a large lodash-style
|
|
12
|
+
* dependency into the bundle.
|
|
13
|
+
*
|
|
14
|
+
* ## Usage
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { isShallowEqual, toArray } from "yummies/data";
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
|
|
3
21
|
/**
|
|
4
22
|
* Performs a shallow comparison for arrays, plain objects, dates and regular expressions.
|
|
5
23
|
*
|
package/data.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.js","names":[],"sources":["../src/data.ts"],"sourcesContent":["import type { AnyObject, Maybe } from 'yummies/types';\n\n/**\n * Performs a shallow comparison for arrays, plain objects, dates and regular expressions.\n *\n * @example\n * ```ts\n * isShallowEqual({ id: 1 }, { id: 1 }); // true\n * ```\n */\nexport const isShallowEqual = (a: unknown, b: unknown): boolean => {\n if (a === b) return true;\n\n if (\n typeof a !== 'object' ||\n typeof b !== 'object' ||\n a === null ||\n b === null\n ) {\n return false;\n }\n\n if (a.constructor !== b.constructor) return false;\n\n const isArrayA = Array.isArray(a);\n\n if (isArrayA !== Array.isArray(b)) return false;\n\n if (isArrayA) {\n const arrA = a as unknown[];\n const arrB = b as unknown[];\n if (arrA.length !== arrB.length) return false;\n\n for (const [i, element] of arrA.entries()) {\n if (element !== arrB[i]) return false;\n }\n return true;\n }\n\n if (a instanceof Date) return a.getTime() === (b as Date).getTime();\n\n if (a instanceof RegExp) return a.toString() === (b as RegExp).toString();\n\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n\n if (aKeys.length !== bKeys.length) return false;\n\n const bObj = b as AnyObject;\n for (const key of aKeys) {\n if (!Object.hasOwn(bObj, key) || (a as AnyObject)[key] !== bObj[key]) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * Wraps a value in an array when it is not already an array.\n *\n * @example\n * ```ts\n * toArray('item'); // ['item']\n * ```\n */\nexport const toArray = <TValue>(value: TValue | TValue[]): TValue[] => {\n return Array.isArray(value) ? value : [value];\n};\n\ntype DeepArray<TValue> = TValue | Array<DeepArray<TValue>>;\n\n/**\n * Recursively flattens a nested array and maps the collected values.\n *\n * @example\n * ```ts\n * flatMapDeep([1, [2, [3]]], (value) => value * 2); // [2, 4, 6]\n * ```\n */\nexport const flatMapDeep = <TSource, TNewValue>(\n arr: DeepArray<TSource>,\n fn: (value: TSource, i: number, arr: TSource[]) => TNewValue,\n): TNewValue[] => {\n const source: TSource[] = [];\n\n const collect = (value: DeepArray<TSource>): void => {\n if (!Array.isArray(value)) {\n source.push(value);\n return;\n }\n\n for (const item of value) {\n collect(item);\n }\n };\n\n collect(arr);\n\n return source.map((value, i) => fn(value, i, source));\n};\n\n/**\n * Parses JSON safely and returns a fallback value when parsing fails.\n *\n * @example\n * ```ts\n * safeJsonParse('{\"enabled\":true}', {}); // { enabled: true }\n * ```\n */\nexport const safeJsonParse = <TValue = any, TFallback = null>(\n json: Maybe<string>,\n fallback: TFallback = null as TFallback,\n): TValue | TFallback => {\n if (json == null) return fallback;\n\n try {\n return JSON.parse(json);\n } catch {\n return fallback;\n }\n};\n\nconst UNSAFE_PROPERTY_KEYS = new Set(['__proto__', 'prototype', 'constructor']);\n\n/**\n * Checks whether a property key is unsafe and can lead to prototype pollution.\n *\n * @example\n * isUnsafeProperty('__proto__'); // true\n * isUnsafeProperty('name'); // false\n */\nexport const isUnsafeProperty = (key: any) => UNSAFE_PROPERTY_KEYS.has(key);\n"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"data.js","names":[],"sources":["../src/data.ts"],"sourcesContent":["/**\n * ---header-docs-section---\n * # yummies/data\n *\n * ## Description\n *\n * General-purpose data helpers: shallow equality, normalizing values to arrays, and recursive\n * `flatMap`-style transforms. They complement `Array`/`Object` builtins when you need stable\n * comparisons for memoization or small structural utilities without pulling a large lodash-style\n * dependency into the bundle.\n *\n * ## Usage\n *\n * ```ts\n * import { isShallowEqual, toArray } from \"yummies/data\";\n * ```\n */\n\nimport type { AnyObject, Maybe } from 'yummies/types';\n\n/**\n * Performs a shallow comparison for arrays, plain objects, dates and regular expressions.\n *\n * @example\n * ```ts\n * isShallowEqual({ id: 1 }, { id: 1 }); // true\n * ```\n */\nexport const isShallowEqual = (a: unknown, b: unknown): boolean => {\n if (a === b) return true;\n\n if (\n typeof a !== 'object' ||\n typeof b !== 'object' ||\n a === null ||\n b === null\n ) {\n return false;\n }\n\n if (a.constructor !== b.constructor) return false;\n\n const isArrayA = Array.isArray(a);\n\n if (isArrayA !== Array.isArray(b)) return false;\n\n if (isArrayA) {\n const arrA = a as unknown[];\n const arrB = b as unknown[];\n if (arrA.length !== arrB.length) return false;\n\n for (const [i, element] of arrA.entries()) {\n if (element !== arrB[i]) return false;\n }\n return true;\n }\n\n if (a instanceof Date) return a.getTime() === (b as Date).getTime();\n\n if (a instanceof RegExp) return a.toString() === (b as RegExp).toString();\n\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n\n if (aKeys.length !== bKeys.length) return false;\n\n const bObj = b as AnyObject;\n for (const key of aKeys) {\n if (!Object.hasOwn(bObj, key) || (a as AnyObject)[key] !== bObj[key]) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * Wraps a value in an array when it is not already an array.\n *\n * @example\n * ```ts\n * toArray('item'); // ['item']\n * ```\n */\nexport const toArray = <TValue>(value: TValue | TValue[]): TValue[] => {\n return Array.isArray(value) ? value : [value];\n};\n\ntype DeepArray<TValue> = TValue | Array<DeepArray<TValue>>;\n\n/**\n * Recursively flattens a nested array and maps the collected values.\n *\n * @example\n * ```ts\n * flatMapDeep([1, [2, [3]]], (value) => value * 2); // [2, 4, 6]\n * ```\n */\nexport const flatMapDeep = <TSource, TNewValue>(\n arr: DeepArray<TSource>,\n fn: (value: TSource, i: number, arr: TSource[]) => TNewValue,\n): TNewValue[] => {\n const source: TSource[] = [];\n\n const collect = (value: DeepArray<TSource>): void => {\n if (!Array.isArray(value)) {\n source.push(value);\n return;\n }\n\n for (const item of value) {\n collect(item);\n }\n };\n\n collect(arr);\n\n return source.map((value, i) => fn(value, i, source));\n};\n\n/**\n * Parses JSON safely and returns a fallback value when parsing fails.\n *\n * @example\n * ```ts\n * safeJsonParse('{\"enabled\":true}', {}); // { enabled: true }\n * ```\n */\nexport const safeJsonParse = <TValue = any, TFallback = null>(\n json: Maybe<string>,\n fallback: TFallback = null as TFallback,\n): TValue | TFallback => {\n if (json == null) return fallback;\n\n try {\n return JSON.parse(json);\n } catch {\n return fallback;\n }\n};\n\nconst UNSAFE_PROPERTY_KEYS = new Set(['__proto__', 'prototype', 'constructor']);\n\n/**\n * Checks whether a property key is unsafe and can lead to prototype pollution.\n *\n * @example\n * isUnsafeProperty('__proto__'); // true\n * isUnsafeProperty('name'); // false\n */\nexport const isUnsafeProperty = (key: any) => UNSAFE_PROPERTY_KEYS.has(key);\n"],"mappings":";;;;;;;;;AA4BA,IAAa,kBAAkB,GAAY,MAAwB;AACjE,KAAI,MAAM,EAAG,QAAO;AAEpB,KACE,OAAO,MAAM,YACb,OAAO,MAAM,YACb,MAAM,QACN,MAAM,KAEN,QAAO;AAGT,KAAI,EAAE,gBAAgB,EAAE,YAAa,QAAO;CAE5C,MAAM,WAAW,MAAM,QAAQ,EAAE;AAEjC,KAAI,aAAa,MAAM,QAAQ,EAAE,CAAE,QAAO;AAE1C,KAAI,UAAU;EACZ,MAAM,OAAO;EACb,MAAM,OAAO;AACb,MAAI,KAAK,WAAW,KAAK,OAAQ,QAAO;AAExC,OAA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
351
351
|
//#endregion
|
|
352
352
|
//#region src/date-time.ts
|
|
353
|
+
/**
|
|
354
|
+
* ---header-docs-section---
|
|
355
|
+
* # yummies/date-time
|
|
356
|
+
*
|
|
357
|
+
* ## Description
|
|
358
|
+
*
|
|
359
|
+
* Date and time formatting built on **dayjs** with locale plugins, human-readable presets, relative
|
|
360
|
+
* phrases, and duration helpers tailored to UI copy. It composes with `yummies/format`, `yummies/ms`,
|
|
361
|
+
* and `yummies/text` for declensions so timestamps read naturally in Russian-facing apps.
|
|
362
|
+
*
|
|
363
|
+
* ## Usage
|
|
364
|
+
*
|
|
365
|
+
* ```ts
|
|
366
|
+
* import { formatDate } from "yummies/date-time";
|
|
367
|
+
* ```
|
|
368
|
+
*/
|
|
353
369
|
var import_duration = /* @__PURE__ */ require_chunk.__toESM(require_duration(), 1);
|
|
354
370
|
var import_relativeTime = /* @__PURE__ */ require_chunk.__toESM(require_relativeTime(), 1);
|
|
355
371
|
require_ru();
|
package/date-time.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time.cjs","names":[],"sources":["../node_modules/.pnpm/dayjs@1.11.20/node_modules/dayjs/plugin/duration.js","../node_modules/.pnpm/dayjs@1.11.20/node_modules/dayjs/plugin/relativeTime.js","../node_modules/.pnpm/dayjs@1.11.20/node_modules/dayjs/locale/ru.js","../src/date-time.ts"],"sourcesContent":["!function(t,s){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=s():\"function\"==typeof define&&define.amd?define(s):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs_plugin_duration=s()}(this,(function(){\"use strict\";var t,s,n=1e3,i=6e4,e=36e5,r=864e5,o=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u=31536e6,d=2628e6,a=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,h={years:u,months:d,days:r,hours:e,minutes:i,seconds:n,milliseconds:1,weeks:6048e5},c=function(t){return t instanceof g},f=function(t,s,n){return new g(t,n,s.$l)},m=function(t){return s.p(t)+\"s\"},l=function(t){return t<0},$=function(t){return l(t)?Math.ceil(t):Math.floor(t)},y=function(t){return Math.abs(t)},v=function(t,s){return t?l(t)?{negative:!0,format:\"\"+y(t)+s}:{negative:!1,format:\"\"+t+s}:{negative:!1,format:\"\"}},g=function(){function l(t,s,n){var i=this;if(this.$d={},this.$l=n,void 0===t&&(this.$ms=0,this.parseFromMilliseconds()),s)return f(t*h[m(s)],this);if(\"number\"==typeof t)return this.$ms=t,this.parseFromMilliseconds(),this;if(\"object\"==typeof t)return Object.keys(t).forEach((function(s){i.$d[m(s)]=t[s]})),this.calMilliseconds(),this;if(\"string\"==typeof t){var e=t.match(a);if(e){var r=e.slice(2).map((function(t){return null!=t?Number(t):0}));return this.$d.years=r[0],this.$d.months=r[1],this.$d.weeks=r[2],this.$d.days=r[3],this.$d.hours=r[4],this.$d.minutes=r[5],this.$d.seconds=r[6],this.calMilliseconds(),this}}return this}var y=l.prototype;return y.calMilliseconds=function(){var t=this;this.$ms=Object.keys(this.$d).reduce((function(s,n){return s+(t.$d[n]||0)*h[n]}),0)},y.parseFromMilliseconds=function(){var t=this.$ms;this.$d.years=$(t/u),t%=u,this.$d.months=$(t/d),t%=d,this.$d.days=$(t/r),t%=r,this.$d.hours=$(t/e),t%=e,this.$d.minutes=$(t/i),t%=i,this.$d.seconds=$(t/n),t%=n,this.$d.milliseconds=t},y.toISOString=function(){var t=v(this.$d.years,\"Y\"),s=v(this.$d.months,\"M\"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var i=v(n,\"D\"),e=v(this.$d.hours,\"H\"),r=v(this.$d.minutes,\"M\"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var u=v(o,\"S\"),d=t.negative||s.negative||i.negative||e.negative||r.negative||u.negative,a=e.format||r.format||u.format?\"T\":\"\",h=(d?\"-\":\"\")+\"P\"+t.format+s.format+i.format+a+e.format+r.format+u.format;return\"P\"===h||\"-P\"===h?\"P0D\":h},y.toJSON=function(){return this.toISOString()},y.format=function(t){var n=t||\"YYYY-MM-DDTHH:mm:ss\",i={Y:this.$d.years,YY:s.s(this.$d.years,2,\"0\"),YYYY:s.s(this.$d.years,4,\"0\"),M:this.$d.months,MM:s.s(this.$d.months,2,\"0\"),D:this.$d.days,DD:s.s(this.$d.days,2,\"0\"),H:this.$d.hours,HH:s.s(this.$d.hours,2,\"0\"),m:this.$d.minutes,mm:s.s(this.$d.minutes,2,\"0\"),s:this.$d.seconds,ss:s.s(this.$d.seconds,2,\"0\"),SSS:s.s(this.$d.milliseconds,3,\"0\")};return n.replace(o,(function(t,s){return s||String(i[t])}))},y.as=function(t){return this.$ms/h[m(t)]},y.get=function(t){var s=this.$ms,n=m(t);return\"milliseconds\"===n?s%=1e3:s=\"weeks\"===n?$(s/h[n]):this.$d[n],s||0},y.add=function(t,s,n){var i;return i=s?t*h[m(s)]:c(t)?t.$ms:f(t,this).$ms,f(this.$ms+i*(n?-1:1),this)},y.subtract=function(t,s){return this.add(t,s,!0)},y.locale=function(t){var s=this.clone();return s.$l=t,s},y.clone=function(){return f(this.$ms,this)},y.humanize=function(s){return t().add(this.$ms,\"ms\").locale(this.$l).fromNow(!s)},y.valueOf=function(){return this.asMilliseconds()},y.milliseconds=function(){return this.get(\"milliseconds\")},y.asMilliseconds=function(){return this.as(\"milliseconds\")},y.seconds=function(){return this.get(\"seconds\")},y.asSeconds=function(){return this.as(\"seconds\")},y.minutes=function(){return this.get(\"minutes\")},y.asMinutes=function(){return this.as(\"minutes\")},y.hours=function(){return this.get(\"hours\")},y.asHours=function(){return this.as(\"hours\")},y.days=function(){return this.get(\"days\")},y.asDays=function(){return this.as(\"days\")},y.weeks=function(){return this.get(\"weeks\")},y.asWeeks=function(){return this.as(\"weeks\")},y.months=function(){return this.get(\"months\")},y.asMonths=function(){return this.as(\"months\")},y.years=function(){return this.get(\"years\")},y.asYears=function(){return this.as(\"years\")},l}(),p=function(t,s,n){return t.add(s.years()*n,\"y\").add(s.months()*n,\"M\").add(s.days()*n,\"d\").add(s.hours()*n,\"h\").add(s.minutes()*n,\"m\").add(s.seconds()*n,\"s\").add(s.milliseconds()*n,\"ms\")};return function(n,i,e){t=e,s=e().$utils(),e.duration=function(t,s){var n=e.locale();return f(t,{$l:n},s)},e.isDuration=c;var r=i.prototype.add,o=i.prototype.subtract;i.prototype.add=function(t,s){return c(t)?p(this,t,1):r.bind(this)(t,s)},i.prototype.subtract=function(t,s){return c(t)?p(this,t,-1):o.bind(this)(t,s)}}}));","!function(r,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(r=\"undefined\"!=typeof globalThis?globalThis:r||self).dayjs_plugin_relativeTime=e()}(this,(function(){\"use strict\";return function(r,e,t){r=r||{};var n=e.prototype,o={future:\"in %s\",past:\"%s ago\",s:\"a few seconds\",m:\"a minute\",mm:\"%d minutes\",h:\"an hour\",hh:\"%d hours\",d:\"a day\",dd:\"%d days\",M:\"a month\",MM:\"%d months\",y:\"a year\",yy:\"%d years\"};function i(r,e,t,o){return n.fromToBase(r,e,t,o)}t.en.relativeTime=o,n.fromToBase=function(e,n,i,d,u){for(var f,a,s,l=i.$locale().relativeTime||o,h=r.thresholds||[{l:\"s\",r:44,d:\"second\"},{l:\"m\",r:89},{l:\"mm\",r:44,d:\"minute\"},{l:\"h\",r:89},{l:\"hh\",r:21,d:\"hour\"},{l:\"d\",r:35},{l:\"dd\",r:25,d:\"day\"},{l:\"M\",r:45},{l:\"MM\",r:10,d:\"month\"},{l:\"y\",r:17},{l:\"yy\",d:\"year\"}],m=h.length,c=0;c<m;c+=1){var y=h[c];y.d&&(f=d?t(e).diff(i,y.d,!0):i.diff(e,y.d,!0));var p=(r.rounding||Math.round)(Math.abs(f));if(s=f>0,p<=y.r||!y.r){p<=1&&c>0&&(y=h[c-1]);var v=l[y.l];u&&(p=u(\"\"+p)),a=\"string\"==typeof v?v.replace(\"%d\",p):v(p,n,y.l,s);break}}if(n)return a;var M=s?l.future:l.past;return\"function\"==typeof M?M(a):M.replace(\"%s\",a)},n.to=function(r,e){return i(r,e,this,!0)},n.from=function(r,e){return i(r,e,this)};var d=function(r){return r.$u?t.utc():t()};n.toNow=function(r){return this.to(d(this),r)},n.fromNow=function(r){return this.from(d(this),r)}}}));","!function(_,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t(require(\"dayjs\")):\"function\"==typeof define&&define.amd?define([\"dayjs\"],t):(_=\"undefined\"!=typeof globalThis?globalThis:_||self).dayjs_locale_ru=t(_.dayjs)}(this,(function(_){\"use strict\";function t(_){return _&&\"object\"==typeof _&&\"default\"in _?_:{default:_}}var e=t(_),n=\"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря\".split(\"_\"),s=\"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь\".split(\"_\"),r=\"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.\".split(\"_\"),o=\"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.\".split(\"_\"),i=/D[oD]?(\\[[^[\\]]*\\]|\\s)+MMMM?/;function d(_,t,e){var n,s;return\"m\"===e?t?\"минута\":\"минуту\":_+\" \"+(n=+_,s={mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[e].split(\"_\"),n%10==1&&n%100!=11?s[0]:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?s[1]:s[2])}var u=function(_,t){return i.test(t)?n[_.month()]:s[_.month()]};u.s=s,u.f=n;var a=function(_,t){return i.test(t)?r[_.month()]:o[_.month()]};a.s=o,a.f=r;var m={name:\"ru\",weekdays:\"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота\".split(\"_\"),weekdaysShort:\"вск_пнд_втр_срд_чтв_птн_сбт\".split(\"_\"),weekdaysMin:\"вс_пн_вт_ср_чт_пт_сб\".split(\"_\"),months:u,monthsShort:a,weekStart:1,yearStart:4,formats:{LT:\"H:mm\",LTS:\"H:mm:ss\",L:\"DD.MM.YYYY\",LL:\"D MMMM YYYY г.\",LLL:\"D MMMM YYYY г., H:mm\",LLLL:\"dddd, D MMMM YYYY г., H:mm\"},relativeTime:{future:\"через %s\",past:\"%s назад\",s:\"несколько секунд\",m:d,mm:d,h:\"час\",hh:d,d:\"день\",dd:d,M:\"месяц\",MM:d,y:\"год\",yy:d},ordinal:function(_){return _},meridiem:function(_){return _<4?\"ночи\":_<12?\"утра\":_<17?\"дня\":\"вечера\"}};return e.default.locale(m,null,!0),m}));","import dayjs, { type Dayjs, type ManipulateType } from 'dayjs';\nimport duration from 'dayjs/plugin/duration.js';\nimport relativeTime from 'dayjs/plugin/relativeTime.js';\nimport { format } from 'yummies/format';\nimport { ms, unitsToMs } from 'yummies/ms';\nimport { declension } from 'yummies/text';\nimport { typeGuard } from 'yummies/type-guard';\nimport type { Maybe } from 'yummies/types';\n\nimport 'dayjs/locale/ru.js';\n\ndayjs.extend(relativeTime);\ndayjs.extend(duration);\ndayjs.locale('ru');\n\nconst toLibFormat = (value: Maybe<RawDateToFormat>): Dayjs | null => {\n let result: Maybe<Dayjs> = null;\n if (dayjs.isDayjs(value)) {\n result = value;\n } else if (value != null) {\n result = dayjs(value);\n }\n\n if (!result?.isValid()) {\n return null;\n }\n\n return result;\n};\n\nexport type RawDateToFormat = Date | string | number | Dayjs;\n\n/**\n * Formats a date-like value using predefined presets or a custom pattern.\n *\n * @example\n * ```ts\n * formatDate('2024-03-15', { format: 'time-short' });\n * ```\n */\nexport const formatDate = (\n value: Maybe<RawDateToFormat>,\n settings?: Maybe<{\n format?:\n | 'human'\n | 'full'\n | 'short'\n | 'day'\n | 'day-only'\n | 'date'\n | 'month'\n | 'spent-time'\n | 'time'\n | 'time-short';\n pattern?: string;\n asTime?: boolean;\n }>,\n) => {\n const dateFormat = settings?.format;\n const datePattern = settings?.pattern;\n const asTime = settings?.asTime;\n\n let libDate: duration.Duration | dayjs.Dayjs | null = null;\n\n if (asTime && typeGuard.isNumber(value)) {\n libDate = dayjs.duration(value);\n } else {\n libDate = toLibFormat(value);\n }\n\n if (!libDate) {\n return format.NO_VALUE;\n }\n\n if (datePattern) {\n return libDate.format(datePattern);\n }\n\n if (dateFormat === 'human' || dateFormat === 'spent-time') {\n if ('fromNow' in libDate) {\n return libDate.fromNow(dateFormat === 'spent-time');\n } else {\n return format.NO_VALUE;\n }\n }\n\n switch (dateFormat) {\n case 'full': {\n return libDate.format('DD MMM YYYY HH:mm:ss');\n }\n case 'short': {\n return libDate.format('DD MMM HH:mm');\n }\n case 'time': {\n return libDate.format('HH:mm:ss');\n }\n case 'time-short': {\n return libDate.format('HH:mm');\n }\n case 'day': {\n return libDate.format('DD MMM YYYY');\n }\n case 'month': {\n return libDate.format('MMMM YYYY');\n }\n default: {\n return libDate.format('DD.MM.YYYY');\n }\n }\n};\n\n/**\n * Splits a duration in milliseconds into day-based time parts.\n *\n * @example\n * ```ts\n * dayTimeDuration(ms(1, 'day') + ms(2, 'hour'));\n * ```\n */\nexport const dayTimeDuration = (timeInMs: number) => {\n let left = Math.max(timeInMs, 0);\n\n const days = Math.floor(left / unitsToMs.day);\n left = left % unitsToMs.day;\n\n const hours = Math.floor(left / unitsToMs.hour);\n left = left % unitsToMs.hour;\n\n const minutes = Math.floor(left / unitsToMs.min);\n left = left % unitsToMs.min;\n\n const seconds = Math.floor(left / unitsToMs.sec);\n left = left % unitsToMs.sec;\n\n const milliseconds = Math.floor(left);\n\n return {\n days,\n hours,\n minutes,\n seconds,\n milliseconds,\n };\n};\n\ntype DateChangeParam = [amount: number, unit?: Maybe<ManipulateType>];\n\n/**\n * Applies one or more date adjustments and returns a new `Date` instance.\n *\n * @example\n * ```ts\n * changeDate(new Date(), 1, 'day', 30, 'minute');\n * ```\n */\nexport const changeDate = (\n date: Maybe<RawDateToFormat>,\n ...args: [\n ...DateChangeParam,\n ...Partial<DateChangeParam>,\n ...Partial<DateChangeParam>,\n ...Partial<DateChangeParam>,\n ...Partial<DateChangeParam>,\n ...Partial<DateChangeParam>,\n ]\n) => {\n let wrappedDate = toLibFormat(date)!;\n\n for (let i = 0; i < args.length; i += 2) {\n const amount = args[i] as DateChangeParam[0];\n const unit = args[i + 1] as DateChangeParam[1];\n if (unit != null) {\n wrappedDate = wrappedDate.add(amount, unit);\n }\n }\n\n return wrappedDate.toDate();\n};\n\n/**\n * Converts milliseconds into hour-based time parts without keeping full days separately.\n *\n * @example\n * ```ts\n * timeDuration(ms(1, 'hour') + ms(30, 'min'));\n * ```\n */\nexport const timeDuration = (timeInMs: number) => {\n const { days, hours, milliseconds, minutes, seconds } =\n dayTimeDuration(timeInMs);\n\n return {\n hours: hours + unitsToMs.day * days,\n milliseconds,\n minutes,\n seconds,\n };\n};\n\nconst durationFormatLabels = {\n days: { compact: 'д', full: ['день', 'дня', 'дней'] },\n hours: { compact: 'ч', full: ['час', 'часа', 'часов'] },\n minutes: { compact: 'мин', full: ['минута', 'минуты', 'минут'] },\n seconds: { compact: 'сек', full: ['секунда', 'секунды', 'секунд'] },\n} as const;\n\n/**\n * Formats a duration either from milliseconds or between two dates.\n *\n * @example\n * ```ts\n * getFormatDuration(ms(2, 'hour') + ms(15, 'min'));\n * ```\n */\nexport function getFormatDuration(\n dateA: Date,\n dateB: Date,\n compact?: boolean,\n): string;\nexport function getFormatDuration(ms: number, compact?: boolean): string;\n\nexport function getFormatDuration(...args: any[]): string {\n let compact = false;\n let diff = 0;\n\n if (args[0] instanceof Date) {\n const startedDate = dayjs(args[0]);\n const endedDate = dayjs(args[1]);\n\n diff = endedDate.diff(startedDate, 'ms');\n compact = args[2] === true;\n } else {\n diff = args[0];\n compact = args[1] === true;\n }\n\n const { days, hours, minutes, seconds } = dayTimeDuration(diff);\n\n const formattedParts: string[] = [];\n\n if (days) {\n if (compact) {\n formattedParts.push(`${days} ${durationFormatLabels.days.compact}`);\n } else {\n formattedParts.push(\n `${days} ${declension(days, durationFormatLabels.days.full)}`,\n );\n }\n }\n\n if (hours) {\n if (compact) {\n formattedParts.push(`${hours} ${durationFormatLabels.hours.compact}`);\n } else {\n formattedParts.push(\n `${hours} ${declension(hours, durationFormatLabels.hours.full)}`,\n );\n }\n }\n\n if (minutes) {\n if (compact) {\n formattedParts.push(`${minutes} ${durationFormatLabels.minutes.compact}`);\n } else {\n formattedParts.push(\n `${minutes} ${declension(minutes, durationFormatLabels.minutes.full)}`,\n );\n }\n }\n\n if (seconds) {\n if (compact) {\n formattedParts.push(`${seconds} ${durationFormatLabels.seconds.compact}`);\n } else {\n formattedParts.push(\n `${seconds} ${declension(seconds, durationFormatLabels.seconds.full)}`,\n );\n }\n }\n\n return formattedParts.join(' ');\n}\n\nexport type TimeDiff = {\n minutes: number;\n seconds: number;\n total: {\n ms: number;\n hours: number;\n };\n};\n\n/**\n * Calculates the difference between two dates in minutes, seconds and total units.\n *\n * @example\n * ```ts\n * getTimeDiff(new Date('2024-03-15T12:30:00'), new Date('2024-03-15T12:00:00'));\n * ```\n */\nexport const getTimeDiff = (\n dateA: RawDateToFormat,\n dateB: RawDateToFormat,\n): TimeDiff => {\n const leftDate = toLibFormat(dateA)?.toDate();\n const rightDate = toLibFormat(dateB)?.toDate();\n\n if (!leftDate || !rightDate) {\n return {\n minutes: 0,\n seconds: 0,\n total: { ms: 0, hours: 0 },\n };\n }\n\n const msDiff = leftDate.getTime() - rightDate.getTime();\n\n return {\n minutes: Math.max(Math.floor(msDiff / ms(1, 'min')), 0),\n seconds: Math.max(Math.floor((msDiff % ms(1, 'min')) / 1000), 0),\n total: {\n hours: Math.round(msDiff / ms(1, 'hour')),\n ms: msDiff,\n },\n };\n};\n\n/**\n * Returns a new date shifted forward by the provided number of days.\n *\n * @example\n * ```ts\n * addDays(new Date('2024-03-15'), 7);\n * ```\n */\nexport const addDays = (date: RawDateToFormat, count: number) =>\n toLibFormat(date)?.add(count, 'd').toDate();\n\n/**\n * Returns a new date shifted backward by the provided number of days.\n *\n * @example\n * ```ts\n * subtractDays(new Date('2024-03-15'), 7);\n * ```\n */\nexport const subtractDays = (date: RawDateToFormat, count: number) =>\n toLibFormat(date)?.subtract(count, 'd').toDate();\n\n/**\n * Returns a new date shifted forward by the provided number of minutes.\n *\n * @example\n * ```ts\n * addMinutes(new Date('2024-03-15T12:00:00'), 15);\n * ```\n */\nexport const addMinutes = (date: RawDateToFormat, count: number) =>\n toLibFormat(date)?.add(count, 'm').toDate();\n\n/**\n * Returns a new date with the minutes field replaced.\n *\n * @example\n * ```ts\n * setMinutes(new Date('2024-03-15T12:00:00'), 45);\n * ```\n */\nexport const setMinutes = (date: RawDateToFormat, minutes: number) =>\n toLibFormat(date)?.set('m', minutes).toDate();\n\n/**\n * Returns a new date with the hours field replaced.\n *\n * @example\n * ```ts\n * setHours(new Date('2024-03-15T12:00:00'), 9);\n * ```\n */\nexport const setHours = (date: RawDateToFormat, hours: number) =>\n toLibFormat(date)?.set('h', hours).toDate();\n"],"x_google_ignoreList":[0,1,2],"mappings":";;;;;;;;;;AAAA,EAAC,SAAS,GAAE,GAAE;AAAC,cAAU,OAAO,WAAS,eAAa,OAAO,SAAO,OAAO,UAAQ,GAAG,GAAC,cAAY,OAAO,UAAQ,OAAO,MAAI,OAAO,EAAE,GAAC,CAAC,IAAE,eAAa,OAAO,aAAW,aAAW,KAAG,MAAM,wBAAsB,GAAG;cAAQ,WAAU;AAAC;EAAa,IAAI,GAAE,GAAE,IAAE,KAAI,IAAE,KAAI,IAAE,MAAK,IAAE,OA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W,MAAuB,UAC7C,YAAY,KAAK,EAAE,IAAI,OAAO,IAAI,CAAC,QAAQ;;;;;;;;;AAU7C,IAAa,gBAAgB,MAAuB,UAClD,YAAY,KAAK,EAAE,SAAS,OAAO,IAAI,CAAC,QAAQ;;;;;;;;;AAUlD,IAAa,cAAc,MAAuB,UAChD,YAAY,KAAK,EAAE,IAAI,OAAO,IAAI,CAAC,QAAQ;;;;;;;;;AAU7C,IAAa,cAAc,MAAuB,YAChD,YAAY,KAAK,EAAE,IAAI,KAAK,QAAQ,CAAC,QAAQ;;;;;;;;;AAU/C,IAAa,YAAY,MAAuB,UAC9C,YAAY,KAAK,EAAE,IAAI,KAAK,MAAM,CAAC,QAAQ"}
|
|
1
|
+
{"version":3,"file":"date-time.cjs","names":[],"sources":["../node_modules/.pnpm/dayjs@1.11.20/node_modules/dayjs/plugin/duration.js","../node_modules/.pnpm/dayjs@1.11.20/node_modules/dayjs/plugin/relativeTime.js","../node_modules/.pnpm/dayjs@1.11.20/node_modules/dayjs/locale/ru.js","../src/date-time.ts"],"sourcesContent":["!function(t,s){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=s():\"function\"==typeof define&&define.amd?define(s):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs_plugin_duration=s()}(this,(function(){\"use strict\";var t,s,n=1e3,i=6e4,e=36e5,r=864e5,o=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u=31536e6,d=2628e6,a=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,h={years:u,months:d,days:r,hours:e,minutes:i,seconds:n,milliseconds:1,weeks:6048e5},c=function(t){return t instanceof g},f=function(t,s,n){return new g(t,n,s.$l)},m=function(t){return s.p(t)+\"s\"},l=function(t){return t<0},$=function(t){return l(t)?Math.ceil(t):Math.floor(t)},y=function(t){return Math.abs(t)},v=function(t,s){return t?l(t)?{negative:!0,format:\"\"+y(t)+s}:{negative:!1,format:\"\"+t+s}:{negative:!1,format:\"\"}},g=function(){function l(t,s,n){var i=this;if(this.$d={},this.$l=n,void 0===t&&(this.$ms=0,this.parseFromMilliseconds()),s)return f(t*h[m(s)],this);if(\"number\"==typeof t)return this.$ms=t,this.parseFromMilliseconds(),this;if(\"object\"==typeof t)return Object.keys(t).forEach((function(s){i.$d[m(s)]=t[s]})),this.calMilliseconds(),this;if(\"string\"==typeof t){var e=t.match(a);if(e){var r=e.slice(2).map((function(t){return null!=t?Number(t):0}));return this.$d.years=r[0],this.$d.months=r[1],this.$d.weeks=r[2],this.$d.days=r[3],this.$d.hours=r[4],this.$d.minutes=r[5],this.$d.seconds=r[6],this.calMilliseconds(),this}}return this}var y=l.prototype;return y.calMilliseconds=function(){var t=this;this.$ms=Object.keys(this.$d).reduce((function(s,n){return s+(t.$d[n]||0)*h[n]}),0)},y.parseFromMilliseconds=function(){var t=this.$ms;this.$d.years=$(t/u),t%=u,this.$d.months=$(t/d),t%=d,this.$d.days=$(t/r),t%=r,this.$d.hours=$(t/e),t%=e,this.$d.minutes=$(t/i),t%=i,this.$d.seconds=$(t/n),t%=n,this.$d.milliseconds=t},y.toISOString=function(){var t=v(this.$d.years,\"Y\"),s=v(this.$d.months,\"M\"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var i=v(n,\"D\"),e=v(this.$d.hours,\"H\"),r=v(this.$d.minutes,\"M\"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var u=v(o,\"S\"),d=t.negative||s.negative||i.negative||e.negative||r.negative||u.negative,a=e.format||r.format||u.format?\"T\":\"\",h=(d?\"-\":\"\")+\"P\"+t.format+s.format+i.format+a+e.format+r.format+u.format;return\"P\"===h||\"-P\"===h?\"P0D\":h},y.toJSON=function(){return this.toISOString()},y.format=function(t){var n=t||\"YYYY-MM-DDTHH:mm:ss\",i={Y:this.$d.years,YY:s.s(this.$d.years,2,\"0\"),YYYY:s.s(this.$d.years,4,\"0\"),M:this.$d.months,MM:s.s(this.$d.months,2,\"0\"),D:this.$d.days,DD:s.s(this.$d.days,2,\"0\"),H:this.$d.hours,HH:s.s(this.$d.hours,2,\"0\"),m:this.$d.minutes,mm:s.s(this.$d.minutes,2,\"0\"),s:this.$d.seconds,ss:s.s(this.$d.seconds,2,\"0\"),SSS:s.s(this.$d.milliseconds,3,\"0\")};return n.replace(o,(function(t,s){return s||String(i[t])}))},y.as=function(t){return this.$ms/h[m(t)]},y.get=function(t){var s=this.$ms,n=m(t);return\"milliseconds\"===n?s%=1e3:s=\"weeks\"===n?$(s/h[n]):this.$d[n],s||0},y.add=function(t,s,n){var i;return i=s?t*h[m(s)]:c(t)?t.$ms:f(t,this).$ms,f(this.$ms+i*(n?-1:1),this)},y.subtract=function(t,s){return this.add(t,s,!0)},y.locale=function(t){var s=this.clone();return s.$l=t,s},y.clone=function(){return f(this.$ms,this)},y.humanize=function(s){return t().add(this.$ms,\"ms\").locale(this.$l).fromNow(!s)},y.valueOf=function(){return this.asMilliseconds()},y.milliseconds=function(){return this.get(\"milliseconds\")},y.asMilliseconds=function(){return this.as(\"milliseconds\")},y.seconds=function(){return this.get(\"seconds\")},y.asSeconds=function(){return this.as(\"seconds\")},y.minutes=function(){return this.get(\"minutes\")},y.asMinutes=function(){return this.as(\"minutes\")},y.hours=function(){return this.get(\"hours\")},y.asHours=function(){return this.as(\"hours\")},y.days=function(){return this.get(\"days\")},y.asDays=function(){return this.as(\"days\")},y.weeks=function(){return this.get(\"weeks\")},y.asWeeks=function(){return this.as(\"weeks\")},y.months=function(){return this.get(\"months\")},y.asMonths=function(){return this.as(\"months\")},y.years=function(){return this.get(\"years\")},y.asYears=function(){return this.as(\"years\")},l}(),p=function(t,s,n){return t.add(s.years()*n,\"y\").add(s.months()*n,\"M\").add(s.days()*n,\"d\").add(s.hours()*n,\"h\").add(s.minutes()*n,\"m\").add(s.seconds()*n,\"s\").add(s.milliseconds()*n,\"ms\")};return function(n,i,e){t=e,s=e().$utils(),e.duration=function(t,s){var n=e.locale();return f(t,{$l:n},s)},e.isDuration=c;var r=i.prototype.add,o=i.prototype.subtract;i.prototype.add=function(t,s){return c(t)?p(this,t,1):r.bind(this)(t,s)},i.prototype.subtract=function(t,s){return c(t)?p(this,t,-1):o.bind(this)(t,s)}}}));","!function(r,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(r=\"undefined\"!=typeof globalThis?globalThis:r||self).dayjs_plugin_relativeTime=e()}(this,(function(){\"use strict\";return function(r,e,t){r=r||{};var n=e.prototype,o={future:\"in %s\",past:\"%s ago\",s:\"a few seconds\",m:\"a minute\",mm:\"%d minutes\",h:\"an hour\",hh:\"%d hours\",d:\"a day\",dd:\"%d days\",M:\"a month\",MM:\"%d months\",y:\"a year\",yy:\"%d years\"};function i(r,e,t,o){return n.fromToBase(r,e,t,o)}t.en.relativeTime=o,n.fromToBase=function(e,n,i,d,u){for(var f,a,s,l=i.$locale().relativeTime||o,h=r.thresholds||[{l:\"s\",r:44,d:\"second\"},{l:\"m\",r:89},{l:\"mm\",r:44,d:\"minute\"},{l:\"h\",r:89},{l:\"hh\",r:21,d:\"hour\"},{l:\"d\",r:35},{l:\"dd\",r:25,d:\"day\"},{l:\"M\",r:45},{l:\"MM\",r:10,d:\"month\"},{l:\"y\",r:17},{l:\"yy\",d:\"year\"}],m=h.length,c=0;c<m;c+=1){var y=h[c];y.d&&(f=d?t(e).diff(i,y.d,!0):i.diff(e,y.d,!0));var p=(r.rounding||Math.round)(Math.abs(f));if(s=f>0,p<=y.r||!y.r){p<=1&&c>0&&(y=h[c-1]);var v=l[y.l];u&&(p=u(\"\"+p)),a=\"string\"==typeof v?v.replace(\"%d\",p):v(p,n,y.l,s);break}}if(n)return a;var M=s?l.future:l.past;return\"function\"==typeof M?M(a):M.replace(\"%s\",a)},n.to=function(r,e){return i(r,e,this,!0)},n.from=function(r,e){return i(r,e,this)};var d=function(r){return r.$u?t.utc():t()};n.toNow=function(r){return this.to(d(this),r)},n.fromNow=function(r){return this.from(d(this),r)}}}));","!function(_,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t(require(\"dayjs\")):\"function\"==typeof define&&define.amd?define([\"dayjs\"],t):(_=\"undefined\"!=typeof globalThis?globalThis:_||self).dayjs_locale_ru=t(_.dayjs)}(this,(function(_){\"use strict\";function t(_){return _&&\"object\"==typeof _&&\"default\"in _?_:{default:_}}var e=t(_),n=\"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря\".split(\"_\"),s=\"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь\".split(\"_\"),r=\"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.\".split(\"_\"),o=\"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.\".split(\"_\"),i=/D[oD]?(\\[[^[\\]]*\\]|\\s)+MMMM?/;function d(_,t,e){var n,s;return\"m\"===e?t?\"минута\":\"минуту\":_+\" \"+(n=+_,s={mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[e].split(\"_\"),n%10==1&&n%100!=11?s[0]:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?s[1]:s[2])}var u=function(_,t){return i.test(t)?n[_.month()]:s[_.month()]};u.s=s,u.f=n;var a=function(_,t){return i.test(t)?r[_.month()]:o[_.month()]};a.s=o,a.f=r;var m={name:\"ru\",weekdays:\"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота\".split(\"_\"),weekdaysShort:\"вск_пнд_втр_срд_чтв_птн_сбт\".split(\"_\"),weekdaysMin:\"вс_пн_вт_ср_чт_пт_сб\".split(\"_\"),months:u,monthsShort:a,weekStart:1,yearStart:4,formats:{LT:\"H:mm\",LTS:\"H:mm:ss\",L:\"DD.MM.YYYY\",LL:\"D MMMM YYYY г.\",LLL:\"D MMMM YYYY г., H:mm\",LLLL:\"dddd, D MMMM YYYY г., H:mm\"},relativeTime:{future:\"через %s\",past:\"%s назад\",s:\"несколько секунд\",m:d,mm:d,h:\"час\",hh:d,d:\"день\",dd:d,M:\"месяц\",MM:d,y:\"год\",yy:d},ordinal:function(_){return _},meridiem:function(_){return _<4?\"ночи\":_<12?\"утра\":_<17?\"дня\":\"вечера\"}};return e.default.locale(m,null,!0),m}));","/**\n * ---header-docs-section---\n * # yummies/date-time\n *\n * ## Description\n *\n * Date and time formatting built on **dayjs** with locale plugins, human-readable presets, relative\n * phrases, and duration helpers tailored to UI copy. It composes with `yummies/format`, `yummies/ms`,\n * and `yummies/text` for declensions so timestamps read naturally in Russian-facing apps.\n *\n * ## Usage\n *\n * ```ts\n * import { formatDate } from \"yummies/date-time\";\n * ```\n */\n\nimport dayjs, { type Dayjs, type ManipulateType } from 'dayjs';\nimport duration from 'dayjs/plugin/duration.js';\nimport relativeTime from 'dayjs/plugin/relativeTime.js';\nimport { format } from 'yummies/format';\nimport { ms, unitsToMs } from 'yummies/ms';\nimport { declension } from 'yummies/text';\nimport { typeGuard } from 'yummies/type-guard';\nimport type { Maybe } from 'yummies/types';\n\nimport 'dayjs/locale/ru.js';\n\ndayjs.extend(relativeTime);\ndayjs.extend(duration);\ndayjs.locale('ru');\n\nconst toLibFormat = (value: Maybe<RawDateToFormat>): Dayjs | null => {\n let result: Maybe<Dayjs> = null;\n if (dayjs.isDayjs(value)) {\n result = value;\n } else if (value != null) {\n result = dayjs(value);\n }\n\n if (!result?.isValid()) {\n return null;\n }\n\n return result;\n};\n\nexport type RawDateToFormat = Date | string | number | Dayjs;\n\n/**\n * Formats a date-like value using predefined presets or a custom pattern.\n *\n * @example\n * ```ts\n * formatDate('2024-03-15', { format: 'time-short' });\n * ```\n */\nexport const formatDate = (\n value: Maybe<RawDateToFormat>,\n settings?: Maybe<{\n format?:\n | 'human'\n | 'full'\n | 'short'\n | 'day'\n | 'day-only'\n | 'date'\n | 'month'\n | 'spent-time'\n | 'time'\n | 'time-short';\n pattern?: string;\n asTime?: boolean;\n }>,\n) => {\n const dateFormat = settings?.format;\n const datePattern = settings?.pattern;\n const asTime = settings?.asTime;\n\n let libDate: duration.Duration | dayjs.Dayjs | null = null;\n\n if (asTime && typeGuard.isNumber(value)) {\n libDate = dayjs.duration(value);\n } else {\n libDate = toLibFormat(value);\n }\n\n if (!libDate) {\n return format.NO_VALUE;\n }\n\n if (datePattern) {\n return libDate.format(datePattern);\n }\n\n if (dateFormat === 'human' || dateFormat === 'spent-time') {\n if ('fromNow' in libDate) {\n return libDate.fromNow(dateFormat === 'spent-time');\n } else {\n return format.NO_VALUE;\n }\n }\n\n switch (dateFormat) {\n case 'full': {\n return libDate.format('DD MMM YYYY HH:mm:ss');\n }\n case 'short': {\n return libDate.format('DD MMM HH:mm');\n }\n case 'time': {\n return libDate.format('HH:mm:ss');\n }\n case 'time-short': {\n return libDate.format('HH:mm');\n }\n case 'day': {\n return libDate.format('DD MMM YYYY');\n }\n case 'month': {\n return libDate.format('MMMM YYYY');\n }\n default: {\n return libDate.format('DD.MM.YYYY');\n }\n }\n};\n\n/**\n * Splits a duration in milliseconds into day-based time parts.\n *\n * @example\n * ```ts\n * dayTimeDuration(ms(1, 'day') + ms(2, 'hour'));\n * ```\n */\nexport const dayTimeDuration = (timeInMs: number) => {\n let left = Math.max(timeInMs, 0);\n\n const days = Math.floor(left / unitsToMs.day);\n left = left % unitsToMs.day;\n\n const hours = Math.floor(left / unitsToMs.hour);\n left = left % unitsToMs.hour;\n\n const minutes = Math.floor(left / unitsToMs.min);\n left = left % unitsToMs.min;\n\n const seconds = Math.floor(left / unitsToMs.sec);\n left = left % unitsToMs.sec;\n\n const milliseconds = Math.floor(left);\n\n return {\n days,\n hours,\n minutes,\n seconds,\n milliseconds,\n };\n};\n\ntype DateChangeParam = [amount: number, unit?: Maybe<ManipulateType>];\n\n/**\n * Applies one or more date adjustments and returns a new `Date` instance.\n *\n * @example\n * ```ts\n * changeDate(new Date(), 1, 'day', 30, 'minute');\n * ```\n */\nexport const changeDate = (\n date: Maybe<RawDateToFormat>,\n ...args: [\n ...DateChangeParam,\n ...Partial<DateChangeParam>,\n ...Partial<DateChangeParam>,\n ...Partial<DateChangeParam>,\n ...Partial<DateChangeParam>,\n ...Partial<DateChangeParam>,\n ]\n) => {\n let wrappedDate = toLibFormat(date)!;\n\n for (let i = 0; i < args.length; i += 2) {\n const amount = args[i] as DateChangeParam[0];\n const unit = args[i + 1] as DateChangeParam[1];\n if (unit != null) {\n wrappedDate = wrappedDate.add(amount, unit);\n }\n }\n\n return wrappedDate.toDate();\n};\n\n/**\n * Converts milliseconds into hour-based time parts without keeping full days separately.\n *\n * @example\n * ```ts\n * timeDuration(ms(1, 'hour') + ms(30, 'min'));\n * ```\n */\nexport const timeDuration = (timeInMs: number) => {\n const { days, hours, milliseconds, minutes, seconds } =\n dayTimeDuration(timeInMs);\n\n return {\n hours: hours + unitsToMs.day * days,\n milliseconds,\n minutes,\n seconds,\n };\n};\n\nconst durationFormatLabels = {\n days: { compact: 'д', full: ['день', 'дня', 'дней'] },\n hours: { compact: 'ч', full: ['час', 'часа', 'часов'] },\n minutes: { compact: 'мин', full: ['минута', 'минуты', 'минут'] },\n seconds: { compact: 'сек', full: ['секунда', 'секунды', 'секунд'] },\n} as const;\n\n/**\n * Formats a duration either from milliseconds or between two dates.\n *\n * @example\n * ```ts\n * getFormatDuration(ms(2, 'hour') + ms(15, 'min'));\n * ```\n */\nexport function getFormatDuration(\n dateA: Date,\n dateB: Date,\n compact?: boolean,\n): string;\nexport function getFormatDuration(ms: number, compact?: boolean): string;\n\nexport function getFormatDuration(...args: any[]): string {\n let compact = false;\n let diff = 0;\n\n if (args[0] instanceof Date) {\n const startedDate = dayjs(args[0]);\n const endedDate = dayjs(args[1]);\n\n diff = endedDate.diff(startedDate, 'ms');\n compact = args[2] === true;\n } else {\n diff = args[0];\n compact = args[1] === true;\n }\n\n const { days, hours, minutes, seconds } = dayTimeDuration(diff);\n\n const formattedParts: string[] = [];\n\n if (days) {\n if (compact) {\n formattedParts.push(`${days} ${durationFormatLabels.days.compact}`);\n } else {\n formattedParts.push(\n `${days} ${declension(days, durationFormatLabels.days.full)}`,\n );\n }\n }\n\n if (hours) {\n if (compact) {\n formattedParts.push(`${hours} ${durationFormatLabels.hours.compact}`);\n } else {\n formattedParts.push(\n `${hours} ${declension(hours, durationFormatLabels.hours.full)}`,\n );\n }\n }\n\n if (minutes) {\n if (compact) {\n formattedParts.push(`${minutes} ${durationFormatLabels.minutes.compact}`);\n } else {\n formattedParts.push(\n `${minutes} ${declension(minutes, durationFormatLabels.minutes.full)}`,\n );\n }\n }\n\n if (seconds) {\n if (compact) {\n formattedParts.push(`${seconds} ${durationFormatLabels.seconds.compact}`);\n } else {\n formattedParts.push(\n `${seconds} ${declension(seconds, durationFormatLabels.seconds.full)}`,\n );\n }\n }\n\n return formattedParts.join(' ');\n}\n\nexport type TimeDiff = {\n minutes: number;\n seconds: number;\n total: {\n ms: number;\n hours: number;\n };\n};\n\n/**\n * Calculates the difference between two dates in minutes, seconds and total units.\n *\n * @example\n * ```ts\n * getTimeDiff(new Date('2024-03-15T12:30:00'), new Date('2024-03-15T12:00:00'));\n * ```\n */\nexport const getTimeDiff = (\n dateA: RawDateToFormat,\n dateB: RawDateToFormat,\n): TimeDiff => {\n const leftDate = toLibFormat(dateA)?.toDate();\n const rightDate = toLibFormat(dateB)?.toDate();\n\n if (!leftDate || !rightDate) {\n return {\n minutes: 0,\n seconds: 0,\n total: { ms: 0, hours: 0 },\n };\n }\n\n const msDiff = leftDate.getTime() - rightDate.getTime();\n\n return {\n minutes: Math.max(Math.floor(msDiff / ms(1, 'min')), 0),\n seconds: Math.max(Math.floor((msDiff % ms(1, 'min')) / 1000), 0),\n total: {\n hours: Math.round(msDiff / ms(1, 'hour')),\n ms: msDiff,\n },\n };\n};\n\n/**\n * Returns a new date shifted forward by the provided number of days.\n *\n * @example\n * ```ts\n * addDays(new Date('2024-03-15'), 7);\n * ```\n */\nexport const addDays = (date: RawDateToFormat, count: number) =>\n toLibFormat(date)?.add(count, 'd').toDate();\n\n/**\n * Returns a new date shifted backward by the provided number of days.\n *\n * @example\n * ```ts\n * subtractDays(new Date('2024-03-15'), 7);\n * ```\n */\nexport const subtractDays = (date: RawDateToFormat, count: number) =>\n toLibFormat(date)?.subtract(count, 'd').toDate();\n\n/**\n * Returns a new date shifted forward by the provided number of minutes.\n *\n * @example\n * ```ts\n * addMinutes(new Date('2024-03-15T12:00:00'), 15);\n * ```\n */\nexport const addMinutes = (date: RawDateToFormat, count: number) =>\n toLibFormat(date)?.add(count, 'm').toDate();\n\n/**\n * Returns a new date with the minutes field replaced.\n *\n * @example\n * ```ts\n * setMinutes(new Date('2024-03-15T12:00:00'), 45);\n * ```\n */\nexport const setMinutes = (date: RawDateToFormat, minutes: number) =>\n toLibFormat(date)?.set('m', minutes).toDate();\n\n/**\n * Returns a new date with the hours field replaced.\n *\n * @example\n * ```ts\n * setHours(new Date('2024-03-15T12:00:00'), 9);\n * ```\n */\nexport const setHours = (date: RawDateToFormat, hours: number) =>\n toLibFormat(date)?.set('h', hours).toDate();\n"],"x_google_ignoreList":[0,1,2],"mappings":";;;;;;;;;;AAAA,EAAC,SAAS,GAAE,GAAE;AAAC,cAAU,OAAO,WAAS,eAAa,OAAO,SAAO,OAAO,UAAQ,GAAG,GAAC,cAAY,OAAO,UAAQ,OAAO,MAAI,OAAO,EAAE,GAAC,CAAC,IAAE,eAAa,OAAO,aAAW,aAAW,KAAG,MAAM,wBAAsB,GAAG;cAAQ,WAAU;AAAC;EAAa,IAAI,GAAE,GAAE,I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AG,OAAO,CAAC;GACzC,IAAI;GACL;EACF;;;;;;;;;;AAWH,IAAa,WAAW,MAAuB,UAC7C,YAAY,KAAK,EAAE,IAAI,OAAO,IAAI,CAAC,QAAQ;;;;;;;;;AAU7C,IAAa,gBAAgB,MAAuB,UAClD,YAAY,KAAK,EAAE,SAAS,OAAO,IAAI,CAAC,QAAQ;;;;;;;;;AAUlD,IAAa,cAAc,MAAuB,UAChD,YAAY,KAAK,EAAE,IAAI,OAAO,IAAI,CAAC,QAAQ;;;;;;;;;AAU7C,IAAa,cAAc,MAAuB,YAChD,YAAY,KAAK,EAAE,IAAI,KAAK,QAAQ,CAAC,QAAQ;;;;;;;;;AAU/C,IAAa,YAAY,MAAuB,UAC9C,YAAY,KAAK,EAAE,IAAI,KAAK,MAAM,CAAC,QAAQ"}
|
package/date-time.d.ts
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import { Dayjs, ManipulateType } from 'dayjs';
|
|
2
2
|
import { Maybe } from 'yummies/types';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* ---header-docs-section---
|
|
6
|
+
* # yummies/date-time
|
|
7
|
+
*
|
|
8
|
+
* ## Description
|
|
9
|
+
*
|
|
10
|
+
* Date and time formatting built on **dayjs** with locale plugins, human-readable presets, relative
|
|
11
|
+
* phrases, and duration helpers tailored to UI copy. It composes with `yummies/format`, `yummies/ms`,
|
|
12
|
+
* and `yummies/text` for declensions so timestamps read naturally in Russian-facing apps.
|
|
13
|
+
*
|
|
14
|
+
* ## Usage
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { formatDate } from "yummies/date-time";
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
|
|
4
21
|
type RawDateToFormat = Date | string | number | Dayjs;
|
|
5
22
|
/**
|
|
6
23
|
* Formats a date-like value using predefined presets or a custom pattern.
|
package/date-time.js
CHANGED
|
@@ -348,6 +348,22 @@ var require_ru = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
348
348
|
}));
|
|
349
349
|
//#endregion
|
|
350
350
|
//#region src/date-time.ts
|
|
351
|
+
/**
|
|
352
|
+
* ---header-docs-section---
|
|
353
|
+
* # yummies/date-time
|
|
354
|
+
*
|
|
355
|
+
* ## Description
|
|
356
|
+
*
|
|
357
|
+
* Date and time formatting built on **dayjs** with locale plugins, human-readable presets, relative
|
|
358
|
+
* phrases, and duration helpers tailored to UI copy. It composes with `yummies/format`, `yummies/ms`,
|
|
359
|
+
* and `yummies/text` for declensions so timestamps read naturally in Russian-facing apps.
|
|
360
|
+
*
|
|
361
|
+
* ## Usage
|
|
362
|
+
*
|
|
363
|
+
* ```ts
|
|
364
|
+
* import { formatDate } from "yummies/date-time";
|
|
365
|
+
* ```
|
|
366
|
+
*/
|
|
351
367
|
var import_duration = /* @__PURE__ */ __toESM(require_duration(), 1);
|
|
352
368
|
var import_relativeTime = /* @__PURE__ */ __toESM(require_relativeTime(), 1);
|
|
353
369
|
require_ru();
|