@magmamath/students-features 0.9.99 → 0.9.100-rc.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.
Files changed (125) hide show
  1. package/.editorconfig +15 -0
  2. package/.eslintignore +2 -0
  3. package/.eslintrc +22 -0
  4. package/.gitattributes +3 -0
  5. package/.github/actions/setup/action.yml +37 -0
  6. package/.github/workflows/ci.yml +73 -0
  7. package/.gitignore +84 -0
  8. package/.idea/.gitignore +8 -0
  9. package/.idea/codeStyles/Project.xml +62 -0
  10. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  11. package/.idea/copilot.data.migration.agent.xml +6 -0
  12. package/.idea/copilot.data.migration.ask.xml +6 -0
  13. package/.idea/copilot.data.migration.ask2agent.xml +6 -0
  14. package/.idea/copilot.data.migration.edit.xml +6 -0
  15. package/.idea/inspectionProfiles/Project_Default.xml +8 -0
  16. package/.idea/jsLinters/eslint.xml +6 -0
  17. package/.idea/modules.xml +8 -0
  18. package/.idea/prettier.xml +7 -0
  19. package/.idea/students-features.iml +12 -0
  20. package/.idea/vcs.xml +6 -0
  21. package/.idea/workspace.xml +650 -0
  22. package/.nvmrc +1 -0
  23. package/.prettierrc +11 -0
  24. package/.release-it.json +17 -0
  25. package/.watchmanconfig +1 -0
  26. package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +541 -0
  27. package/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs +28 -0
  28. package/.yarn/releases/yarn-3.6.1.cjs +874 -0
  29. package/babel.config.js +5 -0
  30. package/bob.config.js +25 -0
  31. package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +3 -0
  32. package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
  33. package/dist/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.js +9 -1
  34. package/dist/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.js.map +1 -1
  35. package/dist/commonjs/features/keyboard/components/UnitsLayout/types.js +1 -0
  36. package/dist/commonjs/features/keyboard/components/UnitsLayout/types.js.map +1 -1
  37. package/dist/commonjs/features/keyboard/constants/keyboardGroupsByLocale.js +2 -1
  38. package/dist/commonjs/features/keyboard/constants/keyboardGroupsByLocale.js.map +1 -1
  39. package/dist/commonjs/features/keyboard/types/MathKeysGroups/units.js +18 -3
  40. package/dist/commonjs/features/keyboard/types/MathKeysGroups/units.js.map +1 -1
  41. package/dist/commonjs/shared/icons/TimeIcon.js +37 -0
  42. package/dist/commonjs/shared/icons/TimeIcon.js.map +1 -0
  43. package/dist/commonjs/shared/translation/localization/ca.json +2 -1
  44. package/dist/commonjs/shared/translation/localization/de.json +2 -1
  45. package/dist/commonjs/shared/translation/localization/en.json +2 -1
  46. package/dist/commonjs/shared/translation/localization/gb.json +2 -1
  47. package/dist/commonjs/shared/translation/localization/sct.json +2 -1
  48. package/dist/commonjs/shared/translation/localization/sw.json +2 -1
  49. package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +3 -0
  50. package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
  51. package/dist/module/features/keyboard/components/UnitsLayout/keyboardGroups.js +9 -1
  52. package/dist/module/features/keyboard/components/UnitsLayout/keyboardGroups.js.map +1 -1
  53. package/dist/module/features/keyboard/components/UnitsLayout/types.js +1 -0
  54. package/dist/module/features/keyboard/components/UnitsLayout/types.js.map +1 -1
  55. package/dist/module/features/keyboard/constants/keyboardGroupsByLocale.js +3 -2
  56. package/dist/module/features/keyboard/constants/keyboardGroupsByLocale.js.map +1 -1
  57. package/dist/module/features/keyboard/types/MathKeysGroups/units.js +18 -3
  58. package/dist/module/features/keyboard/types/MathKeysGroups/units.js.map +1 -1
  59. package/dist/module/shared/icons/TimeIcon.js +29 -0
  60. package/dist/module/shared/icons/TimeIcon.js.map +1 -0
  61. package/dist/module/shared/translation/localization/ca.json +2 -1
  62. package/dist/module/shared/translation/localization/de.json +2 -1
  63. package/dist/module/shared/translation/localization/en.json +2 -1
  64. package/dist/module/shared/translation/localization/gb.json +2 -1
  65. package/dist/module/shared/translation/localization/sct.json +2 -1
  66. package/dist/module/shared/translation/localization/sw.json +2 -1
  67. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts.map +1 -1
  68. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts +1 -0
  69. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts.map +1 -1
  70. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/types.d.ts +2 -1
  71. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/types.d.ts.map +1 -1
  72. package/dist/typescript/commonjs/features/keyboard/constants/keyboardGroupsByLocale.d.ts.map +1 -1
  73. package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/units.d.ts +15 -0
  74. package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/units.d.ts.map +1 -1
  75. package/dist/typescript/commonjs/shared/icons/TimeIcon.d.ts +4 -0
  76. package/dist/typescript/commonjs/shared/icons/TimeIcon.d.ts.map +1 -0
  77. package/dist/typescript/commonjs/shared/translation/constants.d.ts +6 -0
  78. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
  79. package/dist/typescript/commonjs/shared/translation/model.d.ts +2 -0
  80. package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
  81. package/dist/typescript/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts.map +1 -1
  82. package/dist/typescript/module/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts +1 -0
  83. package/dist/typescript/module/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts.map +1 -1
  84. package/dist/typescript/module/features/keyboard/components/UnitsLayout/types.d.ts +2 -1
  85. package/dist/typescript/module/features/keyboard/components/UnitsLayout/types.d.ts.map +1 -1
  86. package/dist/typescript/module/features/keyboard/constants/keyboardGroupsByLocale.d.ts.map +1 -1
  87. package/dist/typescript/module/features/keyboard/types/MathKeysGroups/units.d.ts +15 -0
  88. package/dist/typescript/module/features/keyboard/types/MathKeysGroups/units.d.ts.map +1 -1
  89. package/dist/typescript/module/shared/icons/TimeIcon.d.ts +4 -0
  90. package/dist/typescript/module/shared/icons/TimeIcon.d.ts.map +1 -0
  91. package/dist/typescript/module/shared/translation/constants.d.ts +6 -0
  92. package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
  93. package/dist/typescript/module/shared/translation/model.d.ts +2 -0
  94. package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
  95. package/example/.expo/README.md +8 -0
  96. package/example/.expo/devices.json +3 -0
  97. package/example/.expo/web/cache/production/images/favicon/favicon-24272cdaeff82cc5facdaccd982a6f05b60c4504704bbf94c19a6388659880bb-contain-transparent/favicon-48.png +0 -0
  98. package/example/app.json +30 -0
  99. package/example/assets/adaptive-icon.png +0 -0
  100. package/example/assets/favicon.png +0 -0
  101. package/example/assets/icon.png +0 -0
  102. package/example/assets/splash-icon.png +0 -0
  103. package/example/babel.config.js +28 -0
  104. package/example/index.js +8 -0
  105. package/example/metro.config.js +18 -0
  106. package/example/package.json +25 -0
  107. package/example/src/App.tsx +8 -0
  108. package/example/tsconfig.json +6 -0
  109. package/example/yarn.lock +6552 -0
  110. package/package.json +1 -1
  111. package/src/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.ts +4 -0
  112. package/src/features/keyboard/components/UnitsLayout/keyboardGroups.ts +11 -0
  113. package/src/features/keyboard/components/UnitsLayout/types.ts +1 -0
  114. package/src/features/keyboard/constants/keyboardGroupsByLocale.ts +2 -0
  115. package/src/features/keyboard/types/MathKeysGroups/units.tsx +15 -0
  116. package/src/shared/icons/TimeIcon.tsx +23 -0
  117. package/src/shared/translation/localization/ca.json +2 -1
  118. package/src/shared/translation/localization/de.json +2 -1
  119. package/src/shared/translation/localization/en.json +2 -1
  120. package/src/shared/translation/localization/gb.json +2 -1
  121. package/src/shared/translation/localization/sct.json +2 -1
  122. package/src/shared/translation/localization/sw.json +2 -1
  123. package/tsconfig.build.json +4 -0
  124. package/tsconfig.json +34 -0
  125. package/yarn.lock +8623 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magmamath/students-features",
3
- "version": "0.9.99",
3
+ "version": "0.9.100-rc.1",
4
4
  "description": "Magmamath features library",
5
5
  "source": "src/index.ts",
6
6
  "main": "src/index.ts",
@@ -24,6 +24,10 @@ export const useUnitTabs = () => {
24
24
  title: t('keyboard.weight'),
25
25
  key: KeyboardUnitsGroupType.WEIGHT,
26
26
  },
27
+ {
28
+ title: t('keyboard.time'),
29
+ key: KeyboardUnitsGroupType.TIME,
30
+ },
27
31
  ],
28
32
  [t],
29
33
  )
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  MATH_AREA_UNITS,
3
3
  MATH_LENGTH_UNITS,
4
+ MATH_TIME_UNITS,
4
5
  MATH_VOLUME_UNITS,
5
6
  MATH_WEIGHT_UNITS,
6
7
  } from '../../types/MathKeysGroups/units'
@@ -10,6 +11,7 @@ import { VolumeIcon } from '../../../../shared/icons/VolumeIcon'
10
11
  import { WeightIcon } from '../../../../shared/icons/WeightIcon'
11
12
  import { KeyboardUnitsGroupType, UnitKeyboardGroups } from './types'
12
13
  import { MathEntryKeyboardGroupId } from '../../types/keyboardGroupIds'
14
+ import { TimeIcon } from '../../../../shared/icons/TimeIcon'
13
15
 
14
16
  export const MATH_ENTRY_LENGTH_UNITS_SW_KEYBOARD_GROUPS: UnitKeyboardGroups = {
15
17
  id: MathEntryKeyboardGroupId.LENGTH_UNITS_SW,
@@ -171,6 +173,11 @@ export const MATH_ENTRY_WEIGHT_UNITS_SW_KEYBOARD_GROUPS: UnitKeyboardGroups = {
171
173
  ],
172
174
  }
173
175
 
176
+ export const MATH_ENTRY_TIME_UNITS_SW_KEYBOARD_GROUPS: UnitKeyboardGroups = {
177
+ id: MathEntryKeyboardGroupId.TIME_SW,
178
+ keys: [[MATH_TIME_UNITS.S, MATH_TIME_UNITS.M, MATH_TIME_UNITS.H]],
179
+ }
180
+
174
181
  export const MATH_ENTRY_WEIGHT_UNITS_US_KEYBOARD_GROUPS: UnitKeyboardGroups = {
175
182
  id: MathEntryKeyboardGroupId.WEIGHT_UNITS_US,
176
183
  keys: [
@@ -199,4 +206,8 @@ export const UNITS_KEYBOARD_GROUPS = new Map([
199
206
  KeyboardUnitsGroupType.WEIGHT,
200
207
  { keys: MATH_ENTRY_WEIGHT_UNITS_SW_KEYBOARD_GROUPS.keys, icon: WeightIcon },
201
208
  ],
209
+ [
210
+ KeyboardUnitsGroupType.TIME,
211
+ { keys: MATH_ENTRY_TIME_UNITS_SW_KEYBOARD_GROUPS.keys, icon: TimeIcon },
212
+ ],
202
213
  ])
@@ -10,6 +10,7 @@ export enum KeyboardUnitsGroupType {
10
10
  AREA = 'area',
11
11
  VOLUME = 'volume',
12
12
  WEIGHT = 'weight',
13
+ TIME = 'time',
13
14
  }
14
15
 
15
16
  export type UnitKeyboardGroups = {
@@ -31,6 +31,7 @@ import {
31
31
  MATH_ENTRY_AREA_UNITS_US_KEYBOARD_GROUPS,
32
32
  MATH_ENTRY_LENGTH_UNITS_SW_KEYBOARD_GROUPS,
33
33
  MATH_ENTRY_LENGTH_UNITS_US_KEYBOARD_GROUPS,
34
+ MATH_ENTRY_TIME_UNITS_SW_KEYBOARD_GROUPS,
34
35
  MATH_ENTRY_VOLUME_UNITS_SW_KEYBOARD_GROUPS,
35
36
  MATH_ENTRY_VOLUME_UNITS_UK_KEYBOARD_GROUPS,
36
37
  MATH_ENTRY_VOLUME_UNITS_US_KEYBOARD_GROUPS,
@@ -70,6 +71,7 @@ function createKeyboardUnitsLocale(
70
71
  [KeyboardUnitsGroupType.AREA]: MATH_ENTRY_AREA_UNITS_US_KEYBOARD_GROUPS,
71
72
  [KeyboardUnitsGroupType.VOLUME]: MATH_ENTRY_VOLUME_UNITS_US_KEYBOARD_GROUPS,
72
73
  [KeyboardUnitsGroupType.WEIGHT]: MATH_ENTRY_WEIGHT_UNITS_US_KEYBOARD_GROUPS,
74
+ [KeyboardUnitsGroupType.TIME]: MATH_ENTRY_TIME_UNITS_SW_KEYBOARD_GROUPS,
73
75
  }
74
76
  return { ...base, ...overrides }
75
77
  }
@@ -427,16 +427,31 @@ export const MATH_TIME_UNITS = createMathKeysGroup({
427
427
  label: 's',
428
428
  mathliveValue: '\\mathrm{s}',
429
429
  katexValue: 's',
430
+ style: {
431
+ button: {
432
+ width: 50,
433
+ },
434
+ },
430
435
  },
431
436
  M: {
432
437
  label: 'min',
433
438
  mathliveValue: '$\\mathrm{min}',
434
439
  katexValue: 'min',
440
+ style: {
441
+ button: {
442
+ width: 50,
443
+ },
444
+ },
435
445
  },
436
446
  H: {
437
447
  label: 'h',
438
448
  mathliveValue: '\\mathrm{h}',
439
449
  katexValue: 'h',
450
+ style: {
451
+ button: {
452
+ width: 50,
453
+ },
454
+ },
440
455
  },
441
456
  DAY: {
442
457
  label: 'day',
@@ -0,0 +1,23 @@
1
+ import { COLORS } from '@magmamath/react-native-ui'
2
+ import { IconProps } from './icon.types'
3
+ import Svg, { Path } from 'react-native-svg'
4
+ import React from 'react'
5
+
6
+ export const TimeIcon = ({ size = 20, color = COLORS.NEUTRAL_9 }: IconProps) => {
7
+ return (
8
+ <Svg width={size} height={size} viewBox="0 0 17 17" fill="none">
9
+ <Path
10
+ fillRule="evenodd"
11
+ clipRule="evenodd"
12
+ d="M7.84 1.5C4.33851 1.5 1.5 4.33851 1.5 7.84C1.5 11.3415 4.33851 14.18 7.84 14.18C11.3415 14.18 14.18 11.3415 14.18 7.84C14.18 4.33851 11.3415 1.5 7.84 1.5ZM0 7.84C0 3.51009 3.51009 0 7.84 0C12.1699 0 15.68 3.51009 15.68 7.84C15.68 12.1699 12.1699 15.68 7.84 15.68C3.51009 15.68 0 12.1699 0 7.84Z"
13
+ fill={color}
14
+ />
15
+ <Path
16
+ fillRule="evenodd"
17
+ clipRule="evenodd"
18
+ d="M7.83999 3.0826C8.2542 3.0826 8.58999 3.41839 8.58999 3.8326V7.8033L10.4859 9.42838C10.8004 9.69794 10.8368 10.1714 10.5673 10.4859C10.2977 10.8004 9.82421 10.8368 9.50972 10.5673L7.57539 8.90926C7.2673 8.64519 7.08999 8.25967 7.08999 7.85389V3.8326C7.08999 3.41839 7.42578 3.0826 7.83999 3.0826Z"
19
+ fill={color}
20
+ />
21
+ </Svg>
22
+ )
23
+ }
@@ -37,6 +37,7 @@
37
37
  "length": "Length",
38
38
  "area": "Area",
39
39
  "volume": "Volume",
40
- "weight": "Weight"
40
+ "weight": "Weight",
41
+ "time": "Time"
41
42
  }
42
43
  }
@@ -37,6 +37,7 @@
37
37
  "length": "Länge",
38
38
  "area": "Fläche",
39
39
  "volume": "Volumen",
40
- "weight": "Gewicht"
40
+ "weight": "Gewicht",
41
+ "time": "Zeit"
41
42
  }
42
43
  }
@@ -37,6 +37,7 @@
37
37
  "length": "Length",
38
38
  "area": "Area",
39
39
  "volume": "Volume",
40
- "weight": "Weight"
40
+ "weight": "Weight",
41
+ "time": "Time"
41
42
  }
42
43
  }
@@ -37,6 +37,7 @@
37
37
  "length": "Length",
38
38
  "area": "Area",
39
39
  "volume": "Volume",
40
- "weight": "Weight"
40
+ "weight": "Weight",
41
+ "time": "Time"
41
42
  }
42
43
  }
@@ -37,6 +37,7 @@
37
37
  "length": "Length",
38
38
  "area": "Area",
39
39
  "volume": "Volume",
40
- "weight": "Weight"
40
+ "weight": "Weight",
41
+ "time": "Time"
41
42
  }
42
43
  }
@@ -37,6 +37,7 @@
37
37
  "length": "Längd",
38
38
  "area": "Area",
39
39
  "volume": "Volym",
40
- "weight": "Vikt"
40
+ "weight": "Vikt",
41
+ "time": "Tid"
41
42
  }
42
43
  }
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "./tsconfig",
3
+ "exclude": ["example", "dist"]
4
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "compilerOptions": {
3
+ "paths": {
4
+ "@magmamath/students-features": ["./src/index"]
5
+ },
6
+ "target": "esnext",
7
+ "baseUrl": "./",
8
+ "lib": [
9
+ "dom",
10
+ "dom.iterable",
11
+ "esnext"
12
+ ],
13
+ "declaration": true,
14
+ "allowJs": true,
15
+ "skipLibCheck": true,
16
+ "esModuleInterop": true,
17
+ "allowSyntheticDefaultImports": true,
18
+ "strict": true,
19
+ "forceConsistentCasingInFileNames": true,
20
+ "module": "esnext",
21
+ "moduleResolution": "node",
22
+ "resolveJsonModule": true,
23
+ "isolatedModules": true,
24
+ "jsx": "react",
25
+ "experimentalDecorators": true
26
+ },
27
+ "include": [
28
+ "src"
29
+ ],
30
+ "exclude": [
31
+ "node_modules",
32
+ "example"
33
+ ]
34
+ }