@stamcat/craftsman 0.0.27-alpha.13 → 0.0.27-alpha.14

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/Utilities.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- import { getAmPmLabels as e, getUnitLabel as t, is24HourFormat as n, isEmpty as r, validateEmail as i } from "./src/utilities/validations.esm.js";
2
- export { e as getAmPmLabels, t as getUnitLabel, n as is24HourFormat, r as isEmpty, i as validateEmail };
1
+ import { getAmPmLabels as e, getUnitLabel as t, is24HourFormat as n, isEmpty as r, isTouchDevice as i, validateEmail as a } from "./src/utilities/validations.esm.js";
2
+ export { e as getAmPmLabels, t as getUnitLabel, n as is24HourFormat, r as isEmpty, i as isTouchDevice, a as validateEmail };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stamcat/craftsman",
3
- "version": "0.0.27-alpha.13",
3
+ "version": "0.0.27-alpha.14",
4
4
  "type": "module",
5
5
  "description": "A powerful, lightweight framework for design systems",
6
6
  "repository": {
@@ -1,12 +1,17 @@
1
1
  type TimePickerDisplayProps = {
2
2
  hours: number;
3
3
  minutes: number;
4
- hasValue: boolean;
4
+ hourHasValue: boolean;
5
+ minuteHasValue: boolean;
5
6
  isReadOnly: boolean;
6
7
  timeFormat: 12 | 24;
7
8
  amPmLabels: string[] | null;
8
9
  visible: boolean;
9
10
  onToggleVisible: () => void;
11
+ onClear: {
12
+ hour: () => void;
13
+ minute: () => void;
14
+ };
10
15
  onChange: {
11
16
  hour: (e: React.ChangeEvent<HTMLInputElement>) => void;
12
17
  minute: (e: React.ChangeEvent<HTMLInputElement>) => void;
@@ -4,6 +4,7 @@ export declare const padTime: (n: number) => string;
4
4
  export declare const toDisplayHour: (hours: number, is12h: boolean) => number;
5
5
  export declare const to24Hour: (display: number, isPM: boolean, is12h: boolean) => number;
6
6
  export declare const resolveLocale: (locale?: Intl.LocalesArgument) => string;
7
+ export declare const resolveTimeFormat: (format: 24 | 12 | undefined, is24h: boolean) => 24 | 12;
7
8
  export declare const isInView: (wheelLocation: number, slidePosition: number) => boolean;
8
9
  export declare const setSlideStyles: (emblaApi: EmblaCarouselType, index: number, loop: boolean, slideCount: number, totalRadius: number) => void;
9
10
  export declare const setContainerStyles: (emblaApi: EmblaCarouselType, wheelRotation: number) => void;
@@ -1,5 +1,6 @@
1
1
  export declare function isEmpty(value: unknown): boolean;
2
2
  export declare function validateEmail(value: string): boolean;
3
+ export declare function isTouchDevice(): boolean;
3
4
  export declare const getUnitLabel: (locale: Intl.LocalesArgument, unit: Intl.NumberFormatOptions["unit"], override?: string) => string;
4
5
  export declare const is24HourFormat: (locale: Intl.LocalesArgument) => boolean;
5
6
  export declare const getAmPmLabels: (locale: Intl.LocalesArgument) => [string, string];
@@ -5,14 +5,17 @@ function e(e) {
5
5
  function t(e) {
6
6
  return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
7
7
  }
8
- var n = (e, t, n) => n ?? new Intl.NumberFormat(e, {
8
+ function n() {
9
+ return typeof window < "u" && window.matchMedia("(pointer: coarse)").matches;
10
+ }
11
+ var r = (e, t, n) => n ?? new Intl.NumberFormat(e, {
9
12
  style: "unit",
10
13
  unit: t,
11
14
  unitDisplay: "long"
12
- }).formatToParts(1).find((e) => e.type === "unit")?.value ?? String(t), r = (e) => {
15
+ }).formatToParts(1).find((e) => e.type === "unit")?.value ?? String(t), i = (e) => {
13
16
  let t = new Intl.DateTimeFormat(e, { hour: "numeric" }).resolvedOptions();
14
17
  return t.hourCycle === "h23" || t.hourCycle === "h24";
15
- }, i = (e) => {
18
+ }, a = (e) => {
16
19
  let t = new Intl.DateTimeFormat(e, {
17
20
  hour: "numeric",
18
21
  hour12: !0
@@ -20,4 +23,4 @@ var n = (e, t, n) => n ?? new Intl.NumberFormat(e, {
20
23
  return [t.formatToParts(new Date(2e3, 0, 1, 9)).find((e) => e.type === "dayPeriod")?.value ?? "AM", t.formatToParts(new Date(2e3, 0, 1, 21)).find((e) => e.type === "dayPeriod")?.value ?? "PM"];
21
24
  };
22
25
  //#endregion
23
- export { i as getAmPmLabels, n as getUnitLabel, r as is24HourFormat, e as isEmpty, t as validateEmail };
26
+ export { a as getAmPmLabels, r as getUnitLabel, i as is24HourFormat, e as isEmpty, n as isTouchDevice, t as validateEmail };