@itcase/types 1.0.4 → 1.0.6
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.
- package/CHANGELOG.md +8 -0
- package/package.json +7 -7
- package/types/appearanceKeys.ts +11 -1
- package/types/index.ts +1 -0
- package/types/option.ts +29 -0
- package/types/size/size.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [1.0.6](https://github.com/ITCase/itcase-types/compare/v1.0.5...v1.0.6) (2025-07-14)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* add option type ([1087551](https://github.com/ITCase/itcase-types/commit/1087551371d856ca8d65c1c23564f2785c047531))
|
|
6
|
+
|
|
7
|
+
## [1.0.5](https://github.com/ITCase/itcase-types/compare/v1.0.4...v1.0.5) (2025-06-12)
|
|
8
|
+
|
|
1
9
|
## [1.0.4](https://github.com/ITCase/itcase-types/compare/v1.0.3...v1.0.4) (2025-06-04)
|
|
2
10
|
|
|
3
11
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "unified type storage",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"types"
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@commitlint/cli": "^19.8.1",
|
|
34
34
|
"@commitlint/config-conventional": "^19.8.1",
|
|
35
|
-
"@itcase/config": "^1.0.
|
|
36
|
-
"@itcase/lint": "^1.1.
|
|
35
|
+
"@itcase/config": "^1.0.47",
|
|
36
|
+
"@itcase/lint": "^1.1.15",
|
|
37
37
|
"@semantic-release/changelog": "^6.0.3",
|
|
38
38
|
"@semantic-release/git": "^10.0.1",
|
|
39
39
|
"@semantic-release/release-notes-generator": "14.0.3",
|
|
40
|
-
"conventional-changelog-conventionalcommits": "^
|
|
41
|
-
"eslint": "9.
|
|
40
|
+
"conventional-changelog-conventionalcommits": "^9.0.0",
|
|
41
|
+
"eslint": "9.28.0",
|
|
42
42
|
"husky": "^9.1.7",
|
|
43
|
-
"lint-staged": "^16.
|
|
43
|
+
"lint-staged": "^16.1.0",
|
|
44
44
|
"prettier": "^3.5.3",
|
|
45
|
-
"semantic-release": "^24.2.
|
|
45
|
+
"semantic-release": "^24.2.5",
|
|
46
46
|
"typescript": "^5.8.3"
|
|
47
47
|
}
|
|
48
48
|
}
|
package/types/appearanceKeys.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import type { SizeProps } from './size'
|
|
2
|
+
|
|
3
|
+
type AppearanceKeysDefault =
|
|
2
4
|
| 'accent'
|
|
3
5
|
| 'accentPrimary'
|
|
4
6
|
| 'accentQuaternary'
|
|
@@ -31,3 +33,11 @@ export type AppearanceKeysDefault =
|
|
|
31
33
|
| 'surfaceTertiary'
|
|
32
34
|
| 'unableLoadData'
|
|
33
35
|
| 'warning'
|
|
36
|
+
|
|
37
|
+
type SizeAppearanceKey = `size${Uppercase<SizeProps>}`
|
|
38
|
+
|
|
39
|
+
type CompositeAppearanceKey =
|
|
40
|
+
| `${AppearanceKeysDefault} ${SizeAppearanceKey}`
|
|
41
|
+
| AppearanceKeysDefault
|
|
42
|
+
|
|
43
|
+
export type { AppearanceKeysDefault, CompositeAppearanceKey, SizeAppearanceKey }
|
package/types/index.ts
CHANGED
package/types/option.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a basic option item, typically used in select or dropdown components.
|
|
3
|
+
*
|
|
4
|
+
* `label` — the text displayed to the user.
|
|
5
|
+
* `value` — the underlying value associated with this option (e.g., id, key).
|
|
6
|
+
*/
|
|
7
|
+
type Option = {
|
|
8
|
+
label: string
|
|
9
|
+
value: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A customizable version of `Option` that can be extended with additional fields.
|
|
14
|
+
*
|
|
15
|
+
* @template T - Additional properties to extend the base Option type.
|
|
16
|
+
*
|
|
17
|
+
* Example usage:
|
|
18
|
+
* ```ts
|
|
19
|
+
* type SelectOption = CustomOption<{ appearance: string }>;
|
|
20
|
+
*
|
|
21
|
+
* const options: SelectOption[] = [
|
|
22
|
+
* { label: 'Полная версия 1 месяц', value: 'Month1', appearance: 'accentPrimary sizeXL' },
|
|
23
|
+
* { label: 'Полная версия 3 месяца', value: 'Month2', appearance: 'surfacePrimary sizeXL' },
|
|
24
|
+
* ];
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
type CustomOption<T = unknown> = Readonly<Option & T>
|
|
28
|
+
|
|
29
|
+
export type { Option, CustomOption }
|