@geckou/ui-react 0.1.0

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 (38) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +62 -0
  3. package/package.json +52 -0
  4. package/src/components/BasicButton.tsx +81 -0
  5. package/src/components/CheckBox.tsx +87 -0
  6. package/src/components/CheckBoxes.tsx +93 -0
  7. package/src/components/CheckButton.tsx +66 -0
  8. package/src/components/DatePicker.tsx +154 -0
  9. package/src/components/DateRangePicker.tsx +59 -0
  10. package/src/components/DateSelector.tsx +162 -0
  11. package/src/components/DropdownUi.tsx +126 -0
  12. package/src/components/ErrorMessage.tsx +30 -0
  13. package/src/components/FileInput.tsx +93 -0
  14. package/src/components/InputBox.tsx +118 -0
  15. package/src/components/InputGroup.tsx +13 -0
  16. package/src/components/LabeledCheckbox.tsx +61 -0
  17. package/src/components/LabeledFieldset.tsx +18 -0
  18. package/src/components/LoadingSpinner.tsx +23 -0
  19. package/src/components/ModalBox.tsx +109 -0
  20. package/src/components/PopupBox.tsx +70 -0
  21. package/src/components/RadioButtons.tsx +94 -0
  22. package/src/components/SearchableSelectBox.tsx +108 -0
  23. package/src/components/SelectBox.tsx +152 -0
  24. package/src/components/SlideDownUi.tsx +123 -0
  25. package/src/components/TabUI.tsx +112 -0
  26. package/src/components/TextArea.tsx +102 -0
  27. package/src/components/TextBox.tsx +120 -0
  28. package/src/components/ToggleButton.tsx +102 -0
  29. package/src/components/icons/BackupIcon.tsx +16 -0
  30. package/src/components/icons/CalendarIcon.tsx +15 -0
  31. package/src/components/icons/CheckIcon.tsx +7 -0
  32. package/src/components/icons/CloseIcon.tsx +16 -0
  33. package/src/components/icons/KeyboardArrowDownIcon.tsx +16 -0
  34. package/src/constants/index.ts +2 -0
  35. package/src/hooks/useFormValidation.ts +69 -0
  36. package/src/index.ts +66 -0
  37. package/src/styles/tokens.css +61 -0
  38. package/src/types/index.ts +23 -0
@@ -0,0 +1,61 @@
1
+ /*
2
+ * デザイントークン(customjapan/front_cj の assets/scss/variables.scss 由来)
3
+ * ビューポート 430px〜980px の間で流体スケーリングする。
4
+ * SCSS の calcClamp() を純 CSS の clamp() に展開済み。
5
+ *
6
+ * 各コンポーネントは var(--token, フォールバック値) で参照するため、
7
+ * このファイルを読み込まなくても固定値で動作する。
8
+ * アプリ側で読み込むと本来の流体スケーリングが有効になる:
9
+ * @import '@geckou/ui/styles/tokens.css';
10
+ */
11
+ :root {
12
+ /* 基準値(6px〜8px) */
13
+ --bv: clamp(0.375rem, 0.2773rem + 0.3636vw, 0.5rem);
14
+
15
+ /* スペーシング */
16
+ --sp: var(--bv);
17
+ --sp-max: calc(var(--sp) * 12);
18
+ --sp-larger: calc(var(--sp) * 8);
19
+ --sp-large: calc(var(--sp) * 4);
20
+ --sp-medium: calc(var(--sp) * 2);
21
+ --sp-small: var(--sp);
22
+ --sp-min: calc(var(--sp) / 2);
23
+
24
+ /* アイコンサイズ */
25
+ --icon-min: calc(var(--bv) * 2);
26
+ --icon-small: calc(var(--bv) * 2.5);
27
+ --icon-medium: calc(var(--bv) * 3);
28
+ --icon-large: calc(var(--bv) * 4);
29
+ --icon-larger: calc(var(--bv) * 5);
30
+
31
+ /* 角丸 */
32
+ --radius-min: calc(var(--bv) / 4);
33
+ --radius-small: calc(var(--bv) / 2);
34
+ --radius-medium: var(--bv);
35
+ --radius-large: calc(var(--bv) * 2);
36
+
37
+ /* フォントサイズ */
38
+ --fs-min: 10px;
39
+ --fs-smaller: clamp(0.625rem, 0.5761rem + 0.1818vw, 0.6875rem);
40
+ --fs-small: clamp(0.6875rem, 0.6386rem + 0.1818vw, 0.75rem);
41
+ --fs-medium: clamp(0.8125rem, 0.7636rem + 0.1818vw, 0.875rem);
42
+ --fs-large: clamp(0.875rem, 0.7773rem + 0.3636vw, 1rem);
43
+ --fs-larger: clamp(1rem, 0.8045rem + 0.7273vw, 1.25rem);
44
+ --fs-max: clamp(1.125rem, 0.8318rem + 1.0909vw, 1.5rem);
45
+
46
+ /* 行間・字間 */
47
+ --line-height-tight: 1.12;
48
+ --line-height-narrow: 1.4;
49
+ --line-height-normal: 1.6;
50
+ --letter-spacing-normal: 0.08em;
51
+ --letter-spacing-narrow: 0.04em;
52
+
53
+ /* 画面幅 */
54
+ --mobile-lower-width: 430px;
55
+ --tablet-lower-width: 740px;
56
+ --desktop-lower-width: 1025px;
57
+ --contents-max-width: 1440px;
58
+
59
+ /* その他 */
60
+ --transition-duration: 0.3s;
61
+ }
@@ -0,0 +1,23 @@
1
+ // フォーム部品の型は @geckou/ui-core が正。Vue / React で共通のため、ここでは再エクスポートのみ行う
2
+ export type {
3
+ StateVariation,
4
+ BorderStyle,
5
+ BaseStyle,
6
+ StyleForEachStatus,
7
+ InputBoxStyle,
8
+ InputBoxStyleForEachStatus,
9
+ ButtonStyle,
10
+ ButtonStyleForEachStatus,
11
+ CheckBoxStyle,
12
+ CheckBoxStyleForEachStatus,
13
+ RadioButtonStyle,
14
+ RadioButtonStyleForEachStatus,
15
+ SelectValue,
16
+ Option,
17
+ Validate,
18
+ Validates,
19
+ InputValue,
20
+ DateObject,
21
+ DateType,
22
+ ValidationResult,
23
+ } from '@geckou/ui-core'