@jirawatpyk/aura-tokens 4.20.0 → 5.0.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/aura-tailwind.css +1 -1
- package/aura-tailwind.prefixed.css +1 -1
- package/aura.css +1 -1
- package/components/aura.bundle.js +2 -19
- package/components/index.d.ts +5 -5
- package/package.json +1 -1
- package/tokens.json +1 -1
package/aura-tailwind.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* AURA
|
|
1
|
+
/* AURA v5.0.0 — Tailwind v4 theme. GENERATED by scripts/build-tokens.js from tokens.json. Do not edit by hand.
|
|
2
2
|
* @import "tailwindcss";
|
|
3
3
|
* @import "@jirawatpyk/aura-tokens/tailwind.css";
|
|
4
4
|
* Gives bg-bg-surface, text-fg-primary, border-border-strong, p-aura-6, rounded-aura-xl, shadow-aura-overlay,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* AURA
|
|
1
|
+
/* AURA v5.0.0 — Tailwind v4 theme with aura- prefixed names. GENERATED by scripts/build-tokens.js. Do not edit by hand.
|
|
2
2
|
* For apps that already have a Tailwind theme (shadcn): nothing here redefines an existing name.
|
|
3
3
|
* @layer aura-tokens, theme, base, aura, components, utilities;
|
|
4
4
|
* @import "tailwindcss";
|
package/aura.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* AURA
|
|
1
|
+
/* AURA v5.0.0 — GENERATED by scripts/build-tokens.js from tokens.json. Do not edit by hand. */
|
|
2
2
|
/* Fonts: load aura-fonts.css (or the <link> tags in README) separately, so a blocked Google Fonts never breaks this file. */
|
|
3
3
|
|
|
4
4
|
:root, [data-theme="light"] {
|
|
@@ -124,7 +124,7 @@ window.Aura = (() => {
|
|
|
124
124
|
contrast: () => contrast,
|
|
125
125
|
createTheme: () => createTheme,
|
|
126
126
|
formatBytes: () => formatBytes,
|
|
127
|
-
formatDate: () =>
|
|
127
|
+
formatDate: () => formatDate,
|
|
128
128
|
iconNames: () => iconNames,
|
|
129
129
|
parseDate: () => parseDate,
|
|
130
130
|
parseTime: () => parseTime,
|
|
@@ -1714,7 +1714,7 @@ window.Aura = (() => {
|
|
|
1714
1714
|
const o = opts || {}, d = fromISO(iso);
|
|
1715
1715
|
if (!d) return "";
|
|
1716
1716
|
const f = typeof o.format === "object" ? o.format : PRESETS[o.format || "short"];
|
|
1717
|
-
const loc = o.locale || "
|
|
1717
|
+
const loc = o.locale || "en";
|
|
1718
1718
|
return fmt(localeTag(loc, o.calendar || defaultCalendar(loc)), f, d).replace(ERA, "");
|
|
1719
1719
|
}
|
|
1720
1720
|
var MONTHS = null;
|
|
@@ -1766,23 +1766,6 @@ window.Aura = (() => {
|
|
|
1766
1766
|
}
|
|
1767
1767
|
|
|
1768
1768
|
// src/DatePicker.tsx
|
|
1769
|
-
var warnedNoLocale = false;
|
|
1770
|
-
function isDev() {
|
|
1771
|
-
try {
|
|
1772
|
-
return true;
|
|
1773
|
-
} catch (e) {
|
|
1774
|
-
return false;
|
|
1775
|
-
}
|
|
1776
|
-
}
|
|
1777
|
-
function formatDate2(iso, opts) {
|
|
1778
|
-
if (!warnedNoLocale && !(opts && opts.locale) && isDev()) {
|
|
1779
|
-
warnedNoLocale = true;
|
|
1780
|
-
console.warn(
|
|
1781
|
-
"[AURA] formatDate() was called without a locale. It shows Thai with Buddhist-era years today; in 5.0 it will show English with Gregorian years, like '@jirawatpyk/aura-react/server'. Pass { locale: 'th' } to keep Thai, or use useFormatDate() in components."
|
|
1782
|
-
);
|
|
1783
|
-
}
|
|
1784
|
-
return formatDate(iso, opts);
|
|
1785
|
-
}
|
|
1786
1769
|
function useFormatDate() {
|
|
1787
1770
|
const ctx = useAuraLocale(), locale = ctx.locale || "en", calendar = ctx.calendar;
|
|
1788
1771
|
return React17.useCallback(
|
package/components/index.d.ts
CHANGED
|
@@ -745,7 +745,7 @@ export interface SegmentedControlProps {
|
|
|
745
745
|
/** ISO date string, `YYYY-MM-DD` (Gregorian — the era is display only). */
|
|
746
746
|
export type ISODate = string;
|
|
747
747
|
export interface DateDisplayOptions {
|
|
748
|
-
/** Components: the AuraProvider's locale, else `en`. `formatDate()` (no provider to read): `
|
|
748
|
+
/** Components: the AuraProvider's locale, else `en`. `formatDate()` (no provider to read): `en` unless given (5.0; `th` before). */
|
|
749
749
|
locale?: "th" | "en" | "sv" | undefined;
|
|
750
750
|
/** `buddhist` (พ.ศ.; default for th) or `gregory` (ค.ศ.; default for en and sv). */
|
|
751
751
|
calendar?: "buddhist" | "gregory" | undefined;
|
|
@@ -1227,14 +1227,14 @@ export declare const Combobox: ComboboxComponent;
|
|
|
1227
1227
|
export type FormatDateOptions = DateDisplayOptions & {
|
|
1228
1228
|
format?: "short" | "long" | "numeric" | Intl.DateTimeFormatOptions | undefined;
|
|
1229
1229
|
};
|
|
1230
|
+
/** Format an ISO date for display: "18 Sept 2026" by default (English, Gregorian — 5.0); `{ locale: 'th' }` gives
|
|
1231
|
+
* "18 ก.ย. 2569" (Buddhist era), `{ locale: 'sv' }` "18 sep. 2026". The same function from the package root and from
|
|
1232
|
+
* `/server`. In components, `useFormatDate()` follows the AuraProvider's locale instead. */
|
|
1233
|
+
export declare function formatDate(iso: ISODate | null | undefined, opts?: FormatDateOptions): string;
|
|
1230
1234
|
/** Parse typed text: dd/mm/yyyy (Buddhist years ≥ 2400 are converted), d-m-yyyy, d.m.yyyy, yyyy-mm-dd or '18 ก.ย. 2569' / '18 Sep 2026'. */
|
|
1231
1235
|
export declare function parseDate(text: string | null | undefined): ISODate | null;
|
|
1232
1236
|
/** Today as an ISO date in an IANA time zone (e.g. `Asia/Bangkok`), or in the runtime's own zone without one. (4.19) */
|
|
1233
1237
|
export declare function todayIn(timeZone?: string | null): ISODate;
|
|
1234
|
-
/** Format an ISO date for display. Without a `locale` it is Thai with Buddhist-era years **until 5.0, which makes it
|
|
1235
|
-
* English and Gregorian** like `@jirawatpyk/aura-react/server` and `useFormatDate()`. Pass `{ locale }` (or use
|
|
1236
|
-
* `useFormatDate()` in components) so the switch changes nothing for you; a call without one warns once in development. */
|
|
1237
|
-
export declare function formatDate(iso: ISODate | null | undefined, opts?: FormatDateOptions): string;
|
|
1238
1238
|
/** formatDate bound to the nearest AuraProvider: its locale and calendar (English, Gregorian without one).
|
|
1239
1239
|
* Options you pass still win. Use it in components; plain formatDate() stays for code outside React. */
|
|
1240
1240
|
export declare function useFormatDate(): (iso: ISODate | null | undefined, opts?: FormatDateOptions) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jirawatpyk/aura-tokens",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "AURA Design System — tokens (CSS variables, Tailwind preset, Figma variables), theme contrast checks and token lint.",
|
|
5
5
|
"main": "tailwind.tokens.cjs",
|
|
6
6
|
"types": "components/index.d.ts",
|
package/tokens.json
CHANGED