@airtable/blocks 0.0.0-experimental-3e47d4d04-20250909 → 0.0.0-experimental-e625869e5-20251002
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/dist/esm/base/types/airtable_interface.js +1 -3
- package/dist/esm/base/ui/block_wrapper.js +131 -96
- package/dist/esm/base/ui/cell_renderer.js +5 -176
- package/dist/esm/base/ui/global_alert.js +7 -3
- package/dist/esm/base/ui/global_css_helpers.js +28 -0
- package/dist/esm/base/ui/ui.js +1 -21
- package/dist/esm/base/ui/unstable_standalone_ui.js +28 -26
- package/dist/esm/base/ui/use_loadable.js +2 -3
- package/dist/esm/interface/types/airtable_interface.js +2 -3
- package/dist/esm/interface/ui/block_wrapper.js +45 -54
- package/dist/esm/interface/ui/cell_renderer.js +19 -0
- package/dist/esm/interface/ui/global_css_helpers.js +17 -0
- package/dist/esm/interface/ui/ui.js +1 -1
- package/dist/esm/interface/ui/use_custom_properties.js +43 -14
- package/dist/esm/shared/private_utils.js +51 -1
- package/dist/esm/shared/sdk_core.js +1 -1
- package/dist/esm/shared/ui/cell_renderer.js +137 -0
- package/dist/esm/shared/ui/use_watchable.js +2 -3
- package/dist/types/src/base/types/airtable_interface.d.ts +1 -3
- package/dist/types/src/base/types/airtable_interface.d.ts.map +1 -1
- package/dist/types/src/base/ui/block_wrapper.d.ts +2 -16
- package/dist/types/src/base/ui/block_wrapper.d.ts.map +1 -1
- package/dist/types/src/base/ui/cell_renderer.d.ts +6 -58
- package/dist/types/src/base/ui/cell_renderer.d.ts.map +1 -1
- package/dist/types/src/base/ui/global_css_helpers.d.ts +4 -0
- package/dist/types/src/base/ui/global_css_helpers.d.ts.map +1 -0
- package/dist/types/src/base/ui/ui.d.ts +1 -21
- package/dist/types/src/base/ui/ui.d.ts.map +1 -1
- package/dist/types/src/base/ui/unstable_standalone_ui.d.ts +2 -22
- package/dist/types/src/base/ui/unstable_standalone_ui.d.ts.map +1 -1
- package/dist/types/src/base/ui/use_loadable.d.ts.map +1 -1
- package/dist/types/src/interface/types/airtable_interface.d.ts +6 -4
- package/dist/types/src/interface/types/airtable_interface.d.ts.map +1 -1
- package/dist/types/src/interface/ui/block_wrapper.d.ts +1 -4
- package/dist/types/src/interface/ui/block_wrapper.d.ts.map +1 -1
- package/dist/types/src/interface/ui/cell_renderer.d.ts +19 -0
- package/dist/types/src/interface/ui/cell_renderer.d.ts.map +1 -0
- package/dist/types/src/interface/ui/global_css_helpers.d.ts +3 -0
- package/dist/types/src/interface/ui/global_css_helpers.d.ts.map +1 -0
- package/dist/types/src/interface/ui/ui.d.ts +1 -1
- package/dist/types/src/interface/ui/ui.d.ts.map +1 -1
- package/dist/types/src/interface/ui/use_custom_properties.d.ts +7 -0
- package/dist/types/src/interface/ui/use_custom_properties.d.ts.map +1 -1
- package/dist/types/src/shared/private_utils.d.ts +9 -1
- package/dist/types/src/shared/private_utils.d.ts.map +1 -1
- package/dist/types/src/shared/ui/cell_renderer.d.ts +32 -0
- package/dist/types/src/shared/ui/cell_renderer.d.ts.map +1 -0
- package/dist/types/src/shared/ui/use_watchable.d.ts.map +1 -1
- package/package.json +5 -39
- package/dist/esm/base/ui/baymax_utils.js +0 -455
- package/dist/esm/base/ui/box.js +0 -77
- package/dist/esm/base/ui/button.js +0 -143
- package/dist/esm/base/ui/choice_token.js +0 -84
- package/dist/esm/base/ui/collaborator_token.js +0 -115
- package/dist/esm/base/ui/color_palette.js +0 -185
- package/dist/esm/base/ui/color_palette_synced.js +0 -62
- package/dist/esm/base/ui/confirmation_dialog.js +0 -96
- package/dist/esm/base/ui/control_sizes.js +0 -92
- package/dist/esm/base/ui/create_detect_element_resize.js +0 -197
- package/dist/esm/base/ui/css_helpers.js +0 -17
- package/dist/esm/base/ui/dialog.js +0 -93
- package/dist/esm/base/ui/dialog_close_button.js +0 -96
- package/dist/esm/base/ui/field_icon.js +0 -37
- package/dist/esm/base/ui/field_picker.js +0 -91
- package/dist/esm/base/ui/field_picker_synced.js +0 -59
- package/dist/esm/base/ui/form_field.js +0 -102
- package/dist/esm/base/ui/geometry/geometry.js +0 -9
- package/dist/esm/base/ui/geometry/point.js +0 -12
- package/dist/esm/base/ui/geometry/rect.js +0 -44
- package/dist/esm/base/ui/geometry/size.js +0 -12
- package/dist/esm/base/ui/heading.js +0 -125
- package/dist/esm/base/ui/icon.js +0 -102
- package/dist/esm/base/ui/icon_config.js +0 -423
- package/dist/esm/base/ui/input.js +0 -152
- package/dist/esm/base/ui/input_synced.js +0 -59
- package/dist/esm/base/ui/key_codes.js +0 -66
- package/dist/esm/base/ui/label.js +0 -73
- package/dist/esm/base/ui/link.js +0 -189
- package/dist/esm/base/ui/loader.js +0 -52
- package/dist/esm/base/ui/modal.js +0 -135
- package/dist/esm/base/ui/model_picker_select.js +0 -50
- package/dist/esm/base/ui/popover.js +0 -312
- package/dist/esm/base/ui/progress_bar.js +0 -106
- package/dist/esm/base/ui/record_card.js +0 -556
- package/dist/esm/base/ui/record_card_list.js +0 -292
- package/dist/esm/base/ui/select.js +0 -182
- package/dist/esm/base/ui/select_and_select_buttons_helpers.js +0 -53
- package/dist/esm/base/ui/select_buttons.js +0 -150
- package/dist/esm/base/ui/select_buttons_synced.js +0 -55
- package/dist/esm/base/ui/select_synced.js +0 -58
- package/dist/esm/base/ui/switch.js +0 -160
- package/dist/esm/base/ui/switch_synced.js +0 -46
- package/dist/esm/base/ui/synced.js +0 -39
- package/dist/esm/base/ui/system/all_styles_set.js +0 -86
- package/dist/esm/base/ui/system/appearance/appearance_set.js +0 -21
- package/dist/esm/base/ui/system/appearance/background_color.js +0 -12
- package/dist/esm/base/ui/system/appearance/border.js +0 -48
- package/dist/esm/base/ui/system/appearance/border_radius.js +0 -12
- package/dist/esm/base/ui/system/appearance/box_shadow.js +0 -12
- package/dist/esm/base/ui/system/appearance/opacity.js +0 -12
- package/dist/esm/base/ui/system/dimensions/dimensions_set.js +0 -23
- package/dist/esm/base/ui/system/dimensions/height.js +0 -12
- package/dist/esm/base/ui/system/dimensions/max_height.js +0 -12
- package/dist/esm/base/ui/system/dimensions/max_width.js +0 -12
- package/dist/esm/base/ui/system/dimensions/min_height.js +0 -12
- package/dist/esm/base/ui/system/dimensions/min_width.js +0 -12
- package/dist/esm/base/ui/system/dimensions/width.js +0 -12
- package/dist/esm/base/ui/system/display.js +0 -13
- package/dist/esm/base/ui/system/flex_container/align_content.js +0 -9
- package/dist/esm/base/ui/system/flex_container/align_items.js +0 -9
- package/dist/esm/base/ui/system/flex_container/flex_container_set.js +0 -23
- package/dist/esm/base/ui/system/flex_container/flex_direction.js +0 -9
- package/dist/esm/base/ui/system/flex_container/flex_wrap.js +0 -9
- package/dist/esm/base/ui/system/flex_container/justify_content.js +0 -9
- package/dist/esm/base/ui/system/flex_container/justify_items.js +0 -10
- package/dist/esm/base/ui/system/flex_item/align_self.js +0 -9
- package/dist/esm/base/ui/system/flex_item/flex.js +0 -9
- package/dist/esm/base/ui/system/flex_item/flex_basis.js +0 -9
- package/dist/esm/base/ui/system/flex_item/flex_grow.js +0 -9
- package/dist/esm/base/ui/system/flex_item/flex_item_set.js +0 -25
- package/dist/esm/base/ui/system/flex_item/flex_shrink.js +0 -9
- package/dist/esm/base/ui/system/flex_item/justify_self.js +0 -10
- package/dist/esm/base/ui/system/flex_item/order.js +0 -9
- package/dist/esm/base/ui/system/index.js +0 -96
- package/dist/esm/base/ui/system/overflow.js +0 -15
- package/dist/esm/base/ui/system/position/bottom.js +0 -17
- package/dist/esm/base/ui/system/position/left.js +0 -17
- package/dist/esm/base/ui/system/position/position.js +0 -9
- package/dist/esm/base/ui/system/position/position_set.js +0 -23
- package/dist/esm/base/ui/system/position/right.js +0 -17
- package/dist/esm/base/ui/system/position/top.js +0 -17
- package/dist/esm/base/ui/system/position/z_index.js +0 -12
- package/dist/esm/base/ui/system/spacing/margin.js +0 -65
- package/dist/esm/base/ui/system/spacing/padding.js +0 -58
- package/dist/esm/base/ui/system/spacing/spacing_set.js +0 -15
- package/dist/esm/base/ui/system/typography/font_family.js +0 -12
- package/dist/esm/base/ui/system/typography/font_size.js +0 -12
- package/dist/esm/base/ui/system/typography/font_style.js +0 -9
- package/dist/esm/base/ui/system/typography/font_weight.js +0 -12
- package/dist/esm/base/ui/system/typography/letter_spacing.js +0 -12
- package/dist/esm/base/ui/system/typography/line_height.js +0 -9
- package/dist/esm/base/ui/system/typography/text_align.js +0 -9
- package/dist/esm/base/ui/system/typography/text_color.js +0 -12
- package/dist/esm/base/ui/system/typography/text_decoration.js +0 -9
- package/dist/esm/base/ui/system/typography/text_transform.js +0 -9
- package/dist/esm/base/ui/system/typography/typography_set.js +0 -31
- package/dist/esm/base/ui/system/utils/csstype.js +0 -1
- package/dist/esm/base/ui/system/utils/ensure_numbers_are_within_scale.js +0 -36
- package/dist/esm/base/ui/system/utils/get_style_props_for_responsive_prop.js +0 -67
- package/dist/esm/base/ui/system/utils/types.js +0 -1
- package/dist/esm/base/ui/table_picker.js +0 -64
- package/dist/esm/base/ui/table_picker_synced.js +0 -55
- package/dist/esm/base/ui/text.js +0 -109
- package/dist/esm/base/ui/text_button.js +0 -189
- package/dist/esm/base/ui/theme/default_theme/button_variants.js +0 -53
- package/dist/esm/base/ui/theme/default_theme/control_sizes.js +0 -96
- package/dist/esm/base/ui/theme/default_theme/heading_styles.js +0 -93
- package/dist/esm/base/ui/theme/default_theme/index.js +0 -31
- package/dist/esm/base/ui/theme/default_theme/input_variants.js +0 -32
- package/dist/esm/base/ui/theme/default_theme/link_variants.js +0 -29
- package/dist/esm/base/ui/theme/default_theme/select_buttons_variants.js +0 -66
- package/dist/esm/base/ui/theme/default_theme/select_variants.js +0 -44
- package/dist/esm/base/ui/theme/default_theme/switch_variants.js +0 -78
- package/dist/esm/base/ui/theme/default_theme/text_button_variants.js +0 -38
- package/dist/esm/base/ui/theme/default_theme/text_styles.js +0 -75
- package/dist/esm/base/ui/theme/default_theme/tokens.js +0 -205
- package/dist/esm/base/ui/theme/theme_context.js +0 -7
- package/dist/esm/base/ui/theme/use_theme.js +0 -4
- package/dist/esm/base/ui/tooltip.js +0 -165
- package/dist/esm/base/ui/types/aria_props.js +0 -1
- package/dist/esm/base/ui/types/data_attributes_prop.js +0 -1
- package/dist/esm/base/ui/types/tooltip_anchor_props.js +0 -1
- package/dist/esm/base/ui/use_form_field.js +0 -14
- package/dist/esm/base/ui/use_styled_system.js +0 -19
- package/dist/esm/base/ui/use_text_color_for_background_color.js +0 -9
- package/dist/esm/base/ui/view_picker.js +0 -82
- package/dist/esm/base/ui/view_picker_synced.js +0 -59
- package/dist/esm/base/ui/viewport_constraint.js +0 -120
- package/dist/esm/base/ui/with_styled_system.js +0 -120
- package/dist/types/src/base/ui/baymax_utils.d.ts +0 -2
- package/dist/types/src/base/ui/baymax_utils.d.ts.map +0 -1
- package/dist/types/src/base/ui/box.d.ts +0 -35
- package/dist/types/src/base/ui/box.d.ts.map +0 -1
- package/dist/types/src/base/ui/button.d.ts +0 -86
- package/dist/types/src/base/ui/button.d.ts.map +0 -1
- package/dist/types/src/base/ui/choice_token.d.ts +0 -49
- package/dist/types/src/base/ui/choice_token.d.ts.map +0 -1
- package/dist/types/src/base/ui/collaborator_token.d.ts +0 -45
- package/dist/types/src/base/ui/collaborator_token.d.ts.map +0 -1
- package/dist/types/src/base/ui/color_palette.d.ts +0 -77
- package/dist/types/src/base/ui/color_palette.d.ts.map +0 -1
- package/dist/types/src/base/ui/color_palette_synced.d.ts +0 -30
- package/dist/types/src/base/ui/color_palette_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/confirmation_dialog.d.ts +0 -66
- package/dist/types/src/base/ui/confirmation_dialog.d.ts.map +0 -1
- package/dist/types/src/base/ui/control_sizes.d.ts +0 -16
- package/dist/types/src/base/ui/control_sizes.d.ts.map +0 -1
- package/dist/types/src/base/ui/css_helpers.d.ts +0 -6
- package/dist/types/src/base/ui/css_helpers.d.ts.map +0 -1
- package/dist/types/src/base/ui/dialog.d.ts +0 -58
- package/dist/types/src/base/ui/dialog.d.ts.map +0 -1
- package/dist/types/src/base/ui/dialog_close_button.d.ts +0 -40
- package/dist/types/src/base/ui/dialog_close_button.d.ts.map +0 -1
- package/dist/types/src/base/ui/field_icon.d.ts +0 -25
- package/dist/types/src/base/ui/field_icon.d.ts.map +0 -1
- package/dist/types/src/base/ui/field_picker.d.ts +0 -34
- package/dist/types/src/base/ui/field_picker.d.ts.map +0 -1
- package/dist/types/src/base/ui/field_picker_synced.d.ts +0 -18
- package/dist/types/src/base/ui/field_picker_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/form_field.d.ts +0 -42
- package/dist/types/src/base/ui/form_field.d.ts.map +0 -1
- package/dist/types/src/base/ui/geometry/geometry.d.ts +0 -3
- package/dist/types/src/base/ui/geometry/geometry.d.ts.map +0 -1
- package/dist/types/src/base/ui/geometry/point.d.ts +0 -2
- package/dist/types/src/base/ui/geometry/point.d.ts.map +0 -1
- package/dist/types/src/base/ui/geometry/rect.d.ts +0 -2
- package/dist/types/src/base/ui/geometry/rect.d.ts.map +0 -1
- package/dist/types/src/base/ui/geometry/size.d.ts +0 -2
- package/dist/types/src/base/ui/geometry/size.d.ts.map +0 -1
- package/dist/types/src/base/ui/heading.d.ts +0 -64
- package/dist/types/src/base/ui/heading.d.ts.map +0 -1
- package/dist/types/src/base/ui/icon.d.ts +0 -45
- package/dist/types/src/base/ui/icon.d.ts.map +0 -1
- package/dist/types/src/base/ui/icon_config.d.ts +0 -424
- package/dist/types/src/base/ui/icon_config.d.ts.map +0 -1
- package/dist/types/src/base/ui/input.d.ts +0 -120
- package/dist/types/src/base/ui/input.d.ts.map +0 -1
- package/dist/types/src/base/ui/input_synced.d.ts +0 -18
- package/dist/types/src/base/ui/input_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/key_codes.d.ts +0 -2
- package/dist/types/src/base/ui/key_codes.d.ts.map +0 -1
- package/dist/types/src/base/ui/label.d.ts +0 -35
- package/dist/types/src/base/ui/label.d.ts.map +0 -1
- package/dist/types/src/base/ui/link.d.ts +0 -84
- package/dist/types/src/base/ui/link.d.ts.map +0 -1
- package/dist/types/src/base/ui/loader.d.ts +0 -38
- package/dist/types/src/base/ui/loader.d.ts.map +0 -1
- package/dist/types/src/base/ui/modal.d.ts +0 -54
- package/dist/types/src/base/ui/modal.d.ts.map +0 -1
- package/dist/types/src/base/ui/model_picker_select.d.ts +0 -19
- package/dist/types/src/base/ui/model_picker_select.d.ts.map +0 -1
- package/dist/types/src/base/ui/popover.d.ts +0 -106
- package/dist/types/src/base/ui/popover.d.ts.map +0 -1
- package/dist/types/src/base/ui/progress_bar.d.ts +0 -60
- package/dist/types/src/base/ui/progress_bar.d.ts.map +0 -1
- package/dist/types/src/base/ui/record_card.d.ts +0 -80
- package/dist/types/src/base/ui/record_card.d.ts.map +0 -1
- package/dist/types/src/base/ui/record_card_list.d.ts +0 -88
- package/dist/types/src/base/ui/record_card_list.d.ts.map +0 -1
- package/dist/types/src/base/ui/select.d.ts +0 -82
- package/dist/types/src/base/ui/select.d.ts.map +0 -1
- package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts +0 -25
- package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts.map +0 -1
- package/dist/types/src/base/ui/select_buttons.d.ts +0 -56
- package/dist/types/src/base/ui/select_buttons.d.ts.map +0 -1
- package/dist/types/src/base/ui/select_buttons_synced.d.ts +0 -18
- package/dist/types/src/base/ui/select_buttons_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/select_synced.d.ts +0 -18
- package/dist/types/src/base/ui/select_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/switch.d.ts +0 -82
- package/dist/types/src/base/ui/switch.d.ts.map +0 -1
- package/dist/types/src/base/ui/switch_synced.d.ts +0 -18
- package/dist/types/src/base/ui/switch_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/synced.d.ts +0 -23
- package/dist/types/src/base/ui/synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/all_styles_set.d.ts +0 -85
- package/dist/types/src/base/ui/system/all_styles_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts +0 -14
- package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/background_color.d.ts +0 -12
- package/dist/types/src/base/ui/system/appearance/background_color.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/border.d.ts +0 -30
- package/dist/types/src/base/ui/system/appearance/border.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/border_radius.d.ts +0 -12
- package/dist/types/src/base/ui/system/appearance/border_radius.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts +0 -12
- package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/opacity.d.ts +0 -12
- package/dist/types/src/base/ui/system/appearance/opacity.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts +0 -15
- package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/height.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/height.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/max_height.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/max_height.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/max_width.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/max_width.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/min_height.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/min_height.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/min_width.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/min_width.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/width.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/width.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/display.d.ts +0 -13
- package/dist/types/src/base/ui/system/display.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/align_content.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/align_content.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/align_items.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/align_items.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts +0 -15
- package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/align_self.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/align_self.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/flex.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts +0 -16
- package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/order.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/order.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/index.d.ts +0 -106
- package/dist/types/src/base/ui/system/index.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/overflow.d.ts +0 -17
- package/dist/types/src/base/ui/system/overflow.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/bottom.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/bottom.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/left.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/left.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/position.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/position.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/position_set.d.ts +0 -15
- package/dist/types/src/base/ui/system/position/position_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/right.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/right.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/top.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/top.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/z_index.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/z_index.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/spacing/margin.d.ts +0 -24
- package/dist/types/src/base/ui/system/spacing/margin.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/spacing/padding.d.ts +0 -24
- package/dist/types/src/base/ui/system/spacing/padding.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts +0 -11
- package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/font_family.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/font_family.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/font_size.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/font_size.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/font_style.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/font_style.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/font_weight.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/font_weight.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/line_height.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/line_height.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/text_align.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/text_align.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/text_color.d.ts +0 -16
- package/dist/types/src/base/ui/system/typography/text_color.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/text_decoration.d.ts +0 -14
- package/dist/types/src/base/ui/system/typography/text_decoration.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/text_transform.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/text_transform.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/typography_set.d.ts +0 -19
- package/dist/types/src/base/ui/system/typography/typography_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/csstype.d.ts +0 -3977
- package/dist/types/src/base/ui/system/utils/csstype.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/ensure_numbers_are_within_scale.d.ts +0 -2
- package/dist/types/src/base/ui/system/utils/ensure_numbers_are_within_scale.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/get_style_props_for_responsive_prop.d.ts +0 -2
- package/dist/types/src/base/ui/system/utils/get_style_props_for_responsive_prop.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/types.d.ts +0 -31
- package/dist/types/src/base/ui/system/utils/types.d.ts.map +0 -1
- package/dist/types/src/base/ui/table_picker.d.ts +0 -28
- package/dist/types/src/base/ui/table_picker.d.ts.map +0 -1
- package/dist/types/src/base/ui/table_picker_synced.d.ts +0 -18
- package/dist/types/src/base/ui/table_picker_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/text.d.ts +0 -66
- package/dist/types/src/base/ui/text.d.ts.map +0 -1
- package/dist/types/src/base/ui/text_button.d.ts +0 -83
- package/dist/types/src/base/ui/text_button.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/button_variants.d.ts +0 -8
- package/dist/types/src/base/ui/theme/default_theme/button_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/control_sizes.d.ts +0 -107
- package/dist/types/src/base/ui/theme/default_theme/control_sizes.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/heading_styles.d.ts +0 -11
- package/dist/types/src/base/ui/theme/default_theme/heading_styles.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/index.d.ts +0 -342
- package/dist/types/src/base/ui/theme/default_theme/index.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/input_variants.d.ts +0 -5
- package/dist/types/src/base/ui/theme/default_theme/input_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/link_variants.d.ts +0 -7
- package/dist/types/src/base/ui/theme/default_theme/link_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/select_buttons_variants.d.ts +0 -8
- package/dist/types/src/base/ui/theme/default_theme/select_buttons_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/select_variants.d.ts +0 -5
- package/dist/types/src/base/ui/theme/default_theme/select_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/switch_variants.d.ts +0 -16
- package/dist/types/src/base/ui/theme/default_theme/switch_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/text_button_variants.d.ts +0 -7
- package/dist/types/src/base/ui/theme/default_theme/text_button_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/text_styles.d.ts +0 -76
- package/dist/types/src/base/ui/theme/default_theme/text_styles.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/tokens.d.ts +0 -111
- package/dist/types/src/base/ui/theme/default_theme/tokens.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/theme_context.d.ts +0 -342
- package/dist/types/src/base/ui/theme/theme_context.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/use_theme.d.ts +0 -342
- package/dist/types/src/base/ui/theme/use_theme.d.ts.map +0 -1
- package/dist/types/src/base/ui/tooltip.d.ts +0 -64
- package/dist/types/src/base/ui/tooltip.d.ts.map +0 -1
- package/dist/types/src/base/ui/types/aria_props.d.ts +0 -22
- package/dist/types/src/base/ui/types/aria_props.d.ts.map +0 -1
- package/dist/types/src/base/ui/types/data_attributes_prop.d.ts +0 -10
- package/dist/types/src/base/ui/types/data_attributes_prop.d.ts.map +0 -1
- package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts +0 -13
- package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts.map +0 -1
- package/dist/types/src/base/ui/use_form_field.d.ts +0 -2
- package/dist/types/src/base/ui/use_form_field.d.ts.map +0 -1
- package/dist/types/src/base/ui/use_styled_system.d.ts +0 -2
- package/dist/types/src/base/ui/use_styled_system.d.ts.map +0 -1
- package/dist/types/src/base/ui/use_text_color_for_background_color.d.ts +0 -2
- package/dist/types/src/base/ui/use_text_color_for_background_color.d.ts.map +0 -1
- package/dist/types/src/base/ui/view_picker.d.ts +0 -34
- package/dist/types/src/base/ui/view_picker.d.ts.map +0 -1
- package/dist/types/src/base/ui/view_picker_synced.d.ts +0 -18
- package/dist/types/src/base/ui/view_picker_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/viewport_constraint.d.ts +0 -57
- package/dist/types/src/base/ui/viewport_constraint.d.ts.map +0 -1
- package/dist/types/src/base/ui/with_styled_system.d.ts +0 -2
- package/dist/types/src/base/ui/with_styled_system.d.ts.map +0 -1
- package/types/styled-system__core.d.ts +0 -41
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** @module @airtable/blocks/ui/system: Typography */ /** */
|
|
2
|
-
import { system } from '@styled-system/core';
|
|
3
|
-
|
|
4
|
-
/** */
|
|
5
|
-
|
|
6
|
-
export const config = {
|
|
7
|
-
textColor: {
|
|
8
|
-
property: 'color',
|
|
9
|
-
scale: 'textColors'
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export const textColor = system(config);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/** @module @airtable/blocks/ui/system: Typography */ /** */
|
|
2
|
-
import { system } from '@styled-system/core';
|
|
3
|
-
import { config as fontFamilyConfig } from './font_family';
|
|
4
|
-
import { config as fontSizeConfig } from './font_size';
|
|
5
|
-
import { config as fontStyleConfig } from './font_style';
|
|
6
|
-
import { config as fontWeightConfig } from './font_weight';
|
|
7
|
-
import { config as letterSpacingConfig } from './letter_spacing';
|
|
8
|
-
import { config as lineHeightConfig } from './line_height';
|
|
9
|
-
import { config as textAlignConfig } from './text_align';
|
|
10
|
-
import { config as textColorConfig } from './text_color';
|
|
11
|
-
import { config as textDecorationConfig } from './text_decoration';
|
|
12
|
-
import { config as textTransformConfig } from './text_transform';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Style props for the typography of an element.
|
|
16
|
-
*
|
|
17
|
-
* @docsPath UI/Style System/Typography
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
export const typographySet = system({
|
|
21
|
-
...fontFamilyConfig,
|
|
22
|
-
...fontSizeConfig,
|
|
23
|
-
...fontStyleConfig,
|
|
24
|
-
...fontWeightConfig,
|
|
25
|
-
...letterSpacingConfig,
|
|
26
|
-
...lineHeightConfig,
|
|
27
|
-
...textAlignConfig,
|
|
28
|
-
...textColorConfig,
|
|
29
|
-
...textDecorationConfig,
|
|
30
|
-
...textTransformConfig
|
|
31
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { get } from '@styled-system/core';
|
|
2
|
-
import { spawnError } from '../../../../shared/error_utils';
|
|
3
|
-
|
|
4
|
-
/** @internal */
|
|
5
|
-
// Old eslint rule doesn't understand type guards
|
|
6
|
-
// eslint-disable-next-line airtable/is-returns-boolean
|
|
7
|
-
function isNumber(n) {
|
|
8
|
-
return typeof n === 'number' && !isNaN(n);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/** @internal */
|
|
12
|
-
export default function ensureNumbersAreWithinScale(params) {
|
|
13
|
-
return (value, scale) => {
|
|
14
|
-
if (!Array.isArray(scale)) {
|
|
15
|
-
throw spawnError('The scale for "%s" should be an Array', params.propertyName);
|
|
16
|
-
}
|
|
17
|
-
if (!isNumber(value)) {
|
|
18
|
-
// Not a number, so simply return the value.
|
|
19
|
-
// We still use `get` if we are dealing with responsive values.
|
|
20
|
-
return get(scale, value, value);
|
|
21
|
-
}
|
|
22
|
-
if (!Number.isInteger(value)) {
|
|
23
|
-
throw spawnError('The number you passed for "%s" is not supported. To use a pixel value, pass the string "%spx" instead.', params.propertyName, value);
|
|
24
|
-
}
|
|
25
|
-
const isValueNegative = value < 0;
|
|
26
|
-
if (isValueNegative && !params.shouldAllowNegativeNumbers) {
|
|
27
|
-
throw spawnError('The scale for the "%s" property does not support negative values. To use a pixel value, pass the string "%spx" instead.', params.propertyName, value);
|
|
28
|
-
}
|
|
29
|
-
const absoluteValue = Math.abs(value);
|
|
30
|
-
if (absoluteValue >= scale.length) {
|
|
31
|
-
throw spawnError('The number you passed for "%s" falls out the scale. To use a pixel value, pass the string "%spx" instead.', params.propertyName, value);
|
|
32
|
-
}
|
|
33
|
-
const valueFromScale = Number(scale[absoluteValue]);
|
|
34
|
-
return valueFromScale * (isValueNegative ? -1 : 1);
|
|
35
|
-
};
|
|
36
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { invariant } from '../../../../shared/error_utils';
|
|
2
|
-
import { values, has, keys } from '../../../../shared/private_utils';
|
|
3
|
-
/**
|
|
4
|
-
* Given a styled system scale, convert a responsive prop object into a style props object.
|
|
5
|
-
* Typically used for variant APIs that compose multiple style props.
|
|
6
|
-
*
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export default function getStylePropsForResponsiveProp(responsivePropObject, scale) {
|
|
10
|
-
const responsiveStyleProps = {};
|
|
11
|
-
for (const viewportKey of keys(responsivePropObject)) {
|
|
12
|
-
const scaleValueForViewport = responsivePropObject[viewportKey];
|
|
13
|
-
invariant(scaleValueForViewport, 'scaleValueForViewport');
|
|
14
|
-
const propsForViewport = scale[scaleValueForViewport];
|
|
15
|
-
invariant(propsForViewport !== undefined && propsForViewport !== null, 'propsForViewport');
|
|
16
|
-
for (const propForViewportKey of keys(propsForViewport)) {
|
|
17
|
-
if (!has(responsiveStyleProps, propForViewportKey)) {
|
|
18
|
-
responsiveStyleProps[propForViewportKey] = {};
|
|
19
|
-
}
|
|
20
|
-
responsiveStyleProps[propForViewportKey][viewportKey] = propsForViewport[propForViewportKey];
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @internal
|
|
26
|
-
* If multiple values are the same for each viewport, just use a string value.
|
|
27
|
-
*
|
|
28
|
-
* For example turn the following object:
|
|
29
|
-
*
|
|
30
|
-
* ```
|
|
31
|
-
* "fontSize": {
|
|
32
|
-
* "smallViewport": "13px",
|
|
33
|
-
* "mediumViewport": "15px"
|
|
34
|
-
* },
|
|
35
|
-
* "fontFamily": {
|
|
36
|
-
* "smallViewport": "default",
|
|
37
|
-
* "mediumViewport": "default"
|
|
38
|
-
* },
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* Into:
|
|
42
|
-
*
|
|
43
|
-
* ```
|
|
44
|
-
* "fontSize": {
|
|
45
|
-
* "smallViewport": "13px",
|
|
46
|
-
* "mediumViewport": "15px"
|
|
47
|
-
* },
|
|
48
|
-
* "fontFamily": "default"
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
for (const stylePropKey of Object.keys(responsiveStyleProps)) {
|
|
52
|
-
let shouldConsolidateValue = true;
|
|
53
|
-
let prevValue;
|
|
54
|
-
for (const value of values(responsiveStyleProps[stylePropKey])) {
|
|
55
|
-
if (prevValue === undefined) {
|
|
56
|
-
prevValue = value;
|
|
57
|
-
} else if (prevValue !== value) {
|
|
58
|
-
shouldConsolidateValue = false;
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (shouldConsolidateValue) {
|
|
63
|
-
responsiveStyleProps[stylePropKey] = prevValue;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return responsiveStyleProps;
|
|
67
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
/** @module @airtable/blocks/ui: TablePicker */ /** */
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import useWatchable from '../../shared/ui/use_watchable';
|
|
5
|
-
import { useSdk } from '../../shared/ui/sdk_context';
|
|
6
|
-
import ModelPickerSelect from './model_picker_select';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Props shared between the {@link TablePicker} and {@link TablePickerSynced} components.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Props for the {@link TablePicker} component. Also accepts:
|
|
14
|
-
* * {@link SelectStyleProps}
|
|
15
|
-
*
|
|
16
|
-
* @docsPath UI/components/TablePicker
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Dropdown menu component for selecting tables.
|
|
21
|
-
*
|
|
22
|
-
* [[ Story id="modelpickers--tablepicker-example" title="Table picker example" ]]
|
|
23
|
-
*
|
|
24
|
-
* @docsPath UI/components/TablePicker
|
|
25
|
-
* @component
|
|
26
|
-
*/
|
|
27
|
-
const TablePicker = (props, ref) => {
|
|
28
|
-
const {
|
|
29
|
-
table,
|
|
30
|
-
shouldAllowPickingNone,
|
|
31
|
-
placeholder,
|
|
32
|
-
onChange,
|
|
33
|
-
...restOfProps
|
|
34
|
-
} = props;
|
|
35
|
-
const selectedTable = table && !table.isDeleted ? table : null;
|
|
36
|
-
const sdk = useSdk();
|
|
37
|
-
useWatchable(sdk.base, ['tables']);
|
|
38
|
-
function _onChange(tableId) {
|
|
39
|
-
if (onChange) {
|
|
40
|
-
const newTable = tableId ? sdk.base.getTableByIdIfExists(tableId) : null;
|
|
41
|
-
onChange(newTable);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
let placeholderToUse;
|
|
45
|
-
if (placeholder === undefined) {
|
|
46
|
-
// Let's set a good default value for the placeholder, depending
|
|
47
|
-
// on the shouldAllowPickingNone flag.
|
|
48
|
-
placeholderToUse = shouldAllowPickingNone ? 'None' : 'Pick a table...';
|
|
49
|
-
} else {
|
|
50
|
-
placeholderToUse = placeholder;
|
|
51
|
-
}
|
|
52
|
-
return /*#__PURE__*/React.createElement(ModelPickerSelect, _extends({}, restOfProps, {
|
|
53
|
-
ref: ref,
|
|
54
|
-
models: sdk.base.tables,
|
|
55
|
-
selectedModelId: selectedTable ? selectedTable.id : null,
|
|
56
|
-
modelKeysToWatch: ['name'],
|
|
57
|
-
shouldAllowPickingNone: shouldAllowPickingNone,
|
|
58
|
-
placeholder: placeholderToUse,
|
|
59
|
-
onChange: _onChange
|
|
60
|
-
}));
|
|
61
|
-
};
|
|
62
|
-
const ForwardedRefTablePicker = /*#__PURE__*/React.forwardRef(TablePicker);
|
|
63
|
-
ForwardedRefTablePicker.displayName = 'TablePicker';
|
|
64
|
-
export default ForwardedRefTablePicker;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
/** @module @airtable/blocks/ui: TablePicker */ /** */
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import useSynced from '../../shared/ui/use_synced';
|
|
5
|
-
import useWatchable from '../../shared/ui/use_watchable';
|
|
6
|
-
import { useSdk } from '../../shared/ui/sdk_context';
|
|
7
|
-
import TablePicker from './table_picker';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Props for the {@link TablePickerSynced} component. Also accepts:
|
|
11
|
-
* * {@link SelectStyleProps}
|
|
12
|
-
*
|
|
13
|
-
* @docsPath UI/components/TablePickerSynced
|
|
14
|
-
* @groupPath UI/components/TablePicker
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/** @hidden */
|
|
18
|
-
function _getTableFromGlobalConfigValue(sdk, tableId) {
|
|
19
|
-
return typeof tableId === 'string' ? sdk.base.getTableByIdIfExists(tableId) : null;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* A wrapper around the {@link TablePicker} component that syncs with {@link GlobalConfig}.
|
|
24
|
-
*
|
|
25
|
-
* [[ Story id="modelpickers--tablepickersynced-example" title="Synced table picker example" ]]
|
|
26
|
-
*
|
|
27
|
-
* @docsPath UI/components/TablePickerSynced
|
|
28
|
-
* @groupPath UI/components/TablePicker
|
|
29
|
-
* @component
|
|
30
|
-
*/
|
|
31
|
-
const TablePickerSynced = (props, ref) => {
|
|
32
|
-
const {
|
|
33
|
-
globalConfigKey,
|
|
34
|
-
onChange,
|
|
35
|
-
disabled,
|
|
36
|
-
...restOfProps
|
|
37
|
-
} = props;
|
|
38
|
-
const [tableId, setTableId, canSetTableId] = useSynced(globalConfigKey);
|
|
39
|
-
const sdk = useSdk();
|
|
40
|
-
useWatchable(sdk.base, ['tables']);
|
|
41
|
-
return /*#__PURE__*/React.createElement(TablePicker, _extends({}, restOfProps, {
|
|
42
|
-
ref: ref,
|
|
43
|
-
table: _getTableFromGlobalConfigValue(sdk, tableId),
|
|
44
|
-
onChange: table => {
|
|
45
|
-
setTableId(table ? table.id : null);
|
|
46
|
-
if (onChange) {
|
|
47
|
-
onChange(table);
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
disabled: disabled || !canSetTableId
|
|
51
|
-
}));
|
|
52
|
-
};
|
|
53
|
-
const ForwardedRefTablePickerSynced = /*#__PURE__*/React.forwardRef(TablePickerSynced);
|
|
54
|
-
ForwardedRefTablePickerSynced.displayName = 'TablePickerSynced';
|
|
55
|
-
export default ForwardedRefTablePickerSynced;
|
package/dist/esm/base/ui/text.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
/** @module @airtable/blocks/ui: Text */ /** */
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { cx } from 'emotion';
|
|
5
|
-
import { createEnum } from '../../shared/private_utils';
|
|
6
|
-
import useStyledSystem from './use_styled_system';
|
|
7
|
-
import getStylePropsForResponsiveProp from './system/utils/get_style_props_for_responsive_prop';
|
|
8
|
-
import useTheme from './theme/use_theme';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Variants for the {@link Text} component:
|
|
12
|
-
*
|
|
13
|
-
* • **default**
|
|
14
|
-
*
|
|
15
|
-
* Single-line text.
|
|
16
|
-
*
|
|
17
|
-
* • **paragraph**
|
|
18
|
-
*
|
|
19
|
-
* Multi-line text such as body copy.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
export const TextVariant = createEnum('default', 'paragraph');
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Sizes for the {@link Text} component.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
export const TextSize = createEnum('small', 'default', 'large', 'xlarge');
|
|
29
|
-
/** */
|
|
30
|
-
|
|
31
|
-
/** @internal */
|
|
32
|
-
export function useTextStyle(textSizeProp) {
|
|
33
|
-
let variant = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TextVariant.default;
|
|
34
|
-
const {
|
|
35
|
-
textStyles
|
|
36
|
-
} = useTheme();
|
|
37
|
-
const textSizesForVariant = textStyles[variant];
|
|
38
|
-
let styleProps;
|
|
39
|
-
if (typeof textSizeProp === 'string') {
|
|
40
|
-
styleProps = textSizesForVariant[textSizeProp];
|
|
41
|
-
} else {
|
|
42
|
-
styleProps = getStylePropsForResponsiveProp(textSizeProp, textSizesForVariant);
|
|
43
|
-
}
|
|
44
|
-
return useStyledSystem(styleProps);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Props for the {@link Text} component. Also supports:
|
|
49
|
-
* * {@link AriaProps}
|
|
50
|
-
* * {@link AllStylesProps}
|
|
51
|
-
*
|
|
52
|
-
* @noInheritDoc
|
|
53
|
-
* @docsPath UI/components/Text
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* A text component with sizes and variants.
|
|
58
|
-
*
|
|
59
|
-
* [[ Story id="text--example" title="Text example" ]]
|
|
60
|
-
*
|
|
61
|
-
* @docsPath UI/components/Text
|
|
62
|
-
* @component
|
|
63
|
-
*/
|
|
64
|
-
const Text = (props, ref) => {
|
|
65
|
-
const {
|
|
66
|
-
as: Component = 'p',
|
|
67
|
-
size = TextSize.default,
|
|
68
|
-
variant = TextVariant.default,
|
|
69
|
-
children,
|
|
70
|
-
id,
|
|
71
|
-
role,
|
|
72
|
-
dataAttributes,
|
|
73
|
-
className,
|
|
74
|
-
style,
|
|
75
|
-
'aria-label': ariaLabel,
|
|
76
|
-
'aria-labelledby': ariaLabelledBy,
|
|
77
|
-
'aria-describedby': ariaDescribedBy,
|
|
78
|
-
'aria-controls': ariaControls,
|
|
79
|
-
'aria-expanded': ariaExpanded,
|
|
80
|
-
'aria-haspopup': ariaHasPopup,
|
|
81
|
-
'aria-hidden': ariaHidden,
|
|
82
|
-
'aria-live': ariaLive,
|
|
83
|
-
...styleProps
|
|
84
|
-
} = props;
|
|
85
|
-
const classNameForTextStyle = useTextStyle(size, variant);
|
|
86
|
-
const classNameForStyleProps = useStyledSystem({
|
|
87
|
-
textColor: 'default',
|
|
88
|
-
fontFamily: 'default',
|
|
89
|
-
...styleProps
|
|
90
|
-
});
|
|
91
|
-
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
92
|
-
ref: ref,
|
|
93
|
-
id: id,
|
|
94
|
-
className: cx(classNameForTextStyle, classNameForStyleProps, className),
|
|
95
|
-
style: style,
|
|
96
|
-
role: role,
|
|
97
|
-
"aria-label": ariaLabel,
|
|
98
|
-
"aria-labelledby": ariaLabelledBy,
|
|
99
|
-
"aria-describedby": ariaDescribedBy,
|
|
100
|
-
"aria-controls": ariaControls,
|
|
101
|
-
"aria-expanded": ariaExpanded,
|
|
102
|
-
"aria-haspopup": ariaHasPopup,
|
|
103
|
-
"aria-hidden": ariaHidden,
|
|
104
|
-
"aria-live": ariaLive
|
|
105
|
-
}, dataAttributes), children);
|
|
106
|
-
};
|
|
107
|
-
const ForwardedRefText = /*#__PURE__*/React.forwardRef(Text);
|
|
108
|
-
ForwardedRefText.displayName = 'Text';
|
|
109
|
-
export default ForwardedRefText;
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
/** @module @airtable/blocks/ui: TextButton */ /** */
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { cx } from 'emotion';
|
|
5
|
-
import { compose } from '@styled-system/core';
|
|
6
|
-
import { createEnum } from '../../shared/private_utils';
|
|
7
|
-
import useStyledSystem from './use_styled_system';
|
|
8
|
-
import useTheme from './theme/use_theme';
|
|
9
|
-
import { maxWidth, minWidth, width, flexItemSet, positionSet, spacingSet, display } from './system';
|
|
10
|
-
import { useTextStyle, TextSize } from './text';
|
|
11
|
-
import Icon from './icon';
|
|
12
|
-
import cssHelpers from './css_helpers';
|
|
13
|
-
import Box from './box';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Style props for the {@link TextButton} component. Also accepts:
|
|
17
|
-
* * {@link FlexItemSetProps}
|
|
18
|
-
* * {@link MaxWidthProps}
|
|
19
|
-
* * {@link MinWidthProps}
|
|
20
|
-
* * {@link PositionSetProps}
|
|
21
|
-
* * {@link SpacingSetProps}
|
|
22
|
-
* * {@link WidthProps}
|
|
23
|
-
*
|
|
24
|
-
* @noInheritDoc
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
const styleParser = compose(display, maxWidth, minWidth, width, flexItemSet, positionSet, spacingSet);
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Variants for the {@link TextButton} component:
|
|
31
|
-
*
|
|
32
|
-
* • **default**
|
|
33
|
-
*
|
|
34
|
-
* Blue text.
|
|
35
|
-
*
|
|
36
|
-
* • **dark**
|
|
37
|
-
*
|
|
38
|
-
* Dark gray text.
|
|
39
|
-
*
|
|
40
|
-
* • **light**
|
|
41
|
-
*
|
|
42
|
-
* Light gray text.
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
const TextButtonVariant = createEnum('default', 'dark', 'light');
|
|
46
|
-
|
|
47
|
-
/** @internal */
|
|
48
|
-
function useTextButtonVariant() {
|
|
49
|
-
let variant = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : TextButtonVariant.default;
|
|
50
|
-
const {
|
|
51
|
-
textButtonVariants
|
|
52
|
-
} = useTheme();
|
|
53
|
-
return textButtonVariants[variant];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Props for the {@link TextButton} component. Also supports:
|
|
58
|
-
* * {@link AriaProps}
|
|
59
|
-
* * {@link TextButtonStyleProps}
|
|
60
|
-
*
|
|
61
|
-
* @noInheritDoc
|
|
62
|
-
* @docsPath UI/components/TextButton
|
|
63
|
-
*/
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* A text button component with sizes and variants.
|
|
67
|
-
*
|
|
68
|
-
* [[ Story id="textbutton--example" title="Text button example" ]]
|
|
69
|
-
*
|
|
70
|
-
* @docsPath UI/components/TextButton
|
|
71
|
-
* @component
|
|
72
|
-
*/
|
|
73
|
-
const TextButton = (props, ref) => {
|
|
74
|
-
const {
|
|
75
|
-
size = TextSize.default,
|
|
76
|
-
variant = TextButtonVariant.default,
|
|
77
|
-
icon,
|
|
78
|
-
children,
|
|
79
|
-
disabled,
|
|
80
|
-
id,
|
|
81
|
-
tabIndex = 0,
|
|
82
|
-
dataAttributes,
|
|
83
|
-
onClick,
|
|
84
|
-
className,
|
|
85
|
-
style,
|
|
86
|
-
onMouseEnter,
|
|
87
|
-
onMouseLeave,
|
|
88
|
-
// This hasOnClick prop is set by the Tooltip wrapper. Destructure it here just to get it out of `props`.
|
|
89
|
-
// See 7a80fefd0a0bc871c31e0c063662c6100b0ca77d
|
|
90
|
-
// TODO(stephen): clean this up.
|
|
91
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
92
|
-
hasOnClick,
|
|
93
|
-
'aria-selected': ariaSelected,
|
|
94
|
-
'aria-label': ariaLabel,
|
|
95
|
-
'aria-labelledby': ariaLabelledBy,
|
|
96
|
-
'aria-describedby': ariaDescribedBy,
|
|
97
|
-
'aria-controls': ariaControls,
|
|
98
|
-
'aria-expanded': ariaExpanded,
|
|
99
|
-
'aria-haspopup': ariaHasPopup,
|
|
100
|
-
'aria-hidden': ariaHidden,
|
|
101
|
-
'aria-live': ariaLive,
|
|
102
|
-
...styleProps
|
|
103
|
-
} = props;
|
|
104
|
-
const classNameForTextStyle = useTextStyle(size);
|
|
105
|
-
const classNameForTextButtonVariant = useTextButtonVariant(variant);
|
|
106
|
-
const classNameForStyleProps = useStyledSystem({
|
|
107
|
-
display: 'inline-flex',
|
|
108
|
-
// Use a negative margin to undo the padding.
|
|
109
|
-
padding: '0 0.1em',
|
|
110
|
-
margin: '0 -0.1em',
|
|
111
|
-
maxWidth: '100%',
|
|
112
|
-
...styleProps
|
|
113
|
-
}, styleParser);
|
|
114
|
-
const hasIcon = icon !== undefined;
|
|
115
|
-
const hasChildren = !!children;
|
|
116
|
-
if (!hasChildren && !ariaLabel) {
|
|
117
|
-
// eslint-disable-next-line no-console
|
|
118
|
-
console.error('<TextButton> without a text label should include an explicit aria-label prop.');
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/** @internal */
|
|
122
|
-
function _onKeyDown(e) {
|
|
123
|
-
if (e.ctrlKey || e.metaKey || e.shiftKey) {
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// Use `Spacebar` to support FF <= 37, IE 9-11.
|
|
128
|
-
if ([' ', 'Spacebar', 'Enter'].includes(e.key)) {
|
|
129
|
-
// Prevent scrolling when pressing `Spacebar`.
|
|
130
|
-
e.preventDefault();
|
|
131
|
-
if (onClick) {
|
|
132
|
-
onClick(e);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
return /*#__PURE__*/React.createElement("span", _extends({
|
|
137
|
-
ref: ref,
|
|
138
|
-
id: id
|
|
139
|
-
// Don't set `tabIndex` if `disabled`. We do set it though even if
|
|
140
|
-
// `onClick` is not provided so that it mimics the behavior of a native
|
|
141
|
-
// `button`. We also prevent the user from passing in their own
|
|
142
|
-
// `tabIndex` in the case that it is disabled. This is better than a
|
|
143
|
-
// `-1` because `-1` will make the element focusable but not reachable
|
|
144
|
-
// via keyboard navigation.
|
|
145
|
-
,
|
|
146
|
-
tabIndex: !disabled ? tabIndex : undefined
|
|
147
|
-
// Only fire these events if the `disabled` prop is not true.
|
|
148
|
-
,
|
|
149
|
-
onClick: !disabled ? onClick : undefined,
|
|
150
|
-
onKeyDown: !disabled ? _onKeyDown : undefined,
|
|
151
|
-
onMouseEnter: onMouseEnter,
|
|
152
|
-
onMouseLeave: onMouseLeave,
|
|
153
|
-
className: cx(classNameForTextStyle,
|
|
154
|
-
// TextButton goes 2nd because it overrides `fontWeight`.
|
|
155
|
-
classNameForTextButtonVariant, classNameForStyleProps, className),
|
|
156
|
-
style: style
|
|
157
|
-
// Always have `role="button"`, even if it is disabled. Combined with
|
|
158
|
-
// `aria-disabled`, screen readers will announce this the same as
|
|
159
|
-
// a native `button` element.
|
|
160
|
-
,
|
|
161
|
-
role: "button"
|
|
162
|
-
// Announce to screen readers that the `TextButton` is disabled.
|
|
163
|
-
,
|
|
164
|
-
"aria-disabled": disabled ? 'true' : undefined,
|
|
165
|
-
"aria-selected": ariaSelected,
|
|
166
|
-
"aria-label": ariaLabel,
|
|
167
|
-
"aria-labelledby": ariaLabelledBy,
|
|
168
|
-
"aria-describedby": ariaDescribedBy,
|
|
169
|
-
"aria-controls": ariaControls,
|
|
170
|
-
"aria-expanded": ariaExpanded,
|
|
171
|
-
"aria-haspopup": ariaHasPopup,
|
|
172
|
-
"aria-hidden": ariaHidden,
|
|
173
|
-
"aria-live": ariaLive
|
|
174
|
-
}, dataAttributes), typeof icon === 'string' ? /*#__PURE__*/React.createElement(Icon, {
|
|
175
|
-
name: icon,
|
|
176
|
-
flex: "none",
|
|
177
|
-
size: "1em"
|
|
178
|
-
}) : icon, hasChildren && /*#__PURE__*/React.createElement(Box, {
|
|
179
|
-
as: "span"
|
|
180
|
-
// The margin is on the span, and not on the icon because it would mean that when using a custom icon
|
|
181
|
-
// the consumer would manually need to figure out what the margin is supposed to be.
|
|
182
|
-
,
|
|
183
|
-
marginLeft: hasIcon ? '0.5em' : undefined,
|
|
184
|
-
className: cssHelpers.TRUNCATE
|
|
185
|
-
}, children));
|
|
186
|
-
};
|
|
187
|
-
const ForwardedRefTextButton = /*#__PURE__*/React.forwardRef(TextButton);
|
|
188
|
-
ForwardedRefTextButton.displayName = 'TextButton';
|
|
189
|
-
export default ForwardedRefTextButton;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { cx, css } from 'emotion';
|
|
2
|
-
import { fontFamilies, colors, radii, opacities } from './tokens';
|
|
3
|
-
const baseStyles = css({
|
|
4
|
-
fontFamily: fontFamilies.default,
|
|
5
|
-
borderRadius: radii.default,
|
|
6
|
-
justifyContent: 'center',
|
|
7
|
-
alignItems: 'center',
|
|
8
|
-
paddingTop: 0,
|
|
9
|
-
paddingBottom: 0,
|
|
10
|
-
fontWeight: 500,
|
|
11
|
-
userSelect: 'none',
|
|
12
|
-
outline: 'none',
|
|
13
|
-
appearance: 'none',
|
|
14
|
-
border: 'none',
|
|
15
|
-
'&:not(:disabled)': {
|
|
16
|
-
cursor: 'pointer',
|
|
17
|
-
'&:hover': {
|
|
18
|
-
opacity: opacities.quiet
|
|
19
|
-
},
|
|
20
|
-
'&:active': {
|
|
21
|
-
opacity: 1
|
|
22
|
-
},
|
|
23
|
-
'&:focus': {
|
|
24
|
-
boxShadow: `inset 0 0 0 2px ${colors.darken3}`
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
'&:disabled': {
|
|
28
|
-
cursor: 'default',
|
|
29
|
-
opacity: opacities.quieter
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
const buttonVariants = {
|
|
33
|
-
default: cx(baseStyles, css({
|
|
34
|
-
color: colors.dark,
|
|
35
|
-
backgroundColor: colors.lightGray2
|
|
36
|
-
})),
|
|
37
|
-
primary: cx(baseStyles, css({
|
|
38
|
-
color: colors.white,
|
|
39
|
-
backgroundColor: colors.blueBright
|
|
40
|
-
})),
|
|
41
|
-
secondary: cx(baseStyles, css({
|
|
42
|
-
color: colors.dark,
|
|
43
|
-
backgroundColor: 'transparent',
|
|
44
|
-
'&:hover': {
|
|
45
|
-
backgroundColor: colors.lightGray2
|
|
46
|
-
}
|
|
47
|
-
})),
|
|
48
|
-
danger: cx(baseStyles, css({
|
|
49
|
-
color: colors.white,
|
|
50
|
-
backgroundColor: colors.redBright
|
|
51
|
-
}))
|
|
52
|
-
};
|
|
53
|
-
export default buttonVariants;
|