@tryghost/shade 0.1.0-alpha.0 → 0.1.0-alpha.1
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.
|
@@ -5,26 +5,21 @@ import { forwardRef } from "react";
|
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/ui/time-picker.tsx
|
|
7
7
|
/** Native, keyboard-accessible time input. Values use HH:mm and remain consumer-owned. */
|
|
8
|
-
var TimePicker = forwardRef(function TimePicker({ className,
|
|
8
|
+
var TimePicker = forwardRef(function TimePicker({ className, prefix, disabled, step = 60, ...props }, ref) {
|
|
9
9
|
return /* @__PURE__ */ jsxs(InputGroup, {
|
|
10
10
|
className: cn("min-w-0", className),
|
|
11
11
|
"data-disabled": disabled,
|
|
12
|
-
children: [
|
|
13
|
-
|
|
14
|
-
/* @__PURE__ */ jsx(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
align: "inline-end",
|
|
24
|
-
className: "text-sm font-normal",
|
|
25
|
-
children: suffix
|
|
26
|
-
}) : null
|
|
27
|
-
]
|
|
12
|
+
children: [/* @__PURE__ */ jsx(InputGroupAddon, {
|
|
13
|
+
className: prefix ? "text-sm font-normal" : void 0,
|
|
14
|
+
children: prefix ?? /* @__PURE__ */ jsx(Clock, { "aria-hidden": "true" })
|
|
15
|
+
}), /* @__PURE__ */ jsx(InputGroupInput, {
|
|
16
|
+
ref,
|
|
17
|
+
className: "min-w-0 appearance-none [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none",
|
|
18
|
+
disabled,
|
|
19
|
+
step,
|
|
20
|
+
type: "time",
|
|
21
|
+
...props
|
|
22
|
+
})]
|
|
28
23
|
});
|
|
29
24
|
});
|
|
30
25
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-picker.js","names":[],"sources":["../../../src/components/ui/time-picker.tsx"],"sourcesContent":["import { forwardRef, type ComponentProps, type ReactNode } from 'react';\nimport { Clock } from 'lucide-react';\nimport { InputGroup, InputGroupAddon, InputGroupInput } from '@/components/ui/input-group';\nimport { cn } from '@/lib/utils';\n\nexport interface TimePickerProps extends Omit<ComponentProps<'input'>, 'type' | 'size'> {\n
|
|
1
|
+
{"version":3,"file":"time-picker.js","names":[],"sources":["../../../src/components/ui/time-picker.tsx"],"sourcesContent":["import { forwardRef, type ComponentProps, type ReactNode } from 'react';\nimport { Clock } from 'lucide-react';\nimport { InputGroup, InputGroupAddon, InputGroupInput } from '@/components/ui/input-group';\nimport { cn } from '@/lib/utils';\n\nexport interface TimePickerProps extends Omit<ComponentProps<'input'>, 'type' | 'size' | 'prefix'> {\n /**\n * Optional leading context, such as a timezone abbreviation. It takes the\n * clock icon's place, leaving a 12-hour locale's AM/PM room in narrow fields.\n */\n prefix?: ReactNode;\n}\n\n/** Native, keyboard-accessible time input. Values use HH:mm and remain consumer-owned. */\nexport const TimePicker = forwardRef<HTMLInputElement, TimePickerProps>(function TimePicker(\n { className, prefix, disabled, step = 60, ...props },\n ref,\n) {\n return (\n <InputGroup className={cn('min-w-0', className)} data-disabled={disabled}>\n <InputGroupAddon className={prefix ? 'text-sm font-normal' : undefined}>\n {prefix ?? <Clock aria-hidden=\"true\" />}\n </InputGroupAddon>\n <InputGroupInput\n ref={ref}\n className=\"min-w-0 appearance-none [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none\"\n disabled={disabled}\n step={step}\n type=\"time\"\n {...props}\n />\n </InputGroup>\n );\n});\n"],"mappings":";;;;;;;AAcA,IAAa,aAAa,WAA8C,SAAS,WAC/E,EAAE,WAAW,QAAQ,UAAU,OAAO,IAAI,GAAG,SAC7C,KACA;CACA,OACE,qBAAC,YAAD;EAAY,WAAW,GAAG,WAAW,SAAS;EAAG,iBAAe;YAAhE,CACE,oBAAC,iBAAD;GAAiB,WAAW,SAAS,wBAAwB,KAAA;aAC1D,UAAU,oBAAC,OAAD,EAAO,eAAY,OAAQ,CAAA;EACvB,CAAA,GACjB,oBAAC,iBAAD;GACO;GACL,WAAU;GACA;GACJ;GACN,MAAK;GACL,GAAI;EACL,CAAA,CACS;;AAEhB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { type ComponentProps, type ReactNode } from 'react';
|
|
2
|
-
export interface TimePickerProps extends Omit<ComponentProps<'input'>, 'type' | 'size'> {
|
|
3
|
-
/**
|
|
4
|
-
|
|
2
|
+
export interface TimePickerProps extends Omit<ComponentProps<'input'>, 'type' | 'size' | 'prefix'> {
|
|
3
|
+
/**
|
|
4
|
+
* Optional leading context, such as a timezone abbreviation. It takes the
|
|
5
|
+
* clock icon's place, leaving a 12-hour locale's AM/PM room in narrow fields.
|
|
6
|
+
*/
|
|
7
|
+
prefix?: ReactNode;
|
|
5
8
|
}
|
|
6
9
|
/** Native, keyboard-accessible time input. Values use HH:mm and remain consumer-owned. */
|
|
7
10
|
export declare const TimePicker: import("react").ForwardRefExoticComponent<Omit<TimePickerProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-picker.d.ts","sourceRoot":"","sources":["../../../src/components/ui/time-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAKxE,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"time-picker.d.ts","sourceRoot":"","sources":["../../../src/components/ui/time-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAKxE,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;IAChG;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,0FAA0F;AAC1F,eAAO,MAAM,UAAU,2HAmBrB,CAAC"}
|