@14ch/svelte-ui 0.0.14 → 0.0.16

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 (39) hide show
  1. package/dist/assets/styles/variables.scss +6 -12
  2. package/dist/components/Checkbox.svelte +2 -1
  3. package/dist/components/ColorPicker.svelte +14 -5
  4. package/dist/components/ColorPicker.svelte.d.ts +1 -1
  5. package/dist/components/Combobox.svelte +4 -3
  6. package/dist/components/Datepicker.svelte +12 -12
  7. package/dist/components/Drawer.svelte +7 -3
  8. package/dist/components/Drawer.svelte.d.ts +1 -1
  9. package/dist/components/Icon.svelte +20 -24
  10. package/dist/components/Icon.svelte.d.ts +1 -1
  11. package/dist/components/IconButton.svelte +1 -1
  12. package/dist/components/Input.svelte +499 -268
  13. package/dist/components/Input.svelte.d.ts +17 -0
  14. package/dist/components/Radio.svelte +2 -1
  15. package/dist/components/SegmentedControl.svelte +3 -3
  16. package/dist/components/Select.svelte +1 -1
  17. package/dist/components/Tab.svelte +1 -0
  18. package/dist/components/TabItem.svelte +22 -1
  19. package/dist/components/TabItem.svelte.d.ts +1 -0
  20. package/dist/components/Textarea.svelte +280 -173
  21. package/dist/components/Textarea.svelte.d.ts +7 -3
  22. package/dist/components/skeleton/Skeleton.svelte +48 -6
  23. package/dist/i18n/index.d.ts +48 -1
  24. package/dist/i18n/index.js +3 -13
  25. package/dist/i18n/locales/de.d.ts +8 -0
  26. package/dist/i18n/locales/de.js +10 -2
  27. package/dist/i18n/locales/en.d.ts +8 -0
  28. package/dist/i18n/locales/en.js +10 -2
  29. package/dist/i18n/locales/es.d.ts +8 -0
  30. package/dist/i18n/locales/es.js +10 -2
  31. package/dist/i18n/locales/fr.d.ts +8 -0
  32. package/dist/i18n/locales/fr.js +10 -2
  33. package/dist/i18n/locales/ja.d.ts +8 -0
  34. package/dist/i18n/locales/ja.js +10 -2
  35. package/dist/i18n/locales/zh-cn.d.ts +8 -0
  36. package/dist/i18n/locales/zh-cn.js +10 -2
  37. package/dist/utils/formatText.d.ts +2 -2
  38. package/dist/utils/formatText.js +2 -2
  39. package/package.json +1 -1
@@ -14,6 +14,8 @@ export type InputProps = {
14
14
  max?: number | null;
15
15
  step?: number | null;
16
16
  size?: number | null;
17
+ decimalPlaces?: number | null;
18
+ enableThousandsSeparator?: boolean;
17
19
  autocomplete?: HTMLInputElement['autocomplete'] | null;
18
20
  spellcheck?: boolean | null;
19
21
  inputAttributes?: HTMLInputAttributes | undefined;
@@ -26,6 +28,7 @@ export type InputProps = {
26
28
  maxWidth?: string | number | null;
27
29
  rounded?: boolean;
28
30
  customStyle?: string;
31
+ unit?: string;
29
32
  rightIcon?: string;
30
33
  leftIcon?: string;
31
34
  leftIconAriaLabel?: string;
@@ -40,6 +43,8 @@ export type InputProps = {
40
43
  required?: boolean;
41
44
  clearable?: boolean;
42
45
  linkify?: boolean;
46
+ enablePasswordVisibilityToggle?: boolean;
47
+ enableNumberStepper?: boolean;
43
48
  onfocus?: FocusHandler;
44
49
  onblur?: FocusHandler;
45
50
  onkeydown?: KeyboardHandler;
@@ -67,6 +72,18 @@ export type InputProps = {
67
72
  oninput?: BivariantValueHandler<string | number>;
68
73
  onRightIconClick?: MouseHandler;
69
74
  onLeftIconClick?: MouseHandler;
75
+ onRightIconMouseDown?: MouseHandler;
76
+ onLeftIconMouseDown?: MouseHandler;
77
+ onRightIconMouseUp?: MouseHandler;
78
+ onLeftIconMouseUp?: MouseHandler;
79
+ onRightIconMouseLeave?: MouseHandler;
80
+ onLeftIconMouseLeave?: MouseHandler;
81
+ onRightIconTouchStart?: TouchHandler;
82
+ onLeftIconTouchStart?: TouchHandler;
83
+ onRightIconTouchEnd?: TouchHandler;
84
+ onLeftIconTouchEnd?: TouchHandler;
85
+ onRightIconTouchCancel?: TouchHandler;
86
+ onLeftIconTouchCancel?: TouchHandler;
70
87
  [key: string]: any;
71
88
  };
72
89
  declare const Input: import("svelte").Component<InputProps, {
@@ -365,10 +365,11 @@
365
365
  * ============================================= */
366
366
 
367
367
  .radio {
368
- display: flex;
368
+ display: inline-flex;
369
369
  align-items: center;
370
370
  width: fit-content;
371
371
  min-height: var(--svelte-ui-radio-min-height);
372
+ vertical-align: top;
372
373
  contain: layout;
373
374
  }
374
375
 
@@ -376,7 +376,7 @@
376
376
  // =========================================================================
377
377
  // $derived
378
378
  // =========================================================================
379
- const effectiveIconSize = $derived(
379
+ const resolvedIconSize = $derived(
380
380
  iconOpticalSize || (size === 'small' ? 16 : size === 'large' ? 24 : 20)
381
381
  );
382
382
 
@@ -458,7 +458,7 @@
458
458
  filled={iconFilled || isSelected}
459
459
  weight={iconWeight}
460
460
  grade={iconGrade}
461
- opticalSize={effectiveIconSize}
461
+ opticalSize={resolvedIconSize}
462
462
  variant={iconVariant}
463
463
  >
464
464
  {item.icon}
@@ -474,7 +474,7 @@
474
474
  </div>
475
475
 
476
476
  <style>.segmented-control {
477
- display: inline-flex;
477
+ display: flex;
478
478
  position: relative;
479
479
  padding: var(--svelte-ui-segmented-control-base-padding);
480
480
  background-color: var(--svelte-ui-segmented-control-base-bg);
@@ -355,6 +355,7 @@ select--focus-{focusStyle}"
355
355
  position: relative;
356
356
  width: auto;
357
357
  max-width: 100%;
358
+ vertical-align: top;
358
359
  }
359
360
 
360
361
  /* =============================================
@@ -453,7 +454,6 @@ select--focus-{focusStyle}"
453
454
  border: none;
454
455
  border-radius: var(--svelte-ui-select-border-radius);
455
456
  font-size: 1rem;
456
- color: var(--svelte-ui-select-text-color);
457
457
  line-height: var(--svelte-ui-select-height);
458
458
  }
459
459
  }
@@ -171,6 +171,7 @@
171
171
  {#each tabItems as tabItem, index}
172
172
  <TabItem
173
173
  {tabItem}
174
+ {pathPrefix}
174
175
  isSelected={index === selectedTabIndex}
175
176
  {textColor}
176
177
  {selectedTextColor}
@@ -11,6 +11,7 @@
11
11
  export type TabItemProps = {
12
12
  // 基本プロパティ
13
13
  tabItem: MenuItem;
14
+ pathPrefix?: string;
14
15
 
15
16
  // スタイル/レイアウト
16
17
  textColor: string;
@@ -31,6 +32,7 @@
31
32
  let {
32
33
  // 基本プロパティ
33
34
  tabItem,
35
+ pathPrefix = '',
34
36
 
35
37
  // スタイル/レイアウト
36
38
  textColor,
@@ -47,10 +49,29 @@
47
49
  // 状態/動作
48
50
  isSelected = false
49
51
  }: TabItemProps = $props();
52
+
53
+ // =========================================================================
54
+ // $derived
55
+ // =========================================================================
56
+
57
+ // pathPrefixを付与したhrefを計算
58
+ const hrefWithPrefix = $derived.by(() => {
59
+ if (!tabItem.href) return undefined;
60
+ if (!pathPrefix) return tabItem.href;
61
+
62
+ // 既にpathPrefixが含まれている場合はそのまま
63
+ // pathPrefixが完全一致、またはpathPrefix + '/'で始まる場合
64
+ if (tabItem.href === pathPrefix || tabItem.href.startsWith(`${pathPrefix}/`)) {
65
+ return tabItem.href;
66
+ }
67
+
68
+ // pathPrefixを付与
69
+ return `${pathPrefix}${tabItem.href.startsWith('/') ? '' : '/'}${tabItem.href}`;
70
+ });
50
71
  </script>
51
72
 
52
73
  <a
53
- href={tabItem.href}
74
+ href={hrefWithPrefix}
54
75
  class="tab-item"
55
76
  class:tab-item--selected={isSelected}
56
77
  style="--svelte-ui-tab-item-text-color: {textColor}; --svelte-ui-tab-item-selected-text-color: {selectedTextColor}; --svelte-ui-tab-item-selected-bar-color: {selectedBarColor}"
@@ -2,6 +2,7 @@ import type { MenuItem } from '../types/menuItem';
2
2
  import type { IconVariant, IconWeight, IconGrade, IconOpticalSize } from '../types/icon';
3
3
  export type TabItemProps = {
4
4
  tabItem: MenuItem;
5
+ pathPrefix?: string;
5
6
  textColor: string;
6
7
  selectedTextColor: string;
7
8
  selectedBarColor: string;