@jirawatpyk/aura-tokens 4.11.0 → 4.12.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 CHANGED
@@ -1,4 +1,4 @@
1
- /* AURA v4.11.0 — Tailwind v4 theme. GENERATED by scripts/build-tokens.js from tokens.json. Do not edit by hand.
1
+ /* AURA v4.12.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,
package/aura.css CHANGED
@@ -1,4 +1,4 @@
1
- /* AURA v4.11.0 — GENERATED by scripts/build-tokens.js from tokens.json. Do not edit by hand. */
1
+ /* AURA v4.12.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"] {
@@ -119,6 +119,7 @@ window.Aura = (() => {
119
119
  useAuraLocale: () => useAuraLocale,
120
120
  useBreakpoint: () => useBreakpoint,
121
121
  useColorScheme: () => useColorScheme,
122
+ useFormatDate: () => useFormatDate,
122
123
  useResponsive: () => useResponsive
123
124
  });
124
125
 
@@ -1582,6 +1583,22 @@ window.Aura = (() => {
1582
1583
  const loc = o.locale || "th";
1583
1584
  return fmt(localeTag(loc, o.calendar || defaultCalendar(loc)), f, d).replace(ERA, "");
1584
1585
  }
1586
+ function useFormatDate() {
1587
+ const ctx = useAuraLocale(), locale = ctx.locale || "en", calendar = ctx.calendar;
1588
+ return React17.useCallback(
1589
+ function(iso, opts) {
1590
+ const o = opts || {}, loc = o.locale || locale;
1591
+ return formatDate(
1592
+ iso,
1593
+ Object.assign({}, o, {
1594
+ locale: loc,
1595
+ calendar: o.calendar || (o.locale ? void 0 : calendar) || defaultCalendar(loc)
1596
+ })
1597
+ );
1598
+ },
1599
+ [locale, calendar]
1600
+ );
1601
+ }
1585
1602
  var MONTHS = null;
1586
1603
  function monthIndex(word) {
1587
1604
  if (!MONTHS) {
@@ -966,6 +966,9 @@ export type FormatDateOptions = DateDisplayOptions & {
966
966
  };
967
967
  /** Format an ISO date for display, e.g. "18 ก.ย. 2569" (th, Buddhist) or "18 Sept 2026" (en, Gregorian). */
968
968
  export declare function formatDate(iso: ISODate | null | undefined, opts?: FormatDateOptions): string;
969
+ /** formatDate bound to the nearest AuraProvider: its locale and calendar (English, Gregorian without one).
970
+ * Options you pass still win. Use it in components; plain formatDate() stays for code outside React. */
971
+ export declare function useFormatDate(): (iso: ISODate | null | undefined, opts?: FormatDateOptions) => string;
969
972
  /** 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'. */
970
973
  export declare function parseDate(text: string | null | undefined): ISODate | null;
971
974
  export declare const Calendar: React$1.ForwardRefExoticComponent<CalendarProps & React$1.RefAttributes<HTMLDivElement>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jirawatpyk/aura-tokens",
3
- "version": "4.11.0",
3
+ "version": "4.12.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
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.11.0",
2
+ "version": "4.12.0",
3
3
  "meta": {
4
4
  "name": "AURA Design System",
5
5
  "tier": "3-tier",