@itcase/types 1.0.5 → 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 CHANGED
@@ -1,3 +1,9 @@
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
+
1
7
  ## [1.0.5](https://github.com/ITCase/itcase-types/compare/v1.0.4...v1.0.5) (2025-06-12)
2
8
 
3
9
  ## [1.0.4](https://github.com/ITCase/itcase-types/compare/v1.0.3...v1.0.4) (2025-06-04)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/types",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "unified type storage",
5
5
  "keywords": [
6
6
  "types"
package/types/index.ts CHANGED
@@ -23,6 +23,7 @@ export * from './elevation'
23
23
  export * from './height'
24
24
  export * from './itemColor'
25
25
  export * from './justifyContent'
26
+ export * from './option'
26
27
  export * from './overflow'
27
28
  export * from './position'
28
29
  export * from './resizeMode'
@@ -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 }