@clds/common-definitions
Advanced tools
Comparing version 0.7.6 to 0.8.0
@@ -30,3 +30,3 @@ declare type DefaultValueName<Name extends string> = `default${Capitalize<Name>}`; | ||
* or leaves control to the component (uncontrolled mode) by providing only default value (ie. defaultColor) | ||
* This is explicit choice so you can't observe the internal state change if you don't control it, you also can't provide | ||
* This is explicit choice so you can't observe the internal state change if you don't control it, you can't provide too | ||
* nothing since we want the consumer to be aware of the mixed control mode. | ||
@@ -58,7 +58,11 @@ * | ||
/** | ||
* Since MixedControlProps requires either value or defaultValue to be passed (to make the choice of controlled vs uncontrolled explicitly) | ||
* we need other type that will allow the situation that you don't need to pass anything and the defaultValue is set in the component. | ||
* In some cases this is useful (ie. DropdownMenu - most of people don't need to know that you can control focusedId so why we should ask to provide | ||
* Since MixedControlProps requires either value or defaultValue to be passed | ||
*(to make the choice of controlled vs uncontrolled explicitly) | ||
* we need other type that will allow the situation that you don't need to pass anything | ||
* and the defaultValue is set in the component. | ||
* In some cases this is useful (ie. DropdownMenu - most of people don't need to know that you can control focusedId | ||
* so why we should ask to provide | ||
* either defaultFocusedId or focusedId). | ||
* But use this with only for props that are very optional, not related to props supposed to be used by the component consumer. | ||
* But use this with only for props that are very optional, | ||
* not related to props supposed to be used by the component consumer. | ||
*/ | ||
@@ -69,5 +73,6 @@ export declare type ImplicitMixedControlProps<Name extends AllowedFieldNames, Value> = ImplicitUncontrolledModeProps<Name, Value> | ControlledModeProps<Name, Value>; | ||
* For example: DropdownMenu's onSelect - once it is opened, we just want to know which menu item was selected. | ||
* Use with caution. Don't use the callback to synchronize the parent state in uncontrolled mode (without proving a setter). | ||
* Use with caution. | ||
* Don't use the callback to synchronize the parent state in uncontrolled mode (without proving a setter). | ||
*/ | ||
export declare type ImplicitTraceableMixedControlProps<Name extends AllowedFieldNames, Value> = ImplicitTraceableUncontrolledModeProps<Name, Value> | ControlledModeProps<Name, Value>; | ||
export {}; |
@@ -30,3 +30,3 @@ declare type DefaultValueName<Name extends string> = `default${Capitalize<Name>}`; | ||
* or leaves control to the component (uncontrolled mode) by providing only default value (ie. defaultColor) | ||
* This is explicit choice so you can't observe the internal state change if you don't control it, you also can't provide | ||
* This is explicit choice so you can't observe the internal state change if you don't control it, you can't provide too | ||
* nothing since we want the consumer to be aware of the mixed control mode. | ||
@@ -58,7 +58,11 @@ * | ||
/** | ||
* Since MixedControlProps requires either value or defaultValue to be passed (to make the choice of controlled vs uncontrolled explicitly) | ||
* we need other type that will allow the situation that you don't need to pass anything and the defaultValue is set in the component. | ||
* In some cases this is useful (ie. DropdownMenu - most of people don't need to know that you can control focusedId so why we should ask to provide | ||
* Since MixedControlProps requires either value or defaultValue to be passed | ||
*(to make the choice of controlled vs uncontrolled explicitly) | ||
* we need other type that will allow the situation that you don't need to pass anything | ||
* and the defaultValue is set in the component. | ||
* In some cases this is useful (ie. DropdownMenu - most of people don't need to know that you can control focusedId | ||
* so why we should ask to provide | ||
* either defaultFocusedId or focusedId). | ||
* But use this with only for props that are very optional, not related to props supposed to be used by the component consumer. | ||
* But use this with only for props that are very optional, | ||
* not related to props supposed to be used by the component consumer. | ||
*/ | ||
@@ -69,5 +73,6 @@ export declare type ImplicitMixedControlProps<Name extends AllowedFieldNames, Value> = ImplicitUncontrolledModeProps<Name, Value> | ControlledModeProps<Name, Value>; | ||
* For example: DropdownMenu's onSelect - once it is opened, we just want to know which menu item was selected. | ||
* Use with caution. Don't use the callback to synchronize the parent state in uncontrolled mode (without proving a setter). | ||
* Use with caution. | ||
* Don't use the callback to synchronize the parent state in uncontrolled mode (without proving a setter). | ||
*/ | ||
export declare type ImplicitTraceableMixedControlProps<Name extends AllowedFieldNames, Value> = ImplicitTraceableUncontrolledModeProps<Name, Value> | ControlledModeProps<Name, Value>; | ||
export {}; |
{ | ||
"name": "@clds/common-definitions", | ||
"description": "Common Design System TypeScript definitions", | ||
"version": "0.7.6", | ||
"version": "0.8.0", | ||
"author": "Cloudinary", | ||
@@ -10,8 +10,2 @@ "main": "./dist/cjs/index.js", | ||
"homepage": "https://github.com/cloudinary/design-system/tree/next/libs/foundations/common-definitions#readme", | ||
"exports": { | ||
".": { | ||
"import": "./dist/esm/index.js", | ||
"require": "./dist/cjs/index.js" | ||
} | ||
}, | ||
"dependencies": { | ||
@@ -21,3 +15,3 @@ "utility-types": "3.10.0" | ||
"devDependencies": { | ||
"react": "16.13.1" | ||
"react": "16.14.0" | ||
}, | ||
@@ -31,3 +25,9 @@ "peerDependencies": { | ||
"module": "./dist/esm/index.js", | ||
"typings": "./dist/esm/index.d.ts" | ||
"typings": "./dist/esm/index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./dist/esm/index.js", | ||
"require": "./dist/cjs/index.js" | ||
} | ||
} | ||
}, | ||
@@ -37,7 +37,13 @@ "repository": "cloudinary/design-system.git", | ||
"depcheck": "depcheck", | ||
"lint": "eslint .", | ||
"lint": "eslint --ext .ts,.tsx .", | ||
"test": "nyc mocha", | ||
"typecheck": "tsc --noEmit" | ||
}, | ||
"typings": "./dist/esm/index.d.ts" | ||
"typings": "./dist/esm/index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./dist/esm/index.js", | ||
"require": "./dist/cjs/index.js" | ||
} | ||
} | ||
} |
@@ -0,1 +1,2 @@ | ||
/* eslint-disable no-unused-vars */ | ||
type DefaultValueName<Name extends string> = `default${Capitalize<Name>}`; | ||
@@ -10,3 +11,4 @@ | ||
type AllowedFieldNames = keyof ExceptionalCallbackNames | string; // for better autocompletion when using generic type param | ||
// for better autocompletion when using generic type param | ||
type AllowedFieldNames = keyof ExceptionalCallbackNames | string; | ||
@@ -62,3 +64,3 @@ type RegularCallbackName<Name extends string> = `on${Capitalize<Name>}Change`; | ||
* or leaves control to the component (uncontrolled mode) by providing only default value (ie. defaultColor) | ||
* This is explicit choice so you can't observe the internal state change if you don't control it, you also can't provide | ||
* This is explicit choice so you can't observe the internal state change if you don't control it, you can't provide too | ||
* nothing since we want the consumer to be aware of the mixed control mode. | ||
@@ -93,7 +95,11 @@ * | ||
/** | ||
* Since MixedControlProps requires either value or defaultValue to be passed (to make the choice of controlled vs uncontrolled explicitly) | ||
* we need other type that will allow the situation that you don't need to pass anything and the defaultValue is set in the component. | ||
* In some cases this is useful (ie. DropdownMenu - most of people don't need to know that you can control focusedId so why we should ask to provide | ||
* Since MixedControlProps requires either value or defaultValue to be passed | ||
*(to make the choice of controlled vs uncontrolled explicitly) | ||
* we need other type that will allow the situation that you don't need to pass anything | ||
* and the defaultValue is set in the component. | ||
* In some cases this is useful (ie. DropdownMenu - most of people don't need to know that you can control focusedId | ||
* so why we should ask to provide | ||
* either defaultFocusedId or focusedId). | ||
* But use this with only for props that are very optional, not related to props supposed to be used by the component consumer. | ||
* But use this with only for props that are very optional, | ||
* not related to props supposed to be used by the component consumer. | ||
*/ | ||
@@ -107,3 +113,4 @@ export type ImplicitMixedControlProps<Name extends AllowedFieldNames, Value> = | ||
* For example: DropdownMenu's onSelect - once it is opened, we just want to know which menu item was selected. | ||
* Use with caution. Don't use the callback to synchronize the parent state in uncontrolled mode (without proving a setter). | ||
* Use with caution. | ||
* Don't use the callback to synchronize the parent state in uncontrolled mode (without proving a setter). | ||
*/ | ||
@@ -110,0 +117,0 @@ export type ImplicitTraceableMixedControlProps< |
@@ -0,1 +1,2 @@ | ||
/* eslint-disable no-unused-vars */ | ||
import { Assign } from 'utility-types'; | ||
@@ -2,0 +3,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
47755
885