@clds/compound-components
Advanced tools
Comparing version 0.48.0 to 0.48.1
@@ -10,6 +10,6 @@ "use strict"; | ||
const style_utils_1 = require("@clds/style-utils"); | ||
const ListStyleProvider_1 = require("./ListStyleProvider"); | ||
const theme_1 = require("./theme"); | ||
const ListStyleProvider_js_1 = require("./ListStyleProvider.js"); | ||
const theme_js_1 = require("./theme.js"); | ||
const PaperWithFocusRing = (0, styled_components_1.default)(paper_1.Paper) ` | ||
max-height: ${(0, theme_1.popoverMaxHeightVariant)((variant) => variant.maxHeight)}; | ||
max-height: ${(0, theme_js_1.popoverMaxHeightVariant)((variant) => variant.maxHeight)}; | ||
${({ maxHeight }) => maxHeight !== undefined && | ||
@@ -35,5 +35,5 @@ maxHeight !== 'none' && | ||
exports.DefaultList = (0, react_1.forwardRef)((props, ref) => { | ||
const listContext = (0, ListStyleProvider_1.useListStyle)(); | ||
const listContext = (0, ListStyleProvider_js_1.useListStyle)(); | ||
return react_1.default.createElement(exports.ListPure, Object.assign({}, listContext, props, { ref: ref })); | ||
}); | ||
//# sourceMappingURL=List.js.map |
/// <reference types="react" /> | ||
import { Unselect } from '../..'; | ||
import { Unselect } from '../../index.js'; | ||
export interface ListSelection { | ||
@@ -4,0 +4,0 @@ /** Id of currently selected item */ |
@@ -5,7 +5,7 @@ "use strict"; | ||
const react_1 = require("react"); | ||
const createPropsContextProvider_1 = require("../../utils/createPropsContextProvider"); | ||
const createUseDefinedContext_1 = require("../../utils/hooks/createUseDefinedContext"); | ||
const createPropsContextProvider_js_1 = require("../../utils/createPropsContextProvider.js"); | ||
const createUseDefinedContext_js_1 = require("../../utils/hooks/createUseDefinedContext.js"); | ||
const context = (0, react_1.createContext)(undefined); | ||
exports.ListSelectionProvider = (0, createPropsContextProvider_1.createPropsContextProvider)(context); | ||
exports.useListSelectionContext = (0, createUseDefinedContext_1.createUseDefinedContext)(context, 'useListSelectionContext requires ListSelectionContext to read list item properties'); | ||
exports.ListSelectionProvider = (0, createPropsContextProvider_js_1.createPropsContextProvider)(context); | ||
exports.useListSelectionContext = (0, createUseDefinedContext_js_1.createUseDefinedContext)(context, 'useListSelectionContext requires ListSelectionContext to read list item properties'); | ||
const useListSelection = (id) => { | ||
@@ -12,0 +12,0 @@ const { onClick, selectedId, focusedId } = (0, exports.useListSelectionContext)(); |
@@ -5,7 +5,7 @@ "use strict"; | ||
const react_1 = require("react"); | ||
const createPropsContextProvider_1 = require("../../utils/createPropsContextProvider"); | ||
const createUseDefinedContext_1 = require("../../utils/hooks/createUseDefinedContext"); | ||
const createPropsContextProvider_js_1 = require("../../utils/createPropsContextProvider.js"); | ||
const createUseDefinedContext_js_1 = require("../../utils/hooks/createUseDefinedContext.js"); | ||
const listStyleContext = (0, react_1.createContext)(undefined); | ||
exports.ListStyleProvider = (0, createPropsContextProvider_1.createPropsContextProvider)(listStyleContext); | ||
exports.useListStyle = (0, createUseDefinedContext_1.createUseDefinedContext)(listStyleContext, 'Please wrap your component with ListStyleProvider'); | ||
exports.ListStyleProvider = (0, createPropsContextProvider_js_1.createPropsContextProvider)(listStyleContext); | ||
exports.useListStyle = (0, createUseDefinedContext_js_1.createUseDefinedContext)(listStyleContext, 'Please wrap your component with ListStyleProvider'); | ||
//# sourceMappingURL=ListStyleProvider.js.map |
@@ -1,3 +0,3 @@ | ||
import { ListProps } from './List'; | ||
export declare const listTheme: import("@clds/component-theme/src/api/createTheme.types").Compiled<import("@clds/component-theme").Mixin<{ | ||
import { ListProps } from './List.js'; | ||
export declare const listTheme: import("@clds/component-theme/src/api/createTheme.types.js").Compiled<import("@clds/component-theme").Mixin<{ | ||
byMaxHeight: { | ||
@@ -14,3 +14,3 @@ md: { | ||
}; | ||
}>> & import("@clds/component-theme/src/api/createTheme.types").MappedChildren<{ | ||
}>> & import("@clds/component-theme/src/api/createTheme.types.js").MappedChildren<{ | ||
byMaxHeight: { | ||
@@ -28,3 +28,3 @@ md: { | ||
}> & { | ||
[idField]: import("@clds/component-theme/src/types").ThemeId; | ||
[idField]: import("@clds/component-theme/src/types.js").ThemeId; | ||
}; | ||
@@ -31,0 +31,0 @@ declare type ThemeProps = Pick<ListProps, 'maxHeight'>; |
@@ -5,3 +5,3 @@ "use strict"; | ||
const react_1 = require("react"); | ||
const createUseDefinedContext_1 = require("./hooks/createUseDefinedContext"); | ||
const createUseDefinedContext_js_1 = require("./hooks/createUseDefinedContext.js"); | ||
/** | ||
@@ -18,3 +18,3 @@ * An utility that returns api to manage context registry of children data. | ||
const context = (0, react_1.createContext)(undefined); | ||
const useRegistry = (0, createUseDefinedContext_1.createUseDefinedContext)(context, `child data registry provider for '${friendlyName}' not found in context`); | ||
const useRegistry = (0, createUseDefinedContext_js_1.createUseDefinedContext)(context, `child data registry provider for '${friendlyName}' not found in context`); | ||
const useRegisterChildData = (id, data) => { | ||
@@ -21,0 +21,0 @@ const childData = useRegistry(); |
@@ -1,3 +0,3 @@ | ||
import { KeyboardHandlers } from './useKeyboardEventHandler'; | ||
import { Unselect } from '../unselect'; | ||
import { KeyboardHandlers } from './useKeyboardEventHandler.js'; | ||
import { Unselect } from '../unselect.js'; | ||
export interface ListNavigationHandlers<ItemType> { | ||
@@ -4,0 +4,0 @@ items: Array<ItemType>; |
@@ -5,5 +5,5 @@ "use strict"; | ||
const react_1 = require("react"); | ||
const unselect_1 = require("../unselect"); | ||
const unselect_js_1 = require("../unselect.js"); | ||
const useListNavigationHandlers = ({ items, onActiveItemChange, activeItem, }) => { | ||
const index = activeItem === unselect_1.unselect ? -1 : items.indexOf(activeItem); | ||
const index = activeItem === unselect_js_1.unselect ? -1 : items.indexOf(activeItem); | ||
const end = items.length - 1; | ||
@@ -10,0 +10,0 @@ return (0, react_1.useMemo)(() => ({ |
/// <reference types="react" /> | ||
import { createPubSub, Handler } from '../pubSub'; | ||
import { createPubSub, Handler } from '../pubSub.js'; | ||
/** | ||
@@ -8,3 +8,3 @@ * A hook that returns instance of a PubSub mechanism to enable two-way | ||
*/ | ||
export declare const usePubSub: () => import("../pubSub").PubSub; | ||
export declare const usePubSub: () => import("../pubSub.js").PubSub; | ||
interface PubSubContext { | ||
@@ -11,0 +11,0 @@ pubSub: ReturnType<typeof createPubSub>; |
@@ -5,5 +5,5 @@ "use strict"; | ||
const react_1 = require("react"); | ||
const createUseDefinedContext_1 = require("./createUseDefinedContext"); | ||
const createPropsContextProvider_1 = require("../createPropsContextProvider"); | ||
const pubSub_1 = require("../pubSub"); | ||
const createUseDefinedContext_js_1 = require("./createUseDefinedContext.js"); | ||
const createPropsContextProvider_js_1 = require("../createPropsContextProvider.js"); | ||
const pubSub_js_1 = require("../pubSub.js"); | ||
/** | ||
@@ -14,7 +14,7 @@ * A hook that returns instance of a PubSub mechanism to enable two-way | ||
*/ | ||
const usePubSub = () => (0, react_1.useMemo)(pubSub_1.createPubSub, []); | ||
const usePubSub = () => (0, react_1.useMemo)(pubSub_js_1.createPubSub, []); | ||
exports.usePubSub = usePubSub; | ||
const context = (0, react_1.createContext)(undefined); | ||
exports.PubSubProvider = (0, createPropsContextProvider_1.createPropsContextProvider)(context); | ||
exports.usePubSubContext = (0, createUseDefinedContext_1.createUseDefinedContext)(context, 'PubSub context not found. You should provide PubSub to the context'); | ||
exports.PubSubProvider = (0, createPropsContextProvider_js_1.createPropsContextProvider)(context); | ||
exports.usePubSubContext = (0, createUseDefinedContext_js_1.createUseDefinedContext)(context, 'PubSub context not found. You should provide PubSub to the context'); | ||
/** | ||
@@ -21,0 +21,0 @@ * A hook that activates the subscription for the time the component is mounted |
@@ -7,4 +7,4 @@ import { __rest } from "tslib"; | ||
import { focusRing } from '@clds/style-utils'; | ||
import { useListStyle } from './ListStyleProvider'; | ||
import { popoverMaxHeightVariant } from './theme'; | ||
import { useListStyle } from './ListStyleProvider.js'; | ||
import { popoverMaxHeightVariant } from './theme.js'; | ||
const PaperWithFocusRing = styled(Paper) ` | ||
@@ -11,0 +11,0 @@ max-height: ${popoverMaxHeightVariant((variant) => variant.maxHeight)}; |
/// <reference types="react" /> | ||
import { Unselect } from '../..'; | ||
import { Unselect } from '../../index.js'; | ||
export interface ListSelection { | ||
@@ -4,0 +4,0 @@ /** Id of currently selected item */ |
import { createContext, useCallback } from 'react'; | ||
import { createPropsContextProvider } from '../../utils/createPropsContextProvider'; | ||
import { createUseDefinedContext } from '../../utils/hooks/createUseDefinedContext'; | ||
import { createPropsContextProvider } from '../../utils/createPropsContextProvider.js'; | ||
import { createUseDefinedContext } from '../../utils/hooks/createUseDefinedContext.js'; | ||
const context = createContext(undefined); | ||
@@ -5,0 +5,0 @@ export const ListSelectionProvider = createPropsContextProvider(context); |
import { createContext } from 'react'; | ||
import { createPropsContextProvider } from '../../utils/createPropsContextProvider'; | ||
import { createUseDefinedContext } from '../../utils/hooks/createUseDefinedContext'; | ||
import { createPropsContextProvider } from '../../utils/createPropsContextProvider.js'; | ||
import { createUseDefinedContext } from '../../utils/hooks/createUseDefinedContext.js'; | ||
const listStyleContext = createContext(undefined); | ||
@@ -5,0 +5,0 @@ export const ListStyleProvider = createPropsContextProvider(listStyleContext); |
@@ -1,3 +0,3 @@ | ||
import { ListProps } from './List'; | ||
export declare const listTheme: import("@clds/component-theme/src/api/createTheme.types").Compiled<import("@clds/component-theme").Mixin<{ | ||
import { ListProps } from './List.js'; | ||
export declare const listTheme: import("@clds/component-theme/src/api/createTheme.types.js").Compiled<import("@clds/component-theme").Mixin<{ | ||
byMaxHeight: { | ||
@@ -14,3 +14,3 @@ md: { | ||
}; | ||
}>> & import("@clds/component-theme/src/api/createTheme.types").MappedChildren<{ | ||
}>> & import("@clds/component-theme/src/api/createTheme.types.js").MappedChildren<{ | ||
byMaxHeight: { | ||
@@ -28,3 +28,3 @@ md: { | ||
}> & { | ||
[idField]: import("@clds/component-theme/src/types").ThemeId; | ||
[idField]: import("@clds/component-theme/src/types.js").ThemeId; | ||
}; | ||
@@ -31,0 +31,0 @@ declare type ThemeProps = Pick<ListProps, 'maxHeight'>; |
import { createContext, useEffect, useMemo } from 'react'; | ||
import { createUseDefinedContext } from './hooks/createUseDefinedContext'; | ||
import { createUseDefinedContext } from './hooks/createUseDefinedContext.js'; | ||
/** | ||
@@ -4,0 +4,0 @@ * An utility that returns api to manage context registry of children data. |
@@ -1,3 +0,3 @@ | ||
import { KeyboardHandlers } from './useKeyboardEventHandler'; | ||
import { Unselect } from '../unselect'; | ||
import { KeyboardHandlers } from './useKeyboardEventHandler.js'; | ||
import { Unselect } from '../unselect.js'; | ||
export interface ListNavigationHandlers<ItemType> { | ||
@@ -4,0 +4,0 @@ items: Array<ItemType>; |
import { useMemo } from 'react'; | ||
import { unselect } from '../unselect'; | ||
import { unselect } from '../unselect.js'; | ||
export const useListNavigationHandlers = ({ items, onActiveItemChange, activeItem, }) => { | ||
@@ -4,0 +4,0 @@ const index = activeItem === unselect ? -1 : items.indexOf(activeItem); |
/// <reference types="react" /> | ||
import { createPubSub, Handler } from '../pubSub'; | ||
import { createPubSub, Handler } from '../pubSub.js'; | ||
/** | ||
@@ -8,3 +8,3 @@ * A hook that returns instance of a PubSub mechanism to enable two-way | ||
*/ | ||
export declare const usePubSub: () => import("../pubSub").PubSub; | ||
export declare const usePubSub: () => import("../pubSub.js").PubSub; | ||
interface PubSubContext { | ||
@@ -11,0 +11,0 @@ pubSub: ReturnType<typeof createPubSub>; |
import { createContext, useEffect, useMemo } from 'react'; | ||
import { createUseDefinedContext } from './createUseDefinedContext'; | ||
import { createPropsContextProvider } from '../createPropsContextProvider'; | ||
import { createPubSub } from '../pubSub'; | ||
import { createUseDefinedContext } from './createUseDefinedContext.js'; | ||
import { createPropsContextProvider } from '../createPropsContextProvider.js'; | ||
import { createPubSub } from '../pubSub.js'; | ||
/** | ||
@@ -6,0 +6,0 @@ * A hook that returns instance of a PubSub mechanism to enable two-way |
{ | ||
"name": "@clds/compound-components", | ||
"description": "", | ||
"version": "0.48.0", | ||
"version": "0.48.1", | ||
"author": "Cloudinary", | ||
@@ -15,8 +15,8 @@ "main": "./dist/cjs/index.js", | ||
"uuid": "7.0.2", | ||
"@clds/item": "0.48.0", | ||
"@clds/paper": "0.48.0", | ||
"@clds/style-utils": "0.48.0" | ||
"@clds/item": "0.48.1", | ||
"@clds/paper": "0.48.1", | ||
"@clds/style-utils": "0.48.1" | ||
}, | ||
"devDependencies": { | ||
"@clds/component-theme": "0.48.0" | ||
"@clds/component-theme": "0.48.1" | ||
}, | ||
@@ -23,0 +23,0 @@ "peerDependencies": { |
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import { createTheme, createVariant } from '@clds/component-theme'; | ||
import { ListProps } from './List'; | ||
import { ListProps } from './List.js'; | ||
@@ -6,0 +6,0 @@ export const listTheme = createTheme( |
import { useMemo } from 'react'; | ||
import { KeyboardHandlers } from './useKeyboardEventHandler'; | ||
import { Unselect, unselect } from '../unselect'; | ||
import { KeyboardHandlers } from './useKeyboardEventHandler.js'; | ||
import { Unselect, unselect } from '../unselect.js'; | ||
@@ -6,0 +6,0 @@ export interface ListNavigationHandlers<ItemType> { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
120032
+ Added@clds/blender@0.48.1(transitive)
+ Added@clds/common-definitions@0.48.1(transitive)
+ Added@clds/component-theme@0.48.1(transitive)
+ Added@clds/design-system-foundations@0.48.1(transitive)
+ Added@clds/item@0.48.1(transitive)
+ Added@clds/paper@0.48.1(transitive)
+ Added@clds/style-utils@0.48.1(transitive)
+ Added@clds/theme-helper@0.48.1(transitive)
+ Added@clds/themes@0.48.1(transitive)
+ Added@clds/typography@0.48.1(transitive)
- Removed@clds/blender@0.48.0(transitive)
- Removed@clds/common-definitions@0.48.0(transitive)
- Removed@clds/component-theme@0.48.0(transitive)
- Removed@clds/design-system-foundations@0.48.0(transitive)
- Removed@clds/item@0.48.0(transitive)
- Removed@clds/paper@0.48.0(transitive)
- Removed@clds/style-utils@0.48.0(transitive)
- Removed@clds/theme-helper@0.48.0(transitive)
- Removed@clds/themes@0.48.0(transitive)
- Removed@clds/typography@0.48.0(transitive)
Updated@clds/item@0.48.1
Updated@clds/paper@0.48.1
Updated@clds/style-utils@0.48.1