podo-ui 1.0.0 → 1.0.2

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.
Files changed (34) hide show
  1. package/cdn/podo-datepicker.css +1 -1
  2. package/cdn/podo-datepicker.js +1 -1
  3. package/cdn/podo-datepicker.min.css +1 -1
  4. package/cdn/podo-datepicker.min.js +1 -1
  5. package/cdn/podo-ui.css +4 -1
  6. package/cdn/podo-ui.min.css +1 -1
  7. package/dist/react/atom/editor.d.ts.map +1 -1
  8. package/dist/react/atom/editor.js +94 -2
  9. package/dist/svelte/atom/Avatar.svelte +3 -1
  10. package/dist/svelte/atom/Avatar.svelte.d.ts +2 -1
  11. package/dist/svelte/atom/Chip.svelte +3 -2
  12. package/dist/svelte/atom/Chip.svelte.d.ts +2 -1
  13. package/dist/svelte/atom/Editor.svelte +1314 -0
  14. package/dist/svelte/atom/Editor.svelte.d.ts +30 -0
  15. package/dist/svelte/atom/Radio.svelte +4 -2
  16. package/dist/svelte/atom/Tooltip.svelte +3 -1
  17. package/dist/svelte/atom/Tooltip.svelte.d.ts +2 -1
  18. package/dist/svelte/index.d.ts +2 -0
  19. package/dist/svelte/index.js +2 -0
  20. package/dist/svelte/molecule/DatePicker.svelte +986 -0
  21. package/dist/svelte/molecule/DatePicker.svelte.d.ts +71 -0
  22. package/dist/svelte/molecule/Field.svelte +5 -3
  23. package/dist/svelte/molecule/Field.svelte.d.ts +2 -1
  24. package/dist/svelte/molecule/Pagination.svelte +3 -2
  25. package/dist/svelte/molecule/Pagination.svelte.d.ts +2 -1
  26. package/dist/svelte/molecule/Tab.svelte +3 -2
  27. package/dist/svelte/molecule/Tab.svelte.d.ts +2 -1
  28. package/dist/svelte/molecule/Table.svelte +3 -2
  29. package/dist/svelte/molecule/Table.svelte.d.ts +1 -1
  30. package/dist/svelte/molecule/Toast.svelte +3 -2
  31. package/dist/svelte/molecule/Toast.svelte.d.ts +2 -1
  32. package/global.scss +1 -0
  33. package/package.json +1 -1
  34. package/vite-fonts.scss +1 -1
@@ -0,0 +1,71 @@
1
+ export type DatePickerMode = 'instant' | 'period';
2
+ export type DatePickerType = 'date' | 'time' | 'datetime';
3
+ export interface TimeValue {
4
+ hour: number;
5
+ minute: number;
6
+ }
7
+ export interface DatePickerValue {
8
+ date?: Date;
9
+ time?: TimeValue;
10
+ endDate?: Date;
11
+ endTime?: TimeValue;
12
+ }
13
+ export interface DateRange {
14
+ from: Date;
15
+ to: Date;
16
+ }
17
+ export type DateCondition = Date | DateRange | ((date: Date) => boolean);
18
+ export interface DateTimeLimit {
19
+ date: Date;
20
+ time?: TimeValue;
21
+ }
22
+ export type MinuteStep = 1 | 5 | 10 | 15 | 20 | 30;
23
+ export interface YearRange {
24
+ min?: number;
25
+ max?: number;
26
+ }
27
+ export type CalendarInitial = 'now' | 'prevMonth' | 'nextMonth' | Date;
28
+ export interface InitialCalendar {
29
+ start?: CalendarInitial;
30
+ end?: CalendarInitial;
31
+ }
32
+ interface Props {
33
+ /** Selection mode: instant | period */
34
+ mode?: DatePickerMode;
35
+ /** Value type: date | time | datetime */
36
+ type?: DatePickerType;
37
+ /** Selected value */
38
+ value?: DatePickerValue;
39
+ /** Value change handler */
40
+ onchange?: (value: DatePickerValue) => void;
41
+ /** Placeholder */
42
+ placeholder?: string;
43
+ /** Disabled state */
44
+ disabled?: boolean;
45
+ /** Show action buttons (default true for period mode) */
46
+ showActions?: boolean;
47
+ /** Dropdown alignment */
48
+ align?: 'left' | 'right';
49
+ /** Additional class name */
50
+ class?: string;
51
+ /** Disabled date conditions */
52
+ disable?: DateCondition[];
53
+ /** Enabled date conditions (only these dates are selectable) */
54
+ enable?: DateCondition[];
55
+ /** Minimum selectable date */
56
+ minDate?: Date | DateTimeLimit;
57
+ /** Maximum selectable date */
58
+ maxDate?: Date | DateTimeLimit;
59
+ /** Minute selection step */
60
+ minuteStep?: MinuteStep;
61
+ /** Date/time format pattern */
62
+ format?: string;
63
+ /** Initial calendar display month for period mode */
64
+ initialCalendar?: InitialCalendar;
65
+ /** Year selection range */
66
+ yearRange?: YearRange;
67
+ }
68
+ type $$ComponentProps = Props & Record<string, unknown>;
69
+ declare const DatePicker: import("svelte").Component<$$ComponentProps, {}, "value">;
70
+ type DatePicker = ReturnType<typeof DatePicker>;
71
+ export default DatePicker;
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte';
3
3
  import type { z } from 'zod';
4
+ import { ZodError } from 'zod';
4
5
  import styles from './field.module.scss';
5
6
 
6
7
  interface Props {
@@ -34,7 +35,8 @@
34
35
  validator,
35
36
  value = '',
36
37
  class: className = '',
37
- }: Props = $props();
38
+ ...rest
39
+ }: Props & Record<string, unknown> = $props();
38
40
 
39
41
  let message = $state('');
40
42
  let statusClass = $state('');
@@ -48,7 +50,7 @@
48
50
  validator.parse(value);
49
51
  statusClass = 'success';
50
52
  } catch (e) {
51
- if (e instanceof (await import('zod')).ZodError) {
53
+ if (e instanceof ZodError) {
52
54
  message = e.errors[0].message;
53
55
  statusClass = 'danger';
54
56
  }
@@ -57,7 +59,7 @@
57
59
  });
58
60
  </script>
59
61
 
60
- <div class="{styles.style} {className}">
62
+ <div class="{styles.style} {className}" {...rest}>
61
63
  {#if label}
62
64
  <label class={labelClass}>
63
65
  {label}
@@ -20,6 +20,7 @@ interface Props {
20
20
  /** Additional class name */
21
21
  class?: string;
22
22
  }
23
- declare const Field: import("svelte").Component<Props, {}, "">;
23
+ type $$ComponentProps = Props & Record<string, unknown>;
24
+ declare const Field: import("svelte").Component<$$ComponentProps, {}, "">;
24
25
  type Field = ReturnType<typeof Field>;
25
26
  export default Field;
@@ -17,7 +17,8 @@
17
17
  totalPages,
18
18
  onpagechange,
19
19
  maxVisiblePages = 5,
20
- }: Props = $props();
20
+ ...rest
21
+ }: Props & Record<string, unknown> = $props();
21
22
 
22
23
  function getPageNumbers(): number[] {
23
24
  const pages: number[] = [];
@@ -55,7 +56,7 @@
55
56
  </script>
56
57
 
57
58
  {#if totalPages > 0}
58
- <div class={styles.pagination}>
59
+ <div class={styles.pagination} {...rest}>
59
60
  {#if currentPage > 1}
60
61
  <button
61
62
  onclick={handlePrevious}
@@ -8,6 +8,7 @@ interface Props {
8
8
  /** Maximum visible page numbers */
9
9
  maxVisiblePages?: number;
10
10
  }
11
- declare const Pagination: import("svelte").Component<Props, {}, "currentPage">;
11
+ type $$ComponentProps = Props & Record<string, unknown>;
12
+ declare const Pagination: import("svelte").Component<$$ComponentProps, {}, "currentPage">;
12
13
  type Pagination = ReturnType<typeof Pagination>;
13
14
  export default Pagination;
@@ -32,7 +32,8 @@
32
32
  fill = false,
33
33
  onchange,
34
34
  class: className = '',
35
- }: Props = $props();
35
+ ...rest
36
+ }: Props & Record<string, unknown> = $props();
36
37
 
37
38
  let internalActiveKey = $state(defaultActiveKey || items[0]?.key);
38
39
 
@@ -49,7 +50,7 @@
49
50
  );
50
51
  </script>
51
52
 
52
- <ul class={tabsClass}>
53
+ <ul class={tabsClass} {...rest}>
53
54
  {#each items as item (item.key)}
54
55
  <li class={activeKey === item.key ? 'on' : undefined}>
55
56
  <a
@@ -20,6 +20,7 @@ interface Props {
20
20
  /** Additional class name */
21
21
  class?: string;
22
22
  }
23
- declare const Tab: import("svelte").Component<Props, {}, "">;
23
+ type $$ComponentProps = Props & Record<string, unknown>;
24
+ declare const Tab: import("svelte").Component<$$ComponentProps, {}, "">;
24
25
  type Tab = ReturnType<typeof Tab>;
25
26
  export default Tab;
@@ -44,7 +44,8 @@
44
44
  fill = false,
45
45
  onrowclick,
46
46
  class: className = '',
47
- }: Props = $props();
47
+ ...rest
48
+ }: Props & Record<string, unknown> = $props();
48
49
 
49
50
  function getRowKey(record: T, index: number): string {
50
51
  if (typeof rowKey === 'function') {
@@ -71,7 +72,7 @@
71
72
  );
72
73
  </script>
73
74
 
74
- <table class={tableClass || undefined}>
75
+ <table class={tableClass || undefined} {...rest}>
75
76
  <thead>
76
77
  <tr>
77
78
  {#each columns as col (col.key)}
@@ -29,7 +29,7 @@ declare function $$render<T extends Record<string, unknown>>(): {
29
29
  onrowclick?: (record: T, index: number) => void;
30
30
  /** Additional class name */
31
31
  class?: string;
32
- };
32
+ } & Record<string, unknown>;
33
33
  exports: {};
34
34
  bindings: "";
35
35
  slots: {};
@@ -35,7 +35,8 @@
35
35
  duration = 3000,
36
36
  width,
37
37
  onclose,
38
- }: Props = $props();
38
+ ...rest
39
+ }: Props & Record<string, unknown> = $props();
39
40
 
40
41
  let isVisible = $state(false);
41
42
  let isClosing = $state(false);
@@ -98,7 +99,7 @@
98
99
  }
99
100
  </script>
100
101
 
101
- <div class={toastClasses} style={toastStyle}>
102
+ <div class={toastClasses} style={toastStyle} {...rest}>
102
103
  <i class={getIcon()}></i>
103
104
  <div class="toast-content">
104
105
  {#if header && !long}
@@ -19,6 +19,7 @@ interface Props {
19
19
  /** Close callback */
20
20
  onclose: (id: string) => void;
21
21
  }
22
- declare const Toast: import("svelte").Component<Props, {}, "">;
22
+ type $$ComponentProps = Props & Record<string, unknown>;
23
+ declare const Toast: import("svelte").Component<$$ComponentProps, {}, "">;
23
24
  type Toast = ReturnType<typeof Toast>;
24
25
  export default Toast;
package/global.scss CHANGED
@@ -32,6 +32,7 @@
32
32
  */
33
33
  @forward './scss/icon/icon';
34
34
  @forward './scss/icon/function';
35
+ @use './scss/icon/icon';
35
36
 
36
37
  /*
37
38
  Button
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "podo-ui",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "author": "hada0127 <work@tarucy.net>",
6
6
  "license": "MIT",
package/vite-fonts.scss CHANGED
@@ -4,6 +4,6 @@
4
4
  // 아이콘 폰트
5
5
  @font-face {
6
6
  font-family: 'podo-ui-icon';
7
- src: url(podo-ui/scss/icon/font/icon.woff) format('woff');
7
+ src: url('./scss/icon/font/icon.woff') format('woff');
8
8
  font-display: swap;
9
9
  }