Skip to content

Commit

Permalink
Explicitly mark the package as an ES module (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
szhsin authored Dec 4, 2024
1 parent 1187c1b commit 06d7e09
Show file tree
Hide file tree
Showing 72 changed files with 181 additions and 178 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var common = require('../../common.js');
var useFocusCapture = require('../../hooks/useFocusCapture.js');
var common = require('../../common.cjs');
var useFocusCapture = require('../../hooks/useFocusCapture.cjs');

const scrollIntoView = element => element?.scrollIntoView({
block: 'nearest'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var React = require('react');
var useToggle = require('../../hooks/useToggle.js');
var useToggle = require('../../hooks/useToggle.cjs');

const dropdownToggle = ({
closeOnSelect = true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use strict';

var autocompleteLite = require('./autocompleteLite.js');
var autoFocus = require('./autoFocus.js');
var autoInline = require('./autoInline.js');
var dropdownToggle = require('./dropdownToggle.js');
var inputFocus = require('./inputFocus.js');
var inputToggle = require('./inputToggle.js');
var label = require('./label.js');
var multiInput = require('./multiInput.js');
var nonblurToggle = require('./nonblurToggle.js');
var autocompleteLite = require('./autocompleteLite.cjs');
var autoFocus = require('./autoFocus.cjs');
var autoInline = require('./autoInline.cjs');
var dropdownToggle = require('./dropdownToggle.cjs');
var inputFocus = require('./inputFocus.cjs');
var inputToggle = require('./inputToggle.cjs');
var label = require('./label.cjs');
var multiInput = require('./multiInput.cjs');
var nonblurToggle = require('./nonblurToggle.cjs');



Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

var common = require('../../common.js');
var useToggle = require('../../hooks/useToggle.js');
var useFocusCapture = require('../../hooks/useFocusCapture.js');
var common = require('../../common.cjs');
var useToggle = require('../../hooks/useToggle.cjs');
var useFocusCapture = require('../../hooks/useFocusCapture.cjs');

const inputToggle = () => ({
id,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var common = require('../../common.js');
var common = require('../../common.cjs');

const label = () => ({
id
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var common = require('../../common.js');
var common = require('../../common.cjs');

const nonblurToggle = () => ({
id,
Expand Down
10 changes: 10 additions & 0 deletions dist/cjs/features/molecule/autocomplete.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use strict';

var mergeModules = require('../../utils/mergeModules.cjs');
var autocompleteLite = require('../atom/autocompleteLite.cjs');
var inputToggle = require('../atom/inputToggle.cjs');
var label = require('../atom/label.cjs');

const autocomplete = props => mergeModules.mergeModules(autocompleteLite.autocompleteLite(props), inputToggle.inputToggle(), label.label());

exports.autocomplete = autocomplete;
10 changes: 0 additions & 10 deletions dist/cjs/features/molecule/autocomplete.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

var mergeModules = require('../../utils/mergeModules.js');
var autocompleteLite = require('../atom/autocompleteLite.js');
var dropdownToggle = require('../atom/dropdownToggle.js');
var mergeModules = require('../../utils/mergeModules.cjs');
var autocompleteLite = require('../atom/autocompleteLite.cjs');
var dropdownToggle = require('../atom/dropdownToggle.cjs');

const dropdown = props => mergeModules.mergeModules(autocompleteLite.autocompleteLite({
...props,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use strict';

var autocomplete = require('./autocomplete.js');
var dropdown = require('./dropdown.js');
var multiSelect = require('./multiSelect.js');
var multiSelectDropdown = require('./multiSelectDropdown.js');
var supercomplete = require('./supercomplete.js');
var autocomplete = require('./autocomplete.cjs');
var dropdown = require('./dropdown.cjs');
var multiSelect = require('./multiSelect.cjs');
var multiSelectDropdown = require('./multiSelectDropdown.cjs');
var supercomplete = require('./supercomplete.cjs');



Expand Down
15 changes: 15 additions & 0 deletions dist/cjs/features/molecule/multiSelect.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

var mergeModules = require('../../utils/mergeModules.cjs');
var autocompleteLite = require('../atom/autocompleteLite.cjs');
var nonblurToggle = require('../atom/nonblurToggle.cjs');
var label = require('../atom/label.cjs');
var inputFocus = require('../atom/inputFocus.cjs');
var multiInput = require('../atom/multiInput.cjs');

const multiSelect = props => mergeModules.mergeModules(autocompleteLite.autocompleteLite({
...props,
select: true
}), nonblurToggle.nonblurToggle(), label.label(), inputFocus.inputFocus(), multiInput.multiInput());

exports.multiSelect = multiSelect;
15 changes: 0 additions & 15 deletions dist/cjs/features/molecule/multiSelect.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

var mergeModules = require('../../utils/mergeModules.js');
var multiInput = require('../atom/multiInput.js');
var dropdown = require('./dropdown.js');
var mergeModules = require('../../utils/mergeModules.cjs');
var multiInput = require('../atom/multiInput.cjs');
var dropdown = require('./dropdown.cjs');

const multiSelectDropdown = props => mergeModules.mergeModules(dropdown.dropdown(props), multiInput.multiInput());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

var mergeModules = require('../../utils/mergeModules.js');
var autocomplete = require('./autocomplete.js');
var autoInline = require('../atom/autoInline.js');
var mergeModules = require('../../utils/mergeModules.cjs');
var autocomplete = require('./autocomplete.cjs');
var autoInline = require('../atom/autoInline.cjs');

const supercomplete = props => mergeModules.mergeModules(autocomplete.autocomplete({
...props,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

var React = require('react');
var useId = require('./useId.js');
var common = require('../common.js');
var useId = require('./useId.cjs');
var common = require('../common.cjs');

const useAutocomplete = ({
onChange,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var common = require('../common.js');
var useAutocomplete = require('./useAutocomplete.js');
var common = require('../common.cjs');
var useAutocomplete = require('./useAutocomplete.cjs');

const useCombobox = ({
isEqual = common.defaultEqual,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var useMutableState = require('./useMutableState.js');
var useMutableState = require('./useMutableState.cjs');

const useFocusCapture = focusRef => {
const mutable = useMutableState.useMutableState({});
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var common = require('../common.js');
var useAutocomplete = require('./useAutocomplete.js');
var common = require('../common.cjs');
var useAutocomplete = require('./useAutocomplete.cjs');

const useMultiSelect = ({
isEqual = common.defaultEqual,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var useMutableState = require('./useMutableState.js');
var useMutableState = require('./useMutableState.cjs');

const useToggle = (open, setOpen) => {
const mutable = useMutableState.useMutableState({});
Expand Down
20 changes: 10 additions & 10 deletions dist/cjs/index.js → dist/cjs/index.cjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
'use strict';

var useCombobox = require('./hooks/useCombobox.js');
var useMultiSelect = require('./hooks/useMultiSelect.js');
var autocompleteLite = require('./features/atom/autocompleteLite.js');
var autocomplete = require('./features/molecule/autocomplete.js');
var dropdown = require('./features/molecule/dropdown.js');
var multiSelect = require('./features/molecule/multiSelect.js');
var multiSelectDropdown = require('./features/molecule/multiSelectDropdown.js');
var supercomplete = require('./features/molecule/supercomplete.js');
var mergeGroupedItems = require('./utils/mergeGroupedItems.js');
var mergeModules = require('./utils/mergeModules.js');
var useCombobox = require('./hooks/useCombobox.cjs');
var useMultiSelect = require('./hooks/useMultiSelect.cjs');
var autocompleteLite = require('./features/atom/autocompleteLite.cjs');
var autocomplete = require('./features/molecule/autocomplete.cjs');
var dropdown = require('./features/molecule/dropdown.cjs');
var multiSelect = require('./features/molecule/multiSelect.cjs');
var multiSelectDropdown = require('./features/molecule/multiSelectDropdown.cjs');
var supercomplete = require('./features/molecule/supercomplete.cjs');
var mergeGroupedItems = require('./utils/mergeGroupedItems.cjs');
var mergeModules = require('./utils/mergeModules.cjs');



Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var mergeObjects = require('./mergeObjects.js');
var mergeObjects = require('./mergeObjects.cjs');

const mergeModules = (...modules) => cx => modules.reduce((accu, curr) => mergeObjects.mergeObjects(accu, curr(cx)), {});

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { buttonProps, defaultFocusIndex, getId } from '../../common.js';
import { useFocusCapture } from '../../hooks/useFocusCapture.js';
import { buttonProps, defaultFocusIndex, getId } from '../../common.mjs';
import { useFocusCapture } from '../../hooks/useFocusCapture.mjs';

const scrollIntoView = element => element?.scrollIntoView({
block: 'nearest'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useRef, useEffect } from 'react';
import { useToggle } from '../../hooks/useToggle.js';
import { useToggle } from '../../hooks/useToggle.mjs';

const dropdownToggle = ({
closeOnSelect = true,
Expand Down
9 changes: 0 additions & 9 deletions dist/esm/features/atom/index.js

This file was deleted.

9 changes: 9 additions & 0 deletions dist/esm/features/atom/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export { autocompleteLite } from './autocompleteLite.mjs';
export { autoFocus } from './autoFocus.mjs';
export { autoInline } from './autoInline.mjs';
export { dropdownToggle } from './dropdownToggle.mjs';
export { inputFocus } from './inputFocus.mjs';
export { inputToggle } from './inputToggle.mjs';
export { label } from './label.mjs';
export { multiInput } from './multiInput.mjs';
export { nonblurToggle } from './nonblurToggle.mjs';
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getInputToggleProps } from '../../common.js';
import { useToggle } from '../../hooks/useToggle.js';
import { useFocusCapture } from '../../hooks/useFocusCapture.js';
import { getInputToggleProps } from '../../common.mjs';
import { useToggle } from '../../hooks/useToggle.mjs';
import { useFocusCapture } from '../../hooks/useFocusCapture.mjs';

const inputToggle = () => ({
id,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getId } from '../../common.js';
import { getId } from '../../common.mjs';

const label = () => ({
id
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getInputToggleProps } from '../../common.js';
import { getInputToggleProps } from '../../common.mjs';

const nonblurToggle = () => ({
id,
Expand Down
8 changes: 0 additions & 8 deletions dist/esm/features/molecule/autocomplete.js

This file was deleted.

8 changes: 8 additions & 0 deletions dist/esm/features/molecule/autocomplete.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { mergeModules } from '../../utils/mergeModules.mjs';
import { autocompleteLite } from '../atom/autocompleteLite.mjs';
import { inputToggle } from '../atom/inputToggle.mjs';
import { label } from '../atom/label.mjs';

const autocomplete = props => mergeModules(autocompleteLite(props), inputToggle(), label());

export { autocomplete };
11 changes: 0 additions & 11 deletions dist/esm/features/molecule/dropdown.js

This file was deleted.

11 changes: 11 additions & 0 deletions dist/esm/features/molecule/dropdown.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { mergeModules } from '../../utils/mergeModules.mjs';
import { autocompleteLite } from '../atom/autocompleteLite.mjs';
import { dropdownToggle } from '../atom/dropdownToggle.mjs';

const dropdown = props => mergeModules(autocompleteLite({
...props,
select: true,
deselectOnClear: false
}), dropdownToggle(props));

export { dropdown };
5 changes: 0 additions & 5 deletions dist/esm/features/molecule/index.js

This file was deleted.

5 changes: 5 additions & 0 deletions dist/esm/features/molecule/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export { autocomplete } from './autocomplete.mjs';
export { dropdown } from './dropdown.mjs';
export { multiSelect } from './multiSelect.mjs';
export { multiSelectDropdown } from './multiSelectDropdown.mjs';
export { supercomplete } from './supercomplete.mjs';
13 changes: 0 additions & 13 deletions dist/esm/features/molecule/multiSelect.js

This file was deleted.

13 changes: 13 additions & 0 deletions dist/esm/features/molecule/multiSelect.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { mergeModules } from '../../utils/mergeModules.mjs';
import { autocompleteLite } from '../atom/autocompleteLite.mjs';
import { nonblurToggle } from '../atom/nonblurToggle.mjs';
import { label } from '../atom/label.mjs';
import { inputFocus } from '../atom/inputFocus.mjs';
import { multiInput } from '../atom/multiInput.mjs';

const multiSelect = props => mergeModules(autocompleteLite({
...props,
select: true
}), nonblurToggle(), label(), inputFocus(), multiInput());

export { multiSelect };
Loading

0 comments on commit 06d7e09

Please sign in to comment.