@dotss/tictoccroc 0.3.0 → 0.3.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.
@@ -7,5 +7,5 @@ export interface CalendarProps extends Omit<FlexboxProps, 'onChange' | 'value'>,
7
7
  weekHeadInlineCSS?: FlexboxProps['inlineCSS'];
8
8
  datePickerProps?: Omit<DatePickerProps, 'onChange' | 'value' | 'date'>;
9
9
  }
10
- declare const Calendar: any;
10
+ declare const Calendar: import('react').ForwardRefExoticComponent<Omit<CalendarProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
11
11
  export default Calendar;
@@ -20,5 +20,5 @@ export interface ImageProps extends Omit<HTMLProps<HTMLImageElement>, 'onError'>
20
20
  enableErrorFallback?: boolean;
21
21
  renderErrorFallback?: () => ReactNode;
22
22
  }
23
- declare const Image: any;
23
+ declare const Image: import('react').ForwardRefExoticComponent<Omit<ImageProps, "ref"> & import('react').RefAttributes<HTMLImageElement>>;
24
24
  export default Image;
@@ -7,7 +7,7 @@ export declare function getHorizontalLayoutRows(images: {
7
7
  originalWidth?: number;
8
8
  width: number;
9
9
  height: number;
10
- }[], blocks: ReactElement<MasonryBlockProps>[], rowCount: number, fallbackWidth: number): ReactElement<MasonryBlockProps>[][];
10
+ }[], blocks: ReactElement<MasonryBlockProps>[], rowCount: number, fallbackWidth: number): ReactElement<MasonryBlockProps, string | import('react').JSXElementConstructor<any>>[][];
11
11
  export declare function findNextFocusableElement(currentElement: HTMLDivElement, keyDirection: 'left' | 'right' | 'up' | 'down', candidates: (HTMLDivElement | null)[]): HTMLDivElement | null;
12
12
  export declare function getNextIndexHorizontalFromRows(rows: HTMLDivElement[][], currentIndex: number, keyDirection: 'up' | 'down' | 'left' | 'right'): number | null;
13
13
  export declare function findImageInChildren(children: ReactNode): ReactElement<ImageProps> | null;
@@ -17,5 +17,5 @@ export interface MasonryBlockProps extends FlexboxProps {
17
17
  }>;
18
18
  setInnerRef?: (ref: HTMLDivElement | null) => void;
19
19
  }
20
- declare const MasonryBlock: any;
20
+ declare const MasonryBlock: import('react').ForwardRefExoticComponent<Omit<MasonryBlockProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
21
21
  export default MasonryBlock;
@@ -19,5 +19,5 @@ export interface TimePickerProps extends Omit<FlexboxProps, 'onChange'> {
19
19
  renderStartTimeLabel?: (item: TimePickerItem, isSelected: boolean) => ReactNode;
20
20
  renderEndTimeLabel?: (item: TimePickerItem, isSelected: boolean) => ReactNode;
21
21
  }
22
- declare const TimePicker: any;
22
+ declare const TimePicker: import('react').ForwardRefExoticComponent<Omit<TimePickerProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
23
23
  export default TimePicker;
@@ -1,9 +1,9 @@
1
1
  import { jsxs as R, jsx as c } from "react/jsx-runtime";
2
- import { forwardRef as O, useState as j, useRef as w, useEffect as r } from "react";
3
- import { ChainPicker as I, Typography as S, Flexbox as Q } from "@dotss/ui";
2
+ import { forwardRef as O, useState as j, useRef as w, useCallback as Q, useEffect as r } from "react";
3
+ import { Flexbox as U, Typography as S, ChainPicker as I } from "@dotss/ui";
4
4
  import z from "@emotion/styled";
5
- import b from "../../utils/getTimeRange/getTimeRange.mjs";
6
- const U = z.div`
5
+ import x from "../../utils/getTimeRange/getTimeRange.mjs";
6
+ const V = z.div`
7
7
  position: relative;
8
8
  display: flex;
9
9
  align-items: center;
@@ -11,36 +11,36 @@ const U = z.div`
11
11
  gap: ${({ theme: { spacing: o } }) => o.content(7)}px;
12
12
  width: 100%;
13
13
  padding: ${({ theme: { spacing: o } }) => o.content(2)}px 0;
14
- `, V = z.div`
14
+ `, W = z.div`
15
15
  position: absolute;
16
16
  width: 100%;
17
17
  height: 54px;
18
18
  background: ${({ theme: o }) => o.palette.background.primary};
19
19
  border-radius: 12px;
20
- `, k = O(function({
20
+ `, C = O(function({
21
21
  onChange: F,
22
22
  onChangeStartTime: p,
23
23
  onChangeEndTime: s,
24
24
  startTime: l = 9,
25
- endTime: n = 12,
26
- range: t = [0, 24],
25
+ endTime: t = 12,
26
+ range: n = [0, 24],
27
27
  step: i = 1,
28
- startTimeChainPickerProps: m,
29
- endTimeChainPickerProps: f,
28
+ startTimeChainPickerProps: u,
29
+ endTimeChainPickerProps: d,
30
30
  timePickerHighlightProps: H,
31
31
  renderStartTimeLabel: N,
32
32
  renderEndTimeLabel: q,
33
33
  inlineCSS: A,
34
34
  ...B
35
35
  }, D) {
36
- const [a, y] = j(l), [u, x] = j(n), E = w(
37
- b(0, 24, { minTime: t[0], maxTime: t[1] - i })
38
- ), d = w(
39
- b(0, 24, { minTime: l + i, maxTime: t[1] })
40
- ), $ = (e, h) => {
36
+ const [f, y] = j(l), [m, b] = j(t), E = w(
37
+ x(0, 24, { minTime: n[0], maxTime: n[1] - i })
38
+ ), a = w(
39
+ x(0, 24, { minTime: l + i, maxTime: n[1] })
40
+ ), h = Q((e, $) => {
41
41
  const [v, M] = e.label.split(":").map(Number), K = v >= 12, g = v % 12 || 12, L = K ? "오후" : "오전";
42
42
  return /* @__PURE__ */ R(
43
- Q,
43
+ U,
44
44
  {
45
45
  gap: 1,
46
46
  alignItems: "center",
@@ -48,75 +48,73 @@ const U = z.div`
48
48
  "aria-label": `${L} ${g}시 ${M}분`,
49
49
  inlineCSS: { width: "82px" },
50
50
  children: [
51
- /* @__PURE__ */ c(S, { tag: "span", variant: h ? "h5M" : "b5M", children: L }),
52
- /* @__PURE__ */ c(S, { tag: "span", variant: h ? "h2M" : "h4M", children: `${g}:${M.toString().padStart(2, "0")}` })
51
+ /* @__PURE__ */ c(S, { tag: "span", variant: $ ? "h5M" : "b5M", children: L }),
52
+ /* @__PURE__ */ c(S, { tag: "span", variant: $ ? "h2M" : "h4M", children: `${g}:${M.toString().padStart(2, "0")}` })
53
53
  ]
54
54
  }
55
55
  );
56
- }, G = (e) => {
57
- y(e), d.current = b(0, 24, {
58
- minTime: e + i > t[1] ? t[1] : e + i,
59
- maxTime: t[1]
60
- }), e >= n - 0.5 && x(d.current[0].value);
56
+ }, []), G = (e) => {
57
+ y(e), a.current = x(0, 24, {
58
+ minTime: e + i > n[1] ? n[1] : e + i,
59
+ maxTime: n[1]
60
+ }), e >= t - 0.5 && b(a.current[0].value);
61
61
  }, J = (e) => {
62
- x(e);
62
+ b(e);
63
63
  };
64
64
  return r(() => {
65
- d.current = b(0, 24, {
66
- minTime: l + i > t[1] ? t[1] : l + i,
67
- maxTime: t[1]
65
+ a.current = x(0, 24, {
66
+ minTime: l + i > n[1] ? n[1] : l + i,
67
+ maxTime: n[1]
68
68
  });
69
- }, [l, n, t, i]), r(() => {
69
+ }, [l, t, n, i]), r(() => {
70
70
  y(l);
71
71
  }, [l]), r(() => {
72
- l >= n - 0.5 ? x(d.current[0].value) : x(n);
73
- }, [l, n]), r(() => {
74
- F(a, u);
75
- }, [a, u]), r(() => {
76
- p == null || p(a);
77
- }, [a]), r(() => {
78
- s == null || s(u);
79
- }, [u]), /* @__PURE__ */ R(U, { ref: D, css: A, role: "group", "aria-label": "시간 선택", ...B, children: [
80
- /* @__PURE__ */ c(V, { ...H, "aria-hidden": !0 }),
72
+ l >= t - 0.5 ? b(a.current[0].value) : b(t);
73
+ }, [l, t]), r(() => {
74
+ F(f, m);
75
+ }, [f, m]), r(() => {
76
+ p == null || p(f);
77
+ }, [f]), r(() => {
78
+ s == null || s(m);
79
+ }, [m]), /* @__PURE__ */ R(V, { ref: D, css: A, role: "group", "aria-label": "시간 선택", ...B, children: [
80
+ /* @__PURE__ */ c(W, { ...H, "aria-hidden": !0 }),
81
81
  /* @__PURE__ */ c(
82
82
  I,
83
83
  {
84
84
  column: E.current,
85
85
  value: l,
86
86
  onChange: G,
87
- renderLabel: N || $,
87
+ renderLabel: N || h,
88
88
  "aria-label": "시작 시간 선택",
89
89
  inlineCSS: {
90
90
  "& > li": {
91
91
  padding: 0
92
92
  },
93
- ...m == null ? void 0 : m.inlineCSS
93
+ ...u == null ? void 0 : u.inlineCSS
94
94
  },
95
- ...m
96
- },
97
- `start-time-${a}`
95
+ ...u
96
+ }
98
97
  ),
99
98
  /* @__PURE__ */ c(S, { variant: "h5M", color: "grey.50", "aria-hidden": !0, inlineCSS: { zIndex: 1 }, children: "부터" }),
100
99
  /* @__PURE__ */ c(
101
100
  I,
102
101
  {
103
- column: d.current,
104
- value: n,
102
+ column: a.current,
103
+ value: t,
105
104
  onChange: J,
106
- renderLabel: q || $,
105
+ renderLabel: q || h,
107
106
  "aria-label": "종료 시간 선택",
108
107
  inlineCSS: {
109
108
  "& > li": {
110
109
  padding: 0
111
110
  },
112
- ...f == null ? void 0 : f.inlineCSS
111
+ ...d == null ? void 0 : d.inlineCSS
113
112
  },
114
- ...f
115
- },
116
- `end-time-${u}`
113
+ ...d
114
+ }
117
115
  )
118
116
  ] });
119
117
  });
120
118
  export {
121
- k as default
119
+ C as default
122
120
  };
@@ -1,4 +1,4 @@
1
1
  import { RefObject } from 'react';
2
2
  export default function useInView(targetRef: RefObject<HTMLElement | null>, options?: IntersectionObserverInit): {
3
- isInView: any;
3
+ isInView: boolean;
4
4
  };
@@ -1,2 +1,3 @@
1
- declare const useIsomorphicLayoutEffect: any;
1
+ import { useEffect } from 'react';
2
+ declare const useIsomorphicLayoutEffect: typeof useEffect;
2
3
  export default useIsomorphicLayoutEffect;
@@ -18,5 +18,5 @@ export interface AvailableScheduleSectionProps extends FlexboxProps {
18
18
  };
19
19
  };
20
20
  }
21
- declare const AvailableScheduleSection: any;
21
+ declare const AvailableScheduleSection: import('react').ForwardRefExoticComponent<Omit<AvailableScheduleSectionProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
22
22
  export default AvailableScheduleSection;
@@ -3,5 +3,5 @@ export interface CareNoteSectionProps extends FlexboxProps {
3
3
  totalCount: number;
4
4
  onClickViewAll?: () => void;
5
5
  }
6
- declare const CareNoteSection: any;
6
+ declare const CareNoteSection: import('react').ForwardRefExoticComponent<Omit<CareNoteSectionProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
7
7
  export default CareNoteSection;
@@ -3,5 +3,5 @@ export interface ParentReviewSectionProps extends FlexboxProps {
3
3
  totalCount: number;
4
4
  onClickViewAll?: () => void;
5
5
  }
6
- declare const ParentReviewSection: any;
6
+ declare const ParentReviewSection: import('react').ForwardRefExoticComponent<Omit<ParentReviewSectionProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
7
7
  export default ParentReviewSection;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dotss/tictoccroc",
3
3
  "type": "module",
4
- "version": "0.3.0",
4
+ "version": "0.3.1",
5
5
  "description": "Tictoccroc shared components, hooks, utils, and APIs for Dotss",
6
6
  "main": "./dist/index.mjs",
7
7
  "module": "./dist/index.mjs",
@@ -103,6 +103,7 @@
103
103
  "devDependencies": {
104
104
  "@emotion/react": "^11.14.0",
105
105
  "@emotion/styled": "^11.14.0",
106
+ "@storybook/addon-docs": "^9.0.4",
106
107
  "@storybook/addon-onboarding": "^9.0.4",
107
108
  "@storybook/react-vite": "^9.0.4",
108
109
  "@types/node": "^22.15.29",
@@ -111,7 +112,11 @@
111
112
  "glob": "^10.4.2",
112
113
  "storybook": "^9.0.4",
113
114
  "vite-plugin-dts": "^4.5.4",
114
- "vitest": "^1.6.0"
115
+ "vitest": "^1.6.0",
116
+ "react": "^18.0.0",
117
+ "react-dom": "^18.0.0",
118
+ "@types/react": "^18.0.0",
119
+ "@types/react-dom": "^18.0.0"
115
120
  },
116
121
  "peerDependencies": {
117
122
  "@dotss/ui": ">=1.0.3",